Ignore:
Timestamp:
Mar 10, 2020, 10:49:25 AM (20 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
dfda49f
Parents:
9867cdb (diff), 6565321 (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

    r9867cdb rff489bf  
    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
     
    12651266        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12661267                { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; }
    1267         // | SUSPEND ';'
    1268         //      { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    1269         // | SUSPEND compound_statement ';'
    1270         //      { 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 ) ); }
    12711280        | THROW assignment_expression_opt ';'                           // handles rethrow
    12721281                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    20832092aggregate_control:                                                                              // CFA
    20842093        GENERATOR
    2085                 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
     2094                { yyy = true; $$ = AggregateDecl::Generator; }
    20862095        | MONITOR GENERATOR
    20872096                { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
Note: See TracChangeset for help on using the changeset viewer.