Changeset 80722d0 for src/Parser/parser.yy
- Timestamp:
- Aug 20, 2016, 7:06:26 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ab57786, d30790f
- Parents:
- e6955b1 (diff), 4a7d895 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
re6955b1 r80722d0 311 311 constant: 312 312 // ENUMERATIONconstant is not included here; it is treated as a variable with type "enumeration constant". 313 INTEGERconstant { $$ = new ExpressionNode( build_constantInteger( *$1) ); }314 | FLOATINGconstant { $$ = new ExpressionNode( build_constantFloat( *$1) ); }315 | CHARACTERconstant { $$ = new ExpressionNode( build_constantChar( *$1) ); }313 INTEGERconstant { $$ = new ExpressionNode( build_constantInteger( assign_strptr($1) ) ); } 314 | FLOATINGconstant { $$ = new ExpressionNode( build_constantFloat( assign_strptr($1) ) ); } 315 | CHARACTERconstant { $$ = new ExpressionNode( build_constantChar( assign_strptr($1) ) ); } 316 316 ; 317 317 … … 338 338 339 339 string_literal_list: // juxtaposed strings are concatenated 340 STRINGliteral { $$ = build_constantStr( *$1); }340 STRINGliteral { $$ = build_constantStr( assign_strptr($1) ); } 341 341 | string_literal_list STRINGliteral 342 342 { … … 838 838 jump_statement: 839 839 GOTO IDENTIFIER ';' 840 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Goto ) ); }840 { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Goto ) ); } 841 841 | GOTO '*' comma_expression ';' // GCC, computed goto 842 842 // The syntax for the GCC computed goto violates normal expression precedence, e.g., goto *i+3; => goto *(i+3); … … 849 849 // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and 850 850 // the target of the transfer appears only at the start of an iteration statement. 851 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Continue ) ); delete $2; }851 { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Continue ) ); } 852 852 | BREAK ';' 853 853 // A semantic check is required to ensure this statement appears only in the body of an iteration statement. … … 856 856 // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and 857 857 // the target of the transfer appears only at the start of an iteration statement. 858 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Break ) ); delete $2; }858 { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Break ) ); } 859 859 | RETURN comma_expression_opt ';' 860 860 { $$ = new StatementNode( build_return( $2 ) ); } … … 979 979 label_list: 980 980 no_attr_identifier 981 { $$ = new LabelNode(); $$->labels.push_back( *$1); }981 { $$ = new LabelNode(); $$->labels.push_back( assign_strptr($1) ); } 982 982 | label_list ',' no_attr_identifier 983 { $$ = $1; $1->labels.push_back( *$3); }983 { $$ = $1; $1->labels.push_back( assign_strptr($3) ); } 984 984 ; 985 985 … … 1993 1993 { 1994 1994 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" 1995 linkage = LinkageSpec::fromString( *$2);1995 linkage = LinkageSpec::fromString( assign_strptr($2) ); 1996 1996 } 1997 1997 '{' external_definition_list_opt '}' // C++-style linkage specifier … … 2137 2137 2138 2138 any_word: // GCC 2139 identifier_or_type_name { }2140 | storage_class { }2141 | basic_type_name { }2142 | type_qualifier { }2139 identifier_or_type_name { delete $1; } 2140 | storage_class { delete $1; } 2141 | basic_type_name { delete $1; } 2142 | type_qualifier { delete $1; } 2143 2143 ; 2144 2144
Note:
See TracChangeset
for help on using the changeset viewer.