Changes in src/Parser/parser.yy [861799c7:ddfd945]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r861799c7 rddfd945 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 5 15:48:24201713 // Update Count : 2 22712 // Last Modified On : Thu Mar 16 08:36:17 2017 13 // Update Count : 2310 14 14 // 15 15 … … 104 104 %token TYPEOF LABEL // GCC 105 105 %token ENUM STRUCT UNION 106 %token COROUTINE MONITOR THREAD // CFA 106 107 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA 107 108 %token SIZEOF OFFSETOF … … 223 224 %type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr 224 225 225 %type<decl> identifier_parameter_ array identifier_parameter_declaratoridentifier_parameter_function226 %type<decl> identifier_ parameter_ptr identifier_list226 %type<decl> identifier_parameter_declarator identifier_parameter_ptr identifier_parameter_array identifier_parameter_function 227 %type<decl> identifier_list 227 228 228 229 %type<decl> cfa_abstract_array cfa_abstract_declarator_no_tuple cfa_abstract_declarator_tuple … … 270 271 %type<en> type_name_list 271 272 272 %type<decl> type_qualifier type_qualifier_name type_qualifier_list type_qualifier_list_opt type_specifier type_specifier_nobody 273 %type<decl> type_qualifier type_qualifier_name type_qualifier_list_opt type_qualifier_list 274 %type<decl> type_specifier type_specifier_nobody 273 275 274 276 %type<decl> variable_declarator variable_ptr variable_array variable_function … … 410 412 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_REALFRACTIONconstant( *$2 ) ) ); } 411 413 | postfix_expression ARROW no_attr_identifier 412 { 413 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 414 } 414 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } 415 415 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector 416 416 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); } 417 | postfix_expression ARROW INTEGERconstant // CFA, tuple index418 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); }419 417 | postfix_expression ICR 420 418 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); } … … 439 437 argument_expression: 440 438 // empty 441 { $$ = nullptr; } // use default argument 439 { $$ = nullptr; } 440 // | '@' // use default argument 441 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 442 442 | assignment_expression 443 443 ; … … 1406 1406 type_qualifier_name: 1407 1407 CONST 1408 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); }1408 { $$ = DeclarationNode::newTypeQualifier( Type::Const ); } 1409 1409 | RESTRICT 1410 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); }1410 { $$ = DeclarationNode::newTypeQualifier( Type::Restrict ); } 1411 1411 | VOLATILE 1412 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); }1412 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); } 1413 1413 | LVALUE // CFA 1414 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); }1414 { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); } 1415 1415 | MUTEX 1416 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Mutex ); }1416 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); } 1417 1417 | ATOMIC 1418 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); }1418 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); } 1419 1419 | FORALL '(' 1420 1420 { … … 1449 1449 storage_class: 1450 1450 EXTERN 1451 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }1451 { $$ = DeclarationNode::newStorageClass( Type::Extern ); } 1452 1452 | STATIC 1453 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Static ); }1453 { $$ = DeclarationNode::newStorageClass( Type::Static ); } 1454 1454 | AUTO 1455 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }1455 { $$ = DeclarationNode::newStorageClass( Type::Auto ); } 1456 1456 | REGISTER 1457 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Register ); }1457 { $$ = DeclarationNode::newStorageClass( Type::Register ); } 1458 1458 | THREADLOCAL // C11 1459 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }1459 { $$ = DeclarationNode::newStorageClass( Type::Threadlocal ); } 1460 1460 // Put function specifiers here to simplify parsing rules, but separate them semantically. 1461 1461 | INLINE // C99 1462 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Inline ); }1462 { $$ = DeclarationNode::newFuncSpecifier( Type::Inline ); } 1463 1463 | FORTRAN // C99 1464 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Fortran ); }1464 { $$ = DeclarationNode::newFuncSpecifier( Type::Fortran ); } 1465 1465 | NORETURN // C11 1466 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Noreturn ); }1466 { $$ = DeclarationNode::newFuncSpecifier( Type::Noreturn ); } 1467 1467 ; 1468 1468 … … 1633 1633 | UNION 1634 1634 { $$ = DeclarationNode::Union; } 1635 | COROUTINE 1636 { $$ = DeclarationNode::Struct; } 1637 | MONITOR 1638 { $$ = DeclarationNode::Struct; } 1639 | THREAD 1640 { $$ = DeclarationNode::Struct; } 1635 1641 ; 1636 1642 … … 1678 1684 // empty 1679 1685 { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name 1686 // '@' // empty 1687 // { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name 1680 1688 | bit_subrange_size // no field name 1681 1689 { $$ = DeclarationNode::newBitfield( $1 ); }
Note:
See TracChangeset
for help on using the changeset viewer.