comparison lwcc/tree.h @ 502:14a40f8bb4eb

Add various operators to lwcc Add various binary and ternary operators to lwcc, but only those which can work with constant operands. Seems like variables are probably required next.
author William Astle <lost@l-w.ca>
date Wed, 25 Sep 2019 20:23:49 -0600
parents f3e9732973f1
children 7e8298f7bc0a
comparison
equal deleted inserted replaced
501:f3e9732973f1 502:14a40f8bb4eb
53 #define NODE_CONST_INT 25 // constant integer 53 #define NODE_CONST_INT 25 // constant integer
54 #define NODE_OPER_PLUS 26 // addition 54 #define NODE_OPER_PLUS 26 // addition
55 #define NODE_OPER_MINUS 27 // subtraction 55 #define NODE_OPER_MINUS 27 // subtraction
56 #define NODE_OPER_TIMES 28 // multiplcation 56 #define NODE_OPER_TIMES 28 // multiplcation
57 #define NODE_OPER_DIVIDE 29 // division 57 #define NODE_OPER_DIVIDE 29 // division
58 #define NODE_NUMTYPES 30 // the number of node types 58 #define NODE_OPER_MOD 30 // modulus
59 #define NODE_OPER_COND 31 // ternary conditional
60 #define NODE_OPER_FNCALL 32 // function call
61 #define NODE_OPER_SUBSCRIPT 33 // array subscript
62 #define NODE_OPER_POSTINC 34 // post increment
63 #define NODE_OPER_POSTDEC 35 // post decrement
64 #define NODE_OPER_PTRMEM 36 // member of pointer operator
65 #define NODE_OPER_OBJMEM 37 // member of object operator
66 #define NODE_OPER_LSH 38 // left shift
67 #define NODE_OPER_RSH 39 // right shift
68 #define NODE_OPER_LT 40 // less than
69 #define NODE_OPER_LE 41 // less than or equal
70 #define NODE_OPER_GT 42 // greater than
71 #define NODE_OPER_GE 43 // greater than or equal
72 #define NODE_OPER_EQ 44 // equality
73 #define NODE_OPER_NE 45 // inequality
74 #define NODE_OPER_BWAND 46 // bitwise and
75 #define NODE_OPER_BWXOR 47 // bitwise xor
76 #define NODE_OPER_BWOR 48 // bitwise or
77 #define NODE_OPER_BAND 49 // boolean and
78 #define NODE_OPER_BOR 50 // boolean or
79 #define NODE_OPER_ASS 51 // assignment
80 #define NODE_OPER_ADDASS 52 // add/assign combo
81 #define NODE_OPER_SUBASS 53 // subtract/assign combo
82 #define NODE_OPER_MULASS 54 // multiply/assign combo
83 #define NODE_OPER_DIVASS 55 // divide/assign combo
84 #define NODE_OPER_MODASS 56 // modulus/assign combo
85 #define NODE_OPER_LSHASS 57 // left shift/assign combo
86 #define NODE_OPER_RSHASS 58 // right shift/assign combo
87 #define NODE_OPER_BWANDASS 59 // bitwise and/assign combo
88 #define NODE_OPER_BWXORASS 60 // bitwise xor/assign combo
89 #define NODE_OPER_BWORASS 61 // bitwise or/assign combo
90 #define NODE_OPER_COMMA 62 // comma sequential evaluation operator
91 #define NODE_NUMTYPES 63 // the number of node types
59 92
60 typedef struct node_s node_t; 93 typedef struct node_s node_t;
61 94
62 struct node_s 95 struct node_s
63 { 96 {