Ignore:
Timestamp:
Feb 26, 2018, 12:49:55 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
eddb399
Parents:
17fc7a5 (diff), 2c39855 (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r17fc7a5 r45c43e5  
    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 17:48:54 2018
     13// Update Count     : 3028
    1414//
    1515
     
    187187%token TYPEOF LABEL                                                                             // GCC
    188188%token ENUM STRUCT UNION
     189%token EXCEPTION                                                                                // CFA
    189190%token COROUTINE MONITOR THREAD                                                 // CFA
    190191%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
     
    314315%type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr
    315316
    316 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list cfa_parameter_type_list_opt
     317%type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list_opt
    317318
    318319%type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier
     
    322323%type<decl> KR_declaration_list KR_declaration_list_opt
    323324
    324 %type<decl> parameter_declaration parameter_list parameter_type_list
    325 %type<decl> parameter_type_list_opt
     325%type<decl> parameter_declaration parameter_list 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 '}' // FIX ME
    782                 { $$ = nullptr; }
     781        | unary_expression '=' '{' initializer_list comma_opt '}'
     782                { throw SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } // FIX ME
    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
    851853        | asm_statement
    852854        ;
     
    10641066        | RETURN comma_expression_opt ';'
    10651067                { $$ = new StatementNode( build_return( $2 ) ); }
    1066         | RETURN '{' initializer_list comma_opt '}'                     // FIX ME
    1067                 { $$ = nullptr; }
     1068        | RETURN '{' initializer_list comma_opt '}'
     1069                { throw SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } // FIX ME
    10681070        | THROW assignment_expression_opt ';'                           // handles rethrow
    10691071                { $$ = new StatementNode( build_throw( $2 ) ); }
     
    11931195        ;
    11941196
     1197enable_disable_statement:
     1198        enable_disable_key identifier_list compound_statement
     1199        ;
     1200
     1201enable_disable_key:
     1202        ENABLE
     1203        | DISABLE
     1204        ;
     1205
    11951206asm_statement:
    11961207        ASM asm_volatile_opt '(' string_literal ')' ';'
     
    13921403                        DeclarationNode * ret = new DeclarationNode;
    13931404                        ret->type = maybeClone( $1->type->base );
    1394                         $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr, true ) );
     1405                        $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr ) );
    13951406                }
    13961407        ;
     
    14221433                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    14231434                {
    1424                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
     1435                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
    14251436                }
    14261437        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')'
    14271438                {
    1428                         $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true );
     1439                        $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );
    14291440                }
    14301441        ;
     
    18811892        | UNION
    18821893                { $$ = DeclarationNode::Union; }
     1894        | EXCEPTION
     1895                { $$ = DeclarationNode::Exception; }
    18831896        | COROUTINE
    18841897                { $$ = DeclarationNode::Coroutine; }
     
    19902003        ;
    19912004
    1992 // Minimum of one parameter after which ellipsis is allowed only at the end.
    1993 
    1994 cfa_parameter_type_list_opt:                                                    // CFA
     2005cfa_parameter_type_list_opt:                                                    // CFA, abstract + real
    19952006        // empty
     2007                { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }
     2008        | ELLIPSIS
    19962009                { $$ = nullptr; }
    1997         | cfa_parameter_type_list
    1998         ;
    1999 
    2000 cfa_parameter_type_list:                                                                // CFA, abstract + real
    2001         cfa_abstract_parameter_list
     2010        | cfa_abstract_parameter_list
    20022011        | cfa_parameter_list
    20032012        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list
     
    20302039        // empty
    20312040                { $$ = nullptr; }
    2032         | parameter_type_list
    2033         ;
    2034 
    2035 parameter_type_list:
    2036         parameter_list
     2041        | ELLIPSIS
     2042                { $$ = nullptr; }
     2043        | parameter_list
    20372044        | parameter_list pop ',' push ELLIPSIS
    20382045                { $$ = $1->addVarArgs(); }
Note: See TracChangeset for help on using the changeset viewer.