Changeset dd54139 for src/Parser/parser.yy
- Timestamp:
- Nov 16, 2024, 6:36:58 PM (12 hours ago)
- Branches:
- master
- Children:
- ea10f64
- Parents:
- 95707a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r95707a3 rdd54139 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 13 12:18:15202413 // Update Count : 6 84512 // Last Modified On : Fri Nov 15 15:01:33 2024 13 // Update Count : 6915 14 14 // 15 15 … … 24 24 // the grammar. 25 25 26 // The root language for this grammar is ANSI99/11 C. All of ANSI99/11 is parsed, except for: 27 // 28 // designation with '=' (use ':' instead) 29 // 30 // This incompatibility is discussed in detail before the "designation" grammar rule. Most of the syntactic extensions 31 // from ANSI90 to ANSI11 C are marked with the comment "C99/C11". 26 // The root language for this grammar is ANSI99/11 C. All of ANSI99/11 is parsed. Most of the syntactic extensions from 27 // ANSI90 to ANSI11 C are marked with the comment "C99/C11". 32 28 33 29 // This grammar also has two levels of extensions. The first extensions cover most of the GCC C extensions. All of the … … 1170 1166 // comma_expression in cfa_identifier_parameter_array and cfa_abstract_array 1171 1167 '[' ',' ']' 1172 { $$ = new ExpressionNode( build_tuple( yylloc, nullptr ) ); } 1168 // { $$ = new ExpressionNode( build_tuple( yylloc, nullptr ) ); } 1169 { SemanticError( yylloc, "Empty tuple is meaningless." ); $$ = nullptr; } 1173 1170 | '[' assignment_expression ',' ']' 1174 1171 { $$ = new ExpressionNode( build_tuple( yylloc, $2 ) ); } … … 1224 1221 | DIRECTIVE 1225 1222 { $$ = new StatementNode( build_directive( yylloc, $1 ) ); } 1223 // | attribute ';' 1224 // { $$ = new StatementNode( $1 ); } 1226 1225 ; 1227 1226 … … 2057 2056 | cfa_abstract_tuple identifier_or_type_name asm_name_opt 2058 2057 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 2059 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name asm_name_opt 2060 { $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); } 2058 | multi_array_dimension cfa_abstract_tuple identifier_or_type_name asm_name_opt 2059 { $$ = $2->addNewArray( $1 )->addName( $3 )->addAsmName( $4 ); } 2060 | multi_array_dimension type_qualifier_list cfa_abstract_tuple identifier_or_type_name asm_name_opt 2061 { $$ = $3->addNewArray( $1 )->addQualifiers( $2 )->addName( $4 )->addAsmName( $5 ); } 2061 2062 2062 2063 // [ int s, int t ]; // declare s and t … … 4223 4224 cfa_identifier_parameter_ptr 4224 4225 | cfa_identifier_parameter_array 4226 | type_qualifier_list cfa_identifier_parameter_array 4227 { $$ = $2->addQualifiers( $1 ); } 4225 4228 ; 4226 4229 … … 4246 4249 '[' ']' type_specifier_nobody 4247 4250 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4251 | '[' ']' cfa_abstract_tuple 4252 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4248 4253 | cfa_array_parameter_1st_dimension type_specifier_nobody 4254 { $$ = $2->addNewArray( $1 ); } 4255 | cfa_array_parameter_1st_dimension cfa_abstract_tuple 4249 4256 { $$ = $2->addNewArray( $1 ); } 4250 4257 | '[' ']' multi_array_dimension type_specifier_nobody 4251 4258 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4259 | '[' ']' multi_array_dimension cfa_abstract_tuple 4260 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4252 4261 | cfa_array_parameter_1st_dimension multi_array_dimension type_specifier_nobody 4253 4262 { $$ = $3->addNewArray( $2 )->addNewArray( $1 ); } 4263 | cfa_array_parameter_1st_dimension multi_array_dimension cfa_abstract_tuple 4264 { $$ = $3->addNewArray( $2 )->addNewArray( $1 ); } 4254 4265 | multi_array_dimension type_specifier_nobody 4266 { $$ = $2->addNewArray( $1 ); } 4267 | multi_array_dimension cfa_abstract_tuple 4255 4268 { $$ = $2->addNewArray( $1 ); } 4256 4269
Note: See TracChangeset
for help on using the changeset viewer.