Changes in / [9e1eabc:5f91d650]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9e1eabc r5f91d650  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Nov 17 11:38:57 2017
    13 // Update Count     : 2914
     12// Last Modified On : Wed Oct 25 12:28:54 2017
     13// Update Count     : 2893
    1414//
    1515
     
    348348
    349349
    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 */
    354355// Similar issues exit with the waitfor statement.
    355356
     
    360361%precedence TIMEOUT     // token precedence for start of TIMEOUT in WAITFOR statement
    361362%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 TYPEGENname
    373 %precedence '('
    374363
    375364%locations                      // support location tracking for error messages
     
    17761765
    17771766typegen_name:                                                                                   // CFA
    1778         TYPEGENname
    1779                 { $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
    1780         | TYPEGENname '(' ')'
     1767        TYPEGENname '(' ')'
    17811768                { $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
    17821769        | TYPEGENname '(' type_list ')'
     
    18221809                }
    18231810        | 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 ); }
    18331812        ;
    18341813
Note: See TracChangeset for help on using the changeset viewer.