]> git.sur5r.net Git - cc65/blobdiff - src/ca65/expr.h
Renamed the defines in symdefs.h to something more meaningful. They were named
[cc65] / src / ca65 / expr.h
index 2edff0e1d117a4b1a1f24ee497e11bea53b7ab53..8d492a3dba42094742db8c4628a9bcc6c276dff5 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2003 Ullrich von Bassewitz                                       */
+/* (C) 1998-2006 Ullrich von Bassewitz                                       */
 /*               Römerstraße 52                                              */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                 Forwards                                  */
+/*****************************************************************************/
+
+
+
+struct ExprDesc;
+
+
+
+/*****************************************************************************/
+/*                                          Code                                    */
 /*****************************************************************************/
 
 
@@ -63,12 +73,21 @@ long ConstExpression (void);
 void FreeExpr (ExprNode* Root);
 /* Free the expression tree, Root is pointing to. */
 
+ExprNode* SimplifyExpr (ExprNode* Expr, const struct ExprDesc* D);
+/* Try to simplify the given expression tree */
+
 ExprNode* GenLiteralExpr (long Val);
 /* Return an expression tree that encodes the given literal value */
 
+ExprNode* GenLiteral0 (void);
+/* Return an expression tree that encodes the the number zero */
+
 ExprNode* GenSymExpr (struct SymEntry* Sym);
 /* Return an expression node that encodes the given symbol */
 
+ExprNode* GenAddExpr (ExprNode* Left, ExprNode* Right);
+/* Generate an addition from the two operands */
+
 ExprNode* GenCurrentPC (void);
 /* Return the current program counter as expression */
 
@@ -107,6 +126,9 @@ int IsByteRange (long Val);
 int IsWordRange (long Val);
 /* Return true if this is a word value */
 
+int IsFarRange (long Val);
+/* Return true if this is a far (24 bit) value */
+
 ExprNode* CloneExpr (ExprNode* Expr);
 /* Clone the given expression tree. The function will simply clone symbol
  * nodes, it will not resolve them.
@@ -115,6 +137,23 @@ ExprNode* CloneExpr (ExprNode* Expr);
 void WriteExpr (ExprNode* Expr);
 /* Write the given expression to the object file */
 
+void ExprGuessedAddrSize (const ExprNode* Expr, unsigned char AddrSize);
+/* Mark the address size of the given expression tree as guessed. The address
+ * size passed as argument is the one NOT used, because the actual address
+ * size wasn't known. Example: Zero page addressing was not used because symbol
+ * is undefined, and absolute addressing was available.
+ * This function will actually parse the expression tree for undefined symbols,
+ * and mark these symbols accordingly.
+ */
+
+ExprNode* FuncBankByte (void);
+/* Handle the .BANKBYTE builtin function */
+
+ExprNode* FuncLoByte (void);
+/* Handle the .LOBYTE builtin function */
+
+ExprNode* FuncHiByte (void);
+/* Handle the .HIBYTE builtin function */
 
 
 /* End of expr.h */