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 {
-       EXPR_UNKNOWN = 0,
-       EXPR_INVALID,
+       EXPR_ERROR = 1,
        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;
-       symbol_t          *suffix;
+       string_t           suffix;
 
        /* ast2firm data */
        ir_tarval         *target_value;
@@ -480,7 +479,7 @@ union initializer_t {
  * The statement kinds.
  */
 typedef enum statement_kind_t {
-       STATEMENT_INVALID,
+       STATEMENT_ERROR = 1,
        STATEMENT_EMPTY,
        STATEMENT_COMPOUND,
        STATEMENT_RETURN,
@@ -515,14 +514,6 @@ struct statement_base_t {
 #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. */
@@ -668,16 +659,6 @@ struct translation_unit_t {
        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.