* sim/ucsim/configure.in,
[fw/sdcc] / src / SDCCast.h
index 9865bb297e1c9fbe8cfcd3cd273c964460ba1002..d46ad5f18c9076023ae5d1c96c556625bc9f39ad 100644 (file)
 #include "SDCCset.h"
 #include "SDCCmem.h"
 
-#define  EX_OP       0
-#define  EX_VALUE    1
-#define  EX_LINK     2
-#define  EX_STMNT    3
-#define  EX_OPERAND  4
+typedef enum {
+  EX_OP=0,
+  EX_VALUE,
+  EX_LINK,
+  EX_OPERAND
+} ASTTYPE;
 
 /* expression tree   */
 typedef struct ast
   {
 
-    unsigned type:3;
+    ASTTYPE type;
     unsigned decorated:1;
     unsigned isError:1;
     unsigned funcName:1;
@@ -50,13 +51,13 @@ typedef struct ast
     unsigned initMode:1;
     int level;                 /* level for expr */
     int block;                 /* block number   */
+    int seqPoint;              /* sequence point */
     /* union of values expression can have */
     union
       {
        value *val;             /* value if type = EX_VALUE */
        sym_link *lnk;          /* sym_link * if type= EX_LINK  */
        struct operand *oprnd;  /* used only for side effecting function calls */
-       unsigned stmnt;         /* statement if type=EX_STMNT */
        unsigned op;            /* operator if type= EX_OP  */
       }
     opval;
@@ -178,23 +179,24 @@ extern struct memmap *GcurMemmap;
 ast *newAst_VALUE (value * val);
 ast *newAst_OP (unsigned op);
 ast *newAst_LINK (sym_link * val);
-ast *newAst_STMNT (unsigned val);
 
 void initAst ();
 ast *newNode (long, ast *, ast *);
 ast *copyAst (ast *);
 ast *removeIncDecOps (ast *);
+ast *removePreIncDecOps (ast *);
+ast *removePostIncDecOps (ast *);
 value *sizeofOp (sym_link *);
 value *evalStmnt (ast *);
 ast *createFunction (symbol *, ast *);
 ast *createBlock (symbol *, ast *);
 ast *createLabel (symbol *, ast *);
 ast *createCase (ast *, ast *, ast *);
-ast *createDefault (ast *, ast *);
+ast *createDefault (ast *, ast *, ast *);
 ast *forLoopOptForm (ast *);
 ast *argAst (ast *);
 ast *resolveSymbols (ast *);
-ast *decorateType (ast *);
+ast *decorateType (ast *, RESULT_TYPE);
 ast *createWhile (symbol *, symbol *, symbol *, ast *, ast *);
 ast *createIf (ast *, ast *, ast *);
 ast *createDo (symbol *, symbol *, symbol *, ast *, ast *);
@@ -210,6 +212,8 @@ bool hasSEFcalls (ast *);
 void addSymToBlock (symbol *, ast *);
 void freeStringSymbol(symbol *);
 DEFSETFUNC(resetParmKey);
+int astErrors(ast *);
+RESULT_TYPE getResultTypeFromType (sym_link *);
 
 // exported variables 
 extern set *operKeyReset;