Changes in src/Parser/parser.yy [9335ecc:ca78437]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9335ecc rca78437 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // parser.yy --7 // cfa.y -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 28 22:11:22201713 // Update Count : 24 1412 // Last Modified On : Mon Jun 12 12:59:00 2017 13 // Update Count : 2402 14 14 // 15 15 … … 48 48 #include <cstdio> 49 49 #include <stack> 50 #include "lex.h" 51 #include "parser.h" 50 52 #include "ParseNode.h" 51 53 #include "TypedefTable.h" … … 86 88 bool forall = false; // aggregate have one or more forall qualifiers ? 87 89 %} 88 89 // Types declaration90 %union91 {92 Token tok;93 ParseNode * pn;94 ExpressionNode * en;95 DeclarationNode * decl;96 DeclarationNode::Aggregate aggKey;97 DeclarationNode::TypeClass tclass;98 StatementNode * sn;99 ConstantExpr * constant;100 ForCtl * fctl;101 LabelNode * label;102 InitializerNode * in;103 OperKinds op;104 std::string * str;105 bool flag;106 }107 90 108 91 //************************* TERMINAL TOKENS ******************************** … … 156 139 157 140 %token ATassign // @= 141 142 // Types declaration 143 %union 144 { 145 Token tok; 146 ParseNode * pn; 147 ExpressionNode * en; 148 DeclarationNode * decl; 149 DeclarationNode::Aggregate aggKey; 150 DeclarationNode::TypeClass tclass; 151 StatementNode * sn; 152 ConstantExpr * constant; 153 ForCtl * fctl; 154 LabelNode * label; 155 InitializerNode * in; 156 OperKinds op; 157 std::string * str; 158 bool flag; 159 } 158 160 159 161 %type<tok> identifier no_attr_identifier zero_one … … 957 959 958 960 handler_clause: 959 // TEMPORARY, TEST EXCEPTIONS 960 CATCH '(' push push INTEGERconstant pop ')' compound_statement pop 961 { $$ = new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$5 ) ), $8 ) ); } 962 | handler_clause CATCH '(' push push INTEGERconstant pop ')' compound_statement pop 963 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); } 964 965 | CATCH '(' push push exception_declaration pop ')' compound_statement pop 961 CATCH '(' push push exception_declaration pop ')' compound_statement pop 966 962 { $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); } 967 963 | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop
Note:
See TracChangeset
for help on using the changeset viewer.