Changes in src/SynTree/Declaration.h [68cd1ce:5f2f2d7]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r68cd1ce r5f2f2d7 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 12 23:55:26201513 // Update Count : 2412 // Last Modified On : Sun Jun 7 22:03:43 2015 13 // Update Count : 7 14 14 // 15 15 … … 21 21 #include "Mutator.h" 22 22 #include "Parser/LinkageSpec.h" 23 #include "Parser/ParseNode.h"24 23 25 24 class Declaration { 26 25 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 ); 28 37 Declaration( const Declaration &other ); 29 38 virtual ~Declaration(); … … 31 40 const std::string &get_name() const { return name; } 32 41 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; } 35 44 LinkageSpec::Type get_linkage() const { return linkage; } 36 45 void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; } … … 44 53 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; 45 54 55 static const char* storageClassName[]; 56 46 57 static void dumpIds( std::ostream &os ); 47 58 static Declaration *declFromId( UniqueId id ); 48 59 private: 49 60 std::string name; 50 DeclarationNode::StorageClass storageClass;61 StorageClass storageClass; 51 62 LinkageSpec::Type linkage; 52 63 UniqueId uniqueId; … … 55 66 class DeclarationWithType : public Declaration { 56 67 public: 57 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );68 DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage ); 58 69 DeclarationWithType( const DeclarationWithType &other ); 59 70 virtual ~DeclarationWithType(); … … 75 86 typedef DeclarationWithType Parent; 76 87 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 ); 78 89 ObjectDecl( const ObjectDecl &other ); 79 90 virtual ~ObjectDecl(); … … 101 112 typedef DeclarationWithType Parent; 102 113 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 ); 104 115 FunctionDecl( const FunctionDecl &other ); 105 116 virtual ~FunctionDecl(); … … 133 144 typedef Declaration Parent; 134 145 public: 135 NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type );146 NamedTypeDecl( const std::string &name, StorageClass sc, Type *type ); 136 147 NamedTypeDecl( const TypeDecl &other ); 137 148 virtual ~NamedTypeDecl(); … … 158 169 enum Kind { Any, Dtype, Ftype }; 159 170 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 ); 161 172 TypeDecl( const TypeDecl &other ); 162 173 … … 174 185 typedef NamedTypeDecl Parent; 175 186 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 ) {} 177 188 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 178 189
Note:
See TracChangeset
for help on using the changeset viewer.