6 * Copyright (C) 2003 Linus Torvalds, all rights reserved
8 * Declarations and helper functions for expression parsing.
11 /* Constant expression values */
12 long long get_expression_value(struct expression
*);
14 /* Expression parsing */
15 struct token
*parse_expression(struct token
*token
, struct expression
**tree
);
16 struct token
*conditional_expression(struct token
*token
, struct expression
**tree
);
17 struct token
*primary_expression(struct token
*token
, struct expression
**tree
);
18 struct token
*parens_expression(struct token
*token
, struct expression
**expr
, const char *where
);
19 struct token
*assignment_expression(struct token
*token
, struct expression
**tree
);
21 static inline struct expression
*alloc_expression(struct token
*token
, int type
)
23 struct expression
*expr
= __alloc_expression(0);
29 /* Type name parsing */
30 struct token
*typename(struct token
*, struct symbol
**);
32 static inline int lookup_type(struct token
*token
)
34 if (token
->type
== TOKEN_IDENT
)
35 return lookup_symbol(token
->ident
, NS_TYPEDEF
) != NULL
;
39 /* Statement parsing */
40 struct statement
*alloc_statement(struct token
* token
, int type
);
41 struct token
*initializer(struct token
*token
, struct ctype
*type
);
42 struct token
*compound_statement(struct token
*, struct statement
*);
44 /* The preprocessor calls this 'constant_expression()' */
45 #define constant_expression(token,tree) conditional_expression(token, tree)