Mercurial > hg > index.cgi
comparison lwcc/tree.h @ 314:a3e277c58df9 ccdev
Checkpoint parser development for lwcc
Beginning of lemon based parser for C including all the infrastructure for
calling the lemon generated parser. This requires a translation layer from
the preprocessor token numbers to the lemon parser token numbers due to the
fact that lemon wants to control the token numbers. Eventually when the
lemon parser gets replaced with a hand crafted recursive descent parser,
this translation will no longer be required. However, in the interest of
getting things working sooner rather than later, using something like lemon
is beneficial.
author | William Astle <lost@l-w.ca> |
---|---|
date | Sun, 17 Nov 2013 11:59:36 -0700 |
parents | 41118fb0a8f2 |
children | 1bd2d590d734 |
comparison
equal
deleted
inserted
replaced
313:73b2bfa17ab0 | 314:a3e277c58df9 |
---|---|
23 #define tree_h_seen___ | 23 #define tree_h_seen___ |
24 | 24 |
25 #include <stdio.h> | 25 #include <stdio.h> |
26 | 26 |
27 /* the various node types */ | 27 /* the various node types */ |
28 #define NODE_NONE 0 // a node with no type | 28 #define NODE_NONE 0 // a node with no type |
29 #define NODE_PROGRAM 1 // the whole program | 29 #define NODE_PROGRAM 1 // the whole program |
30 #define NODE_NUMTYPES 2 // the number of node types | 30 #define NODE_DECL 2 // a declaration |
31 #define NODE_TYPE_CHAR 3 // a character type | |
32 #define NODE_TYPE_SHORT 4 // short int | |
33 #define NODE_TYPE_INT 5 // integer | |
34 #define NODE_TYPE_LONG 6 // long int | |
35 #define NODE_TYPE_LONGLONG 7 // long long | |
36 #define NODE_IDENT 8 // an identifier of some kind | |
37 #define NODE_TYPE_PTR 9 // a pointer | |
38 #define NODE_TYPE_SCHAR 10 // signed char | |
39 #define NODE_TYPE_UCHAR 11 // unsigned char | |
40 #define NODE_TYPE_USHORT 12 // unsigned short | |
41 #define NODE_TYPE_UINT 13 // unsigned int | |
42 #define NODE_TYPE_ULONG 14 // unsigned long | |
43 #define NODE_TYPE_ULONGLONG 15 // unsigned long long | |
44 #define NODE_TYPE_VOID 16 // void | |
45 #define NODE_TYPE_FLOAT 17 // float | |
46 #define NODE_TYPE_DOUBLE 18 // double | |
47 #define NODE_TYPE_LDOUBLE 19 // long double | |
48 #define NODE_FUNDEF 20 // function definition | |
49 #define NODE_FUNDECL 21 // function declaration | |
50 #define NODE_FUNARGS 22 // list of function args | |
51 #define NODE_BLOCK 23 // statement block | |
52 #define NODE_NUMTYPES 24 // the number of node types | |
31 | 53 |
32 typedef struct node_s node_t; | 54 typedef struct node_s node_t; |
33 | 55 |
34 struct node_s | 56 struct node_s |
35 { | 57 { |