Changeset 13e8427 for src/Parser


Ignore:
Timestamp:
May 28, 2018, 5:01:57 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, with_gc
Children:
533540a
Parents:
1213f21
Message:

parse tuple array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r1213f21 r13e8427  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 27 12:01:51 2018
    13 // Update Count     : 3373
     12// Last Modified On : Mon May 28 17:01:36 2018
     13// Update Count     : 3383
    1414//
    1515
     
    835835//      '[' ']'
    836836//              { $$ = new ExpressionNode( build_tuple() ); }
    837 //      '[' push assignment_expression pop ']'
     837//      | '[' push assignment_expression pop ']'
    838838//              { $$ = new ExpressionNode( build_tuple( $3 ) ); }
    839839        '[' push ',' tuple_expression_list pop ']'
     
    22092209        '|' no_attr_identifier_or_type_name '(' type_list ')'
    22102210                { $$ = DeclarationNode::newTraitUse( $2, $4 ); }
    2211         | '|' '{' push trait_declaration_list '}'
     2211        | '|' '{' push trait_declaration_list pop '}'
    22122212                { $$ = $4; }
    2213         | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}' '(' type_list ')'
     2213        | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}' '(' type_list ')'
    22142214                { SemanticError( yylloc, "Generic data-type assertion is currently unimplemented." ); $$ = nullptr; }
    22152215        ;
     
    22572257        TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' '}'
    22582258                { $$ = DeclarationNode::newTrait( $2, $5, 0 ); }
    2259         | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}'
     2259        | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}'
    22602260                { $$ = DeclarationNode::newTrait( $2, $5, $10 ); }
    22612261        ;
     
    22632263trait_declaration_list:                                                                 // CFA
    22642264        trait_declaration
    2265         | trait_declaration_list push trait_declaration
    2266                 { $$ = $1->appendList( $3 ); }
     2265        | trait_declaration_list pop push trait_declaration
     2266                { $$ = $1->appendList( $4 ); }
    22672267        ;
    22682268
    22692269trait_declaration:                                                                              // CFA
    2270         cfa_trait_declaring_list pop ';'
    2271         | trait_declaring_list pop ';'
     2270        cfa_trait_declaring_list ';'
     2271        | trait_declaring_list ';'
    22722272        ;
    22732273
     
    29742974        '[' ']'
    29752975                { $$ = DeclarationNode::newArray( 0, 0, false ); }
    2976         // multi_array_dimension handles the '[' '*' ']' case
     2976                // multi_array_dimension handles the '[' '*' ']' case
    29772977        | '[' push type_qualifier_list '*' pop ']'                      // remaining C99
    29782978                { $$ = DeclarationNode::newVarArray( $3 ); }
    29792979        | '[' push type_qualifier_list pop ']'
    29802980                { $$ = DeclarationNode::newArray( 0, $3, false ); }
    2981         // multi_array_dimension handles the '[' assignment_expression ']' case
     2981                // multi_array_dimension handles the '[' assignment_expression ']' case
    29822982        | '[' push type_qualifier_list assignment_expression pop ']'
    29832983                { $$ = DeclarationNode::newArray( $4, $3, false ); }
     
    31743174        '[' push cfa_abstract_parameter_list pop ']'
    31753175                { $$ = DeclarationNode::newTuple( $3 ); }
     3176        | '[' push type_specifier_nobody ELLIPSIS ']'
     3177                { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; }
     3178        | '[' push type_specifier_nobody ELLIPSIS constant_expression ']'
     3179                { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; }
    31763180        ;
    31773181
Note: See TracChangeset for help on using the changeset viewer.