Ignore:
Timestamp:
Feb 4, 2020, 11:35:26 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
eef8dfb
Parents:
aefb247 (diff), 4f7b418 (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' into dkobets-vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    raefb247 rbdfc032  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 16 15:32:58 2019
    13 // Update Count     : 4409
     12// Last Modified On : Sat Feb  1 10:04:40 2020
     13// Update Count     : 4440
    1414//
    1515
     
    323323%type<op> ptrref_operator                               unary_operator                          assignment_operator
    324324%type<en> primary_expression                    postfix_expression                      unary_expression
    325 %type<en> cast_expression                               exponential_expression          multiplicative_expression       additive_expression
     325%type<en> cast_expression_list                  cast_expression                         exponential_expression          multiplicative_expression       additive_expression
    326326%type<en> shift_expression                              relational_expression           equality_expression
    327327%type<en> AND_expression                                exclusive_OR_expression         inclusive_OR_expression
     
    579579        | '(' compound_statement ')'                                            // GCC, lambda expression
    580580                { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
    581         | constant '`' IDENTIFIER                                                       // CFA, postfix call
    582                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    583         | string_literal '`' IDENTIFIER                                         // CFA, postfix call
    584                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    585         | IDENTIFIER '`' IDENTIFIER                                                     // CFA, postfix call
    586                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); }
    587         | tuple '`' IDENTIFIER                                                          // CFA, postfix call
    588                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    589         | '(' comma_expression ')' '`' IDENTIFIER                       // CFA, postfix call
    590                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); }
    591581        | type_name '.' identifier                                                      // CFA, nested type
    592582                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     
    642632        | postfix_expression '(' argument_expression_list ')'
    643633                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
     634        | postfix_expression '`' identifier                                     // CFA, postfix call
     635                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     636        | constant '`' identifier                                                       // CFA, postfix call
     637                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     638        | string_literal '`' identifier                                         // CFA, postfix call
     639                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    644640        | postfix_expression '.' identifier
    645641                { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); }
     
    666662        | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal
    667663                { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); }
    668         | '^' primary_expression '{' argument_expression_list '}' // CFA
     664        | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call
    669665                {
    670666                        Token fn;
     
    679675        | argument_expression
    680676        | argument_expression_list ',' argument_expression
    681                 { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
     677                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    682678        ;
    683679
     
    691687field_name_list:                                                                                // CFA, tuple field selector
    692688        field
    693         | field_name_list ',' field                                     { $$ = (ExpressionNode *)$1->set_last( $3 ); }
     689        | field_name_list ',' field                                     { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    694690        ;
    695691
     
    960956                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); }
    961957        | '[' push assignment_expression pop ',' tuple_expression_list ']'
    962                 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $6 ) ) ); }
     958                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)($3->set_last( $6 ) ) )); }
    963959        ;
    964960
     
    966962        assignment_expression_opt
    967963        | tuple_expression_list ',' assignment_expression_opt
    968                 { $$ = (ExpressionNode *)$1->set_last( $3 ); }
     964                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    969965        ;
    970966
     
    13071303        WAITFOR '(' cast_expression ')'
    13081304                { $$ = $3; }
    1309         | WAITFOR '(' cast_expression ',' argument_expression_list ')'
    1310                 { $$ = (ExpressionNode *)$3->set_last( $5 ); }
     1305//      | WAITFOR '(' cast_expression ',' argument_expression_list ')'
     1306//              { $$ = (ExpressionNode *)$3->set_last( $5 ); }
     1307        | WAITFOR '(' cast_expression_list ':' argument_expression_list ')'
     1308                { $$ = (ExpressionNode *)($3->set_last( $5 )); }
     1309        ;
     1310
     1311cast_expression_list:
     1312        cast_expression
     1313        | cast_expression_list ',' cast_expression
     1314                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    13111315        ;
    13121316
     
    14191423        asm_operand
    14201424        | asm_operands_list ',' asm_operand
    1421                 { $$ = (ExpressionNode *)$1->set_last( $3 ); }
     1425                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    14221426        ;
    14231427
     
    14351439                { $$ = new ExpressionNode( $1 ); }
    14361440        | asm_clobbers_list_opt ',' string_literal
    1437                 // set_last returns ParseNode *
    1438                 { $$ = (ExpressionNode *)$1->set_last( new ExpressionNode( $3 ) ); }
     1441                { $$ = (ExpressionNode *)($1->set_last( new ExpressionNode( $3 ) )); }
    14391442        ;
    14401443
     
    23592362        | initializer_list_opt ',' initializer          { $$ = (InitializerNode *)( $1->set_last( $3 ) ); }
    23602363        | initializer_list_opt ',' designation initializer
    2361                 { $$ = (InitializerNode *)( $1->set_last( $4->set_designators( $3 ) ) ); }
     2364                { $$ = (InitializerNode *)($1->set_last( $4->set_designators( $3 ) )); }
    23622365        ;
    23632366
     
    23812384        designator
    23822385        | designator_list designator
    2383                 { $$ = (ExpressionNode *)( $1->set_last( $2 ) ); }
     2386                { $$ = (ExpressionNode *)($1->set_last( $2 )); }
    23842387        //| designator_list designator                                          { $$ = new ExpressionNode( $1, $2 ); }
    23852388        ;
     
    24782481                { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; }
    24792482        | type_list ',' type
    2480                 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) ) ); }
     2483                { $$ = (ExpressionNode *)($1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) )); }
    24812484        | type_list ',' assignment_expression
    24822485                { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; }
Note: See TracChangeset for help on using the changeset viewer.