- Timestamp:
- Feb 17, 2021, 12:45:36 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- e7c077a
- Parents:
- 5e99a9a (diff), 9fb1367 (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. - Location:
- src
- Files:
-
- 3 edited
-
Parser/lex.ll (modified) (5 diffs)
-
Parser/parser.yy (modified) (8 diffs)
-
main.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r5e99a9a r95b3a9c 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Tue Oct 6 18:15:41 202013 * Update Count : 7 4312 * Last Modified On : Wed Feb 17 08:38:13 2021 13 * Update Count : 752 14 14 */ 15 15 … … 221 221 break { KEYWORD_RETURN(BREAK); } 222 222 case { KEYWORD_RETURN(CASE); } 223 catch { KEYWORD_RETURN(CATCH); } // CFA224 catchResume { KEYWORD_RETURN(CATCHRESUME); } // CFA223 catch { QKEYWORD_RETURN(CATCH); } // CFA 224 catchResume { QKEYWORD_RETURN(CATCHRESUME); } // CFA 225 225 char { KEYWORD_RETURN(CHAR); } 226 226 choose { KEYWORD_RETURN(CHOOSE); } // CFA … … 247 247 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA 248 248 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 249 finally { KEYWORD_RETURN(FINALLY); } // CFA 249 finally { QKEYWORD_RETURN(FINALLY); } // CFA 250 fixup { QKEYWORD_RETURN(FIXUP); } // CFA 250 251 float { KEYWORD_RETURN(FLOAT); } 251 252 __float80 { KEYWORD_RETURN(uuFLOAT80); } // GCC … … 287 288 or { QKEYWORD_RETURN(WOR); } // CFA 288 289 otype { KEYWORD_RETURN(OTYPE); } // CFA 290 recover { QKEYWORD_RETURN(RECOVER); } // CFA 289 291 register { KEYWORD_RETURN(REGISTER); } 292 report { KEYWORD_RETURN(THROWRESUME); } // CFA 290 293 restrict { KEYWORD_RETURN(RESTRICT); } // C99 291 294 __restrict { KEYWORD_RETURN(RESTRICT); } // GCC … … 324 327 __volatile { KEYWORD_RETURN(VOLATILE); } // GCC 325 328 __volatile__ { KEYWORD_RETURN(VOLATILE); } // GCC 326 waitfor { KEYWORD_RETURN(WAITFOR); } 327 when { KEYWORD_RETURN(WHEN); } 329 waitfor { KEYWORD_RETURN(WAITFOR); } // CFA 330 when { KEYWORD_RETURN(WHEN); } // CFA 328 331 while { KEYWORD_RETURN(WHILE); } 329 332 with { KEYWORD_RETURN(WITH); } // CFA -
src/Parser/parser.yy
r5e99a9a r95b3a9c 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 27 08:58:56202113 // Update Count : 4 68012 // Last Modified On : Wed Feb 17 09:03:07 2021 13 // Update Count : 4722 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 CATCH CATCHRESUME FINALLYTHROW THROWRESUME AT WITH WHEN WAITFOR // CFA284 %token CHOOSE DISABLE ENABLE FALLTHRU FALLTHROUGH TRY 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 WOR291 %token<tok> INTEGERconstant CHARACTERconstantSTRINGliteral289 %token<tok> IDENTIFIER QUOTED_IDENTIFIER TYPEDEFname TYPEGENname 290 %token<tok> TIMEOUT WOR CATCH RECOVER CATCHRESUME FIXUP FINALLY // CFA 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 ELSE // token precedence for start of else clause in IF/WAITFOR statement 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 468 474 469 475 // Handle shift/reduce conflict for generic type by shifting the '(' token. For example, this string is ambiguous: … … 544 550 TIMEOUT 545 551 | WOR 552 | CATCH 553 | RECOVER 554 | CATCHRESUME 555 | FIXUP 556 | FINALLY 546 557 ; 547 558 … … 618 629 postfix_expression: 619 630 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; } 620 634 | postfix_expression '[' assignment_expression ']' 621 635 // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a … … 1363 1377 1364 1378 exception_statement: 1365 TRY compound_statement handler_clause 1379 TRY compound_statement handler_clause %prec THEN 1366 1380 { $$ = new StatementNode( build_try( $2, $3, 0 ) ); } 1367 1381 | TRY compound_statement finally_clause … … 1386 1400 handler_key: 1387 1401 CATCH { $$ = CatchStmt::Terminate; } 1402 | RECOVER { $$ = CatchStmt::Terminate; } 1388 1403 | CATCHRESUME { $$ = CatchStmt::Resume; } 1404 | FIXUP { $$ = CatchStmt::Resume; } 1389 1405 ; 1390 1406 … … 3187 3203 | '[' ']' multi_array_dimension 3188 3204 { $$ = 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; } 3189 3208 | multi_array_dimension 3190 3209 ; -
src/main.cc
r5e99a9a r95b3a9c 9 9 // Author : Peter Buhr and Rob Schluntz 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Dec 7 15:29:00 202013 // Update Count : 6 3911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 8 21:10:16 2021 13 // Update Count : 642 14 14 // 15 15 … … 492 492 493 493 static const char * description[] = { 494 "diagnostic color: never, always, or auto.",// -c494 "diagnostic color: never, always, auto", // -c 495 495 "wait for gdb to attach", // -g 496 "print help message",// -h496 "print translator help message", // -h 497 497 "generate libcfa.c", // -l 498 498 "generate line marks", // -L … … 500 500 "do not generate line marks", // -N 501 501 "do not read prelude", // -n 502 " generate prototypes for prelude functions",// -p502 "do not generate prelude prototypes => prelude not printed", // -p 503 503 "only print deterministic output", // -d 504 504 "Use the old-ast", // -O … … 506 506 "print", // -P 507 507 "<directory> prelude directory for debug/nodebug", // no flag 508 "<option-list> enable profiling information: \n counters,heap,time,all,none", // -S508 "<option-list> enable profiling information: counters, heap, time, all, none", // -S 509 509 "building cfa standard lib", // -t 510 510 "", // -w
Note:
See TracChangeset
for help on using the changeset viewer.