Changeset b6b3c42 for src/Parser


Ignore:
Timestamp:
Oct 16, 2017, 11:08:30 AM (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:
633c711
Parents:
0aaac0e
Message:

add mutex statement, and restrict mutex qualifier to only one occurrence in parameter list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0aaac0e rb6b3c42  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct  2 18:18:55 2017
    13 // Update Count     : 2835
     12// Last Modified On : Mon Oct 16 11:07:29 2017
     13// Update Count     : 2892
    1414//
    1515
     
    250250%type<sn> exception_statement                   handler_clause                          finally_clause
    251251%type<catch_kind> handler_key
     252%type<sn> mutex_statement
    252253%type<en> when_clause                                   when_clause_opt                         waitfor                                         timeout
    253254%type<sn> waitfor_statement
     
    807808        | jump_statement
    808809        | with_statement
     810        | mutex_statement
    809811        | waitfor_statement
    810812        | exception_statement
     
    10311033        ;
    10321034
     1035// If MUTEX becomes a general qualifier, there are shift/reduce conflicts, so change syntax to "with mutex".
     1036mutex_statement:
     1037        MUTEX '(' argument_expression_list ')' statement
     1038                { $$ = nullptr; }                                                               // FIX ME
     1039        ;
     1040
    10331041when_clause:
    10341042        WHEN '(' comma_expression ')'
     
    15491557        | VOLATILE
    15501558                { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
    1551         | MUTEX
    1552                 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }
    15531559        | ATOMIC
    15541560                { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); }
     
    27032709        paren_identifier attribute_list_opt
    27042710                { $$ = $1->addQualifiers( $2 ); }
     2711        | '&' MUTEX paren_identifier attribute_list_opt
     2712                { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    27052713        | identifier_parameter_ptr
    27062714        | identifier_parameter_array attribute_list_opt
     
    27432751//
    27442752//              typedef int foo;
     2753//              forall( otype T ) foo( T );
    27452754//              int f( int foo ); // redefine typedef name in new scope
    27462755//
     
    27502759        typedef attribute_list_opt
    27512760                { $$ = $1->addQualifiers( $2 ); }
     2761        | '&' MUTEX typedef attribute_list_opt
     2762                { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    27522763        | type_parameter_ptr
    27532764        | type_parameter_array attribute_list_opt
     
    28962907abstract_parameter_declarator:
    28972908        abstract_parameter_ptr
     2909        | '&' MUTEX attribute_list_opt
     2910                { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); }
    28982911        | abstract_parameter_array attribute_list_opt
    28992912                { $$ = $1->addQualifiers( $2 ); }
Note: See TracChangeset for help on using the changeset viewer.