Changes in src/Parser/parser.yy [9fb1367:ec3f9c8]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9fb1367 rec3f9c8 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 17 09:03:07202113 // Update Count : 4 72212 // Last Modified On : Wed Jan 27 08:58:56 2021 13 // Update Count : 4680 14 14 // 15 15 … … 282 282 %token ATTRIBUTE EXTENSION // GCC 283 283 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 284 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGH TRY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA284 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGH TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH WHEN WAITFOR // CFA 285 285 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 286 286 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11 287 287 288 288 // names and constants: lexer differentiates between identifier and typedef names 289 %token<tok> IDENTIFIER QUOTED_IDENTIFIER TYPEDEFnameTYPEGENname290 %token<tok> TIMEOUT WOR CATCH RECOVER CATCHRESUME FIXUP FINALLY // CFA291 %token<tok> INTEGERconstant CHARACTERconstantSTRINGliteral289 %token<tok> IDENTIFIER QUOTED_IDENTIFIER TYPEDEFname TYPEGENname 290 %token<tok> TIMEOUT WOR 291 %token<tok> INTEGERconstant CHARACTERconstant STRINGliteral 292 292 %token<tok> DIRECTIVE 293 293 // Floating point constant is broken into three kinds of tokens because of the ambiguity with tuple indexing and … … 462 462 // Order of these lines matters (low-to-high precedence). THEN is left associative over WOR/TIMEOUT/ELSE, WOR is left 463 463 // associative over TIMEOUT/ELSE, and TIMEOUT is left associative over ELSE. 464 %precedence THEN // rule precedence for IF/WAITFOR statement 465 %precedence WOR // token precedence for start of WOR in WAITFOR statement 466 %precedence TIMEOUT // token precedence for start of TIMEOUT in WAITFOR statement 467 %precedence CATCH // token precedence for start of TIMEOUT in WAITFOR statement 468 %precedence RECOVER // token precedence for start of TIMEOUT in WAITFOR statement 469 %precedence CATCHRESUME // token precedence for start of TIMEOUT in WAITFOR statement 470 %precedence FIXUP // token precedence for start of TIMEOUT in WAITFOR statement 471 %precedence FINALLY // token precedence for start of TIMEOUT in WAITFOR statement 472 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 473 464 %precedence THEN // rule precedence for IF/WAITFOR statement 465 %precedence WOR // token precedence for start of WOR in WAITFOR statement 466 %precedence TIMEOUT // token precedence for start of TIMEOUT in WAITFOR statement 467 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 474 468 475 469 // Handle shift/reduce conflict for generic type by shifting the '(' token. For example, this string is ambiguous: … … 550 544 TIMEOUT 551 545 | WOR 552 | CATCH553 | RECOVER554 | CATCHRESUME555 | FIXUP556 | FINALLY557 546 ; 558 547 … … 629 618 postfix_expression: 630 619 primary_expression 631 | postfix_expression '[' assignment_expression ',' comma_expression ']'632 // { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_binary_val( OperKinds::Index, $3, $5 ) ) ) ); }633 { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; }634 620 | postfix_expression '[' assignment_expression ']' 635 621 // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a … … 1377 1363 1378 1364 exception_statement: 1379 TRY compound_statement handler_clause %prec THEN1365 TRY compound_statement handler_clause 1380 1366 { $$ = new StatementNode( build_try( $2, $3, 0 ) ); } 1381 1367 | TRY compound_statement finally_clause … … 1400 1386 handler_key: 1401 1387 CATCH { $$ = CatchStmt::Terminate; } 1402 | RECOVER { $$ = CatchStmt::Terminate; }1403 1388 | CATCHRESUME { $$ = CatchStmt::Resume; } 1404 | FIXUP { $$ = CatchStmt::Resume; }1405 1389 ; 1406 1390 … … 3203 3187 | '[' ']' multi_array_dimension 3204 3188 { $$ = DeclarationNode::newArray( 0, 0, false )->addArray( $3 ); } 3205 | '[' push assignment_expression pop ',' comma_expression ']'3206 { $$ = DeclarationNode::newArray( $3, 0, false )->addArray( DeclarationNode::newArray( $6, 0, false ) ); }3207 // { SemanticError( yylloc, "New array dimension is currently unimplemented." ); $$ = nullptr; }3208 3189 | multi_array_dimension 3209 3190 ;
Note:
See TracChangeset
for help on using the changeset viewer.