Changeset 446740a


Ignore:
Timestamp:
Mar 11, 2024, 9:00:04 PM (9 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
282061a
Parents:
6c8b76b
Message:

update for-control for iterating over enumeration type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r6c8b76b r446740a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  6 10:51:55 2024
    13 // Update Count     : 6588
     12// Last Modified On : Mon Mar 11 18:30:03 2024
     13// Update Count     : 6589
    1414//
    1515
     
    12701270// parenthesis:
    12711271//
    1272 //   if x + y + z; => "if ( x + y ) + z" or "if ( x ) + y + z"
     1272//   if x + y + z; => if ( x ) + y + z or if ( x + y ) + z
    12731273//
    12741274//   switch O { }
     
    15961596                { SemanticError( yylloc, "syntax error, missing low/high value for up/down-to range so index is uninitialized." ); $$ = nullptr; }
    15971597
    1598         | comma_expression ';' TYPEDEFname                                      // CFA, array type
     1598        | comma_expression ';' enum_key                                         // CFA, enum type
    15991599                {
    16001600                        SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr;
    16011601                        //$$ = forCtrl( new ExpressionNode( build_varref( $3 ) ), $1, nullptr, OperKinds::Range, nullptr, nullptr );
    16021602                }
    1603         | comma_expression ';' downupdowneq TYPEDEFname         // CFA, array type
     1603        | comma_expression ';' downupdowneq enum_key            // CFA, enum type, reverse direction
    16041604                {
    16051605                        if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) {
     
    16081608                        SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr;
    16091609                }
     1610        ;
     1611
     1612enum_key:
     1613        TYPEDEFname
     1614        | ENUM TYPEDEFname
    16101615        ;
    16111616
     
    22402245                { $$ = build_type_qualifier( ast::CV::Atomic ); }
    22412246
    2242                 // forall must be a CV qualifier because it can appear in places where SC qualifiers are disallowed.
     2247                // forall is a CV qualifier because it can appear in places where SC qualifiers are disallowed.
    22432248                //
    22442249                //   void foo( forall( T ) T (*)( T ) ); // forward declaration
     
    25722577                        // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is
    25732578                        // switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and
     2579                        // delete newFromTypeGen.
    25742580                        if ( $3->kind == TypeData::SymbolicInst && ! $3->symbolic.isTypedef ) {
    25752581                                $$ = DeclarationNode::newFromTypeData( $3 )->addQualifiers( $2 );
     
    40274033        abstract_parameter_ptr
    40284034        | '&' MUTEX attribute_list_opt
    4029                 { $$ = DeclarationNode::newPointer( DeclarationNode::newFromTypeData( build_type_qualifier( ast::CV::Mutex ) ), OperKinds::AddressOf )->addQualifiers( $3 ); }
     4035                { $$ = DeclarationNode::newPointer( DeclarationNode::newFromTypeData( build_type_qualifier( ast::CV::Mutex ) ),
     4036                                                                                        OperKinds::AddressOf )->addQualifiers( $3 ); }
    40304037        | abstract_parameter_array attribute_list_opt
    40314038                { $$ = $1->addQualifiers( $2 ); }
Note: See TracChangeset for help on using the changeset viewer.