- Timestamp:
- Jun 9, 2023, 2:30:05 PM (23 months ago)
- Branches:
- ast-experimental, master
- Children:
- 37b2c2c
- Parents:
- 01fac29
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/parser.yy ¶
r01fac29 r0442f93f 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 6 22:37:59202313 // Update Count : 634 012 // Last Modified On : Wed Jun 7 14:32:28 2023 13 // Update Count : 6341 14 14 // 15 15 … … 689 689 // | RESUME '(' comma_expression ')' compound_statement 690 690 // { SemanticError( yylloc, "Resume expression is currently unimplemented." ); $$ = nullptr; } 691 | IDENTIFIER IDENTIFIER // syntax error691 | IDENTIFIER IDENTIFIER // invalid syntax rules 692 692 { IdentifierBeforeIdentifier( *$1.str, *$2.str, "n expression" ); $$ = nullptr; } 693 | IDENTIFIER type_qualifier // syntax error693 | IDENTIFIER type_qualifier // invalid syntax rules 694 694 { IdentifierBeforeType( *$1.str, "type qualifier" ); $$ = nullptr; } 695 | IDENTIFIER storage_class // syntax error695 | IDENTIFIER storage_class // invalid syntax rules 696 696 { IdentifierBeforeType( *$1.str, "storage class" ); $$ = nullptr; } 697 | IDENTIFIER basic_type_name // syntax error697 | IDENTIFIER basic_type_name // invalid syntax rules 698 698 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 699 | IDENTIFIER TYPEDEFname // syntax error699 | IDENTIFIER TYPEDEFname // invalid syntax rules 700 700 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 701 | IDENTIFIER TYPEGENname // syntax error701 | IDENTIFIER TYPEGENname // invalid syntax rules 702 702 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 703 703 ; … … 1152 1152 identifier_or_type_name ':' attribute_list_opt statement 1153 1153 { $$ = $4->add_label( yylloc, $1, $3 ); } 1154 | identifier_or_type_name ':' attribute_list_opt error // syntax error1154 | identifier_or_type_name ':' attribute_list_opt error // invalid syntax rule 1155 1155 { 1156 1156 SemanticError( yylloc, ::toString( "syntx error, label \"", *$1.str, "\" must be associated with a statement, " … … 1193 1193 | statement_list_nodecl statement 1194 1194 { assert( $1 ); $1->set_last( $2 ); $$ = $1; } 1195 | statement_list_nodecl error // syntax error1195 | statement_list_nodecl error // invalid syntax rule 1196 1196 { SemanticError( yylloc, "syntax error, declarations only allowed at the start of the switch body, i.e., after the '{'." ); $$ = nullptr; } 1197 1197 ; … … 1219 1219 $$ = $7 ? new StatementNode( build_compound( yylloc, (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 1220 1220 } 1221 | SWITCH '(' comma_expression ')' '{' error '}' // CFA, syntaxerror1221 | SWITCH '(' comma_expression ')' '{' error '}' // CFA, invalid syntax rule error 1222 1222 { SemanticError( yylloc, "synatx error, declarations can only appear before the list of case clauses." ); $$ = nullptr; } 1223 1223 | CHOOSE '(' comma_expression ')' case_clause // CFA … … 1228 1228 $$ = $7 ? new StatementNode( build_compound( yylloc, (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 1229 1229 } 1230 | CHOOSE '(' comma_expression ')' '{' error '}' // CFA, syntax error1230 | CHOOSE '(' comma_expression ')' '{' error '}' // CFA, invalid syntax rule 1231 1231 { SemanticError( yylloc, "syntax error, declarations can only appear before the list of case clauses." ); $$ = nullptr; } 1232 1232 ; … … 1268 1268 1269 1269 case_label: // CFA 1270 CASE error // syntax error1270 CASE error // invalid syntax rule 1271 1271 { SemanticError( yylloc, "syntax error, case list missing after case." ); $$ = nullptr; } 1272 1272 | CASE case_value_list ':' { $$ = $2; } 1273 | CASE case_value_list error // syntax error1273 | CASE case_value_list error // invalid syntax rule 1274 1274 { SemanticError( yylloc, "syntax error, colon missing after case list." ); $$ = nullptr; } 1275 1275 | DEFAULT ':' { $$ = new ClauseNode( build_default( yylloc ) ); } 1276 1276 // A semantic check is required to ensure only one default clause per switch/choose statement. 1277 | DEFAULT error // syntax error1277 | DEFAULT error // invalid syntax rules 1278 1278 { SemanticError( yylloc, "syntax error, colon missing after default." ); $$ = nullptr; } 1279 1279 ; … … 1405 1405 else { SemanticError( yylloc, MISSING_HIGH ); $$ = nullptr; } 1406 1406 } 1407 | comma_expression updowneq comma_expression '~' '@' // CFA, error1407 | comma_expression updowneq comma_expression '~' '@' // CFA, invalid syntax rules 1408 1408 { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; } 1409 | '@' updowneq '@' // CFA, error1409 | '@' updowneq '@' // CFA, invalid syntax rules 1410 1410 { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; } 1411 | '@' updowneq comma_expression '~' '@' // CFA, error1411 | '@' updowneq comma_expression '~' '@' // CFA, invalid syntax rules 1412 1412 { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; } 1413 | comma_expression updowneq '@' '~' '@' // CFA, error1413 | comma_expression updowneq '@' '~' '@' // CFA, invalid syntax rules 1414 1414 { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; } 1415 | '@' updowneq '@' '~' '@' // CFA, error1415 | '@' updowneq '@' '~' '@' // CFA, invalid syntax rules 1416 1416 { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; } 1417 1417 … … 1434 1434 else $$ = forCtrl( yylloc, $3, $1, $3->clone(), $4, nullptr, NEW_ONE ); 1435 1435 } 1436 | comma_expression ';' '@' updowneq '@' // CFA, error1436 | comma_expression ';' '@' updowneq '@' // CFA, invalid syntax rules 1437 1437 { SemanticError( yylloc, "syntax error, missing low/high value for up/down-to range so index is uninitialized." ); $$ = nullptr; } 1438 1438 1439 1439 | comma_expression ';' comma_expression updowneq comma_expression '~' comma_expression // CFA 1440 1440 { $$ = forCtrl( yylloc, $3, $1, UPDOWN( $4, $3->clone(), $5 ), $4, UPDOWN( $4, $5->clone(), $3->clone() ), $7 ); } 1441 | comma_expression ';' '@' updowneq comma_expression '~' comma_expression // CFA, error1441 | comma_expression ';' '@' updowneq comma_expression '~' comma_expression // CFA, invalid syntax rules 1442 1442 { 1443 1443 if ( $4 == OperKinds::LThan || $4 == OperKinds::LEThan ) { SemanticError( yylloc, MISSING_LOW ); $$ = nullptr; } … … 1452 1452 | comma_expression ';' comma_expression updowneq comma_expression '~' '@' // CFA 1453 1453 { $$ = forCtrl( yylloc, $3, $1, UPDOWN( $4, $3->clone(), $5 ), $4, UPDOWN( $4, $5->clone(), $3->clone() ), nullptr ); } 1454 | comma_expression ';' '@' updowneq comma_expression '~' '@' // CFA, error1454 | comma_expression ';' '@' updowneq comma_expression '~' '@' // CFA, invalid syntax rules 1455 1455 { 1456 1456 if ( $4 == OperKinds::LThan || $4 == OperKinds::LEThan ) { SemanticError( yylloc, MISSING_LOW ); $$ = nullptr; } … … 1511 1511 else $$ = forCtrl( yylloc, $1, $2, $3, nullptr, nullptr ); 1512 1512 } 1513 | declaration '@' updowneq '@' '~' '@' // CFA, error1513 | declaration '@' updowneq '@' '~' '@' // CFA, invalid syntax rules 1514 1514 { SemanticError( yylloc, "syntax error, missing low/high value for up/down-to range so index is uninitialized." ); $$ = nullptr; } 1515 1515 … … 1522 1522 { 1523 1523 if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { 1524 SemanticError( yylloc, " All enumeration ranges are equal (all values). Remove \"=~\"." ); $$ = nullptr;1524 SemanticError( yylloc, "syntax error, all enumeration ranges are equal (all values). Remove \"=~\"." ); $$ = nullptr; 1525 1525 } 1526 1526 SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr; … … 1666 1666 { $$ = build_waitfor_timeout( yylloc, $1, $3, $4, maybe_build_compound( yylloc, $5 ) ); } 1667 1667 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1668 | wor_waitfor_clause wor when_clause_opt timeout statement wor ELSE statement // syntax error1668 | wor_waitfor_clause wor when_clause_opt timeout statement wor ELSE statement // invalid syntax rules 1669 1669 { SemanticError( yylloc, "syntax error, else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1670 1670 | wor_waitfor_clause wor when_clause_opt timeout statement wor when_clause ELSE statement … … 1711 1711 { $$ = new ast::WaitUntilStmt::ClauseNode( ast::WaitUntilStmt::ClauseNode::Op::LEFT_OR, $1, build_waituntil_timeout( yylloc, $3, $4, maybe_build_compound( yylloc, $5 ) ) ); } 1712 1712 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1713 | wor_waituntil_clause wor when_clause_opt timeout statement wor ELSE statement // syntax error1713 | wor_waituntil_clause wor when_clause_opt timeout statement wor ELSE statement // invalid syntax rules 1714 1714 { SemanticError( yylloc, "syntax error, else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1715 1715 | wor_waituntil_clause wor when_clause_opt timeout statement wor when_clause ELSE statement … … 2102 2102 | type_declaration_specifier 2103 2103 | sue_declaration_specifier 2104 | sue_declaration_specifier invalid_types 2104 | sue_declaration_specifier invalid_types // invalid syntax rule 2105 2105 { 2106 2106 SemanticError( yylloc, ::toString( "syntax error, expecting ';' at end of ", … … 2586 2586 // } // for 2587 2587 } 2588 | type_specifier field_declaring_list_opt '}' 2588 | type_specifier field_declaring_list_opt '}' // invalid syntax rule 2589 2589 { 2590 2590 SemanticError( yylloc, ::toString( "syntax error, expecting ';' at end of previous declaration." ) ); … … 3175 3175 | IDENTIFIER IDENTIFIER 3176 3176 { IdentifierBeforeIdentifier( *$1.str, *$2.str, " declaration" ); $$ = nullptr; } 3177 | IDENTIFIER type_qualifier // syntax error3177 | IDENTIFIER type_qualifier // invalid syntax rules 3178 3178 { IdentifierBeforeType( *$1.str, "type qualifier" ); $$ = nullptr; } 3179 | IDENTIFIER storage_class // syntax error3179 | IDENTIFIER storage_class // invalid syntax rules 3180 3180 { IdentifierBeforeType( *$1.str, "storage class" ); $$ = nullptr; } 3181 | IDENTIFIER basic_type_name // syntax error3181 | IDENTIFIER basic_type_name // invalid syntax rules 3182 3182 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 3183 | IDENTIFIER TYPEDEFname // syntax error3183 | IDENTIFIER TYPEDEFname // invalid syntax rules 3184 3184 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 3185 | IDENTIFIER TYPEGENname // syntax error3185 | IDENTIFIER TYPEGENname // invalid syntax rules 3186 3186 { IdentifierBeforeType( *$1.str, "type" ); $$ = nullptr; } 3187 3187 | external_function_definition
Note: See TracChangeset
for help on using the changeset viewer.