Changes in / [d280784:bc17be98]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rd280784 rbc17be98  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 11 21:32:15 2024
    13 // Update Count     : 6641
     12// Last Modified On : Tue Jun 11 16:56:42 2024
     13// Update Count     : 6638
    1414//
    1515
     
    387387// names and constants: lexer differentiates between identifier and typedef names
    388388%token<tok> IDENTIFIER          TYPEDIMname             TYPEDEFname             TYPEGENname
    389 %token<tok> TIMEOUT                     WAND    WOR             CATCH                   RECOVER                 CATCHRESUME             FIXUP           FINALLY         // CFA
     389%token<tok> TIMEOUT                     WAND    WOR                     CATCH                   RECOVER                 CATCHRESUME             FIXUP           FINALLY         // CFA
    390390%token<tok> INTEGERconstant     CHARACTERconstant       STRINGliteral
    391391%token<tok> DIRECTIVE
     
    493493%type<decl> exception_declaration
    494494
    495 %type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declarator field_abstract_list_opt field_abstract
     495%type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declaring_list field_declarator field_abstract_list_opt field_abstract
    496496%type<expr> field field_name_list field_name fraction_constants_opt
    497497
     
    678678        | '@'                                                                                           // CFA
    679679                { Token tok = { new string( DeclarationNode::anonymous.newName() ), yylval.tok.loc }; $$ = tok; }
    680         ;
    681 
    682 identifier_or_type_name:
    683         identifier
    684         | TYPEDEFname
    685         | TYPEGENname
    686680        ;
    687681
     
    817811                //       z.E;  // lexer returns E is TYPEDEFname
    818812                //   }
    819         | postfix_expression '.' identifier_or_type_name
     813        | postfix_expression '.' identifier
     814                { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
     815        | postfix_expression '.' TYPEDEFname                            // CFA, SKULLDUGGERY
     816                { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
     817        | postfix_expression '.' TYPEGENname                            // CFA, SKULLDUGGERY
    820818                { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }
    821819
     
    16151613enum_key:
    16161614        TYPEDEFname
    1617         | ENUM identifier_or_type_name
     1615        | ENUM TYPEDEFname
    16181616        ;
    16191617
     
    26942692        // empty
    26952693                { $$ = nullptr; }
    2696         | field_declarator
    2697         | field_declaring_list_opt ',' attribute_list_opt field_declarator
     2694        | field_declaring_list
     2695        ;
     2696
     2697field_declaring_list:
     2698        field_declarator
     2699        | field_declaring_list ',' attribute_list_opt field_declarator
    26982700                { $$ = $1->set_last( $4->addQualifiers( $3 ) ); }
    26992701        ;
     
    29592961        ;
    29602962
     2963identifier_or_type_name:
     2964        identifier
     2965        | TYPEDEFname
     2966        | TYPEGENname
     2967        ;
     2968
    29612969type_no_function:                                                                               // sizeof, alignof, cast (constructor)
    29622970        cfa_abstract_declarator_tuple                                           // CFA
     
    32223230        // empty, input file
    32233231        | external_definition_list
    3224                 { parseTree = parseTree ? parseTree->set_last( $1 ) : $1; }
     3232                { parseTree = parseTree ? parseTree->set_last( $1 ) : $1;       }
    32253233        ;
    32263234
     
    34803488
    34813489attr_name:                                                                                              // GCC
    3482         identifier_or_type_name
     3490        IDENTIFIER
     3491        | quasi_keyword
     3492        | TYPEDEFname
     3493        | TYPEGENname
    34833494        | FALLTHROUGH
    34843495                { $$ = Token{ new string( "fallthrough" ), { nullptr, -1 } }; }
Note: See TracChangeset for help on using the changeset viewer.