diff options
author | Carl Worth <cworth@cworth.org> | 2010-05-20 22:27:07 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-05-20 22:27:07 -0700 |
commit | b20d33c5c6fea8e392c26e9ab060efd14034f1f9 (patch) | |
tree | 0285aa21a9c693a155d02a1b1f715137b49f494c /glcpp.h | |
parent | d8327e575dd20fe696f3a44ada4bd4001b15db27 (diff) |
Implement #if, #else, #elif, and #endif with tests.
So far the only expression implemented is a single integer literal,
but obviously that's easy to extend. Various things including nesting
are tested here.
Diffstat (limited to 'glcpp.h')
-rw-r--r-- | glcpp.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -95,12 +95,24 @@ typedef struct expansion_node { struct expansion_node *next; } expansion_node_t; +typedef enum skip_type { + SKIP_NO_SKIP, + SKIP_TO_ELSE, + SKIP_TO_ENDIF +} skip_type_t; + +typedef struct skip_node { + skip_type_t type; + struct skip_node *next; +} skip_node_t; + struct glcpp_parser { yyscan_t scanner; struct hash_table *defines; expansion_node_t *expansions; int just_printed_separator; int need_newline; + skip_node_t *skip_stack; }; void |