Changeset dbedd71 for src/Parser
- Timestamp:
- Aug 12, 2022, 9:05:32 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 283876d
- Parents:
- 4962741
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/parser.yy ¶
r4962741 rdbedd71 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Aug 9 17:21:46202213 // Update Count : 56 2912 // Last Modified On : Fri Aug 12 07:59:58 2022 13 // Update Count : 5649 14 14 // 15 15 … … 1329 1329 | comma_expression updowneq comma_expression // CFA 1330 1330 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), UPDOWN( $2, $1->clone(), $3 ), $2, UPDOWN( $2, $3->clone(), $1->clone() ), NEW_ONE ); } 1331 | '@' updowneq comma_expression // CFA, error 1332 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; } 1331 | '@' updowneq comma_expression // CFA 1332 { 1333 if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1334 else $$ = forCtrl( $3, new string( DeclarationNode::anonymous.newName() ), $3->clone(), $2, nullptr, NEW_ONE ); 1335 } 1333 1336 | comma_expression updowneq '@' // CFA 1334 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; } 1335 1337 { 1338 if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing comparison ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1339 else { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1340 } 1336 1341 | comma_expression updowneq comma_expression '~' comma_expression // CFA 1337 1342 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), UPDOWN( $2, $1->clone(), $3 ), $2, UPDOWN( $2, $3->clone(), $1->clone() ), $5 ); } 1338 | '@' updowneq comma_expression '~' comma_expression // CFA, error 1339 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; } 1340 | comma_expression updowneq '@' '~' comma_expression // CFA, error 1341 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; } 1343 | '@' updowneq comma_expression '~' comma_expression // CFA 1344 { 1345 if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1346 else $$ = forCtrl( $3, new string( DeclarationNode::anonymous.newName() ), $3->clone(), $2, nullptr, $5 ); 1347 } 1348 | comma_expression updowneq '@' '~' comma_expression // CFA 1349 { 1350 if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing comparison ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1351 else { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1352 } 1342 1353 | comma_expression updowneq comma_expression '~' '@' // CFA, error 1343 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; }1354 { SemanticError( yylloc, "Missing increment ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1344 1355 | '@' updowneq comma_expression '~' '@' // CFA, error 1345 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; }1356 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1346 1357 | comma_expression updowneq '@' '~' '@' // CFA, error 1347 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is not useful." ); $$ = nullptr; } 1358 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1359 | '@' updowneq '@' '~' '@' // CFA, error 1360 { SemanticError( yylloc, "Missing loop fields ('@') with an anonymous loop index is meaningless." ); $$ = nullptr; } 1348 1361 1349 1362 | comma_expression ';' comma_expression // CFA … … 1354 1367 | comma_expression ';' comma_expression updowneq comma_expression // CFA 1355 1368 { $$ = forCtrl( $3, $1, UPDOWN( $4, $3->clone(), $5 ), $4, UPDOWN( $4, $5->clone(), $3->clone() ), NEW_ONE ); } 1356 | comma_expression ';' '@' updowneq comma_expression // CFA, error 1369 | comma_expression ';' '@' updowneq comma_expression // CFA 1370 { 1371 if ( $4 == OperKinds::LThan || $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1372 else $$ = forCtrl( $5, $1, $5->clone(), $4, nullptr, NEW_ONE ); 1373 } 1374 | comma_expression ';' comma_expression updowneq '@' // CFA 1375 { 1376 if ( $4 == OperKinds::GThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1377 else if ( $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1378 else $$ = forCtrl( $3, $1, $3->clone(), $4, nullptr, NEW_ONE ); 1379 } 1380 | comma_expression ';' '@' updowneq '@' // CFA, error 1357 1381 { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1358 | comma_expression ';' comma_expression updowneq '@' // CFA1359 {1360 if ( $4 == OperKinds::LEThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Decrement with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; }1361 else $$ = forCtrl( $3, $1, $3->clone(), $4, nullptr, NEW_ONE );1362 }1363 1382 1364 1383 | comma_expression ';' comma_expression updowneq comma_expression '~' comma_expression // CFA 1365 1384 { $$ = forCtrl( $3, $1, UPDOWN( $4, $3->clone(), $5 ), $4, UPDOWN( $4, $5->clone(), $3->clone() ), $7 ); } 1366 1385 | comma_expression ';' '@' updowneq comma_expression '~' comma_expression // CFA, error 1367 { SemanticError( yylloc, "Missing start declaration so cannot compare." ); $$ = nullptr; } 1386 { 1387 if ( $4 == OperKinds::LThan || $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1388 else $$ = forCtrl( $5, $1, $5->clone(), $4, nullptr, $7 ); 1389 } 1368 1390 | comma_expression ';' comma_expression updowneq '@' '~' comma_expression // CFA 1369 1391 { 1370 if ( $4 == OperKinds::LEThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Equal for comparison is meaningless with missing comparison. Use \"~\"." ); $$ = nullptr; } 1392 if ( $4 == OperKinds::GThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1393 else if ( $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1371 1394 else $$ = forCtrl( $3, $1, $3->clone(), $4, nullptr, $7 ); 1372 1395 } … … 1374 1397 { $$ = forCtrl( $3, $1, UPDOWN( $4, $3->clone(), $5 ), $4, UPDOWN( $4, $5->clone(), $3->clone() ), nullptr ); } 1375 1398 | comma_expression ';' '@' updowneq comma_expression '~' '@' // CFA, error 1376 { SemanticError( yylloc, "Missing start declaration so cannot compare." ); $$ = nullptr; } 1399 { 1400 if ( $4 == OperKinds::LThan || $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1401 else $$ = forCtrl( $5, $1, $5->clone(), $4, nullptr, nullptr ); 1402 } 1377 1403 | comma_expression ';' comma_expression updowneq '@' '~' '@' // CFA 1378 1404 { 1379 if ( $4 == OperKinds::GThan ) { SemanticError( yylloc, "Negative range \"-~\" is meaningless when comparison and iterator are empty. Use \"~\"." ); $$ = nullptr; }1380 else if ( $4 == OperKinds::LEThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Equal for comparison is meaningless with missing comparison. Use \"~\"." ); $$ = nullptr; }1405 if ( $4 == OperKinds::GThan || $4 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1406 else if ( $4 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1381 1407 else $$ = forCtrl( $3, $1, $3->clone(), $4, nullptr, nullptr ); 1382 1408 } 1409 | comma_expression ';' '@' updowneq '@' '~' '@' // CFA 1410 { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1383 1411 1384 1412 | declaration comma_expression // CFA … … 1389 1417 | declaration comma_expression updowneq comma_expression // CFA 1390 1418 { $$ = forCtrl( $1, UPDOWN( $3, $2->clone(), $4 ), $3, UPDOWN( $3, $4->clone(), $2->clone() ), NEW_ONE ); } 1391 | declaration '@' updowneq comma_expression // CFA, error 1392 { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1419 | declaration '@' updowneq comma_expression // CFA 1420 { 1421 if ( $3 == OperKinds::LThan || $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1422 else $$ = forCtrl( $1, $4, $3, nullptr, NEW_ONE ); 1423 } 1393 1424 | declaration comma_expression updowneq '@' // CFA 1394 1425 { 1395 if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Decrement with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1426 if ( $3 == OperKinds::GThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1427 else if ( $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1396 1428 else $$ = forCtrl( $1, $2, $3, nullptr, NEW_ONE ); 1397 1429 } … … 1399 1431 | declaration comma_expression updowneq comma_expression '~' comma_expression // CFA 1400 1432 { $$ = forCtrl( $1, UPDOWN( $3, $2, $4 ), $3, UPDOWN( $3, $4->clone(), $2->clone() ), $6 ); } 1401 | declaration '@' updowneq comma_expression '~' comma_expression // CFA, error 1402 { SemanticError( yylloc, "Missing start declaration so cannot compare." ); $$ = nullptr; } 1433 | declaration '@' updowneq comma_expression '~' comma_expression // CFA 1434 { 1435 if ( $3 == OperKinds::LThan || $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1436 else $$ = forCtrl( $1, $4, $3, nullptr, $6 ); 1437 } 1403 1438 | declaration comma_expression updowneq '@' '~' comma_expression // CFA 1404 1439 { 1405 if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Equal for comparison is meaningless with missing comparison. Use \"~\"." ); $$ = nullptr; } 1440 if ( $3 == OperKinds::GThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1441 else if ( $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1406 1442 else $$ = forCtrl( $1, $2, $3, nullptr, $6 ); 1407 1443 } 1408 1444 | declaration comma_expression updowneq comma_expression '~' '@' // CFA 1409 1445 { $$ = forCtrl( $1, UPDOWN( $3, $2, $4 ), $3, UPDOWN( $3, $4->clone(), $2->clone() ), nullptr ); } 1410 | declaration '@' updowneq comma_expression '~' '@' // CFA, error 1411 { SemanticError( yylloc, "Missing start declaration so cannot compare." ); $$ = nullptr; } 1446 | declaration '@' updowneq comma_expression '~' '@' // CFA 1447 { 1448 if ( $3 == OperKinds::LThan || $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1449 else $$ = forCtrl( $1, $4, $3, nullptr, nullptr ); 1450 } 1412 1451 | declaration comma_expression updowneq '@' '~' '@' // CFA 1413 1452 { 1414 if ( $3 == OperKinds::GThan ) { SemanticError( yylloc, "Negative range \"-~\" is meaningless when comparison and iterator are empty. Use \"~\"." ); $$ = nullptr; }1415 else if ( $3 == OperKinds::LEThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Equal for comparison is meaningless with missing comparison. Use \"~\"." ); $$ = nullptr; }1453 if ( $3 == OperKinds::GThan || $3 == OperKinds::GEThan ) { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1454 else if ( $3 == OperKinds::LEThan ) { SemanticError( yylloc, "Equality with missing comparison is meaningless. Use \"~\"." ); $$ = nullptr; } 1416 1455 else $$ = forCtrl( $1, $2, $3, nullptr, nullptr ); 1417 1456 } 1457 | declaration '@' updowneq '@' '~' '@' // CFA, error 1458 { SemanticError( yylloc, "Missing start value so cannot compare." ); $$ = nullptr; } 1418 1459 1419 1460 | comma_expression ';' TYPEDEFname // CFA, array type
Note: See TracChangeset
for help on using the changeset viewer.