1 /*****************************************************************************/
5 /* Expression node structure for the cc65 C compiler */
9 /* (C) 2000 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
45 /*****************************************************************************/
47 /*****************************************************************************/
55 /*****************************************************************************/
57 /*****************************************************************************/
63 NT_NONE, /* None (invalid) op */
66 NT_CONST, /* A constant of some sort */
68 NT_ICAST, /* Implicit type cast */
69 NT_ECAST, /* Explicit type cast */
71 NT_REG_A, /* A register */
72 NT_REG_X, /* X register */
73 NT_REG_Y, /* Y register */
74 NT_REG_AX, /* AX register */
75 NT_REG_EAX, /* EAX register */
77 NT_CALLFUNC, /* Function call */
78 NT_PUSH, /* Push the value onto the stack */
79 NT_POP, /* Pop the value from the stack */
93 NT_PLUS_ASSIGN, /* += */
94 NT_MINUS_ASSIGN, /* -= */
95 NT_MUL_ASSIGN, /* *= */
96 NT_DIV_ASSIGN, /* /= */
97 NT_SHL_ASSIGN, /* <<= */
98 NT_SHR_ASSIGN, /* >>= */
99 NT_AND_ASSIGN, /* &= */
100 NT_OR_ASSIGN, /* |= */
101 NT_XOR_ASSIGN, /* ^= */
104 NT_POST_DEC, /* -- */
106 NT_POST_INC, /* ++ */
110 NT_BOOL_AND, /* && */
119 NT_DEREF, /* * and others */
121 NT_COUNT /* Operation count */
126 /* Struct describing one node in an expression tree */
127 typedef struct ExprNode ExprNode;
130 ExprNode* Left; /* Left and right leaves */
133 nodetype_t NT; /* Node type */
134 type* Type; /* Resulting type */
135 int LValue; /* True if this is an lvalue */
139 ExprNode* Test; /* Third expr for ternary op */
142 long I; /* Constant int value if any */
143 double F; /* Constant float value if any */
144 struct SymEntry* Sym; /* Symbol table entry if any */
151 /*****************************************************************************/
153 /*****************************************************************************/
157 void InitExprNode (ExprNode* E);
158 /* Initialize a new expression node */
162 /* End of exprnode.h */