Ignore:
Timestamp:
Aug 23, 2017, 6:22:07 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9f07232 rd3e4d6c  
    119119%token RESTRICT                                                                                 // C99
    120120%token ATOMIC                                                                                   // C11
    121 %token FORALL LVALUE MUTEX VIRTUAL                                              // CFA
     121%token FORALL MUTEX VIRTUAL                                             // CFA
    122122%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED
    123123%token BOOL COMPLEX IMAGINARY                                                   // C99
     
    687687        conditional_expression
    688688        | unary_expression assignment_operator assignment_expression
    689                 { $$ = new ExpressionNode( build_binary_ptr( $2, $1, $3 ) ); }
     689                { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
    690690        ;
    691691
     
    14831483        | VOLATILE
    14841484                { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
    1485         | LVALUE                                                                                        // CFA
    1486                 { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); }
    14871485        | MUTEX
    14881486                { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }
     
    24662464variable_ptr:
    24672465        ptrref_operator variable_declarator
    2468                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2466                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    24692467        | ptrref_operator type_qualifier_list variable_declarator
    2470                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2468                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    24712469        | '(' variable_ptr ')' attribute_list_opt
    24722470                { $$ = $2->addQualifiers( $4 ); }                               // redundant parenthesis
     
    25142512function_ptr:
    25152513        ptrref_operator function_declarator
    2516                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2514                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    25172515        | ptrref_operator type_qualifier_list function_declarator
    2518                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2516                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    25192517        | '(' function_ptr ')'
    25202518                { $$ = $2; }
     
    25542552KR_function_ptr:
    25552553        ptrref_operator KR_function_declarator
    2556                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2554                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    25572555        | ptrref_operator type_qualifier_list KR_function_declarator
    2558                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2556                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    25592557        | '(' KR_function_ptr ')'
    25602558                { $$ = $2; }
     
    25982596type_ptr:
    25992597        ptrref_operator variable_type_redeclarator
    2600                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2598                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    26012599        | ptrref_operator type_qualifier_list variable_type_redeclarator
    2602                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2600                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    26032601        | '(' type_ptr ')' attribute_list_opt
    26042602                { $$ = $2->addQualifiers( $4 ); }
     
    26422640identifier_parameter_ptr:
    26432641        ptrref_operator identifier_parameter_declarator
    2644                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2642                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    26452643        | ptrref_operator type_qualifier_list identifier_parameter_declarator
    2646                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2644                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    26472645        | '(' identifier_parameter_ptr ')' attribute_list_opt
    26482646                { $$ = $2->addQualifiers( $4 ); }
     
    27022700type_parameter_ptr:
    27032701        ptrref_operator type_parameter_redeclarator
    2704                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2702                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    27052703        | ptrref_operator type_qualifier_list type_parameter_redeclarator
    2706                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2704                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    27072705        | '(' type_parameter_ptr ')' attribute_list_opt
    27082706                { $$ = $2->addQualifiers( $4 ); }
     
    27452743abstract_ptr:
    27462744        ptrref_operator
    2747                 { $$ = DeclarationNode::newPointer( 0 ); }
     2745                { $$ = DeclarationNode::newPointer( 0, $1 ); }
    27482746        | ptrref_operator type_qualifier_list
    2749                 { $$ = DeclarationNode::newPointer( $2 ); }
     2747                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    27502748        | ptrref_operator abstract_declarator
    2751                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2749                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    27522750        | ptrref_operator type_qualifier_list abstract_declarator
    2753                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2751                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    27542752        | '(' abstract_ptr ')' attribute_list_opt
    27552753                { $$ = $2->addQualifiers( $4 ); }
     
    28342832abstract_parameter_ptr:
    28352833        ptrref_operator
    2836                 { $$ = DeclarationNode::newPointer( nullptr ); }
     2834                { $$ = DeclarationNode::newPointer( nullptr, $1 ); }
    28372835        | ptrref_operator type_qualifier_list
    2838                 { $$ = DeclarationNode::newPointer( $2 ); }
     2836                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    28392837        | ptrref_operator abstract_parameter_declarator
    2840                 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); }
     2838                { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
    28412839        | ptrref_operator type_qualifier_list abstract_parameter_declarator
    2842                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2840                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    28432841        | '(' abstract_parameter_ptr ')' attribute_list_opt
    28442842                { $$ = $2->addQualifiers( $4 ); }
     
    29132911variable_abstract_ptr:
    29142912        ptrref_operator
    2915                 { $$ = DeclarationNode::newPointer( 0 ); }
     2913                { $$ = DeclarationNode::newPointer( 0, $1 ); }
    29162914        | ptrref_operator type_qualifier_list
    2917                 { $$ = DeclarationNode::newPointer( $2 ); }
     2915                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    29182916        | ptrref_operator variable_abstract_declarator
    2919                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2917                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29202918        | ptrref_operator type_qualifier_list variable_abstract_declarator
    2921                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2919                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    29222920        | '(' variable_abstract_ptr ')' attribute_list_opt
    29232921                { $$ = $2->addQualifiers( $4 ); }
     
    29592957                // No SUE declaration in parameter list.
    29602958        ptrref_operator type_specifier_nobody
    2961                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2959                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29622960        | type_qualifier_list ptrref_operator type_specifier_nobody
    2963                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2961                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29642962        | ptrref_operator cfa_abstract_function
    2965                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2963                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29662964        | type_qualifier_list ptrref_operator cfa_abstract_function
    2967                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2965                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29682966        | ptrref_operator cfa_identifier_parameter_declarator_tuple
    2969                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2967                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29702968        | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple
    2971                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2969                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29722970        ;
    29732971
     
    30473045cfa_abstract_ptr:                                                                               // CFA
    30483046        ptrref_operator type_specifier
    3049                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     3047                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    30503048        | type_qualifier_list ptrref_operator type_specifier
    3051                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     3049                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    30523050        | ptrref_operator cfa_abstract_function
    3053                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     3051                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    30543052        | type_qualifier_list ptrref_operator cfa_abstract_function
    3055                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     3053                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    30563054        | ptrref_operator cfa_abstract_declarator_tuple
    3057                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     3055                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    30583056        | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple
    3059                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     3057                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    30603058        ;
    30613059
Note: See TracChangeset for help on using the changeset viewer.