Changes in src/Parser/parser.yy [ecf3812:1a8b17a]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
recf3812 r1a8b17a 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 15 15:01:33202413 // Update Count : 6 91512 // Last Modified On : Sun Oct 13 12:18:15 2024 13 // Update Count : 6845 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. Most of the syntactic extensions from 27 // 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, 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". 28 32 29 33 // This grammar also has two levels of extensions. The first extensions cover most of the GCC C extensions. All of the … … 979 983 { $$ = new ExpressionNode( new ast::VirtualCastExpr( yylloc, maybeMoveBuild( $5 ), maybeMoveBuildType( $3 ) ) ); } 980 984 | '(' RETURN type_no_function ')' cast_expression // CFA 981 { $$ = new ExpressionNode( build_cast( yylloc, $3, $5, ast:: ReturnCast) ); }985 { $$ = new ExpressionNode( build_cast( yylloc, $3, $5, ast::CastExpr::Return ) ); } 982 986 | '(' COERCE type_no_function ')' cast_expression // CFA 983 987 { SemanticError( yylloc, "Coerce cast is currently unimplemented." ); $$ = nullptr; } … … 1166 1170 // comma_expression in cfa_identifier_parameter_array and cfa_abstract_array 1167 1171 '[' ',' ']' 1168 // { $$ = new ExpressionNode( build_tuple( yylloc, nullptr ) ); } 1169 { SemanticError( yylloc, "Empty tuple is meaningless." ); $$ = nullptr; } 1172 { $$ = new ExpressionNode( build_tuple( yylloc, nullptr ) ); } 1170 1173 | '[' assignment_expression ',' ']' 1171 1174 { $$ = new ExpressionNode( build_tuple( yylloc, $2 ) ); } … … 1221 1224 | DIRECTIVE 1222 1225 { $$ = new StatementNode( build_directive( yylloc, $1 ) ); } 1223 // | attribute ';'1224 // { $$ = new StatementNode( $1 ); }1225 1226 ; 1226 1227 … … 2056 2057 | cfa_abstract_tuple identifier_or_type_name asm_name_opt 2057 2058 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 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 ); } 2059 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name asm_name_opt 2060 { $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); } 2062 2061 2063 2062 // [ int s, int t ]; // declare s and t … … 4224 4223 cfa_identifier_parameter_ptr 4225 4224 | cfa_identifier_parameter_array 4226 | type_qualifier_list cfa_identifier_parameter_array4227 { $$ = $2->addQualifiers( $1 ); }4228 4225 ; 4229 4226 … … 4249 4246 '[' ']' type_specifier_nobody 4250 4247 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4251 | '[' ']' cfa_abstract_tuple4252 { $$ = $3->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }4253 4248 | cfa_array_parameter_1st_dimension type_specifier_nobody 4254 { $$ = $2->addNewArray( $1 ); }4255 | cfa_array_parameter_1st_dimension cfa_abstract_tuple4256 4249 { $$ = $2->addNewArray( $1 ); } 4257 4250 | '[' ']' multi_array_dimension type_specifier_nobody 4258 4251 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); } 4259 | '[' ']' multi_array_dimension cfa_abstract_tuple4260 { $$ = $4->addNewArray( $3 )->addNewArray( DeclarationNode::newArray( nullptr, nullptr, false ) ); }4261 4252 | cfa_array_parameter_1st_dimension multi_array_dimension type_specifier_nobody 4262 4253 { $$ = $3->addNewArray( $2 )->addNewArray( $1 ); } 4263 | cfa_array_parameter_1st_dimension multi_array_dimension cfa_abstract_tuple4264 { $$ = $3->addNewArray( $2 )->addNewArray( $1 ); }4265 4254 | multi_array_dimension type_specifier_nobody 4266 { $$ = $2->addNewArray( $1 ); }4267 | multi_array_dimension cfa_abstract_tuple4268 4255 { $$ = $2->addNewArray( $1 ); } 4269 4256
Note:
See TracChangeset
for help on using the changeset viewer.