projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use strstart() instead of strncmp().
[cparser]
/
ast_t.h
diff --git
a/ast_t.h
b/ast_t.h
index
92caf95
..
41367a9
100644
(file)
--- a/
ast_t.h
+++ b/
ast_t.h
@@
-62,8
+62,7
@@
typedef enum precedence_t {
* Expression kinds.
*/
typedef enum expression_kind_t {
* Expression kinds.
*/
typedef enum expression_kind_t {
- EXPR_UNKNOWN = 0,
- EXPR_INVALID,
+ EXPR_ERROR = 1,
EXPR_REFERENCE,
EXPR_REFERENCE_ENUM_VALUE,
EXPR_LITERAL_BOOLEAN,
EXPR_REFERENCE,
EXPR_REFERENCE_ENUM_VALUE,
EXPR_LITERAL_BOOLEAN,
@@
-265,7
+264,7
@@
struct expression_base_t {
struct literal_expression_t {
expression_base_t base;
string_t value;
struct literal_expression_t {
expression_base_t base;
string_t value;
- s
ymbol_t *
suffix;
+ s
tring_t
suffix;
/* ast2firm data */
ir_tarval *target_value;
/* ast2firm data */
ir_tarval *target_value;
@@
-480,7
+479,7
@@
union initializer_t {
* The statement kinds.
*/
typedef enum statement_kind_t {
* The statement kinds.
*/
typedef enum statement_kind_t {
- STATEMENT_
INVALID
,
+ STATEMENT_
ERROR = 1
,
STATEMENT_EMPTY,
STATEMENT_COMPOUND,
STATEMENT_RETURN,
STATEMENT_EMPTY,
STATEMENT_COMPOUND,
STATEMENT_RETURN,
@@
-515,14
+514,6
@@
struct statement_base_t {
#endif
};
#endif
};
-struct invalid_statement_t {
- statement_base_t base;
-};
-
-struct empty_statement_t {
- statement_base_t base;
-};
-
struct return_statement_t {
statement_base_t base;
expression_t *value; /**< The return value if any. */
struct return_statement_t {
statement_base_t base;
expression_t *value; /**< The return value if any. */
@@
-668,16
+659,6
@@
struct translation_unit_t {
statement_t *global_asm;
};
statement_t *global_asm;
};
-static inline bool is_invalid_expression(expression_t *expression)
-{
- return expression->base.kind == EXPR_INVALID;
-}
-
-static inline bool is_invalid_statement(statement_t *statement)
-{
- return statement->base.kind == STATEMENT_INVALID;
-}
-
/**
* Allocate an AST node with given size and
* initialize all fields with zero.
/**
* Allocate an AST node with given size and
* initialize all fields with zero.