BASIC : Refactor FoldConstants for extracting it from SwExprNode.

Change-Id: Ia47597b26d63db216dd3ab71acbb18449ece7b1a
Reviewed-on: https://gerrit.libreoffice.org/16963
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: Arnaud Versini <arnaud.versini@libreoffice.org>
This commit is contained in:
Arnaud Versini
2015-07-12 13:52:53 +02:00
committed by Arnaud Versini
parent a9db17aabc
commit 4251e676bb
2 changed files with 192 additions and 162 deletions

View File

@@ -105,6 +105,8 @@ class SbiExprNode { // operators (and operands)
SbiToken eTok;
bool bError; // true: error
void FoldConstants(SbiParser*);
void FoldConstantsBinaryNode(SbiParser*);
void FoldConstantsUnaryNode(SbiParser*);
void CollectBits(); // converting numbers to strings
bool IsOperand()
{ return eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW; }
@@ -131,6 +133,10 @@ public:
{ return eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL; }
bool IsIntConst();
bool IsVariable();
bool IsUnary()
{ return pLeft && !pRight; }
bool IsBinary()
{ return pLeft && pRight; }
SbiExprNode* GetWithParent() { return pWithParent; }
void SetWithParent( SbiExprNode* p ) { pWithParent = p; }