Ignore:
Timestamp:
Aug 25, 2017, 11:09:02 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6b224a52
Parents:
3eab0ef6
Message:

First step for waitfor statments, does nothing but is there

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r3eab0ef6 r135b431  
    9797        DeclarationNode::TypeClass tclass;
    9898        StatementNode * sn;
     99        WaitForStmt * wfs;
    99100        ConstantExpr * constant;
    100101        IfCtl * ifctl;
     
    187188%type<flag> asm_volatile_opt
    188189%type<en> handler_predicate_opt
     190%type<en> when_clause_opt timeout
    189191
    190192// statements
     
    192194%type<sn> iteration_statement                   jump_statement
    193195%type<sn> with_statement                                exception_statement                     asm_statement
    194 %type<sn> when_clause_opt                               waitfor_statement                       waitfor_clause                          waitfor                         timeout
     196%type<sn> waitfor_statement
    195197%type<sn> fall_through_opt                              fall_through
    196198%type<sn> statement                                             statement_list
     
    202204%type<sn> handler_clause                                finally_clause
    203205%type<catch_kind> handler_key
     206%type<wfs> waitfor_clause
     207%type<en> waitfor
    204208
    205209// declarations
     
    979983when_clause_opt:
    980984        // empty
    981                 { $$ = nullptr; }                                                               // FIX ME
     985                { $$ = nullptr; }
    982986        | WHEN '(' comma_expression ')'
    983                 { $$ = nullptr; }                                                               // FIX ME
     987                { $$ = $3; }
    984988        ;
    985989
    986990waitfor:
    987991        WAITFOR '(' identifier ')'
    988                 { $$ = nullptr; }                                                               // FIX ME
     992                {
     993                        $$ = new ExpressionNode( new NameExpr( *$3 ) );
     994                        delete $3;
     995                }
    989996        | WAITFOR '(' identifier ',' argument_expression_list ')'
    990                 { $$ = nullptr; }                                                               // FIX ME
     997                {
     998                        $$ = new ExpressionNode( new NameExpr( *$3 ) );
     999                        $$->set_last( $5 );
     1000                        delete $3;
     1001                }
    9911002        ;
    9921003
    9931004timeout:
    9941005        TIMEOUT '(' comma_expression ')'
    995                 { $$ = nullptr; }                                                               // FIX ME
     1006                { $$ = $3; }
    9961007        ;
    9971008
    9981009waitfor_clause:
    9991010        when_clause_opt waitfor statement %prec THEN
    1000                 { $$ = nullptr; }                                                               // FIX ME
     1011                { $$ = build_waitfor( $2, $3, $1 ); }
    10011012        | when_clause_opt waitfor statement WOR waitfor_clause
    1002                 { $$ = nullptr; }                                                               // FIX ME
     1013                { $$ = build_waitfor( $2, $3, $1, $5 ); }
    10031014        | when_clause_opt timeout statement %prec THEN
    1004                 { $$ = nullptr; }                                                               // FIX ME
     1015                { $$ = build_waitfor_timeout( $2, $3, $1 ); }
    10051016        | when_clause_opt ELSE statement
    1006                 { $$ = nullptr; }                                                               // FIX ME
     1017                { $$ = build_waitfor_timeout( nullptr, $3, $1 ); }
    10071018        | when_clause_opt timeout statement WOR when_clause_opt ELSE statement
    1008                 { $$ = nullptr; }                                                               // FIX ME
     1019                { $$ = build_waitfor_timeout( $2, $3, $1, $7, $5 ); }
    10091020        ;
    10101021
    10111022waitfor_statement:
    10121023        when_clause_opt waitfor statement %prec THEN
    1013                 { $$ = nullptr; }                                                               // FIX ME
     1024                { $$ = new StatementNode( build_waitfor( $2, $3, $1 ) ); }
    10141025        | when_clause_opt waitfor statement WOR waitfor_clause
    1015                 { $$ = nullptr; }                                                               // FIX ME
     1026                { $$ = new StatementNode( build_waitfor( $2, $3, $1, $5 ) ); }
    10161027        ;
    10171028
Note: See TracChangeset for help on using the changeset viewer.