X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCast.h;h=f0cbfaf69423251ae407bc4f7da32295aa589f7e;hb=3064a007acd3a1dff676497e2f748f25318d052b;hp=735a6a937a7441b91203014955d56bb07983a424;hpb=d92cc039b1bd6ddf52cecdc687f72b22523440aa;p=fw%2Fsdcc diff --git a/src/SDCCast.h b/src/SDCCast.h index 735a6a93..f0cbfaf6 100644 --- a/src/SDCCast.h +++ b/src/SDCCast.h @@ -29,6 +29,7 @@ #include "SDCCsymt.h" #include "SDCCval.h" #include "SDCCset.h" +#include "SDCCmem.h" #define EX_OP 0 #define EX_VALUE 1 @@ -65,6 +66,7 @@ typedef struct ast union { char *inlineasm; /* pointer to inline assembler code */ + literalList *constlist; /* init list for array initializer. */ symbol *sym; /* if block then -> symbols */ value *args; /* if function then args */ /* if switch then switch values */ @@ -111,6 +113,7 @@ ast; /* easy access macros */ #define IS_AST_OP(x) (x && x->type == EX_OP) +#define IS_CALLOP(x) (IS_AST_OP(x) && x->opval.op == CALL) #define IS_BITOR(x) (IS_AST_OP(x) && x->opval.op == '|') #define IS_BITAND(x) (IS_AST_OP(x) && x->opval.op == '&' && \ x->left && x->right ) @@ -129,6 +132,8 @@ ast; x->opval.op == EQ_OP || \ x->opval.op == NE_OP )) #define IS_CAST_OP(x) (IS_AST_OP(x) && x->opval.op == CAST) +#define IS_TERNARY_OP(x) (IS_AST_OP(x) && x->opval.op == '?') +#define IS_COLON_OP(x) (IS_AST_OP(x) && x->opval.op == ':') #define IS_ADDRESS_OF_OP(x) (IS_AST_OP(x) && \ x->opval.op == '&' && \ x->right == NULL ) @@ -140,6 +145,7 @@ ast; #define AST_VALUE(x) (x->opval.val) #define AST_VALUES(x,y) (x->values.y) #define AST_FOR(x,y) x->values.forVals.y +#define IS_AST_PARAM(x) (IS_AST_OP(x) && x->opval.op == PARAM) #define CAN_EVAL(x) ( x == '[' || x == '.' || x == PTR_OP || \ x == '&' || x == '|' || x == '^' || x == '*' || \ @@ -166,7 +172,7 @@ ast; /* forward declarations for global variables */ extern ast *staticAutos; extern FILE *codeOutFile; -extern memmap *GcurMemmap; +extern struct memmap *GcurMemmap; /* forward definitions for functions */ ast *newAst_VALUE (value * val); @@ -203,5 +209,6 @@ void addSymToBlock (symbol *, ast *); // exported variables extern set *operKeyReset; extern int noAlloc; +extern int inInitMode; #endif