Changeset d3e4d6c for src/Parser/parser.yy
- Timestamp:
- Aug 23, 2017, 6:22:07 PM (7 years ago)
- 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:
- 87e08e24, cb811ac
- Parents:
- 9f07232 (diff), bd37119 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9f07232 rd3e4d6c 119 119 %token RESTRICT // C99 120 120 %token ATOMIC // C11 121 %token FORALL LVALUEMUTEX VIRTUAL // CFA121 %token FORALL MUTEX VIRTUAL // CFA 122 122 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 123 123 %token BOOL COMPLEX IMAGINARY // C99 … … 687 687 conditional_expression 688 688 | unary_expression assignment_operator assignment_expression 689 { $$ = new ExpressionNode( build_binary_ ptr( $2, $1, $3 ) ); }689 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 690 690 ; 691 691 … … 1483 1483 | VOLATILE 1484 1484 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); } 1485 | LVALUE // CFA1486 { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); }1487 1485 | MUTEX 1488 1486 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); } … … 2466 2464 variable_ptr: 2467 2465 ptrref_operator variable_declarator 2468 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2466 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2469 2467 | ptrref_operator type_qualifier_list variable_declarator 2470 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2468 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2471 2469 | '(' variable_ptr ')' attribute_list_opt 2472 2470 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis … … 2514 2512 function_ptr: 2515 2513 ptrref_operator function_declarator 2516 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2514 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2517 2515 | ptrref_operator type_qualifier_list function_declarator 2518 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2516 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2519 2517 | '(' function_ptr ')' 2520 2518 { $$ = $2; } … … 2554 2552 KR_function_ptr: 2555 2553 ptrref_operator KR_function_declarator 2556 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2554 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2557 2555 | ptrref_operator type_qualifier_list KR_function_declarator 2558 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2556 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2559 2557 | '(' KR_function_ptr ')' 2560 2558 { $$ = $2; } … … 2598 2596 type_ptr: 2599 2597 ptrref_operator variable_type_redeclarator 2600 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2598 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2601 2599 | ptrref_operator type_qualifier_list variable_type_redeclarator 2602 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2600 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2603 2601 | '(' type_ptr ')' attribute_list_opt 2604 2602 { $$ = $2->addQualifiers( $4 ); } … … 2642 2640 identifier_parameter_ptr: 2643 2641 ptrref_operator identifier_parameter_declarator 2644 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2642 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2645 2643 | ptrref_operator type_qualifier_list identifier_parameter_declarator 2646 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2644 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2647 2645 | '(' identifier_parameter_ptr ')' attribute_list_opt 2648 2646 { $$ = $2->addQualifiers( $4 ); } … … 2702 2700 type_parameter_ptr: 2703 2701 ptrref_operator type_parameter_redeclarator 2704 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2702 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2705 2703 | ptrref_operator type_qualifier_list type_parameter_redeclarator 2706 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2704 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2707 2705 | '(' type_parameter_ptr ')' attribute_list_opt 2708 2706 { $$ = $2->addQualifiers( $4 ); } … … 2745 2743 abstract_ptr: 2746 2744 ptrref_operator 2747 { $$ = DeclarationNode::newPointer( 0 ); }2745 { $$ = DeclarationNode::newPointer( 0, $1 ); } 2748 2746 | ptrref_operator type_qualifier_list 2749 { $$ = DeclarationNode::newPointer( $2 ); }2747 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2750 2748 | ptrref_operator abstract_declarator 2751 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2749 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2752 2750 | ptrref_operator type_qualifier_list abstract_declarator 2753 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2751 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2754 2752 | '(' abstract_ptr ')' attribute_list_opt 2755 2753 { $$ = $2->addQualifiers( $4 ); } … … 2834 2832 abstract_parameter_ptr: 2835 2833 ptrref_operator 2836 { $$ = DeclarationNode::newPointer( nullptr ); }2834 { $$ = DeclarationNode::newPointer( nullptr, $1 ); } 2837 2835 | ptrref_operator type_qualifier_list 2838 { $$ = DeclarationNode::newPointer( $2 ); }2836 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2839 2837 | ptrref_operator abstract_parameter_declarator 2840 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); }2838 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); } 2841 2839 | ptrref_operator type_qualifier_list abstract_parameter_declarator 2842 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2840 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2843 2841 | '(' abstract_parameter_ptr ')' attribute_list_opt 2844 2842 { $$ = $2->addQualifiers( $4 ); } … … 2913 2911 variable_abstract_ptr: 2914 2912 ptrref_operator 2915 { $$ = DeclarationNode::newPointer( 0 ); }2913 { $$ = DeclarationNode::newPointer( 0, $1 ); } 2916 2914 | ptrref_operator type_qualifier_list 2917 { $$ = DeclarationNode::newPointer( $2 ); }2915 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2918 2916 | ptrref_operator variable_abstract_declarator 2919 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2917 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2920 2918 | ptrref_operator type_qualifier_list variable_abstract_declarator 2921 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2919 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2922 2920 | '(' variable_abstract_ptr ')' attribute_list_opt 2923 2921 { $$ = $2->addQualifiers( $4 ); } … … 2959 2957 // No SUE declaration in parameter list. 2960 2958 ptrref_operator type_specifier_nobody 2961 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2959 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2962 2960 | type_qualifier_list ptrref_operator type_specifier_nobody 2963 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2961 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2964 2962 | ptrref_operator cfa_abstract_function 2965 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2963 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2966 2964 | type_qualifier_list ptrref_operator cfa_abstract_function 2967 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2965 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2968 2966 | ptrref_operator cfa_identifier_parameter_declarator_tuple 2969 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2967 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2970 2968 | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple 2971 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2969 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2972 2970 ; 2973 2971 … … 3047 3045 cfa_abstract_ptr: // CFA 3048 3046 ptrref_operator type_specifier 3049 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }3047 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 3050 3048 | type_qualifier_list ptrref_operator type_specifier 3051 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }3049 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 3052 3050 | ptrref_operator cfa_abstract_function 3053 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }3051 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 3054 3052 | type_qualifier_list ptrref_operator cfa_abstract_function 3055 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }3053 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 3056 3054 | ptrref_operator cfa_abstract_declarator_tuple 3057 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }3055 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 3058 3056 | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple 3059 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }3057 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 3060 3058 ; 3061 3059
Note: See TracChangeset
for help on using the changeset viewer.