Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0a6d8204 r60a8062  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 27 12:25:42 2020
    13 // Update Count     : 4483
     12// Last Modified On : Sun Feb 16 08:22:14 2020
     13// Update Count     : 4461
    1414//
    1515
     
    278278%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    279279%token SIZEOF OFFSETOF
    280 // %token RESUME                                                                        // CFA
    281 %token SUSPEND                                                                  // CFA
     280// %token SUSPEND RESUME                                                                        // CFA
    282281%token ATTRIBUTE EXTENSION                                                              // GCC
    283282%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    919918        conditional_expression
    920919        | unary_expression assignment_operator assignment_expression
    921                 {
    922                         if ( $2 == OperKinds::AtAssn ) {
    923                                 SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr;
    924                         } else {
    925                                 $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) );
    926                         } // if
    927                 }
     920                { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
    928921        | unary_expression '=' '{' initializer_list_opt comma_opt '}'
    929922                { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; }
     
    966959
    967960tuple_expression_list:
    968         assignment_expression
    969         | '@'                                                                                           // CFA
    970                 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
    971         | tuple_expression_list ',' assignment_expression
     961        assignment_expression_opt
     962        | tuple_expression_list ',' assignment_expression_opt
    972963                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    973         | tuple_expression_list ',' '@'
    974                 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
    975964        ;
    976965
     
    12701259        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12711260                { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; }
    1272         | SUSPEND ';'
    1273                 { $$ = new StatementNode( build_suspend( nullptr ) ); }
    1274         | SUSPEND compound_statement
    1275                 { $$ = new StatementNode( build_suspend( $2 ) ); }
    1276         | SUSPEND COROUTINE ';'
    1277                 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); }
    1278         | SUSPEND COROUTINE compound_statement
    1279                 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); }
    1280         | SUSPEND GENERATOR ';'
    1281                 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); }
    1282         | SUSPEND GENERATOR compound_statement
    1283                 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); }
     1261        // | SUSPEND ';'
     1262        //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1263        // | SUSPEND compound_statement ';'
     1264        //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    12841265        | THROW assignment_expression_opt ';'                           // handles rethrow
    12851266                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    16081589                // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be
    16091590                // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name.
    1610         cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt
     1591        cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
    16111592                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    1612                 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); }
    1613         | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt
    1614                 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); }
     1593                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
     1594        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
     1595                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
    16151596        ;
    16161597
     
    20962077aggregate_control:                                                                              // CFA
    20972078        GENERATOR
    2098                 { yyy = true; $$ = AggregateDecl::Generator; }
    2099         | MONITOR GENERATOR
    2100                 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
     2079                { yyy = true; $$ = AggregateDecl::Coroutine; }
    21012080        | COROUTINE
    21022081                { yyy = true; $$ = AggregateDecl::Coroutine; }
    21032082        | MONITOR
    21042083                { yyy = true; $$ = AggregateDecl::Monitor; }
    2105         | MONITOR COROUTINE
    2106                 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    21072084        | THREAD
    21082085                { yyy = true; $$ = AggregateDecl::Thread; }
    2109         | MONITOR THREAD
    2110                 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    21112086        ;
    21122087
Note: See TracChangeset for help on using the changeset viewer.