Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r861799c7 rddfd945  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar  5 15:48:24 2017
    13 // Update Count     : 2227
     12// Last Modified On : Thu Mar 16 08:36:17 2017
     13// Update Count     : 2310
    1414//
    1515
     
    104104%token TYPEOF LABEL                                                                             // GCC
    105105%token ENUM STRUCT UNION
     106%token COROUTINE MONITOR THREAD                                                 // CFA
    106107%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    107108%token SIZEOF OFFSETOF
     
    223224%type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr
    224225
    225 %type<decl> identifier_parameter_array identifier_parameter_declarator identifier_parameter_function
    226 %type<decl> identifier_parameter_ptr identifier_list
     226%type<decl> identifier_parameter_declarator identifier_parameter_ptr identifier_parameter_array identifier_parameter_function
     227%type<decl> identifier_list
    227228
    228229%type<decl> cfa_abstract_array cfa_abstract_declarator_no_tuple cfa_abstract_declarator_tuple
     
    270271%type<en> type_name_list
    271272
    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
    273275
    274276%type<decl> variable_declarator variable_ptr variable_array variable_function
     
    410412                { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_REALFRACTIONconstant( *$2 ) ) ); }
    411413        | 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 ) ) ); }
    415415        | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector
    416416                        { $$ = 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 ) ) ); }
    419417        | postfix_expression ICR
    420418                { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); }
     
    439437argument_expression:
    440438        // empty
    441                 { $$ = nullptr; }                                                               // use default argument
     439                { $$ = nullptr; }
     440        // | '@'                                                                                                // use default argument
     441        //      { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); }
    442442        | assignment_expression
    443443        ;
     
    14061406type_qualifier_name:
    14071407        CONST
    1408                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); }
     1408                { $$ = DeclarationNode::newTypeQualifier( Type::Const ); }
    14091409        | RESTRICT
    1410                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); }
     1410                { $$ = DeclarationNode::newTypeQualifier( Type::Restrict ); }
    14111411        | VOLATILE
    1412                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); }
     1412                { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
    14131413        | LVALUE                                                                                        // CFA
    1414                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); }
     1414                { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); }
    14151415        | MUTEX
    1416                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Mutex ); }
     1416                { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }
    14171417        | ATOMIC
    1418                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); }
     1418                { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); }
    14191419        | FORALL '('
    14201420                {
     
    14491449storage_class:
    14501450        EXTERN
    1451                 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
     1451                { $$ = DeclarationNode::newStorageClass( Type::Extern ); }
    14521452        | STATIC
    1453                 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Static ); }
     1453                { $$ = DeclarationNode::newStorageClass( Type::Static ); }
    14541454        | AUTO
    1455                 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Auto ); }
     1455                { $$ = DeclarationNode::newStorageClass( Type::Auto ); }
    14561456        | REGISTER
    1457                 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
     1457                { $$ = DeclarationNode::newStorageClass( Type::Register ); }
    14581458        | THREADLOCAL                                                                           // C11
    1459                 { $$ = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
     1459                { $$ = DeclarationNode::newStorageClass( Type::Threadlocal ); }
    14601460                // Put function specifiers here to simplify parsing rules, but separate them semantically.
    14611461        | INLINE                                                                                        // C99
    1462                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Inline ); }
     1462                { $$ = DeclarationNode::newFuncSpecifier( Type::Inline ); }
    14631463        | FORTRAN                                                                                       // C99
    1464                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Fortran ); }
     1464                { $$ = DeclarationNode::newFuncSpecifier( Type::Fortran ); }
    14651465        | NORETURN                                                                                      // C11
    1466                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Noreturn ); }
     1466                { $$ = DeclarationNode::newFuncSpecifier( Type::Noreturn ); }
    14671467        ;
    14681468
     
    16331633        | UNION
    16341634                { $$ = DeclarationNode::Union; }
     1635        | COROUTINE
     1636                { $$ = DeclarationNode::Struct; }
     1637        | MONITOR
     1638                { $$ = DeclarationNode::Struct; }
     1639        | THREAD
     1640                { $$ = DeclarationNode::Struct; }
    16351641        ;
    16361642
     
    16781684        // empty
    16791685                { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name
     1686        // '@' // empty
     1687        //      { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name
    16801688        | bit_subrange_size                                                                     // no field name
    16811689                { $$ = DeclarationNode::newBitfield( $1 ); }
Note: See TracChangeset for help on using the changeset viewer.