Changeset 36e6f10
- Timestamp:
- Oct 30, 2023, 3:03:30 PM (14 months ago)
- Branches:
- master
- Children:
- 7d55e4d
- Parents:
- 3c714ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r3c714ad r36e6f10 48 48 using namespace std; 49 49 50 #include "SynTree/Type.h" // for Type51 50 #include "DeclarationNode.h" // for DeclarationNode, ... 52 51 #include "ExpressionNode.h" // for ExpressionNode, ... … … 2169 2168 type_qualifier_name: 2170 2169 CONST 2171 { $$ = DeclarationNode::newTypeQualifier( Type::Const ); }2170 { $$ = DeclarationNode::newTypeQualifier( ast::CV::Const ); } 2172 2171 | RESTRICT 2173 { $$ = DeclarationNode::newTypeQualifier( Type::Restrict ); }2172 { $$ = DeclarationNode::newTypeQualifier( ast::CV::Restrict ); } 2174 2173 | VOLATILE 2175 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }2174 { $$ = DeclarationNode::newTypeQualifier( ast::CV::Volatile ); } 2176 2175 | ATOMIC 2177 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); }2176 { $$ = DeclarationNode::newTypeQualifier( ast::CV::Atomic ); } 2178 2177 | forall 2179 2178 { $$ = DeclarationNode::newForall( $1 ); } … … 2206 2205 storage_class: 2207 2206 EXTERN 2208 { $$ = DeclarationNode::newStorageClass( Type::Extern ); }2207 { $$ = DeclarationNode::newStorageClass( ast::Storage::Extern ); } 2209 2208 | STATIC 2210 { $$ = DeclarationNode::newStorageClass( Type::Static ); }2209 { $$ = DeclarationNode::newStorageClass( ast::Storage::Static ); } 2211 2210 | AUTO 2212 { $$ = DeclarationNode::newStorageClass( Type::Auto ); }2211 { $$ = DeclarationNode::newStorageClass( ast::Storage::Auto ); } 2213 2212 | REGISTER 2214 { $$ = DeclarationNode::newStorageClass( Type::Register ); }2213 { $$ = DeclarationNode::newStorageClass( ast::Storage::Register ); } 2215 2214 | THREADLOCALGCC // GCC 2216 { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalGcc ); }2215 { $$ = DeclarationNode::newStorageClass( ast::Storage::ThreadLocalGcc ); } 2217 2216 | THREADLOCALC11 // C11 2218 { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalC11 ); }2217 { $$ = DeclarationNode::newStorageClass( ast::Storage::ThreadLocalC11 ); } 2219 2218 // Put function specifiers here to simplify parsing rules, but separate them semantically. 2220 2219 | INLINE // C99 2221 { $$ = DeclarationNode::newFuncSpecifier( Type::Inline ); }2220 { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Inline ); } 2222 2221 | FORTRAN // C99 2223 { $$ = DeclarationNode::newFuncSpecifier( Type::Fortran ); }2222 { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Fortran ); } 2224 2223 | NORETURN // C11 2225 { $$ = DeclarationNode::newFuncSpecifier( Type::Noreturn ); }2224 { $$ = DeclarationNode::newFuncSpecifier( ast::Function::Noreturn ); } 2226 2225 ; 2227 2226 … … 3717 3716 { $$ = $1->addQualifiers( $2 ); } 3718 3717 | '&' 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 ); } 3720 3719 | identifier_parameter_ptr 3721 3720 | identifier_parameter_array attribute_list_opt … … 3767 3766 { $$ = $1->addQualifiers( $2 ); } 3768 3767 | '&' 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 ); } 3770 3769 | type_parameter_ptr 3771 3770 | type_parameter_array attribute_list_opt … … 3941 3940 abstract_parameter_ptr 3942 3941 | '&' 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 ); } 3944 3943 | abstract_parameter_array attribute_list_opt 3945 3944 { $$ = $1->addQualifiers( $2 ); }
Note: See TracChangeset
for help on using the changeset viewer.