Changeset 04e6f93 for src/Parser/parser.yy
- Timestamp:
- Feb 27, 2020, 4:04:25 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a037f85
- Parents:
- 41efd33 (diff), 930b504 (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
r41efd33 r04e6f93 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 10:04:40202013 // Update Count : 44 4012 // Last Modified On : Wed Feb 26 14:27:39 2020 13 // Update Count : 4472 14 14 // 15 15 … … 166 166 } // rebindForall 167 167 168 NameExpr * build_postfix_name( const string * name ) { 169 NameExpr * new_name = build_varref( new string( "?`" + *name ) ); 170 delete name; 171 return new_name; 168 string * build_postfix_name( string * name ) { 169 *name = string("__postfix_func_") + *name; 170 return name; 172 171 } // build_postfix_name 173 172 … … 633 632 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 634 633 | postfix_expression '`' identifier // CFA, postfix call 635 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ postfix_name( $3) ), $1 ) ); }634 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), $1 ) ); } 636 635 | constant '`' identifier // CFA, postfix call 637 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ postfix_name( $3) ), $1 ) ); }636 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), $1 ) ); } 638 637 | string_literal '`' identifier // CFA, postfix call 639 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ postfix_name( $3) ), new ExpressionNode( $1 ) ) ); }638 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), new ExpressionNode( $1 ) ) ); } 640 639 | postfix_expression '.' identifier 641 640 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } … … 1590 1589 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1591 1590 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1592 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1591 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt 1593 1592 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 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 ) ; }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_opt 1595 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); } 1597 1596 ; 1598 1597 … … 2078 2077 aggregate_control: // CFA 2079 2078 GENERATOR 2080 { yyy = true; $$ = AggregateDecl::Coroutine; } 2079 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2080 | MONITOR GENERATOR 2081 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2081 2082 | COROUTINE 2082 2083 { yyy = true; $$ = AggregateDecl::Coroutine; } 2083 2084 | MONITOR 2084 2085 { yyy = true; $$ = AggregateDecl::Monitor; } 2086 | MONITOR COROUTINE 2087 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2085 2088 | THREAD 2086 2089 { yyy = true; $$ = AggregateDecl::Thread; } 2090 | MONITOR THREAD 2091 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2087 2092 ; 2088 2093
Note:
See TracChangeset
for help on using the changeset viewer.