Changes in src/Parser/parser.yy [aeb5d0d:948fdef]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
raeb5d0d r948fdef 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 26 14:27:39202013 // Update Count : 44 7212 // Last Modified On : Sat Feb 1 10:04:40 2020 13 // Update Count : 4440 14 14 // 15 15 … … 166 166 } // rebindForall 167 167 168 string * build_postfix_name( string * name ) { 169 *name = string("__postfix_func_") + *name; 170 return name; 168 NameExpr * build_postfix_name( const string * name ) { 169 NameExpr * new_name = build_varref( new string( "?`" + *name ) ); 170 delete name; 171 return new_name; 171 172 } // build_postfix_name 172 173 … … 632 633 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 633 634 | postfix_expression '`' identifier // CFA, postfix call 634 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), $1 ) ); }635 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 635 636 | constant '`' identifier // CFA, postfix call 636 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), $1 ) ); }637 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 637 638 | string_literal '`' identifier // CFA, postfix call 638 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), new ExpressionNode( $1 ) ) ); }639 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 639 640 | postfix_expression '.' identifier 640 641 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } … … 1589 1590 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1590 1591 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1591 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt1592 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1592 1593 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1593 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ) ->addQualifiers( $8 ); }1594 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt1595 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ) ->addQualifiers( $8 ); }1594 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1595 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1596 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1596 1597 ; 1597 1598 … … 2077 2078 aggregate_control: // CFA 2078 2079 GENERATOR 2079 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2080 | MONITOR GENERATOR 2081 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2080 { yyy = true; $$ = AggregateDecl::Coroutine; } 2082 2081 | COROUTINE 2083 2082 { yyy = true; $$ = AggregateDecl::Coroutine; } 2084 2083 | MONITOR 2085 2084 { yyy = true; $$ = AggregateDecl::Monitor; } 2086 | MONITOR COROUTINE2087 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }2088 2085 | THREAD 2089 2086 { yyy = true; $$ = AggregateDecl::Thread; } 2090 | MONITOR THREAD2091 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }2092 2087 ; 2093 2088
Note:
See TracChangeset
for help on using the changeset viewer.