Changeset 7cf8006 for src


Ignore:
Timestamp:
Nov 2, 2022, 9:36:27 PM (18 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
f6aa89c
Parents:
e50d9cb8
Message:

add type to enum hiding productions

Location:
src/Parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    re50d9cb8 r7cf8006  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 18 16:22:15 2022
    13 // Update Count     : 937
     12// Last Modified On : Wed Nov  2 21:27:07 2022
     13// Update Count     : 939
    1414//
    1515
     
    168168        Ctor, Dtor,
    169169}; // OperKinds
     170
     171enum class EnumHiding { Visible, Hide };
    170172
    171173struct LabelNode {
  • src/Parser/parser.yy

    re50d9cb8 r7cf8006  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Oct 28 15:27:08 2022
    13 // Update Count     : 5764
     12// Last Modified On : Wed Nov  2 21:31:21 2022
     13// Update Count     : 5810
    1414//
    1515
     
    278278
    279279// Types declaration for productions
     280
    280281%union {
    281282        Token tok;
     
    290291        CondCtl * ifctl;
    291292        ForCtrl * fctl;
    292         enum OperKinds compop;
     293        OperKinds compop;
    293294        LabelNode * label;
    294295        InitializerNode * in;
     
    296297        std::string * str;
    297298        bool flag;
     299        EnumHiding hide;
    298300        CatchStmt::Kind catch_kind;
    299301        GenericExpr * genexpr;
     
    364366%type<constant> string_literal
    365367%type<str> string_literal_list
     368
     369%type<hide> hide_opt                                    visible_hide_opt
    366370
    367371// expressions
     
    25542558                { typedefTable.makeTypedef( *$3 ); }
    25552559          hide_opt '{' enumerator_list comma_opt '}'
    2556                 { $$ = DeclarationNode::newEnum( $3, $7, true, false )->addQualifiers( $2 ); }
     2560          { $$ = DeclarationNode::newEnum( $3, $7, true, false )->addQualifiers( $2 ); }
    25572561        | ENUM attribute_list_opt typedef_name                          // unqualified type name
    25582562          hide_opt '{' enumerator_list comma_opt '}'
     
    25982602hide_opt:
    25992603        // empty
     2604                { $$ = EnumHiding::Visible; }
    26002605        | '!'
     2606                { $$ = EnumHiding::Hide; }
    26012607        ;
    26022608
     
    26092615
    26102616enumerator_list:
    2611         hide_visible_opt identifier_or_type_name enumerator_value_opt
     2617        visible_hide_opt identifier_or_type_name enumerator_value_opt
    26122618                { $$ = DeclarationNode::newEnumValueGeneric( $2, $3 ); }
    26132619        | INLINE type_name
    26142620                { $$ = DeclarationNode::newEnumInLine( *$2->type->symbolic.name ); }
    2615         | enumerator_list ',' hide_visible_opt identifier_or_type_name enumerator_value_opt
     2621        | enumerator_list ',' visible_hide_opt identifier_or_type_name enumerator_value_opt
    26162622                { $$ = $1->appendList( DeclarationNode::newEnumValueGeneric( $4, $5 ) ); }
    26172623        | enumerator_list ',' INLINE type_name enumerator_value_opt
     
    26192625        ;
    26202626
    2621 hide_visible_opt:
     2627visible_hide_opt:
    26222628        hide_opt
    26232629        | '^'
     2630                { $$ = EnumHiding::Visible; }
    26242631        ;
    26252632
Note: See TracChangeset for help on using the changeset viewer.