diff options
author | Carl Worth <cworth@cworth.org> | 2010-05-25 14:52:43 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-05-25 14:52:43 -0700 |
commit | 808401fd79eea9fa2c965f9f235a753c0cb0d920 (patch) | |
tree | fb10baace89ff1d1c9191465795eeff18ca0e588 /glcpp.h | |
parent | 80dc60b9c3529cf438948d50b9619e8af2fad880 (diff) |
Store parsed tokens as token list and print all text lines.
Still not doing any macro expansion just yet. But it should be fairly
easy from here.
Diffstat (limited to 'glcpp.h')
-rw-r--r-- | glcpp.h | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -44,21 +44,34 @@ typedef struct string_list { string_node_t *tail; } string_list_t; -typedef struct token { +typedef struct token token_t; +typedef struct token_list token_list_t; + +typedef union YYSTYPE +{ + int ival; + char *str; + token_t *token; + token_list_t *token_list; +} YYSTYPE; + +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 + +struct token { int type; - char *value; -} token_t; + YYSTYPE value; +}; typedef struct token_node { - int type; - const char *value; + token_t *token; struct token_node *next; } token_node_t; -typedef struct token_list { +struct token_list { token_node_t *head; token_node_t *tail; -} token_list_t; +}; typedef struct argument_node { token_list_t *argument; |