Changes in src/SynTree/Declaration.h [8f60f0b:58dd019]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r8f60f0b r58dd019 179 179 typedef NamedTypeDecl Parent; 180 180 public: 181 enum Kind { Any, Dtype, Ftype, Ttype }; 182 /// Data extracted from a type decl 183 struct Data { 184 TypeDecl::Kind kind; 185 bool isComplete; 186 Data() : kind( (TypeDecl::Kind)-1 ), isComplete( false ) {} 187 Data( TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {} 188 Data( Kind kind, bool isComplete ) : kind( kind ), isComplete( isComplete ) {} 189 bool operator==(const Data & other) const { return kind == other.kind && isComplete == other.isComplete; } 190 bool operator!=(const Data & other) const { return !(*this == other);} 191 }; 181 enum Kind { Any, Dtype, Ftype }; 192 182 193 183 TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ); … … 196 186 Kind get_kind() const { return kind; } 197 187 198 bool isComplete() const { return kind == Any || sized; }199 bool get_sized() const { return sized; }200 TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; }201 202 188 virtual TypeDecl *clone() const { return new TypeDecl( *this ); } 203 189 virtual void accept( Visitor &v ) { v.visit( this ); } … … 206 192 virtual std::string typeString() const; 207 193 Kind kind; 208 bool sized;209 194 }; 210 195 … … 299 284 300 285 std::ostream & operator<<( std::ostream & out, const Declaration * decl ); 301 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data );302 286 303 287 #endif // DECLARATION_H
Note:
See TracChangeset
for help on using the changeset viewer.