comparison lwcc/symbol.h @ 299:856caf91ffaa ccdev

Added token list structure and switched some stuff to use it Swithced to using a token list structure instead of manually fiddling pointers throughout the macro expansion code. Also fixed up some problematic things related to stringification and concatenation.
author William Astle <lost@l-w.ca>
date Sun, 15 Sep 2013 13:06:00 -0600
parents 83fcc1ed6ad6
children
comparison
equal deleted inserted replaced
298:6112c67728ba 299:856caf91ffaa
26 #include "token.h" 26 #include "token.h"
27 27
28 struct symtab_e 28 struct symtab_e
29 { 29 {
30 char *name; // symbol name 30 char *name; // symbol name
31 struct token *tl; // token list the name is defined as, NULL for none 31 struct token_list *tl; // token list the name is defined as, NULL for none
32 int nargs; // number named of arguments - -1 for object like macro 32 int nargs; // number named of arguments - -1 for object like macro
33 int vargs; // set if macro has varargs style 33 int vargs; // set if macro has varargs style
34 char **params; // the names of the parameters 34 char **params; // the names of the parameters
35 struct symtab_e *next; // next entry in list 35 struct symtab_e *next; // next entry in list
36 }; 36 };
37 37
38 struct symtab_e *symtab_find(struct preproc_info *, char *); 38 struct symtab_e *symtab_find(struct preproc_info *, char *);
39 void symtab_undef(struct preproc_info *, char *); 39 void symtab_undef(struct preproc_info *, char *);
40 void symtab_define(struct preproc_info *, char *, struct token *, int, char **, int); 40 void symtab_define(struct preproc_info *, char *, struct token_list *, int, char **, int);
41 41
42 #endif // symbol_h_seen___ 42 #endif // symbol_h_seen___