Rewrote expression evaluation. More smaller changes.

git-svn-id: svn://svn.cc65.org/cc65/trunk@2638 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-11-11 13:57:30 +00:00
parent 3d1e244a8a
commit 4555fdcad1
14 changed files with 668 additions and 637 deletions

View File

@@ -7,7 +7,7 @@
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<>merstrasse 52 */
/* R<>merstra<EFBFBD>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
@@ -92,30 +92,21 @@ ExprNode* GenWordExpr (ExprNode* Expr);
ExprNode* GenNE (ExprNode* Expr, long Val);
/* Generate an expression that compares Expr and Val for inequality */
int IsConstExpr (ExprNode* Root);
int IsConstExpr (ExprNode* Expr, long* Val);
/* Return true if the given expression is a constant expression, that is, one
* with no references to external symbols.
* with no references to external symbols. If Val is not NULL and the
* expression is constant, the constant value is stored here.
*/
int IsByteExpr (ExprNode* Root);
/* Return true if this is a byte expression */
long GetExprVal (ExprNode* Expr);
/* Get the value of a constant expression */
int IsByteRange (long Val);
/* Return true if this is a byte value */
int IsWordRange (long Val);
/* Return true if this is a word value */
ExprNode* FinalizeExpr (ExprNode* Expr);
/* Resolve any symbols by cloning the symbol expression tree instead of the
* symbol reference, then try to simplify the expression as much as possible.
* This function must only be called if all symbols are resolved (no undefined
* symbol errors).
*/
ExprNode* CloneExpr (ExprNode* Expr);
/* Clone the given expression tree. The function will simply clone symbol
* nodes, it will not resolve them.