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