Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r24c3b67 r2a8427c6  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 15 17:12:31 2018
    13 // Update Count     : 3006
     12// Last Modified On : Thu Feb 22 15:31:19 2018
     13// Update Count     : 3027
    1414//
    1515
     
    314314%type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr
    315315
    316 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list cfa_parameter_type_list_opt
     316%type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list_opt
    317317
    318318%type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier
     
    322322%type<decl> KR_declaration_list KR_declaration_list_opt
    323323
    324 %type<decl> parameter_declaration parameter_list parameter_type_list
    325 %type<decl> parameter_type_list_opt
     324%type<decl> parameter_declaration parameter_list parameter_type_list_opt
    326325
    327326%type<decl> paren_identifier paren_type
     
    779778        | unary_expression assignment_operator assignment_expression
    780779                { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
    781         | unary_expression '=' '{' initializer_list comma_opt '}' // FIX ME
    782                 { $$ = nullptr; }
     780        | unary_expression '=' '{' initializer_list comma_opt '}'
     781                { throw SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } // FIX ME
    783782        ;
    784783
     
    849848        | waitfor_statement
    850849        | exception_statement
     850        | enable_disable_statement
     851                { throw SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } // FIX ME
    851852        | asm_statement
    852853        ;
     
    10641065        | RETURN comma_expression_opt ';'
    10651066                { $$ = new StatementNode( build_return( $2 ) ); }
    1066         | RETURN '{' initializer_list comma_opt '}'                     // FIX ME
    1067                 { $$ = nullptr; }
     1067        | RETURN '{' initializer_list comma_opt '}'
     1068                { throw SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } // FIX ME
    10681069        | THROW assignment_expression_opt ';'                           // handles rethrow
    10691070                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    11931194        ;
    11941195
     1196enable_disable_statement:
     1197        enable_disable_key identifier_list compound_statement
     1198        ;
     1199
     1200enable_disable_key:
     1201        ENABLE
     1202        | DISABLE
     1203        ;
     1204
    11951205asm_statement:
    11961206        ASM asm_volatile_opt '(' string_literal ')' ';'
     
    13921402                        DeclarationNode * ret = new DeclarationNode;
    13931403                        ret->type = maybeClone( $1->type->base );
    1394                         $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr, true ) );
     1404                        $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr ) );
    13951405                }
    13961406        ;
     
    14221432                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    14231433                {
    1424                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
     1434                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
    14251435                }
    14261436        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')'
    14271437                {
    1428                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
     1438                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
    14291439                }
    14301440        ;
     
    19902000        ;
    19912001
    1992 // Minimum of one parameter after which ellipsis is allowed only at the end.
    1993 
    1994 cfa_parameter_type_list_opt:                                                    // CFA
     2002cfa_parameter_type_list_opt:                                                    // CFA, abstract + real
    19952003        // empty
     2004                { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }
     2005        | ELLIPSIS
    19962006                { $$ = nullptr; }
    1997         | cfa_parameter_type_list
    1998         ;
    1999 
    2000 cfa_parameter_type_list:                                                                // CFA, abstract + real
    2001         cfa_abstract_parameter_list
     2007        | cfa_abstract_parameter_list
    20022008        | cfa_parameter_list
    20032009        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list
     
    20302036        // empty
    20312037                { $$ = nullptr; }
    2032         | parameter_type_list
    2033         ;
    2034 
    2035 parameter_type_list:
    2036         parameter_list
     2038        | ELLIPSIS
     2039                { $$ = nullptr; }
     2040        | parameter_list
    20372041        | parameter_list pop ',' push ELLIPSIS
    20382042                { $$ = $1->addVarArgs(); }
Note: See TracChangeset for help on using the changeset viewer.