what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
+#ifndef SDCCEXPR_H
+#define SDCCEXPR_H
+
#include "SDCCglobl.h"
#include "SDCCsymt.h"
#include "SDCCval.h"
-
-#ifndef SDCCEXPR_H
-#define SDCCEXPR_H
+#include "SDCCset.h"
#define EX_OP 0
#define EX_VALUE 1
/* union of values expression can have */
union {
value *val ; /* value if type = EX_VALUE */
- link *lnk ; /* link * if type= EX_LINK */
+ 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 */
int lineno ; /* source file line number */
char *filename ; /* filename of the source file */
- link *ftype ; /* start of type chain for this subtree */
- link *etype ; /* end of type chain for this subtree */
+ sym_link *ftype ; /* start of type chain for this subtree */
+ sym_link *etype ; /* end of type chain for this subtree */
symbol *argSym ; /* argument symbols */
value *args ; /* args of a function */
#define IS_AST_VALUE(x) (x && x->type == EX_VALUE && x->opval.val)
#define IS_AST_LINK(x) (x->type == EX_LINK)
#define IS_AST_NOT_OPER(x) (x && IS_AST_OP(x) && x->opval.op == '!')
+#define IS_ARRAY_OP(x) (IS_AST_OP(x) && x->opval.op == '[')
#define IS_COMPARE_OP(x) (IS_AST_OP(x) && \
(x->opval.op == '>' || \
x->opval.op == '<' || \
x == AND_ASSIGN || x == OR_ASSIGN || x == INC_OP || x == DEC_OP)
#define IS_DEREF_OP(x) (( x->opval.op == '*' && x->right == NULL) || x->opval.op == '.')
-/* forward declrations for global variables */
+/* forward declarations for global variables */
extern ast *staticAutos ;
+extern FILE *codeOutFile;
/* forward definitions for functions */
-ast *newAst (int , void * );
+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 (int ,ast * ,ast * );
+ast *newNode (long ,ast * ,ast * );
ast *copyAst (ast * );
-value *sizeofOp (link * );
+value *sizeofOp (sym_link * );
value *evalStmnt (ast * );
ast *createFunction(symbol *,ast * );
ast *createBlock (symbol *,ast * );
ast *createFor (symbol *,symbol *,symbol *,symbol *,ast *,ast *,ast *, ast *);
void eval2icode (ast *);
value *constExprValue (ast *,int);
-symbol *funcOfType (char *,link *,link *,int,int);
+symbol *funcOfType (char *,sym_link *,sym_link *,int,int);
ast *initAggregates ( symbol *,initList *, ast *);
bool hasSEFcalls ( ast *);
void addSymToBlock (symbol *, ast *) ;
+// exported variables
+extern set *operKeyReset;
+extern int noAlloc;
+
#endif