Changeset 2d019af for src/Parser
- Timestamp:
- Mar 12, 2021, 11:14:29 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 41ca6fa, e867b44
- Parents:
- 6083392
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r6083392 r2d019af 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 11 20:58:07 202113 // Update Count : 11 3712 // Last Modified On : Fri Mar 12 18:35:37 2021 13 // Update Count : 1141 14 14 // 15 15 … … 424 424 newnode->attributes.push_back( new Attribute( *name, exprs ) ); 425 425 delete name; 426 return newnode; 427 } 428 429 DeclarationNode * DeclarationNode::newDirectiveStmt( StatementNode * stmt ) { 430 DeclarationNode * newnode = new DeclarationNode; 431 newnode->directiveStmt = stmt; 426 432 return newnode; 427 433 } … … 1072 1078 return new AsmDecl( strict_dynamic_cast<AsmStmt *>( asmStmt->build() ) ); 1073 1079 } // if 1080 if ( directiveStmt ) { 1081 return new DirectiveDecl( strict_dynamic_cast<DirectiveStmt *>( directiveStmt->build() ) ); 1082 } // if 1074 1083 1075 1084 if ( variable.tyClass != TypeDecl::NUMBER_OF_KINDS ) { -
src/Parser/ParseNode.h
r6083392 r2d019af 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jan 3 18:23:01202113 // Update Count : 89 612 // Last Modified On : Fri Mar 12 15:19:04 2021 13 // Update Count : 897 14 14 // 15 15 … … 249 249 static DeclarationNode * newTypeof( ExpressionNode * expr, bool basetypeof = false ); 250 250 static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 251 static DeclarationNode * newDirectiveStmt( StatementNode * stmt ); // gcc external directive statement 251 252 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 252 253 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message ); … … 345 346 std::string error; 346 347 StatementNode * asmStmt = nullptr; 348 StatementNode * directiveStmt = nullptr; 347 349 348 350 static UniqueName anonymous; -
src/Parser/parser.yy
r6083392 r2d019af 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 17 09:03:07202113 // Update Count : 472 212 // Last Modified On : Fri Mar 12 15:21:02 2021 13 // Update Count : 4728 14 14 // 15 15 … … 2639 2639 2640 2640 external_definition: 2641 declaration 2641 DIRECTIVE 2642 { $$ = DeclarationNode::newDirectiveStmt( new StatementNode( build_directive( $1 ) ) ); } 2643 | declaration 2642 2644 | external_function_definition 2643 2645 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown
Note: See TracChangeset
for help on using the changeset viewer.