[Monodevelop-patches-list] r2597 - in trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory: . src/Parser/generated
Jacob Ilsø Christensen <jacobilsoe@gmail.com>
jacobilsoe at mono-cvs.ximian.com
Mon Jun 13 10:54:44 EDT 2005
Author: jacobilsoe
Date: 2005-06-13 10:54:44 -0400 (Mon, 13 Jun 2005)
New Revision: 2597
Modified:
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
Log:
Fixed location of get/set regions of properties
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-06-11 12:25:16 UTC (rev 2596)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-06-13 14:54:44 UTC (rev 2597)
@@ -1,3 +1,9 @@
+2005-06-13 Jacob Ilsø Christensen <jacobilsoe at gmail.com>
+
+ * src/Parser/generated/cs.ATG:
+ * src/Parser/generated/Parser.cs: Make sure that properties
+ have the location of their get/set regions set correctly.
+
2005-04-17 John Luke <john.luke at gmail.com>
* Makefile.am: fix distcheck
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-06-11 12:25:16 UTC (rev 2596)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-06-13 14:54:44 UTC (rev 2597)
@@ -772,43 +772,43 @@
}
void Expr(
-#line 1759 "cs.ATG"
+#line 1767 "cs.ATG"
out Expression expr) {
-#line 1760 "cs.ATG"
+#line 1768 "cs.ATG"
expr = null; Expression expr1 = null, expr2 = null;
UnaryExpr(
-#line 1762 "cs.ATG"
+#line 1770 "cs.ATG"
out expr);
if (StartOf(5)) {
ConditionalOrExpr(
-#line 1765 "cs.ATG"
+#line 1773 "cs.ATG"
ref expr);
if (la.kind == 11) {
lexer.NextToken();
Expr(
-#line 1765 "cs.ATG"
+#line 1773 "cs.ATG"
out expr1);
Expect(9);
Expr(
-#line 1765 "cs.ATG"
+#line 1773 "cs.ATG"
out expr2);
-#line 1765 "cs.ATG"
+#line 1773 "cs.ATG"
expr = new ConditionalExpression(expr, expr1, expr2);
}
} else if (StartOf(6)) {
-#line 1767 "cs.ATG"
+#line 1775 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1767 "cs.ATG"
+#line 1775 "cs.ATG"
out op);
Expr(
-#line 1767 "cs.ATG"
+#line 1775 "cs.ATG"
out val);
-#line 1767 "cs.ATG"
+#line 1775 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else SynErr(128);
}
@@ -2540,11 +2540,11 @@
}
void Block(
-#line 1404 "cs.ATG"
+#line 1412 "cs.ATG"
out Statement stmt) {
Expect(14);
-#line 1406 "cs.ATG"
+#line 1414 "cs.ATG"
BlockStatement blockStmt = new BlockStatement();
blockStmt.StartLocation = t.Location;
compilationUnit.BlockStart(blockStmt);
@@ -2554,7 +2554,7 @@
}
Expect(15);
-#line 1411 "cs.ATG"
+#line 1419 "cs.ATG"
stmt = blockStmt;
blockStmt.EndLocation = t.EndLocation;
compilationUnit.BlockEnd();
@@ -2562,34 +2562,34 @@
}
void VariableDeclarator(
-#line 1397 "cs.ATG"
+#line 1405 "cs.ATG"
ArrayList fieldDeclaration) {
-#line 1398 "cs.ATG"
+#line 1406 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1400 "cs.ATG"
+#line 1408 "cs.ATG"
VariableDeclaration f = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
VariableInitializer(
-#line 1401 "cs.ATG"
+#line 1409 "cs.ATG"
out expr);
-#line 1401 "cs.ATG"
+#line 1409 "cs.ATG"
f.Initializer = expr;
}
-#line 1401 "cs.ATG"
+#line 1409 "cs.ATG"
fieldDeclaration.Add(f);
}
void EventAccessorDecls(
-#line 1346 "cs.ATG"
+#line 1354 "cs.ATG"
out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
-#line 1347 "cs.ATG"
+#line 1355 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
Statement stmt;
@@ -2598,102 +2598,102 @@
while (la.kind == 16) {
AttributeSection(
-#line 1354 "cs.ATG"
+#line 1362 "cs.ATG"
out section);
-#line 1354 "cs.ATG"
+#line 1362 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1356 "cs.ATG"
+#line 1364 "cs.ATG"
IdentIsAdd()) {
-#line 1356 "cs.ATG"
+#line 1364 "cs.ATG"
addBlock = new EventAddRegion(attributes);
AddAccessorDecl(
-#line 1357 "cs.ATG"
+#line 1365 "cs.ATG"
out stmt);
-#line 1357 "cs.ATG"
+#line 1365 "cs.ATG"
attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt;
while (la.kind == 16) {
AttributeSection(
-#line 1358 "cs.ATG"
+#line 1366 "cs.ATG"
out section);
-#line 1358 "cs.ATG"
+#line 1366 "cs.ATG"
attributes.Add(section);
}
RemoveAccessorDecl(
-#line 1359 "cs.ATG"
+#line 1367 "cs.ATG"
out stmt);
-#line 1359 "cs.ATG"
+#line 1367 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt;
} else if (
-#line 1360 "cs.ATG"
+#line 1368 "cs.ATG"
IdentIsRemove()) {
RemoveAccessorDecl(
-#line 1361 "cs.ATG"
+#line 1369 "cs.ATG"
out stmt);
-#line 1361 "cs.ATG"
+#line 1369 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList();
while (la.kind == 16) {
AttributeSection(
-#line 1362 "cs.ATG"
+#line 1370 "cs.ATG"
out section);
-#line 1362 "cs.ATG"
+#line 1370 "cs.ATG"
attributes.Add(section);
}
AddAccessorDecl(
-#line 1363 "cs.ATG"
+#line 1371 "cs.ATG"
out stmt);
-#line 1363 "cs.ATG"
+#line 1371 "cs.ATG"
addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt;
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1364 "cs.ATG"
+#line 1372 "cs.ATG"
Error("add or remove accessor declaration expected");
} else SynErr(157);
}
void ConstructorInitializer(
-#line 1433 "cs.ATG"
+#line 1441 "cs.ATG"
out ConstructorInitializer ci) {
-#line 1434 "cs.ATG"
+#line 1442 "cs.ATG"
Expression expr; ci = new ConstructorInitializer();
Expect(9);
if (la.kind == 50) {
lexer.NextToken();
-#line 1438 "cs.ATG"
+#line 1446 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.Base;
} else if (la.kind == 110) {
lexer.NextToken();
-#line 1439 "cs.ATG"
+#line 1447 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.This;
} else SynErr(158);
Expect(18);
if (StartOf(21)) {
Argument(
-#line 1442 "cs.ATG"
+#line 1450 "cs.ATG"
out expr);
-#line 1442 "cs.ATG"
+#line 1450 "cs.ATG"
ci.Arguments.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1442 "cs.ATG"
+#line 1450 "cs.ATG"
out expr);
-#line 1442 "cs.ATG"
+#line 1450 "cs.ATG"
ci.Arguments.Add(expr);
}
}
@@ -2701,7 +2701,7 @@
}
void OverloadableOperator(
-#line 1454 "cs.ATG"
+#line 1462 "cs.ATG"
out Token op) {
switch (la.kind) {
case 4: {
@@ -2795,7 +2795,7 @@
default: SynErr(159); break;
}
-#line 1463 "cs.ATG"
+#line 1471 "cs.ATG"
op = t;
}
@@ -2886,77 +2886,77 @@
}
void InterfaceAccessors(
-#line 1368 "cs.ATG"
+#line 1376 "cs.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1370 "cs.ATG"
+#line 1378 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
getBlock = null; setBlock = null;
while (la.kind == 16) {
AttributeSection(
-#line 1375 "cs.ATG"
+#line 1383 "cs.ATG"
out section);
-#line 1375 "cs.ATG"
+#line 1383 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1377 "cs.ATG"
+#line 1385 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1377 "cs.ATG"
+#line 1385 "cs.ATG"
getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1378 "cs.ATG"
+#line 1386 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1378 "cs.ATG"
+#line 1386 "cs.ATG"
setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1379 "cs.ATG"
+#line 1387 "cs.ATG"
Error("set or get expected");
} else SynErr(161);
Expect(10);
-#line 1381 "cs.ATG"
+#line 1389 "cs.ATG"
attributes = new ArrayList();
if (la.kind == 1 || la.kind == 16) {
while (la.kind == 16) {
AttributeSection(
-#line 1383 "cs.ATG"
+#line 1391 "cs.ATG"
out section);
-#line 1383 "cs.ATG"
+#line 1391 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1385 "cs.ATG"
+#line 1393 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1385 "cs.ATG"
+#line 1393 "cs.ATG"
if (getBlock != null) Error("get already declared");
else getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1388 "cs.ATG"
+#line 1396 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1388 "cs.ATG"
+#line 1396 "cs.ATG"
if (setBlock != null) Error("set already declared");
else setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1391 "cs.ATG"
+#line 1399 "cs.ATG"
Error("set or get expected");
} else SynErr(162);
Expect(10);
@@ -2972,179 +2972,197 @@
Expect(1);
#line 1334 "cs.ATG"
+ Point startLocation = t.Location;
+
+#line 1335 "cs.ATG"
if (t.val != "get") Error("get expected");
if (la.kind == 14) {
Block(
-#line 1335 "cs.ATG"
+#line 1336 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(163);
-#line 1335 "cs.ATG"
+#line 1337 "cs.ATG"
getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes, m);
+
+#line 1338 "cs.ATG"
+ getBlock.StartLocation = startLocation;
+
+#line 1339 "cs.ATG"
+ getBlock.EndLocation = t.Location;
}
void SetAccessorDecl(
-#line 1338 "cs.ATG"
+#line 1342 "cs.ATG"
out PropertySetRegion setBlock, ArrayList attributes, Modifier m) {
-#line 1339 "cs.ATG"
+#line 1343 "cs.ATG"
Statement stmt = null;
Expect(1);
-#line 1342 "cs.ATG"
+#line 1346 "cs.ATG"
+ Point startLocation = t.Location;
+
+#line 1347 "cs.ATG"
if (t.val != "set") Error("set expected");
if (la.kind == 14) {
Block(
-#line 1343 "cs.ATG"
+#line 1348 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(164);
-#line 1343 "cs.ATG"
+#line 1349 "cs.ATG"
setBlock = new PropertySetRegion((BlockStatement)stmt, attributes, m);
+
+#line 1350 "cs.ATG"
+ setBlock.StartLocation = startLocation;
+
+#line 1351 "cs.ATG"
+ setBlock.EndLocation = t.Location;
}
void AddAccessorDecl(
-#line 1417 "cs.ATG"
+#line 1425 "cs.ATG"
out Statement stmt) {
-#line 1418 "cs.ATG"
+#line 1426 "cs.ATG"
stmt = null;
Expect(1);
-#line 1421 "cs.ATG"
+#line 1429 "cs.ATG"
if (t.val != "add") Error("add expected");
Block(
-#line 1422 "cs.ATG"
+#line 1430 "cs.ATG"
out stmt);
}
void RemoveAccessorDecl(
-#line 1425 "cs.ATG"
+#line 1433 "cs.ATG"
out Statement stmt) {
-#line 1426 "cs.ATG"
+#line 1434 "cs.ATG"
stmt = null;
Expect(1);
-#line 1429 "cs.ATG"
+#line 1437 "cs.ATG"
if (t.val != "remove") Error("remove expected");
Block(
-#line 1430 "cs.ATG"
+#line 1438 "cs.ATG"
out stmt);
}
void VariableInitializer(
-#line 1446 "cs.ATG"
+#line 1454 "cs.ATG"
out Expression initializerExpression) {
-#line 1447 "cs.ATG"
+#line 1455 "cs.ATG"
TypeReference type = null; Expression expr = null; initializerExpression = null;
if (StartOf(4)) {
Expr(
-#line 1449 "cs.ATG"
+#line 1457 "cs.ATG"
out initializerExpression);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1450 "cs.ATG"
+#line 1458 "cs.ATG"
out initializerExpression);
} else if (la.kind == 105) {
lexer.NextToken();
Type(
-#line 1451 "cs.ATG"
+#line 1459 "cs.ATG"
out type);
Expect(16);
Expr(
-#line 1451 "cs.ATG"
+#line 1459 "cs.ATG"
out expr);
Expect(17);
-#line 1451 "cs.ATG"
+#line 1459 "cs.ATG"
initializerExpression = new StackAllocExpression(type, expr);
} else SynErr(165);
}
void Statement() {
-#line 1534 "cs.ATG"
+#line 1542 "cs.ATG"
TypeReference type;
Expression expr;
Statement stmt;
if (
-#line 1540 "cs.ATG"
+#line 1548 "cs.ATG"
IsLabel()) {
Expect(1);
-#line 1540 "cs.ATG"
+#line 1548 "cs.ATG"
compilationUnit.AddChild(new LabelStatement(t.val));
Expect(9);
Statement();
} else if (la.kind == 59) {
lexer.NextToken();
Type(
-#line 1543 "cs.ATG"
+#line 1551 "cs.ATG"
out type);
-#line 1543 "cs.ATG"
+#line 1551 "cs.ATG"
LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location;
Expect(1);
-#line 1544 "cs.ATG"
+#line 1552 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1545 "cs.ATG"
+#line 1553 "cs.ATG"
out expr);
-#line 1545 "cs.ATG"
+#line 1553 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1546 "cs.ATG"
+#line 1554 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1546 "cs.ATG"
+#line 1554 "cs.ATG"
out expr);
-#line 1546 "cs.ATG"
+#line 1554 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
}
Expect(10);
-#line 1547 "cs.ATG"
+#line 1555 "cs.ATG"
compilationUnit.AddChild(var);
} else if (
-#line 1549 "cs.ATG"
+#line 1557 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1549 "cs.ATG"
+#line 1557 "cs.ATG"
out stmt);
Expect(10);
-#line 1549 "cs.ATG"
+#line 1557 "cs.ATG"
compilationUnit.AddChild(stmt);
} else if (StartOf(24)) {
EmbeddedStatement(
-#line 1550 "cs.ATG"
+#line 1558 "cs.ATG"
out stmt);
-#line 1550 "cs.ATG"
+#line 1558 "cs.ATG"
compilationUnit.AddChild(stmt);
} else SynErr(166);
}
void Argument(
-#line 1466 "cs.ATG"
+#line 1474 "cs.ATG"
out Expression argumentexpr) {
-#line 1468 "cs.ATG"
+#line 1476 "cs.ATG"
Expression expr;
FieldDirection fd = FieldDirection.None;
@@ -3152,48 +3170,48 @@
if (la.kind == 99) {
lexer.NextToken();
-#line 1473 "cs.ATG"
+#line 1481 "cs.ATG"
fd = FieldDirection.Ref;
} else {
lexer.NextToken();
-#line 1474 "cs.ATG"
+#line 1482 "cs.ATG"
fd = FieldDirection.Out;
}
}
Expr(
-#line 1476 "cs.ATG"
+#line 1484 "cs.ATG"
out expr);
-#line 1476 "cs.ATG"
+#line 1484 "cs.ATG"
argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr;
}
void ArrayInitializer(
-#line 1495 "cs.ATG"
+#line 1503 "cs.ATG"
out Expression outExpr) {
-#line 1497 "cs.ATG"
+#line 1505 "cs.ATG"
Expression expr = null;
ArrayInitializerExpression initializer = new ArrayInitializerExpression();
Expect(14);
if (StartOf(25)) {
VariableInitializer(
-#line 1502 "cs.ATG"
+#line 1510 "cs.ATG"
out expr);
-#line 1502 "cs.ATG"
+#line 1510 "cs.ATG"
initializer.CreateExpressions.Add(expr);
while (
-#line 1502 "cs.ATG"
+#line 1510 "cs.ATG"
NotFinalComma()) {
Expect(12);
VariableInitializer(
-#line 1502 "cs.ATG"
+#line 1510 "cs.ATG"
out expr);
-#line 1502 "cs.ATG"
+#line 1510 "cs.ATG"
initializer.CreateExpressions.Add(expr);
}
if (la.kind == 12) {
@@ -3202,91 +3220,91 @@
}
Expect(15);
-#line 1503 "cs.ATG"
+#line 1511 "cs.ATG"
outExpr = initializer;
}
void AssignmentOperator(
-#line 1479 "cs.ATG"
+#line 1487 "cs.ATG"
out AssignmentOperatorType op) {
-#line 1480 "cs.ATG"
+#line 1488 "cs.ATG"
op = AssignmentOperatorType.None;
switch (la.kind) {
case 3: {
lexer.NextToken();
-#line 1482 "cs.ATG"
+#line 1490 "cs.ATG"
op = AssignmentOperatorType.Assign;
break;
}
case 37: {
lexer.NextToken();
-#line 1483 "cs.ATG"
+#line 1491 "cs.ATG"
op = AssignmentOperatorType.Add;
break;
}
case 38: {
lexer.NextToken();
-#line 1484 "cs.ATG"
+#line 1492 "cs.ATG"
op = AssignmentOperatorType.Subtract;
break;
}
case 39: {
lexer.NextToken();
-#line 1485 "cs.ATG"
+#line 1493 "cs.ATG"
op = AssignmentOperatorType.Multiply;
break;
}
case 40: {
lexer.NextToken();
-#line 1486 "cs.ATG"
+#line 1494 "cs.ATG"
op = AssignmentOperatorType.Divide;
break;
}
case 41: {
lexer.NextToken();
-#line 1487 "cs.ATG"
+#line 1495 "cs.ATG"
op = AssignmentOperatorType.Modulus;
break;
}
case 42: {
lexer.NextToken();
-#line 1488 "cs.ATG"
+#line 1496 "cs.ATG"
op = AssignmentOperatorType.BitwiseAnd;
break;
}
case 43: {
lexer.NextToken();
-#line 1489 "cs.ATG"
+#line 1497 "cs.ATG"
op = AssignmentOperatorType.BitwiseOr;
break;
}
case 44: {
lexer.NextToken();
-#line 1490 "cs.ATG"
+#line 1498 "cs.ATG"
op = AssignmentOperatorType.ExclusiveOr;
break;
}
case 45: {
lexer.NextToken();
-#line 1491 "cs.ATG"
+#line 1499 "cs.ATG"
op = AssignmentOperatorType.ShiftLeft;
break;
}
case 46: {
lexer.NextToken();
-#line 1492 "cs.ATG"
+#line 1500 "cs.ATG"
op = AssignmentOperatorType.ShiftRight;
break;
}
@@ -3295,83 +3313,83 @@
}
void LocalVariableDecl(
-#line 1506 "cs.ATG"
+#line 1514 "cs.ATG"
out Statement stmt) {
-#line 1508 "cs.ATG"
+#line 1516 "cs.ATG"
TypeReference type;
VariableDeclaration var = null;
LocalVariableDeclaration localVariableDeclaration;
Type(
-#line 1513 "cs.ATG"
+#line 1521 "cs.ATG"
out type);
-#line 1513 "cs.ATG"
+#line 1521 "cs.ATG"
localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location;
LocalVariableDeclarator(
-#line 1514 "cs.ATG"
+#line 1522 "cs.ATG"
out var);
-#line 1514 "cs.ATG"
+#line 1522 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
while (la.kind == 12) {
lexer.NextToken();
LocalVariableDeclarator(
-#line 1515 "cs.ATG"
+#line 1523 "cs.ATG"
out var);
-#line 1515 "cs.ATG"
+#line 1523 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
}
-#line 1516 "cs.ATG"
+#line 1524 "cs.ATG"
stmt = localVariableDeclaration;
}
void LocalVariableDeclarator(
-#line 1519 "cs.ATG"
+#line 1527 "cs.ATG"
out VariableDeclaration var) {
-#line 1520 "cs.ATG"
+#line 1528 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1522 "cs.ATG"
+#line 1530 "cs.ATG"
var = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
LocalVariableInitializer(
-#line 1522 "cs.ATG"
+#line 1530 "cs.ATG"
out expr);
-#line 1522 "cs.ATG"
+#line 1530 "cs.ATG"
var.Initializer = expr;
}
}
void LocalVariableInitializer(
-#line 1525 "cs.ATG"
+#line 1533 "cs.ATG"
out Expression expr) {
-#line 1526 "cs.ATG"
+#line 1534 "cs.ATG"
expr = null;
if (StartOf(4)) {
Expr(
-#line 1528 "cs.ATG"
+#line 1536 "cs.ATG"
out expr);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1529 "cs.ATG"
+#line 1537 "cs.ATG"
out expr);
} else SynErr(168);
}
void EmbeddedStatement(
-#line 1556 "cs.ATG"
+#line 1564 "cs.ATG"
out Statement statement) {
-#line 1558 "cs.ATG"
+#line 1566 "cs.ATG"
TypeReference type = null;
Expression expr = null;
Statement embeddedStatement = null;
@@ -3379,177 +3397,177 @@
if (la.kind == 14) {
Block(
-#line 1564 "cs.ATG"
+#line 1572 "cs.ATG"
out statement);
} else if (la.kind == 10) {
lexer.NextToken();
-#line 1566 "cs.ATG"
+#line 1574 "cs.ATG"
statement = new EmptyStatement();
} else if (
-#line 1568 "cs.ATG"
+#line 1576 "cs.ATG"
IdentIsYield ()) {
Expect(1);
if (la.kind == 100) {
lexer.NextToken();
Expr(
-#line 1569 "cs.ATG"
+#line 1577 "cs.ATG"
out expr);
} else if (la.kind == 52) {
lexer.NextToken();
} else SynErr(169);
Expect(10);
-#line 1569 "cs.ATG"
+#line 1577 "cs.ATG"
statement = new YieldStatement(expr);
} else if (
-#line 1571 "cs.ATG"
+#line 1579 "cs.ATG"
UnCheckedAndLBrace()) {
-#line 1571 "cs.ATG"
+#line 1579 "cs.ATG"
Statement block; bool isChecked = true;
if (la.kind == 57) {
lexer.NextToken();
} else if (la.kind == 117) {
lexer.NextToken();
-#line 1572 "cs.ATG"
+#line 1580 "cs.ATG"
isChecked = false;
} else SynErr(170);
Block(
-#line 1573 "cs.ATG"
+#line 1581 "cs.ATG"
out block);
-#line 1573 "cs.ATG"
+#line 1581 "cs.ATG"
statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block);
} else if (StartOf(4)) {
StatementExpr(
-#line 1575 "cs.ATG"
+#line 1583 "cs.ATG"
out statement);
Expect(10);
} else if (la.kind == 78) {
lexer.NextToken();
-#line 1577 "cs.ATG"
+#line 1585 "cs.ATG"
Statement elseStatement = null;
Expect(18);
Expr(
-#line 1578 "cs.ATG"
+#line 1586 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1579 "cs.ATG"
+#line 1587 "cs.ATG"
out embeddedStatement);
if (la.kind == 66) {
lexer.NextToken();
EmbeddedStatement(
-#line 1580 "cs.ATG"
+#line 1588 "cs.ATG"
out elseStatement);
}
-#line 1581 "cs.ATG"
+#line 1589 "cs.ATG"
statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) : (Statement)new IfStatement(expr, embeddedStatement);
} else if (la.kind == 109) {
lexer.NextToken();
-#line 1582 "cs.ATG"
+#line 1590 "cs.ATG"
ArrayList switchSections = new ArrayList();
Expect(18);
Expr(
-#line 1583 "cs.ATG"
+#line 1591 "cs.ATG"
out expr);
Expect(19);
Expect(14);
while (la.kind == 54 || la.kind == 62) {
SwitchSection(
-#line 1584 "cs.ATG"
+#line 1592 "cs.ATG"
out statement);
-#line 1584 "cs.ATG"
+#line 1592 "cs.ATG"
switchSections.Add(statement);
}
Expect(15);
-#line 1585 "cs.ATG"
+#line 1593 "cs.ATG"
statement = new SwitchStatement(expr, switchSections);
} else if (la.kind == 124) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1587 "cs.ATG"
+#line 1595 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1588 "cs.ATG"
+#line 1596 "cs.ATG"
out embeddedStatement);
-#line 1588 "cs.ATG"
+#line 1596 "cs.ATG"
statement = new WhileStatement(expr, embeddedStatement);
} else if (la.kind == 64) {
lexer.NextToken();
EmbeddedStatement(
-#line 1589 "cs.ATG"
+#line 1597 "cs.ATG"
out embeddedStatement);
Expect(124);
Expect(18);
Expr(
-#line 1590 "cs.ATG"
+#line 1598 "cs.ATG"
out expr);
Expect(19);
Expect(10);
-#line 1590 "cs.ATG"
+#line 1598 "cs.ATG"
statement = new DoWhileStatement(expr, embeddedStatement);
} else if (la.kind == 75) {
lexer.NextToken();
-#line 1591 "cs.ATG"
+#line 1599 "cs.ATG"
ArrayList initializer = null, iterator = null;
Expect(18);
if (StartOf(4)) {
ForInitializer(
-#line 1592 "cs.ATG"
+#line 1600 "cs.ATG"
out initializer);
}
Expect(10);
if (StartOf(4)) {
Expr(
-#line 1593 "cs.ATG"
+#line 1601 "cs.ATG"
out expr);
}
Expect(10);
if (StartOf(4)) {
ForIterator(
-#line 1594 "cs.ATG"
+#line 1602 "cs.ATG"
out iterator);
}
Expect(19);
EmbeddedStatement(
-#line 1595 "cs.ATG"
+#line 1603 "cs.ATG"
out embeddedStatement);
-#line 1595 "cs.ATG"
+#line 1603 "cs.ATG"
statement = new ForStatement(initializer, expr, iterator, embeddedStatement);
} else if (la.kind == 76) {
lexer.NextToken();
Expect(18);
Type(
-#line 1596 "cs.ATG"
+#line 1604 "cs.ATG"
out type);
Expect(1);
-#line 1596 "cs.ATG"
+#line 1604 "cs.ATG"
string varName = t.val;
Expect(80);
Expr(
-#line 1597 "cs.ATG"
+#line 1605 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1598 "cs.ATG"
+#line 1606 "cs.ATG"
out embeddedStatement);
-#line 1598 "cs.ATG"
+#line 1606 "cs.ATG"
statement = new ForeachStatement(type, varName , expr, embeddedStatement);
statement.EndLocation = t.EndLocation;
@@ -3557,363 +3575,363 @@
lexer.NextToken();
Expect(10);
-#line 1602 "cs.ATG"
+#line 1610 "cs.ATG"
statement = new BreakStatement();
} else if (la.kind == 60) {
lexer.NextToken();
Expect(10);
-#line 1603 "cs.ATG"
+#line 1611 "cs.ATG"
statement = new ContinueStatement();
} else if (la.kind == 77) {
GotoStatement(
-#line 1604 "cs.ATG"
+#line 1612 "cs.ATG"
out statement);
} else if (la.kind == 100) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1605 "cs.ATG"
+#line 1613 "cs.ATG"
out expr);
}
Expect(10);
-#line 1605 "cs.ATG"
+#line 1613 "cs.ATG"
statement = new ReturnStatement(expr);
} else if (la.kind == 111) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1606 "cs.ATG"
+#line 1614 "cs.ATG"
out expr);
}
Expect(10);
-#line 1606 "cs.ATG"
+#line 1614 "cs.ATG"
statement = new ThrowStatement(expr);
} else if (la.kind == 113) {
TryStatement(
-#line 1609 "cs.ATG"
+#line 1617 "cs.ATG"
out statement);
} else if (la.kind == 85) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1611 "cs.ATG"
+#line 1619 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1612 "cs.ATG"
+#line 1620 "cs.ATG"
out embeddedStatement);
-#line 1612 "cs.ATG"
+#line 1620 "cs.ATG"
statement = new LockStatement(expr, embeddedStatement);
} else if (la.kind == 120) {
-#line 1614 "cs.ATG"
+#line 1622 "cs.ATG"
Statement resourceAcquisitionStmt = null;
lexer.NextToken();
Expect(18);
ResourceAcquisition(
-#line 1616 "cs.ATG"
+#line 1624 "cs.ATG"
out resourceAcquisitionStmt);
Expect(19);
EmbeddedStatement(
-#line 1617 "cs.ATG"
+#line 1625 "cs.ATG"
out embeddedStatement);
-#line 1617 "cs.ATG"
+#line 1625 "cs.ATG"
statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement);
} else if (la.kind == 118) {
lexer.NextToken();
Block(
-#line 1619 "cs.ATG"
+#line 1627 "cs.ATG"
out embeddedStatement);
-#line 1619 "cs.ATG"
+#line 1627 "cs.ATG"
statement = new UnsafeStatement(embeddedStatement);
} else if (la.kind == 73) {
lexer.NextToken();
Expect(18);
Type(
-#line 1622 "cs.ATG"
+#line 1630 "cs.ATG"
out type);
-#line 1622 "cs.ATG"
+#line 1630 "cs.ATG"
if (type.PointerNestingLevel == 0) Error("can only fix pointer types");
FixedStatement fxStmt = new FixedStatement(type);
string identifier = null;
Expect(1);
-#line 1626 "cs.ATG"
+#line 1634 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1627 "cs.ATG"
+#line 1635 "cs.ATG"
out expr);
-#line 1627 "cs.ATG"
+#line 1635 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1629 "cs.ATG"
+#line 1637 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1630 "cs.ATG"
+#line 1638 "cs.ATG"
out expr);
-#line 1630 "cs.ATG"
+#line 1638 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
}
Expect(19);
EmbeddedStatement(
-#line 1632 "cs.ATG"
+#line 1640 "cs.ATG"
out embeddedStatement);
-#line 1632 "cs.ATG"
+#line 1640 "cs.ATG"
fxStmt.EmbeddedStatement = embeddedStatement; statement = fxStmt;
} else SynErr(171);
}
void StatementExpr(
-#line 1740 "cs.ATG"
+#line 1748 "cs.ATG"
out Statement stmt) {
-#line 1745 "cs.ATG"
+#line 1753 "cs.ATG"
bool mustBeAssignment = la.kind == Tokens.Plus || la.kind == Tokens.Minus ||
la.kind == Tokens.Not || la.kind == Tokens.BitwiseComplement ||
la.kind == Tokens.Times || la.kind == Tokens.BitwiseAnd || IsTypeCast();
Expression expr = null;
UnaryExpr(
-#line 1751 "cs.ATG"
+#line 1759 "cs.ATG"
out expr);
if (StartOf(6)) {
-#line 1754 "cs.ATG"
+#line 1762 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1754 "cs.ATG"
+#line 1762 "cs.ATG"
out op);
Expr(
-#line 1754 "cs.ATG"
+#line 1762 "cs.ATG"
out val);
-#line 1754 "cs.ATG"
+#line 1762 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else if (la.kind == 10 || la.kind == 12 || la.kind == 19) {
-#line 1755 "cs.ATG"
+#line 1763 "cs.ATG"
if (mustBeAssignment) Error("error in assignment.");
} else SynErr(172);
-#line 1756 "cs.ATG"
+#line 1764 "cs.ATG"
stmt = new StatementExpression(expr);
}
void SwitchSection(
-#line 1654 "cs.ATG"
+#line 1662 "cs.ATG"
out Statement stmt) {
-#line 1656 "cs.ATG"
+#line 1664 "cs.ATG"
SwitchSection switchSection = new SwitchSection();
Expression expr;
SwitchLabel(
-#line 1660 "cs.ATG"
+#line 1668 "cs.ATG"
out expr);
-#line 1660 "cs.ATG"
+#line 1668 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
while (la.kind == 54 || la.kind == 62) {
SwitchLabel(
-#line 1660 "cs.ATG"
+#line 1668 "cs.ATG"
out expr);
-#line 1660 "cs.ATG"
+#line 1668 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
}
-#line 1661 "cs.ATG"
+#line 1669 "cs.ATG"
compilationUnit.BlockStart(switchSection);
Statement();
while (StartOf(20)) {
Statement();
}
-#line 1664 "cs.ATG"
+#line 1672 "cs.ATG"
compilationUnit.BlockEnd();
stmt = switchSection;
}
void ForInitializer(
-#line 1635 "cs.ATG"
+#line 1643 "cs.ATG"
out ArrayList initializer) {
-#line 1637 "cs.ATG"
+#line 1645 "cs.ATG"
Statement stmt;
initializer = new ArrayList();
if (
-#line 1641 "cs.ATG"
+#line 1649 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1641 "cs.ATG"
+#line 1649 "cs.ATG"
out stmt);
-#line 1641 "cs.ATG"
+#line 1649 "cs.ATG"
initializer.Add(stmt);
} else if (StartOf(4)) {
StatementExpr(
-#line 1642 "cs.ATG"
+#line 1650 "cs.ATG"
out stmt);
-#line 1642 "cs.ATG"
+#line 1650 "cs.ATG"
initializer.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1642 "cs.ATG"
+#line 1650 "cs.ATG"
out stmt);
-#line 1642 "cs.ATG"
+#line 1650 "cs.ATG"
initializer.Add(stmt);
}
-#line 1642 "cs.ATG"
+#line 1650 "cs.ATG"
initializer.Add(stmt);
} else SynErr(173);
}
void ForIterator(
-#line 1645 "cs.ATG"
+#line 1653 "cs.ATG"
out ArrayList iterator) {
-#line 1647 "cs.ATG"
+#line 1655 "cs.ATG"
Statement stmt;
iterator = new ArrayList();
StatementExpr(
-#line 1651 "cs.ATG"
+#line 1659 "cs.ATG"
out stmt);
-#line 1651 "cs.ATG"
+#line 1659 "cs.ATG"
iterator.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1651 "cs.ATG"
+#line 1659 "cs.ATG"
out stmt);
-#line 1651 "cs.ATG"
+#line 1659 "cs.ATG"
iterator.Add(stmt);
}
}
void GotoStatement(
-#line 1713 "cs.ATG"
+#line 1721 "cs.ATG"
out Statement stmt) {
-#line 1714 "cs.ATG"
+#line 1722 "cs.ATG"
Expression expr; stmt = null;
Expect(77);
if (la.kind == 1) {
lexer.NextToken();
-#line 1718 "cs.ATG"
+#line 1726 "cs.ATG"
stmt = new GotoStatement(t.val);
Expect(10);
} else if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1719 "cs.ATG"
+#line 1727 "cs.ATG"
out expr);
Expect(10);
-#line 1719 "cs.ATG"
+#line 1727 "cs.ATG"
stmt = new GotoCaseStatement(expr);
} else if (la.kind == 62) {
lexer.NextToken();
Expect(10);
-#line 1720 "cs.ATG"
+#line 1728 "cs.ATG"
stmt = new GotoCaseStatement(null);
} else SynErr(174);
}
void TryStatement(
-#line 1676 "cs.ATG"
+#line 1684 "cs.ATG"
out Statement tryStatement) {
-#line 1678 "cs.ATG"
+#line 1686 "cs.ATG"
Statement blockStmt = null, finallyStmt = null;
ArrayList catchClauses = null;
Expect(113);
Block(
-#line 1682 "cs.ATG"
+#line 1690 "cs.ATG"
out blockStmt);
if (la.kind == 55) {
CatchClauses(
-#line 1684 "cs.ATG"
+#line 1692 "cs.ATG"
out catchClauses);
if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1684 "cs.ATG"
+#line 1692 "cs.ATG"
out finallyStmt);
}
} else if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1685 "cs.ATG"
+#line 1693 "cs.ATG"
out finallyStmt);
} else SynErr(175);
-#line 1688 "cs.ATG"
+#line 1696 "cs.ATG"
tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
}
void ResourceAcquisition(
-#line 1724 "cs.ATG"
+#line 1732 "cs.ATG"
out Statement stmt) {
-#line 1726 "cs.ATG"
+#line 1734 "cs.ATG"
stmt = null;
Expression expr;
if (
-#line 1731 "cs.ATG"
+#line 1739 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1731 "cs.ATG"
+#line 1739 "cs.ATG"
out stmt);
} else if (StartOf(4)) {
Expr(
-#line 1732 "cs.ATG"
+#line 1740 "cs.ATG"
out expr);
-#line 1736 "cs.ATG"
+#line 1744 "cs.ATG"
stmt = new StatementExpression(expr);
} else SynErr(176);
}
void SwitchLabel(
-#line 1669 "cs.ATG"
+#line 1677 "cs.ATG"
out Expression expr) {
-#line 1670 "cs.ATG"
+#line 1678 "cs.ATG"
expr = null;
if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1672 "cs.ATG"
+#line 1680 "cs.ATG"
out expr);
Expect(9);
} else if (la.kind == 62) {
@@ -3923,153 +3941,153 @@
}
void CatchClauses(
-#line 1693 "cs.ATG"
+#line 1701 "cs.ATG"
out ArrayList catchClauses) {
-#line 1695 "cs.ATG"
+#line 1703 "cs.ATG"
catchClauses = new ArrayList();
Expect(55);
-#line 1698 "cs.ATG"
+#line 1706 "cs.ATG"
string name;
string identifier;
Statement stmt;
if (la.kind == 14) {
Block(
-#line 1704 "cs.ATG"
+#line 1712 "cs.ATG"
out stmt);
-#line 1704 "cs.ATG"
+#line 1712 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
} else if (la.kind == 18) {
lexer.NextToken();
ClassType(
-#line 1706 "cs.ATG"
+#line 1714 "cs.ATG"
out name);
-#line 1706 "cs.ATG"
+#line 1714 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1706 "cs.ATG"
+#line 1714 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1706 "cs.ATG"
+#line 1714 "cs.ATG"
out stmt);
-#line 1706 "cs.ATG"
+#line 1714 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
while (
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
IsTypedCatch()) {
Expect(55);
Expect(18);
ClassType(
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
out name);
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
out stmt);
-#line 1707 "cs.ATG"
+#line 1715 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
}
if (la.kind == 55) {
lexer.NextToken();
Block(
-#line 1709 "cs.ATG"
+#line 1717 "cs.ATG"
out stmt);
-#line 1709 "cs.ATG"
+#line 1717 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
}
} else SynErr(178);
}
void UnaryExpr(
-#line 1772 "cs.ATG"
+#line 1780 "cs.ATG"
out Expression uExpr) {
-#line 1774 "cs.ATG"
+#line 1782 "cs.ATG"
TypeReference type = null;
Expression expr;
ArrayList expressions = new ArrayList();
uExpr = null;
while (StartOf(26) ||
-#line 1796 "cs.ATG"
+#line 1804 "cs.ATG"
IsTypeCast()) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1781 "cs.ATG"
+#line 1789 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus));
} else if (la.kind == 5) {
lexer.NextToken();
-#line 1782 "cs.ATG"
+#line 1790 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus));
} else if (la.kind == 22) {
lexer.NextToken();
-#line 1783 "cs.ATG"
+#line 1791 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not));
} else if (la.kind == 25) {
lexer.NextToken();
-#line 1784 "cs.ATG"
+#line 1792 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot));
} else if (la.kind == 6) {
lexer.NextToken();
-#line 1785 "cs.ATG"
+#line 1793 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star));
} else if (la.kind == 29) {
lexer.NextToken();
-#line 1786 "cs.ATG"
+#line 1794 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment));
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1787 "cs.ATG"
+#line 1795 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement));
} else if (la.kind == 26) {
lexer.NextToken();
-#line 1788 "cs.ATG"
+#line 1796 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd));
} else {
Expect(18);
Type(
-#line 1796 "cs.ATG"
+#line 1804 "cs.ATG"
out type);
Expect(19);
-#line 1796 "cs.ATG"
+#line 1804 "cs.ATG"
expressions.Add(new CastExpression(type));
}
}
PrimaryExpr(
-#line 1799 "cs.ATG"
+#line 1807 "cs.ATG"
out expr);
-#line 1799 "cs.ATG"
+#line 1807 "cs.ATG"
for (int i = 0; i < expressions.Count; ++i) {
Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr;
if (expressions[i] is CastExpression) {
@@ -4087,33 +4105,33 @@
}
void ConditionalOrExpr(
-#line 1901 "cs.ATG"
+#line 1909 "cs.ATG"
ref Expression outExpr) {
-#line 1902 "cs.ATG"
+#line 1910 "cs.ATG"
Expression expr;
ConditionalAndExpr(
-#line 1904 "cs.ATG"
+#line 1912 "cs.ATG"
ref outExpr);
while (la.kind == 24) {
lexer.NextToken();
UnaryExpr(
-#line 1904 "cs.ATG"
+#line 1912 "cs.ATG"
out expr);
ConditionalAndExpr(
-#line 1904 "cs.ATG"
+#line 1912 "cs.ATG"
ref expr);
-#line 1904 "cs.ATG"
+#line 1912 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);
}
}
void PrimaryExpr(
-#line 1816 "cs.ATG"
+#line 1824 "cs.ATG"
out Expression pexpr) {
-#line 1818 "cs.ATG"
+#line 1826 "cs.ATG"
TypeReference type = null;
bool isArrayCreation = false;
Expression expr;
@@ -4123,46 +4141,46 @@
case 112: {
lexer.NextToken();
-#line 1825 "cs.ATG"
+#line 1833 "cs.ATG"
pexpr = new PrimitiveExpression(true, "true");
break;
}
case 71: {
lexer.NextToken();
-#line 1826 "cs.ATG"
+#line 1834 "cs.ATG"
pexpr = new PrimitiveExpression(false, "false");
break;
}
case 89: {
lexer.NextToken();
-#line 1827 "cs.ATG"
+#line 1835 "cs.ATG"
pexpr = new PrimitiveExpression(null, "null");
break;
}
case 2: {
lexer.NextToken();
-#line 1828 "cs.ATG"
+#line 1836 "cs.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val);
break;
}
case 1: {
lexer.NextToken();
-#line 1830 "cs.ATG"
+#line 1838 "cs.ATG"
pexpr = new IdentifierExpression(t.val);
break;
}
case 18: {
lexer.NextToken();
Expr(
-#line 1832 "cs.ATG"
+#line 1840 "cs.ATG"
out expr);
Expect(19);
-#line 1832 "cs.ATG"
+#line 1840 "cs.ATG"
pexpr = new ParenthesizedExpression(expr);
break;
}
@@ -4230,185 +4248,185 @@
}
}
-#line 1838 "cs.ATG"
+#line 1846 "cs.ATG"
string val = t.val; t.val = "";
Expect(13);
Expect(1);
-#line 1838 "cs.ATG"
+#line 1846 "cs.ATG"
pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val);
break;
}
case 110: {
lexer.NextToken();
-#line 1840 "cs.ATG"
+#line 1848 "cs.ATG"
pexpr = new ThisReferenceExpression();
break;
}
case 50: {
lexer.NextToken();
-#line 1842 "cs.ATG"
+#line 1850 "cs.ATG"
Expression retExpr = new BaseReferenceExpression();
if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1844 "cs.ATG"
+#line 1852 "cs.ATG"
retExpr = new FieldReferenceExpression(retExpr, t.val);
} else if (la.kind == 16) {
lexer.NextToken();
Expr(
-#line 1845 "cs.ATG"
+#line 1853 "cs.ATG"
out expr);
-#line 1845 "cs.ATG"
+#line 1853 "cs.ATG"
ArrayList indices = new ArrayList(); indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1846 "cs.ATG"
+#line 1854 "cs.ATG"
out expr);
-#line 1846 "cs.ATG"
+#line 1854 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1847 "cs.ATG"
+#line 1855 "cs.ATG"
retExpr = new IndexerExpression(retExpr, indices);
} else SynErr(179);
-#line 1848 "cs.ATG"
+#line 1856 "cs.ATG"
pexpr = retExpr;
break;
}
case 88: {
lexer.NextToken();
NonArrayType(
-#line 1849 "cs.ATG"
+#line 1857 "cs.ATG"
out type);
-#line 1849 "cs.ATG"
+#line 1857 "cs.ATG"
ArrayList parameters = new ArrayList();
if (la.kind == 18) {
lexer.NextToken();
-#line 1854 "cs.ATG"
+#line 1862 "cs.ATG"
ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters);
if (StartOf(21)) {
Argument(
-#line 1854 "cs.ATG"
+#line 1862 "cs.ATG"
out expr);
-#line 1854 "cs.ATG"
+#line 1862 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1855 "cs.ATG"
+#line 1863 "cs.ATG"
out expr);
-#line 1855 "cs.ATG"
+#line 1863 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1855 "cs.ATG"
+#line 1863 "cs.ATG"
pexpr = oce;
} else if (la.kind == 16) {
-#line 1857 "cs.ATG"
+#line 1865 "cs.ATG"
isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace;
lexer.NextToken();
-#line 1858 "cs.ATG"
+#line 1866 "cs.ATG"
int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList();
if (StartOf(4)) {
Expr(
-#line 1860 "cs.ATG"
+#line 1868 "cs.ATG"
out expr);
-#line 1860 "cs.ATG"
+#line 1868 "cs.ATG"
parameterExpression.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1860 "cs.ATG"
+#line 1868 "cs.ATG"
out expr);
-#line 1860 "cs.ATG"
+#line 1868 "cs.ATG"
parameterExpression.Add(expr);
}
Expect(17);
-#line 1860 "cs.ATG"
+#line 1868 "cs.ATG"
parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters;
while (
-#line 1861 "cs.ATG"
+#line 1869 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1861 "cs.ATG"
+#line 1869 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1861 "cs.ATG"
+#line 1869 "cs.ATG"
dims++;
}
-#line 1861 "cs.ATG"
+#line 1869 "cs.ATG"
rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
-#line 1862 "cs.ATG"
+#line 1870 "cs.ATG"
if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); }
if (la.kind == 14) {
ArrayInitializer(
-#line 1863 "cs.ATG"
+#line 1871 "cs.ATG"
out expr);
-#line 1863 "cs.ATG"
+#line 1871 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr;
}
} else if (la.kind == 12 || la.kind == 17) {
while (la.kind == 12) {
lexer.NextToken();
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
dims++;
}
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
while (
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
dims++;
}
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
ArrayInitializer(
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
out expr);
-#line 1865 "cs.ATG"
+#line 1873 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters;
} else SynErr(180);
} else SynErr(181);
@@ -4418,20 +4436,20 @@
lexer.NextToken();
Expect(18);
if (
-#line 1871 "cs.ATG"
+#line 1879 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 1871 "cs.ATG"
+#line 1879 "cs.ATG"
type = new TypeReference("void");
} else if (StartOf(8)) {
Type(
-#line 1872 "cs.ATG"
+#line 1880 "cs.ATG"
out type);
} else SynErr(182);
Expect(19);
-#line 1873 "cs.ATG"
+#line 1881 "cs.ATG"
pexpr = new TypeOfExpression(type);
break;
}
@@ -4439,11 +4457,11 @@
lexer.NextToken();
Expect(18);
Type(
-#line 1874 "cs.ATG"
+#line 1882 "cs.ATG"
out type);
Expect(19);
-#line 1874 "cs.ATG"
+#line 1882 "cs.ATG"
pexpr = new SizeOfExpression(type);
break;
}
@@ -4451,11 +4469,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1875 "cs.ATG"
+#line 1883 "cs.ATG"
out expr);
Expect(19);
-#line 1875 "cs.ATG"
+#line 1883 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4463,11 +4481,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1876 "cs.ATG"
+#line 1884 "cs.ATG"
out expr);
Expect(19);
-#line 1876 "cs.ATG"
+#line 1884 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4478,350 +4496,350 @@
if (la.kind == 29) {
lexer.NextToken();
-#line 1880 "cs.ATG"
+#line 1888 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement);
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1881 "cs.ATG"
+#line 1889 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement);
} else SynErr(184);
} else if (la.kind == 47) {
lexer.NextToken();
Expect(1);
-#line 1884 "cs.ATG"
+#line 1892 "cs.ATG"
pexpr = new PointerReferenceExpression(pexpr, t.val);
} else if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1885 "cs.ATG"
+#line 1893 "cs.ATG"
pexpr = new FieldReferenceExpression(pexpr, t.val);
} else if (la.kind == 18) {
lexer.NextToken();
-#line 1887 "cs.ATG"
+#line 1895 "cs.ATG"
ArrayList parameters = new ArrayList();
if (StartOf(21)) {
Argument(
-#line 1888 "cs.ATG"
+#line 1896 "cs.ATG"
out expr);
-#line 1888 "cs.ATG"
+#line 1896 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1889 "cs.ATG"
+#line 1897 "cs.ATG"
out expr);
-#line 1889 "cs.ATG"
+#line 1897 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1890 "cs.ATG"
+#line 1898 "cs.ATG"
pexpr = new InvocationExpression(pexpr, parameters);
} else {
-#line 1892 "cs.ATG"
+#line 1900 "cs.ATG"
if (isArrayCreation) Error("element access not allow on array creation");
ArrayList indices = new ArrayList();
lexer.NextToken();
Expr(
-#line 1895 "cs.ATG"
+#line 1903 "cs.ATG"
out expr);
-#line 1895 "cs.ATG"
+#line 1903 "cs.ATG"
indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1896 "cs.ATG"
+#line 1904 "cs.ATG"
out expr);
-#line 1896 "cs.ATG"
+#line 1904 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1897 "cs.ATG"
+#line 1905 "cs.ATG"
pexpr = new IndexerExpression(pexpr, indices);
}
}
}
void ConditionalAndExpr(
-#line 1907 "cs.ATG"
+#line 1915 "cs.ATG"
ref Expression outExpr) {
-#line 1908 "cs.ATG"
+#line 1916 "cs.ATG"
Expression expr;
InclusiveOrExpr(
-#line 1910 "cs.ATG"
+#line 1918 "cs.ATG"
ref outExpr);
while (la.kind == 23) {
lexer.NextToken();
UnaryExpr(
-#line 1910 "cs.ATG"
+#line 1918 "cs.ATG"
out expr);
InclusiveOrExpr(
-#line 1910 "cs.ATG"
+#line 1918 "cs.ATG"
ref expr);
-#line 1910 "cs.ATG"
+#line 1918 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr);
}
}
void InclusiveOrExpr(
-#line 1913 "cs.ATG"
+#line 1921 "cs.ATG"
ref Expression outExpr) {
-#line 1914 "cs.ATG"
+#line 1922 "cs.ATG"
Expression expr;
ExclusiveOrExpr(
-#line 1916 "cs.ATG"
+#line 1924 "cs.ATG"
ref outExpr);
while (la.kind == 27) {
lexer.NextToken();
UnaryExpr(
-#line 1916 "cs.ATG"
+#line 1924 "cs.ATG"
out expr);
ExclusiveOrExpr(
-#line 1916 "cs.ATG"
+#line 1924 "cs.ATG"
ref expr);
-#line 1916 "cs.ATG"
+#line 1924 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr);
}
}
void ExclusiveOrExpr(
-#line 1919 "cs.ATG"
+#line 1927 "cs.ATG"
ref Expression outExpr) {
-#line 1920 "cs.ATG"
+#line 1928 "cs.ATG"
Expression expr;
AndExpr(
-#line 1922 "cs.ATG"
+#line 1930 "cs.ATG"
ref outExpr);
while (la.kind == 28) {
lexer.NextToken();
UnaryExpr(
-#line 1922 "cs.ATG"
+#line 1930 "cs.ATG"
out expr);
AndExpr(
-#line 1922 "cs.ATG"
+#line 1930 "cs.ATG"
ref expr);
-#line 1922 "cs.ATG"
+#line 1930 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr);
}
}
void AndExpr(
-#line 1925 "cs.ATG"
+#line 1933 "cs.ATG"
ref Expression outExpr) {
-#line 1926 "cs.ATG"
+#line 1934 "cs.ATG"
Expression expr;
EqualityExpr(
-#line 1928 "cs.ATG"
+#line 1936 "cs.ATG"
ref outExpr);
while (la.kind == 26) {
lexer.NextToken();
UnaryExpr(
-#line 1928 "cs.ATG"
+#line 1936 "cs.ATG"
out expr);
EqualityExpr(
-#line 1928 "cs.ATG"
+#line 1936 "cs.ATG"
ref expr);
-#line 1928 "cs.ATG"
+#line 1936 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr);
}
}
void EqualityExpr(
-#line 1931 "cs.ATG"
+#line 1939 "cs.ATG"
ref Expression outExpr) {
-#line 1933 "cs.ATG"
+#line 1941 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
RelationalExpr(
-#line 1937 "cs.ATG"
+#line 1945 "cs.ATG"
ref outExpr);
while (la.kind == 31 || la.kind == 32) {
if (la.kind == 32) {
lexer.NextToken();
-#line 1940 "cs.ATG"
+#line 1948 "cs.ATG"
op = BinaryOperatorType.InEquality;
} else {
lexer.NextToken();
-#line 1941 "cs.ATG"
+#line 1949 "cs.ATG"
op = BinaryOperatorType.Equality;
}
UnaryExpr(
-#line 1943 "cs.ATG"
+#line 1951 "cs.ATG"
out expr);
RelationalExpr(
-#line 1943 "cs.ATG"
+#line 1951 "cs.ATG"
ref expr);
-#line 1943 "cs.ATG"
+#line 1951 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void RelationalExpr(
-#line 1947 "cs.ATG"
+#line 1955 "cs.ATG"
ref Expression outExpr) {
-#line 1949 "cs.ATG"
+#line 1957 "cs.ATG"
TypeReference type;
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
ShiftExpr(
-#line 1954 "cs.ATG"
+#line 1962 "cs.ATG"
ref outExpr);
while (StartOf(28)) {
if (StartOf(29)) {
if (la.kind == 21) {
lexer.NextToken();
-#line 1957 "cs.ATG"
+#line 1965 "cs.ATG"
op = BinaryOperatorType.LessThan;
} else if (la.kind == 20) {
lexer.NextToken();
-#line 1958 "cs.ATG"
+#line 1966 "cs.ATG"
op = BinaryOperatorType.GreaterThan;
} else if (la.kind == 34) {
lexer.NextToken();
-#line 1959 "cs.ATG"
+#line 1967 "cs.ATG"
op = BinaryOperatorType.LessThanOrEqual;
} else if (la.kind == 33) {
lexer.NextToken();
-#line 1960 "cs.ATG"
+#line 1968 "cs.ATG"
op = BinaryOperatorType.GreaterThanOrEqual;
} else SynErr(185);
UnaryExpr(
-#line 1962 "cs.ATG"
+#line 1970 "cs.ATG"
out expr);
ShiftExpr(
-#line 1962 "cs.ATG"
+#line 1970 "cs.ATG"
ref expr);
-#line 1962 "cs.ATG"
+#line 1970 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
} else {
if (la.kind == 84) {
lexer.NextToken();
-#line 1965 "cs.ATG"
+#line 1973 "cs.ATG"
op = BinaryOperatorType.IS;
} else if (la.kind == 49) {
lexer.NextToken();
-#line 1966 "cs.ATG"
+#line 1974 "cs.ATG"
op = BinaryOperatorType.AS;
} else SynErr(186);
Type(
-#line 1968 "cs.ATG"
+#line 1976 "cs.ATG"
out type);
-#line 1968 "cs.ATG"
+#line 1976 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type));
}
}
}
void ShiftExpr(
-#line 1972 "cs.ATG"
+#line 1980 "cs.ATG"
ref Expression outExpr) {
-#line 1974 "cs.ATG"
+#line 1982 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
AdditiveExpr(
-#line 1978 "cs.ATG"
+#line 1986 "cs.ATG"
ref outExpr);
while (la.kind == 35 || la.kind == 36) {
if (la.kind == 35) {
lexer.NextToken();
-#line 1981 "cs.ATG"
+#line 1989 "cs.ATG"
op = BinaryOperatorType.ShiftLeft;
} else {
lexer.NextToken();
-#line 1982 "cs.ATG"
+#line 1990 "cs.ATG"
op = BinaryOperatorType.ShiftRight;
}
UnaryExpr(
-#line 1984 "cs.ATG"
+#line 1992 "cs.ATG"
out expr);
AdditiveExpr(
-#line 1984 "cs.ATG"
+#line 1992 "cs.ATG"
ref expr);
-#line 1984 "cs.ATG"
+#line 1992 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void AdditiveExpr(
-#line 1988 "cs.ATG"
+#line 1996 "cs.ATG"
ref Expression outExpr) {
-#line 1990 "cs.ATG"
+#line 1998 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
MultiplicativeExpr(
-#line 1994 "cs.ATG"
+#line 2002 "cs.ATG"
ref outExpr);
while (la.kind == 4 || la.kind == 5) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1997 "cs.ATG"
+#line 2005 "cs.ATG"
op = BinaryOperatorType.Add;
} else {
lexer.NextToken();
-#line 1998 "cs.ATG"
+#line 2006 "cs.ATG"
op = BinaryOperatorType.Subtract;
}
UnaryExpr(
-#line 2000 "cs.ATG"
+#line 2008 "cs.ATG"
out expr);
MultiplicativeExpr(
-#line 2000 "cs.ATG"
+#line 2008 "cs.ATG"
ref expr);
-#line 2000 "cs.ATG"
+#line 2008 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void MultiplicativeExpr(
-#line 2004 "cs.ATG"
+#line 2012 "cs.ATG"
ref Expression outExpr) {
-#line 2006 "cs.ATG"
+#line 2014 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
@@ -4829,24 +4847,24 @@
if (la.kind == 6) {
lexer.NextToken();
-#line 2012 "cs.ATG"
+#line 2020 "cs.ATG"
op = BinaryOperatorType.Multiply;
} else if (la.kind == 7) {
lexer.NextToken();
-#line 2013 "cs.ATG"
+#line 2021 "cs.ATG"
op = BinaryOperatorType.Divide;
} else {
lexer.NextToken();
-#line 2014 "cs.ATG"
+#line 2022 "cs.ATG"
op = BinaryOperatorType.Modulus;
}
UnaryExpr(
-#line 2016 "cs.ATG"
+#line 2024 "cs.ATG"
out expr);
-#line 2016 "cs.ATG"
+#line 2024 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG 2005-06-11 12:25:16 UTC (rev 2596)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG 2005-06-13 14:54:44 UTC (rev 2597)
@@ -1331,16 +1331,24 @@
(. Statement stmt = null; .)
=
ident /* "get" is not a keyword */
+ (. Point startLocation = t.Location; .)
(. if (t.val != "get") Error("get expected"); .)
- ( Block<out stmt> | ";" ) (. getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes, m); .)
+ ( Block<out stmt> | ";" )
+ (. getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes, m); .)
+ (. getBlock.StartLocation = startLocation; .)
+ (. getBlock.EndLocation = t.Location; .)
.
SetAccessorDecl<out PropertySetRegion setBlock, ArrayList attributes, Modifier m>
(. Statement stmt = null; .)
=
ident /* "set" is not a keyword */
+ (. Point startLocation = t.Location; .)
(. if (t.val != "set") Error("set expected"); .)
- ( Block<out stmt> | ";" ) (. setBlock = new PropertySetRegion((BlockStatement)stmt, attributes, m); .)
+ ( Block<out stmt> | ";" )
+ (. setBlock = new PropertySetRegion((BlockStatement)stmt, attributes, m); .)
+ (. setBlock.StartLocation = startLocation; .)
+ (. setBlock.EndLocation = t.Location; .)
.
EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBlock>
More information about the Monodevelop-patches-list
mailing list