Changes in / [9e1eabc:5f91d650]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9e1eabc r5f91d650 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 17 11:38:57201713 // Update Count : 2 91412 // Last Modified On : Wed Oct 25 12:28:54 2017 13 // Update Count : 2893 14 14 // 15 15 … … 348 348 349 349 350 // Handle shift/reduce conflict for dangling else by shifting the ELSE token. For example, this string is ambiguous: 351 // .---------. matches IF '(' comma_expression ')' statement . (reduce) 352 // if ( C ) S1 else S2 353 // `-----------------' matches IF '(' comma_expression ')' statement . (shift) ELSE statement */ 350 // Handle single shift/reduce conflict for dangling else by shifting the ELSE token. For example, this string 351 // is ambiguous: 352 // .---------. matches IF '(' comma_expression ')' statement . (reduce) 353 // if ( C ) S1 else S2 354 // `-----------------' matches IF '(' comma_expression ')' statement . (shift) ELSE statement */ 354 355 // Similar issues exit with the waitfor statement. 355 356 … … 360 361 %precedence TIMEOUT // token precedence for start of TIMEOUT in WAITFOR statement 361 362 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 362 363 // Handle shift/reduce conflict for generic type by shifting the '(' token. For example, this string is ambiguous:364 // forall( otype T ) struct Foo { T v; };365 // .-----. matches pointer to function returning a generic (which is impossible without a type)366 // Foo ( *fp )( int );367 // `---' matches start of TYPEGENname '('368 // Must be:369 // Foo( int ) ( *fp )( int );370 371 // Order of these lines matters (low-to-high precedence).372 %precedence TYPEGENname373 %precedence '('374 363 375 364 %locations // support location tracking for error messages … … 1776 1765 1777 1766 typegen_name: // CFA 1778 TYPEGENname 1779 { $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); } 1780 | TYPEGENname '(' ')' 1767 TYPEGENname '(' ')' 1781 1768 { $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); } 1782 1769 | TYPEGENname '(' type_list ')' … … 1822 1809 } 1823 1810 | aggregate_key attribute_list_opt typegen_name // CFA 1824 { 1825 // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is 1826 // switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and 1827 // delete newFromTypeGen. 1828 $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $3->type->symbolic.actuals, nullptr, false )->addQualifiers( $2 ); 1829 $3->type->symbolic.name = nullptr; 1830 $3->type->symbolic.actuals = nullptr; 1831 delete $3; 1832 } 1811 { $$ = $3->addQualifiers( $2 ); } 1833 1812 ; 1834 1813
Note:
See TracChangeset
for help on using the changeset viewer.