summaryrefslogtreecommitdiff
path: root/glcpp.h
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-19 13:54:37 -0700
committerCarl Worth <cworth@cworth.org>2010-05-19 13:54:37 -0700
commit472524413d004680dbdb89602617f32da8f42f56 (patch)
tree674aa3027e4b3878dce3ec2a4669cad51c3aa701 /glcpp.h
parentaaa9acbf10b7a8e7dac061885ef95823ad27f80e (diff)
Use new token_list_t rather than string_list_t for macro values.
There's not yet any change in functionality here, (at least according to the test suite). But we now have the option of specifying a type for each string in the token list. This will allow us to finalize an unexpanded macro name so that it won't be subjected to excess expansion later.
Diffstat (limited to 'glcpp.h')
-rw-r--r--glcpp.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/glcpp.h b/glcpp.h
index ef821a7637..c647e2a72e 100644
--- a/glcpp.h
+++ b/glcpp.h
@@ -42,8 +42,19 @@ typedef struct string_list {
string_node_t *tail;
} string_list_t;
+typedef struct token_node {
+ int type;
+ const char *value;
+ struct token_node *next;
+} token_node_t;
+
+typedef struct token_list {
+ token_node_t *head;
+ token_node_t *tail;
+} token_list_t;
+
typedef struct argument_node {
- string_list_t *argument;
+ token_list_t *argument;
struct argument_node *next;
} argument_node_t;
@@ -70,13 +81,13 @@ typedef struct {
int is_function;
string_list_t *parameters;
const char *identifier;
- string_list_t *replacements;
+ token_list_t *replacements;
} macro_t;
typedef struct expansion_node {
macro_t *macro;
argument_list_t *arguments;
- string_node_t *replacements;
+ token_node_t *replacements;
struct expansion_node *next;
} expansion_node_t;