Ignore:
Timestamp:
Mar 18, 2020, 3:41:01 PM (19 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
778452d, d658183
Parents:
c4fd4ef (diff), 45f4147 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rc4fd4ef rbbdb0c6  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 26 14:27:39 2020
    13 // Update Count     : 4472
     12// Last Modified On : Fri Mar  6 17:26:45 2020
     13// Update Count     : 4474
    1414//
    1515
     
    278278%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    279279%token SIZEOF OFFSETOF
    280 // %token SUSPEND RESUME                                                                        // CFA
     280// %token RESUME                                                                        // CFA
     281%token SUSPEND                                                                  // CFA
    281282%token ATTRIBUTE EXTENSION                                                              // GCC
    282283%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    918919        conditional_expression
    919920        | unary_expression assignment_operator assignment_expression
    920                 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
     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                }
    921928        | unary_expression '=' '{' initializer_list_opt comma_opt '}'
    922929                { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; }
     
    12591266        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12601267                { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; }
    1261         // | SUSPEND ';'
    1262         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    1263         // | SUSPEND compound_statement ';'
    1264         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1268        | SUSPEND ';'
     1269                { $$ = new StatementNode( build_suspend( nullptr ) ); }
     1270        | SUSPEND compound_statement
     1271                { $$ = new StatementNode( build_suspend( $2 ) ); }
     1272        | SUSPEND COROUTINE ';'
     1273                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); }
     1274        | SUSPEND COROUTINE compound_statement
     1275                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); }
     1276        | SUSPEND GENERATOR ';'
     1277                { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); }
     1278        | SUSPEND GENERATOR compound_statement
     1279                { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); }
    12651280        | THROW assignment_expression_opt ';'                           // handles rethrow
    12661281                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    20772092aggregate_control:                                                                              // CFA
    20782093        GENERATOR
    2079                 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
     2094                { yyy = true; $$ = AggregateDecl::Generator; }
    20802095        | MONITOR GENERATOR
    20812096                { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
Note: See TracChangeset for help on using the changeset viewer.