Changeset 36e6f10 for src


Ignore:
Timestamp:
Oct 30, 2023, 3:03:30 PM (8 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
7d55e4d
Parents:
3c714ad
Message:

Parser now uses constants from the new ast types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r3c714ad r36e6f10  
    4848using namespace std;
    4949
    50 #include "SynTree/Type.h"                               // for Type
    5150#include "DeclarationNode.h"                            // for DeclarationNode, ...
    5251#include "ExpressionNode.h"                             // for ExpressionNode, ...
     
    21692168type_qualifier_name:
    21702169        CONST
    2171                 { $$ = DeclarationNode::newTypeQualifier( Type::Const ); }
     2170                { $$ = DeclarationNode::newTypeQualifier( ast::CV::Const ); }
    21722171        | RESTRICT
    2173                 { $$ = DeclarationNode::newTypeQualifier( Type::Restrict ); }
     2172                { $$ = DeclarationNode::newTypeQualifier( ast::CV::Restrict ); }
    21742173        | VOLATILE
    2175                 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
     2174                { $$ = DeclarationNode::newTypeQualifier( ast::CV::Volatile ); }
    21762175        | ATOMIC
    2177                 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); }
     2176                { $$ = DeclarationNode::newTypeQualifier( ast::CV::Atomic ); }
    21782177        | forall
    21792178                { $$ = DeclarationNode::newForall( $1 ); }
     
    22062205storage_class:
    22072206        EXTERN
    2208                 { $$ = DeclarationNode::newStorageClass( Type::Extern ); }
     2207                { $$ = DeclarationNode::newStorageClass( ast::Storage::Extern ); }
    22092208        | STATIC
    2210                 { $$ = DeclarationNode::newStorageClass( Type::Static ); }
     2209                { $$ = DeclarationNode::newStorageClass( ast::Storage::Static ); }
    22112210        | AUTO
    2212                 { $$ = DeclarationNode::newStorageClass( Type::Auto ); }
     2211                { $$ = DeclarationNode::newStorageClass( ast::Storage::Auto ); }
    22132212        | REGISTER
    2214                 { $$ = DeclarationNode::newStorageClass( Type::Register ); }
     2213                { $$ = DeclarationNode::newStorageClass( ast::Storage::Register ); }
    22152214        | THREADLOCALGCC                                                                                // GCC
    2216                 { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalGcc ); }
     2215                { $$ = DeclarationNode::newStorageClass( ast::Storage::ThreadLocalGcc ); }
    22172216        | THREADLOCALC11                                                                                // C11
    2218                 { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalC11 ); }
     2217                { $$ = DeclarationNode::newStorageClass( ast::Storage::ThreadLocalC11 ); }
    22192218                // Put function specifiers here to simplify parsing rules, but separate them semantically.
    22202219        | INLINE                                                                                        // C99
    2221                 { $$ = DeclarationNode::newFuncSpecifier( Type::Inline ); }
     2220                { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Inline ); }
    22222221        | FORTRAN                                                                                       // C99
    2223                 { $$ = DeclarationNode::newFuncSpecifier( Type::Fortran ); }
     2222                { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Fortran ); }
    22242223        | NORETURN                                                                                      // C11
    2225                 { $$ = DeclarationNode::newFuncSpecifier( Type::Noreturn ); }
     2224                { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Noreturn ); }
    22262225        ;
    22272226
     
    37173716                { $$ = $1->addQualifiers( $2 ); }
    37183717        | '&' MUTEX paren_identifier attribute_list_opt
    3719                 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
     3718                { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( ast::CV::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    37203719        | identifier_parameter_ptr
    37213720        | identifier_parameter_array attribute_list_opt
     
    37673766                { $$ = $1->addQualifiers( $2 ); }
    37683767        | '&' MUTEX typedef_name attribute_list_opt
    3769                 { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
     3768                { $$ = $3->addPointer( DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( ast::CV::Mutex ), OperKinds::AddressOf ) )->addQualifiers( $4 ); }
    37703769        | type_parameter_ptr
    37713770        | type_parameter_array attribute_list_opt
     
    39413940        abstract_parameter_ptr
    39423941        | '&' MUTEX attribute_list_opt
    3943                 { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( Type::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); }
     3942                { $$ = DeclarationNode::newPointer( DeclarationNode::newTypeQualifier( ast::CV::Mutex ), OperKinds::AddressOf )->addQualifiers( $3 ); }
    39443943        | abstract_parameter_array attribute_list_opt
    39453944                { $$ = $1->addQualifiers( $2 ); }
Note: See TracChangeset for help on using the changeset viewer.