comparison lwcc/tree.h @ 501:f3e9732973f1

Add basic integer operations to lwcc Add +, -, *, and / to lwcc parser and code generator. Multiplication and division require helper functions in a yet to be created support library. These operations are integer only for the moment.
author William Astle <lost@l-w.ca>
date Tue, 24 Sep 2019 22:07:56 -0600
parents 1bd2d590d734
children 14a40f8bb4eb
comparison
equal deleted inserted replaced
500:733fd05ca2a8 501:f3e9732973f1
49 #define NODE_FUNDECL 21 // function declaration 49 #define NODE_FUNDECL 21 // function declaration
50 #define NODE_FUNARGS 22 // list of function args 50 #define NODE_FUNARGS 22 // list of function args
51 #define NODE_BLOCK 23 // statement block 51 #define NODE_BLOCK 23 // statement block
52 #define NODE_STMT_RETURN 24 // return statement 52 #define NODE_STMT_RETURN 24 // return statement
53 #define NODE_CONST_INT 25 // constant integer 53 #define NODE_CONST_INT 25 // constant integer
54 #define NODE_NUMTYPES 26 // the number of node types 54 #define NODE_OPER_PLUS 26 // addition
55 #define NODE_OPER_MINUS 27 // subtraction
56 #define NODE_OPER_TIMES 28 // multiplcation
57 #define NODE_OPER_DIVIDE 29 // division
58 #define NODE_NUMTYPES 30 // the number of node types
55 59
56 typedef struct node_s node_t; 60 typedef struct node_s node_t;
57 61
58 struct node_s 62 struct node_s
59 { 63 {