Changeset 366f5cd for src/Parser/parser.yy
- Timestamp:
- Jun 23, 2026, 1:57:51 PM (31 hours ago)
- Branches:
- master
- Children:
- 9d7a19f
- Parents:
- 45d0e65
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r45d0e65 r366f5cd 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri May 1 11:01:45202613 // Update Count : 73 2012 // Last Modified On : Tue Jun 23 12:37:08 2026 13 // Update Count : 7350 14 14 // 15 15 … … 393 393 %token DISABLE ENABLE TRY THROW THROWRESUME AT // CFA 394 394 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 395 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11395 %token ALIGNAS ALIGNOF __ALIGNOF GENERIC STATICASSERT // C11/C23 396 396 397 397 // names and constants: lexer differentiates between identifier and typedef names … … 432 432 %type<expr> constant 433 433 %type<expr> tuple tuple_expression_list 434 %type<oper> ptrref_operator unary_operator assignment_operator simple_assignment_operator compound_assignment_operator434 %type<oper> ptrref_operator alignof_operator unary_operator assignment_operator simple_assignment_operator compound_assignment_operator 435 435 %type<expr> primary_expression postfix_expression unary_expression 436 436 %type<expr> cast_expression_list cast_expression exponential_expression multiplicative_expression additive_expression … … 933 933 | SIZEOF '(' attribute_list type_no_function ')' 934 934 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $4->addQualifiers( $3 ) ) ) ); } 935 | ALIGNOF unary_expression // GCC, variable alignment 936 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); } 937 | ALIGNOF '(' type_no_function ')' // GCC, type alignment 938 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 935 | alignof_operator unary_expression // GCC, variable alignment 936 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ), 937 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 938 | alignof_operator '(' type_no_function ')' // GCC, type alignment 939 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ), 940 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 939 941 940 942 // Cannot use rule "type", which includes cfa_abstract_function, for sizeof/alignof, because of S/R problems on … … 942 944 | SIZEOF '(' cfa_abstract_function ')' 943 945 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 944 | ALIGNOF '(' cfa_abstract_function ')'// GCC, type alignment945 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }946 946 | alignof_operator '(' cfa_abstract_function ')' // GCC, type alignment 947 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ), 948 $1 == OperKinds::AlignOf ? ast::AlignofExpr::Alignof : ast::AlignofExpr::__Alignof ) ); } 947 949 | OFFSETOF '(' type_no_function ',' identifier ')' 948 950 { $$ = new ExpressionNode( build_offsetOf( yylloc, $3, build_varref( yylloc, $5 ) ) ); } … … 956 958 | COUNTOF '(' type_no_function ')' 957 959 { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 960 ; 961 962 alignof_operator: 963 ALIGNOF { $$ = OperKinds::AlignOf; } 964 | __ALIGNOF { $$ = OperKinds::__AlignOf; } 958 965 ; 959 966
Note:
See TracChangeset
for help on using the changeset viewer.