Changeset 37cdd97 for src/Parser


Ignore:
Timestamp:
Feb 27, 2020, 5:24:09 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
427854b
Parents:
5452673
Message:

Added a ast node for suspend statements

Location:
src/Parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    r5452673 r37cdd97  
    6565#define FLOATXX(v) KEYWORD_RETURN(v);
    6666#else
    67 #define FLOATXX(v) IDENTIFIER_RETURN(); 
     67#define FLOATXX(v) IDENTIFIER_RETURN();
    6868#endif // HAVE_KEYWORDS_FLOATXX
    6969
     
    301301_Static_assert  { KEYWORD_RETURN(STATICASSERT); }               // C11
    302302struct                  { KEYWORD_RETURN(STRUCT); }
    303         /* suspend                      { KEYWORD_RETURN(SUSPEND); }                    // CFA */
     303suspend                 { KEYWORD_RETURN(SUSPEND); }                    // CFA
    304304switch                  { KEYWORD_RETURN(SWITCH); }
    305305thread                  { KEYWORD_RETURN(THREAD); }                             // C11
  • src/Parser/parser.yy

    r5452673 r37cdd97  
    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
     
    12591260        | RETURN '{' initializer_list_opt comma_opt '}' ';'
    12601261                { 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; }
     1262        | SUSPEND ';'
     1263                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1264        | SUSPEND compound_statement ';'
     1265                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1266        | SUSPEND COROUTINE ';'
     1267                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1268        | SUSPEND COROUTINE compound_statement
     1269                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1270        | SUSPEND GENERATOR ';'
     1271                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
     1272        | SUSPEND GENERATOR compound_statement
     1273                { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }
    12651274        | THROW assignment_expression_opt ';'                           // handles rethrow
    12661275                { $$ = new StatementNode( build_throw( $2 ) ); }
Note: See TracChangeset for help on using the changeset viewer.