Changeset 93bbbc4 for src/Parser
- Timestamp:
- Jul 14, 2021, 6:35:37 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- e7a63e3
- Parents:
- b16e15e
- Location:
- src/Parser
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rb16e15e r93bbbc4 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 23 08:44:08202113 // Update Count : 11 4912 // Last Modified On : Wed Jul 14 17:36:57 2021 13 // Update Count : 1154 14 14 // 15 15 … … 385 385 newnode->type = new TypeData( basetypeof ? TypeData::Basetypeof : TypeData::Typeof ); 386 386 newnode->type->typeexpr = expr; 387 return newnode; 388 } 389 390 DeclarationNode * DeclarationNode::newVtableType( DeclarationNode * decl ) { 391 DeclarationNode * newnode = new DeclarationNode; 392 newnode->type = new TypeData( TypeData::Vtable ); 393 newnode->setBase( decl->type ); 387 394 return newnode; 388 395 } -
src/Parser/ParseNode.h
rb16e15e r93bbbc4 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 15:19:04202113 // Update Count : 89712 // Last Modified On : Wed Jul 14 17:28:53 2021 13 // Update Count : 900 14 14 // 15 15 … … 249 249 static DeclarationNode * newTuple( DeclarationNode * members ); 250 250 static DeclarationNode * newTypeof( ExpressionNode * expr, bool basetypeof = false ); 251 static DeclarationNode * newVtableType( DeclarationNode * expr ); 251 252 static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 252 253 static DeclarationNode * newDirectiveStmt( StatementNode * stmt ); // gcc external directive statement -
src/Parser/TypeData.cc
rb16e15e r93bbbc4 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 16 07:56:46 201913 // Update Count : 6 6212 // Last Modified On : Wed Jul 14 17:46:47 2021 13 // Update Count : 671 14 14 // 15 15 … … 100 100 typeexpr = nullptr; 101 101 break; 102 case Vtable: 103 break; 102 104 case Builtin: 103 105 // builtin = new Builtin_t; … … 170 172 // delete typeexpr->expr; 171 173 delete typeexpr; 174 break; 175 case Vtable: 172 176 break; 173 177 case Builtin: … … 249 253 case Basetypeof: 250 254 newtype->typeexpr = maybeClone( typeexpr ); 255 break; 256 case Vtable: 251 257 break; 252 258 case Builtin: … … 467 473 case Basetypeof: 468 474 case Builtin: 475 case Vtable: 469 476 assertf(false, "Tried to get leaf name from kind without a name: %d", kind); 470 477 break; … … 546 553 case TypeData::Basetypeof: 547 554 return buildTypeof( td ); 555 case TypeData::Vtable: 556 return buildVtable( td ); 548 557 case TypeData::Builtin: 549 558 switch ( td->builtintype ) { … … 950 959 951 960 961 VTableType * buildVtable( const TypeData * td ) { 962 assert( td->base ); 963 return new VTableType{ buildQualifiers( td ), typebuild( td->base ) }; 964 } // buildVtable 965 966 952 967 Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, std::list< Attribute * > attributes ) { 953 968 if ( td->kind == TypeData::Function ) { -
src/Parser/TypeData.h
rb16e15e r93bbbc4 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Mar 27 09:05:35 202113 // Update Count : 20 012 // Last Modified On : Wed Jul 14 17:44:05 2021 13 // Update Count : 202 14 14 // 15 15 … … 27 27 struct TypeData { 28 28 enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 29 SymbolicInst, Tuple, Typeof, Basetypeof, Builtin, GlobalScope, Qualified, Unknown };29 SymbolicInst, Tuple, Typeof, Basetypeof, Vtable, Builtin, GlobalScope, Qualified, Unknown }; 30 30 31 31 struct Aggregate_t { … … 128 128 TupleType * buildTuple( const TypeData * ); 129 129 TypeofType * buildTypeof( const TypeData * ); 130 VTableType * buildVtable( const TypeData * ); 130 131 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, 131 132 Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); -
src/Parser/parser.yy
rb16e15e r93bbbc4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 29 09:12:47202113 // Update Count : 50 2712 // Last Modified On : Wed Jul 14 17:27:54 2021 13 // Update Count : 5030 14 14 // 15 15 … … 1923 1923 1924 1924 vtable: 1925 VTABLE '(' type_list ')' default_opt 1926 { SemanticError( yylloc, "vtable is currently unimplemented." ); $$ = nullptr; } 1925 VTABLE '(' typedef_name ')' default_opt 1926 { $$ = DeclarationNode::newVtableType( $3 ); } 1927 // { SemanticError( yylloc, "vtable is currently unimplemented." ); $$ = nullptr; } 1927 1928 ; 1928 1929
Note: See TracChangeset
for help on using the changeset viewer.