Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r6a0d4d61 rdd020c0  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 15:22:10 2017
    13 // Update Count     : 662
     12// Last Modified On : Fri Mar  3 21:34:27 2017
     13// Update Count     : 704
    1414//
    1515
     
    1919#include <string>
    2020#include <list>
     21#include <bitset>
    2122#include <iterator>
    2223#include <memory>
     
    203204        // These must remain in the same order as the corresponding DeclarationNode names.
    204205
    205         // enum StorageClass { Extern, Static, Auto, Register, NoStorageClass };
    206         // enum FunctionSpec { Inline, Fortran, Noreturn, NoFunctionSpec };
    207         // enum Qualifier { Const, Restrict, Volatile, Lvalue, Atomic, Threadlocal, Mutex, NoQualifier };
    208 
    209         enum StorageClass { Extern, Static, Auto, Register, Inline, Fortran, Noreturn, Threadlocal, NoStorageClass, };
    210         enum Qualifier { Const, Restrict, Volatile, Lvalue, Atomic, NoQualifier };
     206        enum StorageClass { Extern, Static, Auto, Register, Threadlocal, NoStorageClass };
     207        enum FuncSpecifier { Inline, Noreturn, Fortran, NoFuncSpecifier,
     208                                        InlineSpec = 1 << Inline, NoreturnSpec = 1 << Noreturn, FortranSpec = 1 << Fortran };
     209        enum TypeQualifier { Const, Restrict, Volatile, Lvalue, Atomic, NoTypeQualifier };
    211210        enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType };
    212211        enum ComplexType { Complex, Imaginary, NoComplexType };
     
    217216        enum BuiltinType { Valist, Zero, One, NoBuiltinType };
    218217
    219         static const char * storageName[];
    220         static const char * qualifierName[];
    221         static const char * basicTypeName[];
    222         static const char * complexTypeName[];
    223         static const char * signednessName[];
    224         static const char * lengthName[];
    225         static const char * aggregateName[];
    226         static const char * typeClassName[];
    227         static const char * builtinTypeName[];
    228 
    229         static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false );
    230         static DeclarationNode * newQualifier( Qualifier );
    231         static DeclarationNode * newForall( DeclarationNode * );
     218        static const char * storageClassNames[];
     219        static const char * funcSpecifierNames[];
     220        static const char * typeQualifierNames[];
     221        static const char * basicTypeNames[];
     222        static const char * complexTypeNames[];
     223        static const char * signednessNames[];
     224        static const char * lengthNames[];
     225        static const char * aggregateNames[];
     226        static const char * typeClassNames[];
     227        static const char * builtinTypeNames[];
     228
    232229        static DeclarationNode * newStorageClass( StorageClass );
     230        static DeclarationNode * newFuncSpecifier( FuncSpecifier );
     231        static DeclarationNode * newTypeQualifier( TypeQualifier );
    233232        static DeclarationNode * newBasicType( BasicType );
    234233        static DeclarationNode * newComplexType( ComplexType );
    235         static DeclarationNode * newSignedNess( Signedness sn );
    236         static DeclarationNode * newLength( Length lnth );
     234        static DeclarationNode * newSignedNess( Signedness );
     235        static DeclarationNode * newLength( Length );
    237236        static DeclarationNode * newBuiltinType( BuiltinType );
     237        static DeclarationNode * newForall( DeclarationNode * );
    238238        static DeclarationNode * newFromTypedef( std::string * );
     239        static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false );
    239240        static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    240241        static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );
     
    324325        TypeData * type;
    325326        StorageClass storageClass;
     327
     328        typedef std::bitset< DeclarationNode::NoFuncSpecifier > FuncSpec;
     329        FuncSpec funcSpec;
     330        static void print_FuncSpec( std::ostream & output, FuncSpec funcSpec );
     331
    326332        ExpressionNode * bitfieldWidth;
    327         bool isInline, isNoreturn;
    328333        std::unique_ptr<ExpressionNode> enumeratorValue;
    329334        bool hasEllipsis;
Note: See TracChangeset for help on using the changeset viewer.