Changeset a7741435 for src/Parser/parser.yy
- Timestamp:
- Dec 14, 2016, 9:43:35 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c7800bfc
- Parents:
- 74e5a3aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r74e5a3aa ra7741435 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 13 14:14:52 201613 // Update Count : 20 8112 // Last Modified On : Wed Dec 14 21:28:22 2016 13 // Update Count : 2090 14 14 // 15 15 … … 775 775 // therefore, are removed from the grammar even though C allows it. The change also applies to choose 776 776 // statement. 777 $$ = $7 != 0? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw;777 $$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 778 778 } 779 779 | CHOOSE '(' comma_expression ')' case_clause // CFA … … 782 782 { 783 783 StatementNode *sw = new StatementNode( build_switch( $3, $8 ) ); 784 $$ = $7 != 0? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw;784 $$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 785 785 } 786 786 ; … … 1014 1014 { $$ = new ExpressionNode( $1 ); } 1015 1015 | asm_clobbers_list_opt ',' string_literal 1016 // set_last return ParseNode * 1016 1017 { $$ = (ExpressionNode *)$1->set_last( new ExpressionNode( $3 ) ); } 1017 1018 ; … … 1535 1536 { $$ = nullptr; } 1536 1537 | field_declaration_list field_declaration 1537 { $$ = $1 != 0? $1->appendList( $2 ) : $2; }1538 { $$ = $1 ? $1->appendList( $2 ) : $2; } 1538 1539 ; 1539 1540 … … 1713 1714 { 1714 1715 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1715 $$ = $2->addType( $1 )->addInitializer( new InitializerNode( $3 ));1716 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 1716 1717 } 1717 1718 | declaration_specifier type_parameter_redeclarator assignment_opt 1718 1719 { 1719 1720 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1720 $$ = $2->addType( $1 )->addInitializer( new InitializerNode( $3 ));1721 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 1721 1722 } 1722 1723 ; … … 1901 1902 { $$ = nullptr; } 1902 1903 | assertion_list_opt assertion 1903 { $$ = $1 != 0? $1->appendList( $2 ) : $2; }1904 { $$ = $1 ? $1->appendList( $2 ) : $2; } 1904 1905 ; 1905 1906 … … 2022 2023 {} // empty input file 2023 2024 | external_definition_list 2024 { parseTree = parseTree != nullptr? parseTree->appendList( $1 ) : $1; }2025 { parseTree = parseTree ? parseTree->appendList( $1 ) : $1; } 2025 2026 ; 2026 2027 … … 2028 2029 external_definition 2029 2030 | external_definition_list push external_definition 2030 { $$ = $1 != nullptr? $1->appendList( $3 ) : $3; }2031 { $$ = $1 ? $1->appendList( $3 ) : $3; } 2031 2032 ; 2032 2033
Note: See TracChangeset
for help on using the changeset viewer.