Changes in src/SynTree/Declaration.h [de62360d:843054c2]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
rde62360d r843054c2 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 09:10:31201513 // Update Count : 2 512 // Last Modified On : Mon May 18 08:46:25 2015 13 // Update Count : 2 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(); 30 39 31 const std::string &get_name() const { return name; }40 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, bool isNoreturn);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(); … … 112 123 CompoundStmt *get_statements() const { return statements; } 113 124 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 114 bool get_isInline() const { return isInline; }115 bool get_isNoreturn() const { return isNoreturn; }125 // bool get_isInline() const { return isInline; } 126 // void set_isInline( bool newValue ) { isInline = newValue; } 116 127 std::list< std::string >& get_oldIdents() { return oldIdents; } 117 128 std::list< Declaration* >& get_oldDecls() { return oldDecls; } … … 125 136 FunctionType *type; 126 137 CompoundStmt *statements; 127 bool isInline , isNoreturn;138 bool isInline; 128 139 std::list< std::string > oldIdents; 129 140 std::list< Declaration* > oldDecls; … … 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.