Changes in src/Parser/parser.yy [c27fb59:24c3b67]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rc27fb59 r24c3b67 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 22 17:48:54201813 // Update Count : 30 2812 // Last Modified On : Thu Feb 15 17:12:31 2018 13 // Update Count : 3006 14 14 // 15 15 … … 187 187 %token TYPEOF LABEL // GCC 188 188 %token ENUM STRUCT UNION 189 %token EXCEPTION // CFA190 189 %token COROUTINE MONITOR THREAD // CFA 191 190 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA … … 315 314 %type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr 316 315 317 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list _opt316 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list cfa_parameter_type_list_opt 318 317 319 318 %type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier … … 323 322 %type<decl> KR_declaration_list KR_declaration_list_opt 324 323 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 326 326 327 327 %type<decl> paren_identifier paren_type … … 779 779 | unary_expression assignment_operator assignment_expression 780 780 { $$ = 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 ME781 | unary_expression '=' '{' initializer_list comma_opt '}' // FIX ME 782 { $$ = nullptr; } 783 783 ; 784 784 … … 849 849 | waitfor_statement 850 850 | exception_statement 851 | enable_disable_statement852 { throw SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } // FIX ME853 851 | asm_statement 854 852 ; … … 1066 1064 | RETURN comma_expression_opt ';' 1067 1065 { $$ = new StatementNode( build_return( $2 ) ); } 1068 | RETURN '{' initializer_list comma_opt '}' 1069 { throw SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } // FIX ME1066 | RETURN '{' initializer_list comma_opt '}' // FIX ME 1067 { $$ = nullptr; } 1070 1068 | THROW assignment_expression_opt ';' // handles rethrow 1071 1069 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1195 1193 ; 1196 1194 1197 enable_disable_statement:1198 enable_disable_key identifier_list compound_statement1199 ;1200 1201 enable_disable_key:1202 ENABLE1203 | DISABLE1204 ;1205 1206 1195 asm_statement: 1207 1196 ASM asm_volatile_opt '(' string_literal ')' ';' … … 1403 1392 DeclarationNode * ret = new DeclarationNode; 1404 1393 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 ) ); 1406 1395 } 1407 1396 ; … … 1433 1422 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1434 1423 { 1435 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );1424 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1436 1425 } 1437 1426 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1438 1427 { 1439 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 );1428 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1440 1429 } 1441 1430 ; … … 1892 1881 | UNION 1893 1882 { $$ = DeclarationNode::Union; } 1894 | EXCEPTION1895 { $$ = DeclarationNode::Exception; }1896 1883 | COROUTINE 1897 1884 { $$ = DeclarationNode::Coroutine; } … … 2003 1990 ; 2004 1991 2005 cfa_parameter_type_list_opt: // CFA, abstract + real 1992 // Minimum of one parameter after which ellipsis is allowed only at the end. 1993 1994 cfa_parameter_type_list_opt: // CFA 2006 1995 // empty 2007 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }2008 | ELLIPSIS2009 1996 { $$ = nullptr; } 2010 | cfa_abstract_parameter_list 1997 | cfa_parameter_type_list 1998 ; 1999 2000 cfa_parameter_type_list: // CFA, abstract + real 2001 cfa_abstract_parameter_list 2011 2002 | cfa_parameter_list 2012 2003 | cfa_parameter_list pop ',' push cfa_abstract_parameter_list … … 2039 2030 // empty 2040 2031 { $$ = nullptr; } 2041 | ELLIPSIS 2042 { $$ = nullptr; } 2043 | parameter_list 2032 | parameter_type_list 2033 ; 2034 2035 parameter_type_list: 2036 parameter_list 2044 2037 | parameter_list pop ',' push ELLIPSIS 2045 2038 { $$ = $1->addVarArgs(); }
Note:
See TracChangeset
for help on using the changeset viewer.