Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r68cd1ce r5f2f2d7  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 12 23:55:26 2015
    13 // Update Count     : 24
     12// Last Modified On : Sun Jun  7 22:03:43 2015
     13// Update Count     : 7
    1414//
    1515
     
    2121#include "Mutator.h"
    2222#include "Parser/LinkageSpec.h"
    23 #include "Parser/ParseNode.h"
    2423
    2524class Declaration {
    2625  public:
    27         Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
     26        enum StorageClass { 
     27                NoStorageClass,
     28                Extern,
     29                Static,
     30                Auto,
     31                Register,
     32                Inline,
     33                Fortran,
     34        };     
     35
     36        Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
    2837        Declaration( const Declaration &other );
    2938        virtual ~Declaration();
     
    3140        const std::string &get_name() const { return name; }
    3241        void set_name( std::string newValue ) { name = newValue; }
    33         DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
    34         void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
     42        StorageClass get_storageClass() const { return storageClass; }
     43        void set_storageClass( StorageClass newValue ) { storageClass = newValue; }
    3544        LinkageSpec::Type get_linkage() const { return linkage; }
    3645        void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; }
     
    4453        virtual void printShort( std::ostream &os, int indent = 0 ) const = 0;
    4554
     55        static const char* storageClassName[]; 
     56
    4657        static void dumpIds( std::ostream &os );
    4758        static Declaration *declFromId( UniqueId id );
    4859  private:
    4960        std::string name;
    50         DeclarationNode::StorageClass storageClass;
     61        StorageClass storageClass;
    5162        LinkageSpec::Type linkage;
    5263        UniqueId uniqueId;
     
    5566class DeclarationWithType : public Declaration {
    5667  public:
    57         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
     68        DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );
    5869        DeclarationWithType( const DeclarationWithType &other );
    5970        virtual ~DeclarationWithType();
     
    7586        typedef DeclarationWithType Parent;
    7687  public:
    77         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
     88        ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );
    7889        ObjectDecl( const ObjectDecl &other );
    7990        virtual ~ObjectDecl();
     
    101112        typedef DeclarationWithType Parent;
    102113  public:
    103         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline );
     114        FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline );
    104115        FunctionDecl( const FunctionDecl &other );
    105116        virtual ~FunctionDecl();
     
    133144        typedef Declaration Parent;
    134145  public:
    135         NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );
     146        NamedTypeDecl( const std::string &name, StorageClass sc, Type *type );
    136147        NamedTypeDecl( const TypeDecl &other );
    137148        virtual ~NamedTypeDecl();
     
    158169        enum Kind { Any, Dtype, Ftype };
    159170
    160         TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind );
     171        TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind );
    161172        TypeDecl( const TypeDecl &other );
    162173
     
    174185        typedef NamedTypeDecl Parent;
    175186  public:
    176         TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
     187        TypedefDecl( const std::string &name, StorageClass sc, Type *type ) : Parent( name, sc, type ) {}
    177188        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    178189
Note: See TracChangeset for help on using the changeset viewer.