Changeset 366f5cd for src/Parser
- Timestamp:
- Jun 23, 2026, 1:57:51 PM (31 hours ago)
- Branches:
- master
- Children:
- 9d7a19f
- Parents:
- 45d0e65
- Location:
- src/Parser
- Files:
-
- 4 edited
-
ExpressionNode.cpp (modified) (2 diffs)
-
ParseNode.hpp (modified) (2 diffs)
-
lex.ll (modified) (3 diffs)
-
parser.yy (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cpp
r45d0e65 r366f5cd 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri May 1 11:07:48202613 // Update Count : 112 812 // Last Modified On : Mon Jun 22 16:30:56 2026 13 // Update Count : 1129 14 14 // 15 15 … … 591 591 static const char * OperName[] = { // must harmonize with OperKinds 592 592 // diadic 593 "SizeOf", "AlignOf", " OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&",593 "SizeOf", "AlignOf", "__alignof", "OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&", 594 594 "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?", 595 595 "?=?", "?@=?", "?\\=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?", -
src/Parser/ParseNode.hpp
r45d0e65 r366f5cd 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 9 17:39:34 202313 // Update Count : 94 512 // Last Modified On : Tue Jun 23 07:43:13 2026 13 // Update Count : 947 14 14 // 15 15 … … 94 94 enum class OperKinds { 95 95 // diadic 96 SizeOf, AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And,96 SizeOf, AlignOf, __AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And, 97 97 BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq, 98 98 Assign, AtAssn, ExpAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn, -
src/Parser/lex.ll
r45d0e65 r366f5cd 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : T hu Jun 5 22:38:35 202513 * Update Count : 88 512 * Last Modified On : Tue Jun 23 07:44:07 2026 13 * Update Count : 888 14 14 */ 15 15 … … 56 56 string * build_postfix_name( string * name ); 57 57 58 char * yyfilename;59 string * strtext; // accumulate parts of character and string constant value58 char * yyfilename; 59 string * strtext; // accumulate parts of character and string constant value 60 60 61 61 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x ) … … 225 225 alignas { KEYWORD_RETURN(ALIGNAS); } // CFA 226 226 _Alignas { KEYWORD_RETURN(ALIGNAS); } // C11 227 alignof { KEYWORD_RETURN(ALIGNOF); } // C FA227 alignof { KEYWORD_RETURN(ALIGNOF); } // C23 228 228 _Alignof { KEYWORD_RETURN(ALIGNOF); } // C11 229 __alignof { KEYWORD_RETURN( ALIGNOF); } // GCC230 __alignof__ { KEYWORD_RETURN( ALIGNOF); } // GCC229 __alignof { KEYWORD_RETURN(__ALIGNOF); } // GCC 230 __alignof__ { KEYWORD_RETURN(__ALIGNOF); } // GCC 231 231 and { QKEYWORD_RETURN(WAND); } // CFA 232 232 asm { KEYWORD_RETURN(ASM); } -
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.