diff options
| author | Linus Torvalds <torvalds@penguin.transmeta.com> | 2003-03-24 11:26:02 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 20:59:40 -0700 |
| commit | dd70c1f2ceb662e396256e11b9edd44cc7f7724c (patch) | |
| tree | c9bed7577d1b6da535589f096b94d0530f9e33ac | |
| parent | 6a9acf2316de67159f2a07eb61bdb96618f8af86 (diff) | |
| download | sparse-dev-dd70c1f2ceb662e396256e11b9edd44cc7f7724c.tar.gz | |
Move expression data structures to "expression.h", they got
left behind in "parse.h" when the files were split.
| -rw-r--r-- | expression.h | 41 | ||||
| -rw-r--r-- | lib.c | 1 | ||||
| -rw-r--r-- | parse.h | 41 | ||||
| -rw-r--r-- | pre-process.c | 1 |
4 files changed, 43 insertions, 41 deletions
diff --git a/expression.h b/expression.h index d3781843..0566fadd 100644 --- a/expression.h +++ b/expression.h @@ -8,6 +8,47 @@ * Declarations and helper functions for expression parsing. */ +enum expression_type { + EXPR_CONSTANT, + EXPR_SYMBOL, + EXPR_BINOP, + EXPR_DEREF, + EXPR_PREOP, + EXPR_POSTOP, + EXPR_CAST, + EXPR_SIZEOF, + EXPR_CONDITIONAL, + EXPR_STATEMENT, +}; + +struct expression { + int type, op; + struct token *token; + union { + struct expression *unop; + struct statement *statement; + struct symbol *symbol; + struct binop_arg { + struct expression *left, *right; + }; + struct deref_arg { + struct expression *deref; + struct token *member; + }; + struct cast_arg { + struct symbol *cast_type; + struct expression *cast_expression; + }; + struct conditional_expr { + struct expression *conditional, *cond_true, *cond_false; + }; + struct statement_struct { + struct symbol_list *syms; + struct statement_list *stmts; + }; + }; +}; + /* Constant expression values */ long long get_expression_value(struct expression *); @@ -13,6 +13,7 @@ #include "token.h" #include "parse.h" #include "symbol.h" +#include "expression.h" struct token *skip_to(struct token *token, int op) { @@ -8,47 +8,6 @@ #include "symbol.h" -enum expression_type { - EXPR_CONSTANT, - EXPR_SYMBOL, - EXPR_BINOP, - EXPR_DEREF, - EXPR_PREOP, - EXPR_POSTOP, - EXPR_CAST, - EXPR_SIZEOF, - EXPR_CONDITIONAL, - EXPR_STATEMENT, -}; - -struct expression { - int type, op; - struct token *token; - union { - struct expression *unop; - struct statement *statement; - struct symbol *symbol; - struct binop_arg { - struct expression *left, *right; - }; - struct deref_arg { - struct expression *deref; - struct token *member; - }; - struct cast_arg { - struct symbol *cast_type; - struct expression *cast_expression; - }; - struct conditional_expr { - struct expression *conditional, *cond_true, *cond_false; - }; - struct statement_struct { - struct symbol_list *syms; - struct statement_list *stmts; - }; - }; -}; - enum statement_type { STMT_NONE, STMT_EXPRESSION, diff --git a/pre-process.c b/pre-process.c index 36dc5021..df1ddd2f 100644 --- a/pre-process.c +++ b/pre-process.c @@ -20,6 +20,7 @@ #include "parse.h" #include "token.h" #include "symbol.h" +#include "expression.h" #define MAXNEST (16) static int true_nesting = 0; |
