diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-03-31 10:38:49 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 20:59:55 -0700 |
| commit | bdc6803647b8feb99bf35fa9d5b533351ae3dc4f (patch) | |
| tree | 58cc00deeb16c86dfb481e1f32cee7dfc98630c3 /expression.h | |
| parent | 9d2258c5def38d3c161e8c2750b6e9fe62449bb3 (diff) | |
| download | sparse-dev-bdc6803647b8feb99bf35fa9d5b533351ae3dc4f.tar.gz | |
Parse initializers properly. We parsed them before, but we didn't
add them to the parse tree. We now do.
Diffstat (limited to 'expression.h')
| -rw-r--r-- | expression.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/expression.h b/expression.h index 21297b58..c0d701d7 100644 --- a/expression.h +++ b/expression.h @@ -28,6 +28,9 @@ enum expression_type { EXPR_COMMA, EXPR_COMPARE, EXPR_BITFIELD, + EXPR_INITIALIZER, // initializer list + EXPR_IDENTIFIER, // identifier in initializer + EXPR_INDEX, // index in initializer }; struct expression { @@ -85,6 +88,14 @@ struct expression { unsigned char bitpos, nrbits; struct expression *address; }; + // EXPR_INITIALIZER + struct expression_list *expr_list; + // EXPR_IDENTIFIER + struct ident *expr_ident; + // EXPR_INDEX + struct index_expr { + unsigned int idx_from, idx_to; + }; }; }; @@ -120,7 +131,7 @@ static inline int lookup_type(struct token *token) /* Statement parsing */ struct statement *alloc_statement(struct token * token, int type); -struct token *initializer(struct token *token, struct ctype *type); +struct token *initializer(struct expression **tree, struct token *token); struct token *compound_statement(struct token *, struct statement *); /* The preprocessor calls this 'constant_expression()' */ |
