Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rc27fb59 r24c3b67  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 22 17:48:54 2018
    13 // Update Count     : 3028
     12// Last Modified On : Thu Feb 15 17:12:31 2018
     13// Update Count     : 3006
    1414//
    1515
     
    187187%token TYPEOF LABEL                                                                             // GCC
    188188%token ENUM STRUCT UNION
    189 %token EXCEPTION                                                                                // CFA
    190189%token COROUTINE MONITOR THREAD                                                 // CFA
    191190%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
     
    315314%type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr
    316315
    317 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list_opt
     316%type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list cfa_parameter_type_list_opt
    318317
    319318%type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier
     
    323322%type<decl> KR_declaration_list KR_declaration_list_opt
    324323
    325 %type<decl> parameter_declaration parameter_list parameter_type_list_opt
     324%type<decl> parameter_declaration parameter_list parameter_type_list
     325%type<decl> parameter_type_list_opt
    326326
    327327%type<decl> paren_identifier paren_type
     
    779779        | unary_expression assignment_operator assignment_expression
    780780                { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
    781         | unary_expression '=' '{' initializer_list comma_opt '}'
    782                 { throw SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } // FIX ME
     781        | unary_expression '=' '{' initializer_list comma_opt '}' // FIX ME
     782                { $$ = nullptr; }
    783783        ;
    784784
     
    849849        | waitfor_statement
    850850        | exception_statement
    851         | enable_disable_statement
    852                 { throw SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } // FIX ME
    853851        | asm_statement
    854852        ;
     
    10661064        | RETURN comma_expression_opt ';'
    10671065                { $$ = new StatementNode( build_return( $2 ) ); }
    1068         | RETURN '{' initializer_list comma_opt '}'
    1069                 { throw SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } // FIX ME
     1066        | RETURN '{' initializer_list comma_opt '}'                     // FIX ME
     1067                { $$ = nullptr; }
    10701068        | THROW assignment_expression_opt ';'                           // handles rethrow
    10711069                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    11951193        ;
    11961194
    1197 enable_disable_statement:
    1198         enable_disable_key identifier_list compound_statement
    1199         ;
    1200 
    1201 enable_disable_key:
    1202         ENABLE
    1203         | DISABLE
    1204         ;
    1205 
    12061195asm_statement:
    12071196        ASM asm_volatile_opt '(' string_literal ')' ';'
     
    14031392                        DeclarationNode * ret = new DeclarationNode;
    14041393                        ret->type = maybeClone( $1->type->base );
    1405                         $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr ) );
     1394                        $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr, true ) );
    14061395                }
    14071396        ;
     
    14331422                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    14341423                {
    1435                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
     1424                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
    14361425                }
    14371426        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')'
    14381427                {
    1439                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
     1428                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
    14401429                }
    14411430        ;
     
    18921881        | UNION
    18931882                { $$ = DeclarationNode::Union; }
    1894         | EXCEPTION
    1895                 { $$ = DeclarationNode::Exception; }
    18961883        | COROUTINE
    18971884                { $$ = DeclarationNode::Coroutine; }
     
    20031990        ;
    20041991
    2005 cfa_parameter_type_list_opt:                                                    // CFA, abstract + real
     1992// Minimum of one parameter after which ellipsis is allowed only at the end.
     1993
     1994cfa_parameter_type_list_opt:                                                    // CFA
    20061995        // empty
    2007                 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }
    2008         | ELLIPSIS
    20091996                { $$ = nullptr; }
    2010         | cfa_abstract_parameter_list
     1997        | cfa_parameter_type_list
     1998        ;
     1999
     2000cfa_parameter_type_list:                                                                // CFA, abstract + real
     2001        cfa_abstract_parameter_list
    20112002        | cfa_parameter_list
    20122003        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list
     
    20392030        // empty
    20402031                { $$ = nullptr; }
    2041         | ELLIPSIS
    2042                 { $$ = nullptr; }
    2043         | parameter_list
     2032        | parameter_type_list
     2033        ;
     2034
     2035parameter_type_list:
     2036        parameter_list
    20442037        | parameter_list pop ',' push ELLIPSIS
    20452038                { $$ = $1->addVarArgs(); }
Note: See TracChangeset for help on using the changeset viewer.