Changeset 044ae62 for src/Parser/parser.yy
- Timestamp:
- May 29, 2023, 11:44:29 AM (2 years ago)
- Branches:
- ADT
- Children:
- fa2c005
- Parents:
- 3a513d89 (diff), 2b78949 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r3a513d89 r044ae62 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tue Apr 4 14:02:00202313 // Update Count : 63 2911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 26 16:45:37 2023 13 // Update Count : 6330 14 14 // 15 15 … … 307 307 ClauseNode * clause; 308 308 ast::WaitForStmt * wfs; 309 ast::WaitUntilStmt::ClauseNode * wucn; 309 310 CondCtl * ifctl; 310 311 ForCtrl * forctl; … … 427 428 %type<expr> when_clause when_clause_opt waitfor waituntil timeout 428 429 %type<stmt> waitfor_statement waituntil_statement 429 %type<wfs> wor_waitfor_clause waituntil_clause wand_waituntil_clause wor_waituntil_clause 430 %type<wfs> wor_waitfor_clause 431 %type<wucn> waituntil_clause wand_waituntil_clause wor_waituntil_clause 430 432 431 433 // declarations … … 1682 1684 1683 1685 waituntil: 1684 WAITUNTIL '(' c ast_expression ')'1686 WAITUNTIL '(' comma_expression ')' 1685 1687 { $$ = $3; } 1686 1688 ; … … 1688 1690 waituntil_clause: 1689 1691 when_clause_opt waituntil statement 1690 { printf( "waituntil_clause 1\n" ); $$ = nullptr; }1692 { $$ = build_waituntil_clause( yylloc, $1, $2, maybe_build_compound( yylloc, $3 ) ); } 1691 1693 | '(' wor_waituntil_clause ')' 1692 { printf( "waituntil_clause 2\n" ); $$ = nullptr; }1694 { $$ = $2; } 1693 1695 ; 1694 1696 1695 1697 wand_waituntil_clause: 1696 1698 waituntil_clause %prec THEN 1697 { printf( "wand_waituntil_clause 1\n" ); $$ = nullptr; }1699 { $$ = $1; } 1698 1700 | waituntil_clause wand wand_waituntil_clause 1699 { printf( "wand_waituntil_clause 2\n" ); $$ = nullptr; }1701 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::AND, $1, $3 ); } 1700 1702 ; 1701 1703 1702 1704 wor_waituntil_clause: 1703 1705 wand_waituntil_clause 1704 { printf( "wor_waituntil_clause 1\n" ); $$ = nullptr; }1706 { $$ = $1; } 1705 1707 | wor_waituntil_clause wor wand_waituntil_clause 1706 { printf( "wor_waituntil_clause 2\n" ); $$ = nullptr; }1708 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::OR, $1, $3 ); } 1707 1709 | wor_waituntil_clause wor when_clause_opt ELSE statement 1708 { printf( "wor_waituntil_clause 3\n" ); $$ = nullptr; }1710 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::LEFT_OR, $1, build_waituntil_else( yylloc, $3, maybe_build_compound( yylloc, $5 ) ) ); } 1709 1711 | wor_waituntil_clause wor when_clause_opt timeout statement %prec THEN 1710 { printf( "wor_waituntil_clause 4\n" ); $$ = nullptr; }1712 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::LEFT_OR, $1, build_waituntil_timeout( yylloc, $3, $4, maybe_build_compound( yylloc, $5 ) ) ); } 1711 1713 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1712 1714 | wor_waituntil_clause wor when_clause_opt timeout statement wor ELSE statement // syntax error 1713 1715 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1714 1716 | wor_waituntil_clause wor when_clause_opt timeout statement wor when_clause ELSE statement 1715 { printf( "wor_waituntil_clause 6\n" ); $$ = nullptr; } 1717 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::LEFT_OR, $1, 1718 new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::OR, 1719 build_waituntil_timeout( yylloc, $3, $4, maybe_build_compound( yylloc, $5 ) ), 1720 build_waituntil_else( yylloc, $7, maybe_build_compound( yylloc, $9 ) ) ) ); } 1716 1721 ; 1717 1722 … … 1719 1724 wor_waituntil_clause %prec THEN 1720 1725 // SKULLDUGGERY: create an empty compound statement to test parsing of waituntil statement. 1721 { $$ = new StatementNode( build_compound( yylloc, nullptr ) ); } 1726 { 1727 $$ = new StatementNode( build_waituntil_stmt( yylloc, $1 ) ); 1728 // $$ = new StatementNode( build_compound( yylloc, nullptr ) ); 1729 } 1722 1730 ; 1723 1731
Note:
See TracChangeset
for help on using the changeset viewer.