Ignore:
Timestamp:
Aug 10, 2017, 3:39:11 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
38d70ab
Parents:
275f4b4 (diff), e1780a2 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r275f4b4 rcd7ef0b  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Jul 25 10:07:00 2017
    13 // Update Count     : 2464
     12// Last Modified On : Wed Aug  4 13:33:00 2017
     13// Update Count     : 2475
    1414//
    1515
     
    142142// converted into the tuple index (.)(1). e.g., 3.x
    143143%token<tok>     REALDECIMALconstant     REALFRACTIONconstant    FLOATINGconstant
    144 %token<tok> ZERO                                ONE                                             // CFA
    145144
    146145// multi-character operators
     
    159158%token ATassign                                                                                 // @=
    160159
    161 %type<tok> identifier  no_attr_identifier  zero_one
     160%type<tok> identifier  no_attr_identifier
    162161%type<tok> identifier_or_type_name  no_attr_identifier_or_type_name  attr_name
    163162%type<constant> string_literal
     
    183182%type<en> asm_clobbers_list_opt
    184183%type<flag> asm_volatile_opt
     184%type<en> handler_predicate_opt
    185185
    186186// statements
     
    360360        ;
    361361
    362 zero_one:                                                                                               // CFA
    363         ZERO
    364         | ONE
    365         ;
    366 
    367362string_literal:
    368363        string_literal_list                                                     { $$ = build_constantStr( *$1 ); }
     
    384379        IDENTIFIER                                                                                      // typedef name cannot be used as a variable name
    385380                { $$ = new ExpressionNode( build_varref( $1 ) ); }
    386         | zero_one
    387                 { $$ = new ExpressionNode( build_constantZeroOne( *$1 ) ); }
    388381        | tuple
    389382        | '(' comma_expression ')'
     
    485478                        $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) );
    486479                }
    487         | zero_one fraction_constants
    488                 {
    489                         $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantZeroOne( *$1 ), $2 ) );
    490                 }
    491480        ;
    492481
     
    539528        | ALIGNOF unary_expression                                                      // GCC, variable alignment
    540529                { $$ = new ExpressionNode( build_alignOfexpr( $2 ) ); }
    541         | ALIGNOF '(' type_no_function ')'                              // GCC, type alignment
     530        | ALIGNOF '(' type_no_function ')'                                      // GCC, type alignment
    542531                { $$ = new ExpressionNode( build_alignOftype( $3 ) ); }
    543532        | OFFSETOF '(' type_no_function ',' no_attr_identifier ')'
     
    980969
    981970handler_clause:
    982         // TEMPORARY, TEST EXCEPTIONS
    983         handler_key '(' push push INTEGERconstant pop ')' compound_statement pop
    984                 { $$ = new StatementNode( build_catch( $1, nullptr, new ExpressionNode( build_constantInteger( *$5 ) ), $8 ) ); }
    985         | handler_clause handler_key '(' push push INTEGERconstant pop ')' compound_statement pop
    986                 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); }
    987 
    988         | handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop
    989                 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $9 ) ); }
     971        handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop
     972                { $$ = new StatementNode( build_catch( $1, $5, $7, $9 ) ); }
    990973        | handler_clause handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop
    991                 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $10 ) ) ); }
     974                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, $8, $10 ) ) ); }
    992975        ;
    993976
    994977handler_predicate_opt:
    995978        //empty
     979                { $$ = nullptr; }
    996980        | ';' conditional_expression
     981                { $$ = $2; }
    997982        ;
    998983
     
    16861671        | aggregate_key attribute_list_opt typegen_name         // CFA
    16871672                { $$ = $3->addQualifiers( $2 ); }
    1688 
    1689 // Temp, testing TreeStruct
    1690     | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name
    1691         {
    1692             typedefTable.makeTypedef( *$4 );            // create typedef
    1693             if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
    1694             forall = false;                             // reset
    1695         }
    1696       '{' field_declaration_list '}'
    1697         {
    1698             $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
    1699                 $4, nullptr, nullptr, $7, true )->addQualifiers( $3 );
    1700         }
    1701     | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name TYPEDEFname
    1702         {
    1703             typedefTable.makeTypedef( *$4 );            // create typedef
    1704             if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
    1705             forall = false;                             // reset
    1706         }
    1707       '{' field_declaration_list '}'
    1708         {
    1709             $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
    1710                 $4, $5, nullptr, $8, true )->addQualifiers( $3 );
    1711         }
    17121673        ;
    17131674
     
    19691930        | '=' initializer
    19701931                { $$ = $2; }
     1932        | '=' VOID
     1933                { $$ = nullptr; }
    19711934        | ATassign initializer
    19721935                { $$ = $2->set_maybeConstructed( false ); }
Note: See TracChangeset for help on using the changeset viewer.