diff options
author | Josh Triplett <josh@freedesktop.org> | 2007-03-07 21:45:57 -0800 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2007-03-07 21:45:57 -0800 |
commit | b7955d6cb0b64cd7af70c80de4a971073cccb78c (patch) | |
tree | d1d7bfc9e73c1c2a594d6bc991467b4ba32bc541 /symbol.h | |
parent | Free up some special bits in modifiers. (diff) | |
download | sparse-b7955d6cb0b64cd7af70c80de4a971073cccb78c.tar.gz sparse-b7955d6cb0b64cd7af70c80de4a971073cccb78c.tar.bz2 sparse-b7955d6cb0b64cd7af70c80de4a971073cccb78c.zip |
Introducing statement keywords
This change using keyword lookup for statement parsing
instead of a order compare.
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'symbol.h')
-rw-r--r-- | symbol.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -64,6 +64,7 @@ enum keyword { KW_QUALIFIER = 1 << 2, KW_ATTRIBUTE = 1 << 3, KW_TYPEOF = 1 << 4, + KW_STATEMENT = 1 << 5, }; struct context { @@ -91,6 +92,7 @@ struct symbol_op { /* keywrods */ struct token *(*declarator)(struct token *token, struct ctype *ctype); + struct token *(*statement)(struct token *token, struct statement *stmt); }; extern int expand_safe_p(struct expression *expr, int cost); @@ -291,6 +293,13 @@ static inline int get_sym_type(struct symbol *type) return type->type; } +static inline struct symbol *lookup_keyword(struct ident *ident, enum namespace ns) +{ + if (!ident->keyword) + return NULL; + return lookup_symbol(ident, ns); +} + #define is_restricted_type(type) (get_sym_type(type) == SYM_RESTRICT) #define is_fouled_type(type) (get_sym_type(type) == SYM_FOULED) #define is_bitfield_type(type) (get_sym_type(type) == SYM_BITFIELD) |