Changes in / [9d6082c:006d4c4]
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r9d6082c r006d4c4 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Thu Jun 20 16:54:05202413 * Update Count : 77 812 * Last Modified On : Sat Feb 24 11:47:24 2024 13 * Update Count : 777 14 14 */ 15 15 … … 321 321 __signed__ { KEYWORD_RETURN(SIGNED); } // GCC 322 322 sizeof { KEYWORD_RETURN(SIZEOF); } 323 countof { KEYWORD_RETURN(COUNTOF); }// GCC323 __count_e__ { KEYWORD_RETURN(COUNT); } // GCC 324 324 static { KEYWORD_RETURN(STATIC); } 325 325 _Static_assert { KEYWORD_RETURN(STATICASSERT); } // C11 -
src/Parser/parser.yy
r9d6082c r006d4c4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 20 21:34:49202413 // Update Count : 66 5412 // Last Modified On : Mon Jun 17 21:43:02 2024 13 // Update Count : 6643 14 14 // 15 15 … … 302 302 } // if 303 303 } else { 304 assert( false );304 SemanticError( yylloc, "syntax error, loop-index name missing. Expression disallowed." ); return nullptr; 305 305 } // if 306 306 } // enumRangeCtrl … … 390 390 %token DECIMAL32 DECIMAL64 DECIMAL128 // GCC 391 391 %token ZERO_T ONE_T // CFA 392 %token SIZEOF TYPEOF VA_LIST VA_ARG AUTO_TYPE COUNT OF// GCC392 %token SIZEOF TYPEOF VA_LIST VA_ARG AUTO_TYPE COUNT // GCC 393 393 %token OFFSETOF BASETYPEOF TYPEID // CFA 394 394 %token ENUM STRUCT UNION … … 508 508 %type<decl> elaborated_type elaborated_type_nobody 509 509 510 %type<decl> enumerator_list enum_type enum_type_nobody enum _key enumerator_type510 %type<decl> enumerator_list enum_type enum_type_nobody enumerator_type 511 511 %type<init> enumerator_value_opt 512 512 … … 990 990 // $$ = new ExpressionNode( build_offsetOf( $3, build_varref( $5 ) ) ); 991 991 } 992 | COUNTOF '(' type_no_function ')' 993 { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 994 | COUNTOF unary_expression 995 { SemanticError( yylloc, "countof for expressions is currently unimplemented. "); $$ = nullptr; } 992 | COUNT '(' type ')' 993 { 994 // SemanticError( yylloc, "Count is currently unimplemented. "); $$ = nullptr; 995 $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuildType( $3 ) ) ); 996 } 996 997 ; 997 998 … … 1625 1626 { SemanticError( yylloc, "syntax error, missing low/high value for up/down-to range so index is uninitialized." ); $$ = nullptr; } 1626 1627 1627 | comma_expression ';' enum_ key// CFA, enum type1628 { 1629 $$ = enumRangeCtrl( $1, new ExpressionNode( new ast::TypeExpr( 1630 } 1631 | comma_expression ';' downupdowneq enum_ key// CFA, enum type, reverse direction1628 | comma_expression ';' enum_type // CFA, enum type 1629 { 1630 $$ = enumRangeCtrl( $1, new ExpressionNode( new ast::TypeExpr(yylloc, $3->buildType() ) ) ); 1631 } 1632 | comma_expression ';' downupdowneq enum_type // CFA, enum type, reverse direction 1632 1633 { 1633 1634 if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { … … 1636 1637 SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr; 1637 1638 } 1638 ;1639 1640 enum_key:1641 type_name1642 { $$ = DeclarationNode::newEnum( $1->symbolic.name, nullptr, false, false ); }1643 | ENUM identifier1644 { $$ = DeclarationNode::newEnum( $2, nullptr, false, false ); }1645 | ENUM type_name1646 { $$ = DeclarationNode::newEnum( $2->symbolic.name, nullptr, false, false ); }1647 1639 ; 1648 1640
Note: See TracChangeset
for help on using the changeset viewer.