- completed __FUNCSIG__ and __FUNCDNAME__
[cparser] / ast_t.h
diff --git a/ast_t.h b/ast_t.h
index e6b71e6..8522139 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -51,6 +51,8 @@ typedef enum {
 
        EXPR_FUNCTION,
        EXPR_PRETTY_FUNCTION,
+       EXPR_FUNCSIG,           /**< MS function signature, aka ld_name */
+       EXPR_FUNCDNAME,         /**< MS decorated name of a function */
        EXPR_BUILTIN_SYMBOL,
        EXPR_BUILTIN_CONSTANT_P,
        EXPR_BUILTIN_PREFETCH,
@@ -415,15 +417,23 @@ union initializer_t {
        initializer_designator_t  designator;
 };
 
+/**
+ * Extended microsoft modifier.
+ */
 typedef enum {
-       DM_DLLIMPORT   = (1 << 0),
-       DM_DLLEXPORT   = (1 << 1),
-       DM_THREAD      = (1 << 2),
-       DM_NAKED       = (1 << 3),
-       DM_FORCEINLINE = (1 << 4),
-       DM_NOTHROW     = (1 << 5),
-       DM_NORETURN    = (1 << 6),
-       DM_NOINLINE    = (1 << 7)
+       DM_DLLIMPORT        = (1 <<  0),
+       DM_DLLEXPORT        = (1 <<  1),
+       DM_THREAD           = (1 <<  2),
+       DM_NAKED            = (1 <<  3),
+       DM_MICROSOFT_INLINE = (1 <<  4),
+       DM_FORCEINLINE      = (1 <<  5),
+       DM_SELECTANY        = (1 <<  6),
+       DM_NOTHROW          = (1 <<  7),
+       DM_NOVTABLE         = (1 <<  8),
+       DM_NORETURN         = (1 <<  9),
+       DM_NOINLINE         = (1 << 10),
+       DM_RESTRICT         = (1 << 11),
+       DM_NOALIAS          = (1 << 12)
 } decl_modifier_t;
 
 typedef unsigned short decl_modifiers_t;
@@ -432,10 +442,15 @@ struct declaration_t {
        unsigned char       namespc;
        unsigned char       declared_storage_class;
        unsigned char       storage_class;
-       decl_modifiers_t    modifiers;
+       unsigned char       alignment;          /**< Alignment of the declaration, 0 for default. */
+       decl_modifiers_t    modifiers;          /**< MS __declspec modifiers. */
+       const char         *deprecated_string;  /**< MS deprecated string if any. */
+       symbol_t           *get_property_sym;   /**< MS get property. */
+       symbol_t           *put_property_sym;   /**< MS put property. */
        unsigned int        address_taken : 1;
        unsigned int        is_inline     : 1;
        unsigned int        used          : 1;  /**< Set if the declaration is used. */
+       unsigned int        deprecated    : 1;  /**< Microsoft of GNU deprecated attribute. */
        type_t             *type;
        symbol_t           *symbol;
        source_position_t   source_position;
@@ -467,6 +482,7 @@ struct declaration_t {
 
 typedef enum {
        STATEMENT_INVALID,
+       STATEMENT_EMPTY,
        STATEMENT_COMPOUND,
        STATEMENT_RETURN,
        STATEMENT_DECLARATION,
@@ -490,6 +506,14 @@ struct statement_base_t {
        source_position_t  source_position;
 };
 
+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;
@@ -617,6 +641,19 @@ void *_allocate_ast(size_t size)
        return obstack_alloc(&ast_obstack, size);
 }
 
+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;
+}
+
+
 #define allocate_ast(size)                 _allocate_ast(size)
 
 #endif