[Monodevelop-patches-list] r2450 - in trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory: . src/Parser/AST/GlobalScope src/Parser/generated
John Luke <jluke@cfl.rr.com>
jluke at mono-cvs.ximian.com
Wed Apr 13 17:51:54 EDT 2005
Author: jluke
Date: 2005-04-13 17:51:53 -0400 (Wed, 13 Apr 2005)
New Revision: 2450
Modified:
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
Log:
allow 'partial' before TypeDeclaration
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-04-13 20:27:23 UTC (rev 2449)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-04-13 21:51:53 UTC (rev 2450)
@@ -1,5 +1,13 @@
2005-04-13 John Luke <john.luke at gmail.com>
+ * src/Parser/AST/GlobalScope/TypeDeclaration.cs: add IsStaticClass
+ and IsPartial for later use, add new ctors for handling partial types
+ * src/Parser/generated/cs.ATG:
+ * src/Parser/generated/Parser.cs: allow partial before TypeDeclaration
+ of class, interface and struct
+
+2005-04-13 John Luke <john.luke at gmail.com>
+
* Makefile.am:
* src/Parser/AST/GlobalScope/ExternAliasDeclaration.cs: add this
* src/Parser/AST/IASTVisitor.cs:
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs 2005-04-13 20:27:23 UTC (rev 2449)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/GlobalScope/TypeDeclaration.cs 2005-04-13 21:51:53 UTC (rev 2450)
@@ -29,6 +29,7 @@
Types type; // Class | Interface | Struct | Enum
StringCollection bases;
ArrayList attributes;
+ bool partial;
public string Name {
get {
@@ -70,16 +71,26 @@
attributes = value;
}
}
+
+ // only valid for class, struct, and interface
+ public bool IsPartial {
+ get { return partial; }
+ }
+
+ // only valid for classes
+ public bool IsStatic {
+ get { return type == Types.Class && (modifier & Modifier.Static) != 0; }
+ }
+
+ public TypeDeclaration () : this (false)
+ {
+ }
+
+ public TypeDeclaration (bool partial)
+ {
+ this.partial = partial;
+ }
-// public TypeDeclaration(string name, Modifier modifier, Types type, StringCollection bases, ArrayList attributes)
-// {
-// this.name = name;
-// this.modifier = modifier;
-// this.type = type;
-// this.bases = bases;
-// this.attributes = attributes;
-// }
-
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-04-13 20:27:23 UTC (rev 2449)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-04-13 21:51:53 UTC (rev 2450)
@@ -354,6 +354,11 @@
return la.kind == Tokens.Identifier && la.val == "yield";
}
+/* True, if lookahead ident is "partial" */
+bool IdentIsPartial () {
+ return la.kind == Tokens.Identifier && la.val == "partial";
+}
+
/* True, if lookahead ident is "get" */
bool IdentIsGet () {
return la.kind == Tokens.Identifier && la.val == "get";
@@ -462,7 +467,7 @@
void CS() {
-#line 522 "cs.ATG"
+#line 527 "cs.ATG"
compilationUnit = new CompilationUnit();
while (la.kind == 70) {
ExternAlias();
@@ -471,7 +476,7 @@
UsingDirective();
}
while (
-#line 526 "cs.ATG"
+#line 531 "cs.ATG"
IsGlobalAttrTarget()) {
GlobalAttributeSection();
}
@@ -483,47 +488,47 @@
void ExternAlias() {
-#line 533 "cs.ATG"
+#line 538 "cs.ATG"
externAliases = new ArrayList ();
Expect(70);
Expect(1);
-#line 536 "cs.ATG"
+#line 541 "cs.ATG"
if (t.val != "alias") Error ("alias expected");
Expect(1);
-#line 537 "cs.ATG"
+#line 542 "cs.ATG"
externAliases.Add (new ExternAliasDeclaration (t.val));
Expect(10);
}
void UsingDirective() {
-#line 543 "cs.ATG"
+#line 548 "cs.ATG"
usingNamespaces = new ArrayList();
string qualident = null, aliasident = null;
Expect(120);
-#line 547 "cs.ATG"
+#line 552 "cs.ATG"
Point startPos = t.Location;
INode node = null;
if (
-#line 550 "cs.ATG"
+#line 555 "cs.ATG"
IsAssignment()) {
lexer.NextToken();
-#line 550 "cs.ATG"
+#line 555 "cs.ATG"
aliasident = t.val;
Expect(3);
}
Qualident(
-#line 551 "cs.ATG"
+#line 556 "cs.ATG"
out qualident);
-#line 551 "cs.ATG"
+#line 556 "cs.ATG"
if (qualident != null && qualident.Length > 0) {
if (aliasident != null) {
node = new UsingAliasDeclaration(aliasident, qualident);
@@ -535,7 +540,7 @@
Expect(10);
-#line 560 "cs.ATG"
+#line 565 "cs.ATG"
node.StartLocation = startPos;
node.EndLocation = t.EndLocation;
compilationUnit.AddChild(node);
@@ -545,11 +550,11 @@
void GlobalAttributeSection() {
Expect(16);
-#line 569 "cs.ATG"
+#line 574 "cs.ATG"
Point startPos = t.Location;
Expect(1);
-#line 569 "cs.ATG"
+#line 574 "cs.ATG"
if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
string attributeTarget = t.val;
ArrayList attributes = new ArrayList();
@@ -557,20 +562,20 @@
Expect(9);
Attribute(
-#line 574 "cs.ATG"
+#line 579 "cs.ATG"
out attribute);
-#line 574 "cs.ATG"
+#line 579 "cs.ATG"
attributes.Add(attribute);
while (
-#line 575 "cs.ATG"
+#line 580 "cs.ATG"
NotFinalComma()) {
Expect(12);
Attribute(
-#line 575 "cs.ATG"
+#line 580 "cs.ATG"
out attribute);
-#line 575 "cs.ATG"
+#line 580 "cs.ATG"
attributes.Add(attribute);
}
if (la.kind == 12) {
@@ -578,7 +583,7 @@
}
Expect(17);
-#line 577 "cs.ATG"
+#line 582 "cs.ATG"
AttributeSection section = new AttributeSection(attributeTarget, attributes);
section.StartLocation = startPos;
section.EndLocation = t.EndLocation;
@@ -588,7 +593,7 @@
void NamespaceMemberDecl() {
-#line 659 "cs.ATG"
+#line 664 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
Modifiers m = new Modifiers(this);
@@ -597,13 +602,13 @@
if (la.kind == 87) {
lexer.NextToken();
-#line 665 "cs.ATG"
+#line 670 "cs.ATG"
Point startPos = t.Location;
Qualident(
-#line 666 "cs.ATG"
+#line 671 "cs.ATG"
out qualident);
-#line 666 "cs.ATG"
+#line 671 "cs.ATG"
INode node = new NamespaceDeclaration(qualident);
node.StartLocation = startPos;
compilationUnit.AddChild(node);
@@ -621,83 +626,94 @@
lexer.NextToken();
}
-#line 675 "cs.ATG"
+#line 680 "cs.ATG"
node.EndLocation = t.EndLocation;
compilationUnit.BlockEnd();
} else if (StartOf(2)) {
while (la.kind == 16) {
AttributeSection(
-#line 679 "cs.ATG"
+#line 684 "cs.ATG"
out section);
-#line 679 "cs.ATG"
+#line 684 "cs.ATG"
attributes.Add(section);
}
while (StartOf(3)) {
TypeModifier(
-#line 680 "cs.ATG"
+#line 685 "cs.ATG"
m);
}
+
+#line 686 "cs.ATG"
+ bool partial = false;
+ if (
+#line 687 "cs.ATG"
+IdentIsPartial ()) {
+ lexer.NextToken();
+
+#line 687 "cs.ATG"
+ partial = true;
+ }
TypeDecl(
-#line 681 "cs.ATG"
-m, attributes);
+#line 688 "cs.ATG"
+m, attributes, partial);
} else SynErr(126);
}
void Qualident(
-#line 766 "cs.ATG"
+#line 775 "cs.ATG"
out string qualident) {
Expect(1);
-#line 768 "cs.ATG"
+#line 777 "cs.ATG"
StringBuilder qualidentBuilder = new StringBuilder(t.val);
while (
-#line 769 "cs.ATG"
+#line 778 "cs.ATG"
DotAndIdent()) {
Expect(13);
Expect(1);
-#line 769 "cs.ATG"
+#line 778 "cs.ATG"
qualidentBuilder.Append('.');
qualidentBuilder.Append(t.val);
}
-#line 772 "cs.ATG"
+#line 781 "cs.ATG"
qualident = qualidentBuilder.ToString();
}
void Attribute(
-#line 584 "cs.ATG"
+#line 589 "cs.ATG"
out ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute) {
-#line 585 "cs.ATG"
+#line 590 "cs.ATG"
string qualident;
Qualident(
-#line 587 "cs.ATG"
+#line 592 "cs.ATG"
out qualident);
-#line 587 "cs.ATG"
+#line 592 "cs.ATG"
ArrayList positional = new ArrayList();
ArrayList named = new ArrayList();
string name = qualident;
if (la.kind == 18) {
AttributeArguments(
-#line 591 "cs.ATG"
+#line 596 "cs.ATG"
ref positional, ref named);
}
-#line 591 "cs.ATG"
+#line 596 "cs.ATG"
attribute = new ICSharpCode.SharpRefactory.Parser.AST.Attribute(name, positional, named);
}
void AttributeArguments(
-#line 594 "cs.ATG"
+#line 599 "cs.ATG"
ref ArrayList positional, ref ArrayList named) {
-#line 596 "cs.ATG"
+#line 601 "cs.ATG"
bool nameFound = false;
string name = "";
Expression expr;
@@ -705,48 +721,48 @@
Expect(18);
if (StartOf(4)) {
if (
-#line 604 "cs.ATG"
+#line 609 "cs.ATG"
IsAssignment()) {
-#line 604 "cs.ATG"
+#line 609 "cs.ATG"
nameFound = true;
lexer.NextToken();
-#line 605 "cs.ATG"
+#line 610 "cs.ATG"
name = t.val;
Expect(3);
}
Expr(
-#line 607 "cs.ATG"
+#line 612 "cs.ATG"
out expr);
-#line 607 "cs.ATG"
+#line 612 "cs.ATG"
if(name == "") positional.Add(expr);
else { named.Add(new NamedArgument(name, expr)); name = ""; }
while (la.kind == 12) {
lexer.NextToken();
if (
-#line 614 "cs.ATG"
+#line 619 "cs.ATG"
IsAssignment()) {
-#line 614 "cs.ATG"
+#line 619 "cs.ATG"
nameFound = true;
Expect(1);
-#line 615 "cs.ATG"
+#line 620 "cs.ATG"
name = t.val;
Expect(3);
} else if (StartOf(4)) {
-#line 617 "cs.ATG"
+#line 622 "cs.ATG"
if (nameFound) Error("no positional argument after named argument");
} else SynErr(127);
Expr(
-#line 618 "cs.ATG"
+#line 623 "cs.ATG"
out expr);
-#line 618 "cs.ATG"
+#line 623 "cs.ATG"
if(name == "") positional.Add(expr);
else { named.Add(new NamedArgument(name, expr)); name = ""; }
@@ -756,52 +772,52 @@
}
void Expr(
-#line 1748 "cs.ATG"
+#line 1759 "cs.ATG"
out Expression expr) {
-#line 1749 "cs.ATG"
+#line 1760 "cs.ATG"
expr = null; Expression expr1 = null, expr2 = null;
UnaryExpr(
-#line 1751 "cs.ATG"
+#line 1762 "cs.ATG"
out expr);
if (StartOf(5)) {
ConditionalOrExpr(
-#line 1754 "cs.ATG"
+#line 1765 "cs.ATG"
ref expr);
if (la.kind == 11) {
lexer.NextToken();
Expr(
-#line 1754 "cs.ATG"
+#line 1765 "cs.ATG"
out expr1);
Expect(9);
Expr(
-#line 1754 "cs.ATG"
+#line 1765 "cs.ATG"
out expr2);
-#line 1754 "cs.ATG"
+#line 1765 "cs.ATG"
expr = new ConditionalExpression(expr, expr1, expr2);
}
} else if (StartOf(6)) {
-#line 1756 "cs.ATG"
+#line 1767 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1756 "cs.ATG"
+#line 1767 "cs.ATG"
out op);
Expr(
-#line 1756 "cs.ATG"
+#line 1767 "cs.ATG"
out val);
-#line 1756 "cs.ATG"
+#line 1767 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else SynErr(128);
}
void AttributeSection(
-#line 626 "cs.ATG"
+#line 631 "cs.ATG"
out AttributeSection section) {
-#line 628 "cs.ATG"
+#line 633 "cs.ATG"
string attributeTarget = "";
ArrayList attributes = new ArrayList();
ICSharpCode.SharpRefactory.Parser.AST.Attribute attribute;
@@ -809,25 +825,25 @@
Expect(16);
-#line 634 "cs.ATG"
+#line 639 "cs.ATG"
Point startPos = t.Location;
if (
-#line 635 "cs.ATG"
+#line 640 "cs.ATG"
IsLocalAttrTarget()) {
if (la.kind == 68) {
lexer.NextToken();
-#line 636 "cs.ATG"
+#line 641 "cs.ATG"
attributeTarget = "event";
} else if (la.kind == 100) {
lexer.NextToken();
-#line 637 "cs.ATG"
+#line 642 "cs.ATG"
attributeTarget = "return";
} else {
lexer.NextToken();
-#line 638 "cs.ATG"
+#line 643 "cs.ATG"
if (t.val != "field" || t.val != "method" ||
t.val != "module" || t.val != "param" ||
t.val != "property" || t.val != "type")
@@ -839,20 +855,20 @@
Expect(9);
}
Attribute(
-#line 648 "cs.ATG"
+#line 653 "cs.ATG"
out attribute);
-#line 648 "cs.ATG"
+#line 653 "cs.ATG"
attributes.Add(attribute);
while (
-#line 649 "cs.ATG"
+#line 654 "cs.ATG"
NotFinalComma()) {
Expect(12);
Attribute(
-#line 649 "cs.ATG"
+#line 654 "cs.ATG"
out attribute);
-#line 649 "cs.ATG"
+#line 654 "cs.ATG"
attributes.Add(attribute);
}
if (la.kind == 12) {
@@ -860,7 +876,7 @@
}
Expect(17);
-#line 651 "cs.ATG"
+#line 656 "cs.ATG"
section = new AttributeSection(attributeTarget, attributes);
section.StartLocation = startPos;
section.EndLocation = t.EndLocation;
@@ -868,69 +884,69 @@
}
void TypeModifier(
-#line 937 "cs.ATG"
+#line 946 "cs.ATG"
Modifiers m) {
switch (la.kind) {
case 88: {
lexer.NextToken();
-#line 939 "cs.ATG"
+#line 948 "cs.ATG"
m.Add(Modifier.New);
break;
}
case 97: {
lexer.NextToken();
-#line 940 "cs.ATG"
+#line 949 "cs.ATG"
m.Add(Modifier.Public);
break;
}
case 96: {
lexer.NextToken();
-#line 941 "cs.ATG"
+#line 950 "cs.ATG"
m.Add(Modifier.Protected);
break;
}
case 83: {
lexer.NextToken();
-#line 942 "cs.ATG"
+#line 951 "cs.ATG"
m.Add(Modifier.Internal);
break;
}
case 95: {
lexer.NextToken();
-#line 943 "cs.ATG"
+#line 952 "cs.ATG"
m.Add(Modifier.Private);
break;
}
case 118: {
lexer.NextToken();
-#line 944 "cs.ATG"
+#line 953 "cs.ATG"
m.Add(Modifier.Unsafe);
break;
}
case 48: {
lexer.NextToken();
-#line 945 "cs.ATG"
+#line 954 "cs.ATG"
m.Add(Modifier.Abstract);
break;
}
case 102: {
lexer.NextToken();
-#line 946 "cs.ATG"
+#line 955 "cs.ATG"
m.Add(Modifier.Sealed);
break;
}
case 106: {
lexer.NextToken();
-#line 947 "cs.ATG"
+#line 956 "cs.ATG"
m.Add(Modifier.Static);
break;
}
@@ -939,22 +955,22 @@
}
void TypeDecl(
-#line 684 "cs.ATG"
-Modifiers m, ArrayList attributes) {
+#line 691 "cs.ATG"
+Modifiers m, ArrayList attributes, bool partial) {
-#line 686 "cs.ATG"
+#line 693 "cs.ATG"
TypeReference type;
StringCollection names;
ArrayList p; string name;
if (la.kind == 58) {
-#line 690 "cs.ATG"
+#line 697 "cs.ATG"
m.Check(Modifier.Classes);
lexer.NextToken();
-#line 691 "cs.ATG"
- TypeDeclaration newType = new TypeDeclaration();
+#line 698 "cs.ATG"
+ TypeDeclaration newType = new TypeDeclaration (partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
@@ -964,37 +980,37 @@
Expect(1);
-#line 699 "cs.ATG"
+#line 706 "cs.ATG"
newType.Name = t.val;
if (la.kind == 9) {
ClassBase(
-#line 700 "cs.ATG"
+#line 707 "cs.ATG"
out names);
-#line 700 "cs.ATG"
+#line 707 "cs.ATG"
newType.BaseTypes = names;
}
-#line 700 "cs.ATG"
+#line 707 "cs.ATG"
newType.StartLocation = t.EndLocation;
ClassBody();
if (la.kind == 10) {
lexer.NextToken();
}
-#line 702 "cs.ATG"
+#line 709 "cs.ATG"
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
} else if (StartOf(7)) {
-#line 705 "cs.ATG"
+#line 712 "cs.ATG"
m.Check(Modifier.StructsInterfacesEnumsDelegates);
if (la.kind == 108) {
lexer.NextToken();
-#line 706 "cs.ATG"
- TypeDeclaration newType = new TypeDeclaration();
+#line 713 "cs.ATG"
+ TypeDeclaration newType = new TypeDeclaration(partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Struct;
@@ -1003,33 +1019,33 @@
Expect(1);
-#line 713 "cs.ATG"
+#line 720 "cs.ATG"
newType.Name = t.val;
if (la.kind == 9) {
StructInterfaces(
-#line 714 "cs.ATG"
+#line 721 "cs.ATG"
out names);
-#line 714 "cs.ATG"
+#line 721 "cs.ATG"
newType.BaseTypes = names;
}
-#line 714 "cs.ATG"
+#line 721 "cs.ATG"
newType.StartLocation = t.EndLocation;
StructBody();
if (la.kind == 10) {
lexer.NextToken();
}
-#line 716 "cs.ATG"
+#line 723 "cs.ATG"
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
} else if (la.kind == 82) {
lexer.NextToken();
-#line 720 "cs.ATG"
- TypeDeclaration newType = new TypeDeclaration();
+#line 727 "cs.ATG"
+ TypeDeclaration newType = new TypeDeclaration(partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Interface;
@@ -1037,106 +1053,108 @@
newType.Modifier = m.Modifier;
Expect(1);
-#line 726 "cs.ATG"
+#line 733 "cs.ATG"
newType.Name = t.val;
if (la.kind == 9) {
InterfaceBase(
-#line 727 "cs.ATG"
+#line 734 "cs.ATG"
out names);
-#line 727 "cs.ATG"
+#line 734 "cs.ATG"
newType.BaseTypes = names;
}
-#line 727 "cs.ATG"
+#line 734 "cs.ATG"
newType.StartLocation = t.EndLocation;
InterfaceBody();
if (la.kind == 10) {
lexer.NextToken();
}
-#line 729 "cs.ATG"
+#line 736 "cs.ATG"
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
} else if (la.kind == 67) {
lexer.NextToken();
-#line 733 "cs.ATG"
+#line 740 "cs.ATG"
+ if (partial) Error ("partial is not allowed for enum types");
TypeDeclaration newType = new TypeDeclaration();
- compilationUnit.AddChild(newType);
- compilationUnit.BlockStart(newType);
- newType.Type = Types.Enum;
- newType.Attributes = attributes;
- newType.Modifier = m.Modifier;
+ compilationUnit.AddChild(newType);
+ compilationUnit.BlockStart(newType);
+ newType.Type = Types.Enum;
+ newType.Attributes = attributes;
+ newType.Modifier = m.Modifier;
Expect(1);
-#line 739 "cs.ATG"
+#line 747 "cs.ATG"
newType.Name = t.val;
if (la.kind == 9) {
lexer.NextToken();
IntegralType(
-#line 740 "cs.ATG"
+#line 748 "cs.ATG"
out name);
-#line 740 "cs.ATG"
+#line 748 "cs.ATG"
newType.BaseTypes = new StringCollection();
newType.BaseTypes.Add(name);
}
-#line 743 "cs.ATG"
+#line 751 "cs.ATG"
newType.StartLocation = t.EndLocation;
EnumBody();
if (la.kind == 10) {
lexer.NextToken();
}
-#line 745 "cs.ATG"
+#line 753 "cs.ATG"
newType.EndLocation = t.Location;
compilationUnit.BlockEnd();
} else {
lexer.NextToken();
-#line 749 "cs.ATG"
+#line 757 "cs.ATG"
+ if (partial) Error ("partial is not allowed for delegate types");
DelegateDeclaration delegateDeclr = new DelegateDeclaration();
- delegateDeclr.StartLocation = t.Location;
- delegateDeclr.Modifier = m.Modifier;
- delegateDeclr.Attributes = attributes;
-
+ delegateDeclr.StartLocation = t.Location;
+ delegateDeclr.Modifier = m.Modifier;
+ delegateDeclr.Attributes = attributes;
+
if (
-#line 754 "cs.ATG"
+#line 763 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 754 "cs.ATG"
+#line 763 "cs.ATG"
delegateDeclr.ReturnType = new TypeReference("void", 0, null);
} else if (StartOf(8)) {
Type(
-#line 755 "cs.ATG"
+#line 764 "cs.ATG"
out type);
-#line 755 "cs.ATG"
+#line 764 "cs.ATG"
delegateDeclr.ReturnType = type;
} else SynErr(130);
Expect(1);
-#line 757 "cs.ATG"
+#line 766 "cs.ATG"
delegateDeclr.Name = t.val;
Expect(18);
if (StartOf(9)) {
FormalParameterList(
-#line 758 "cs.ATG"
+#line 767 "cs.ATG"
out p);
-#line 758 "cs.ATG"
+#line 767 "cs.ATG"
delegateDeclr.Parameters = p;
}
Expect(19);
Expect(10);
-#line 760 "cs.ATG"
+#line 769 "cs.ATG"
delegateDeclr.EndLocation = t.Location;
compilationUnit.AddChild(delegateDeclr);
@@ -1145,141 +1163,141 @@
}
void ClassBase(
-#line 775 "cs.ATG"
+#line 784 "cs.ATG"
out StringCollection names) {
-#line 777 "cs.ATG"
+#line 786 "cs.ATG"
string qualident;
names = new StringCollection();
Expect(9);
ClassType(
-#line 781 "cs.ATG"
+#line 790 "cs.ATG"
out qualident);
-#line 781 "cs.ATG"
+#line 790 "cs.ATG"
names.Add(qualident);
while (la.kind == 12) {
lexer.NextToken();
Qualident(
-#line 782 "cs.ATG"
+#line 791 "cs.ATG"
out qualident);
-#line 782 "cs.ATG"
+#line 791 "cs.ATG"
names.Add(qualident);
}
}
void ClassBody() {
-#line 786 "cs.ATG"
+#line 795 "cs.ATG"
AttributeSection section;
Expect(14);
while (StartOf(10)) {
-#line 789 "cs.ATG"
+#line 798 "cs.ATG"
ArrayList attributes = new ArrayList();
Modifiers m = new Modifiers(this);
while (la.kind == 16) {
AttributeSection(
-#line 792 "cs.ATG"
+#line 801 "cs.ATG"
out section);
-#line 792 "cs.ATG"
+#line 801 "cs.ATG"
attributes.Add(section);
}
while (StartOf(11)) {
MemberModifier(
-#line 793 "cs.ATG"
+#line 802 "cs.ATG"
m);
}
ClassMemberDecl(
-#line 794 "cs.ATG"
+#line 803 "cs.ATG"
m, attributes);
}
Expect(15);
}
void StructInterfaces(
-#line 799 "cs.ATG"
+#line 808 "cs.ATG"
out StringCollection names) {
-#line 801 "cs.ATG"
+#line 810 "cs.ATG"
string qualident;
names = new StringCollection();
Expect(9);
Qualident(
-#line 805 "cs.ATG"
+#line 814 "cs.ATG"
out qualident);
-#line 805 "cs.ATG"
+#line 814 "cs.ATG"
names.Add(qualident);
while (la.kind == 12) {
lexer.NextToken();
Qualident(
-#line 806 "cs.ATG"
+#line 815 "cs.ATG"
out qualident);
-#line 806 "cs.ATG"
+#line 815 "cs.ATG"
names.Add(qualident);
}
}
void StructBody() {
-#line 810 "cs.ATG"
+#line 819 "cs.ATG"
AttributeSection section;
Expect(14);
while (StartOf(12)) {
-#line 813 "cs.ATG"
+#line 822 "cs.ATG"
ArrayList attributes = new ArrayList();
Modifiers m = new Modifiers(this);
while (la.kind == 16) {
AttributeSection(
-#line 816 "cs.ATG"
+#line 825 "cs.ATG"
out section);
-#line 816 "cs.ATG"
+#line 825 "cs.ATG"
attributes.Add(section);
}
while (StartOf(11)) {
MemberModifier(
-#line 817 "cs.ATG"
+#line 826 "cs.ATG"
m);
}
StructMemberDecl(
-#line 818 "cs.ATG"
+#line 827 "cs.ATG"
m, attributes);
}
Expect(15);
}
void InterfaceBase(
-#line 823 "cs.ATG"
+#line 832 "cs.ATG"
out StringCollection names) {
-#line 825 "cs.ATG"
+#line 834 "cs.ATG"
string qualident;
names = new StringCollection();
Expect(9);
Qualident(
-#line 829 "cs.ATG"
+#line 838 "cs.ATG"
out qualident);
-#line 829 "cs.ATG"
+#line 838 "cs.ATG"
names.Add(qualident);
while (la.kind == 12) {
lexer.NextToken();
Qualident(
-#line 830 "cs.ATG"
+#line 839 "cs.ATG"
out qualident);
-#line 830 "cs.ATG"
+#line 839 "cs.ATG"
names.Add(qualident);
}
}
@@ -1293,72 +1311,72 @@
}
void IntegralType(
-#line 957 "cs.ATG"
+#line 966 "cs.ATG"
out string name) {
-#line 957 "cs.ATG"
+#line 966 "cs.ATG"
name = "";
switch (la.kind) {
case 101: {
lexer.NextToken();
-#line 959 "cs.ATG"
+#line 968 "cs.ATG"
name = "sbyte";
break;
}
case 53: {
lexer.NextToken();
-#line 960 "cs.ATG"
+#line 969 "cs.ATG"
name = "byte";
break;
}
case 103: {
lexer.NextToken();
-#line 961 "cs.ATG"
+#line 970 "cs.ATG"
name = "short";
break;
}
case 119: {
lexer.NextToken();
-#line 962 "cs.ATG"
+#line 971 "cs.ATG"
name = "ushort";
break;
}
case 81: {
lexer.NextToken();
-#line 963 "cs.ATG"
+#line 972 "cs.ATG"
name = "int";
break;
}
case 115: {
lexer.NextToken();
-#line 964 "cs.ATG"
+#line 973 "cs.ATG"
name = "uint";
break;
}
case 86: {
lexer.NextToken();
-#line 965 "cs.ATG"
+#line 974 "cs.ATG"
name = "long";
break;
}
case 116: {
lexer.NextToken();
-#line 966 "cs.ATG"
+#line 975 "cs.ATG"
name = "ulong";
break;
}
case 56: {
lexer.NextToken();
-#line 967 "cs.ATG"
+#line 976 "cs.ATG"
name = "char";
break;
}
@@ -1368,25 +1386,25 @@
void EnumBody() {
-#line 836 "cs.ATG"
+#line 845 "cs.ATG"
FieldDeclaration f;
Expect(14);
if (la.kind == 1 || la.kind == 16) {
EnumMemberDecl(
-#line 838 "cs.ATG"
+#line 847 "cs.ATG"
out f);
-#line 838 "cs.ATG"
+#line 847 "cs.ATG"
compilationUnit.AddChild(f);
while (
-#line 839 "cs.ATG"
+#line 848 "cs.ATG"
NotFinalComma()) {
Expect(12);
EnumMemberDecl(
-#line 839 "cs.ATG"
+#line 848 "cs.ATG"
out f);
-#line 839 "cs.ATG"
+#line 848 "cs.ATG"
compilationUnit.AddChild(f);
}
if (la.kind == 12) {
@@ -1397,68 +1415,68 @@
}
void Type(
-#line 844 "cs.ATG"
+#line 853 "cs.ATG"
out TypeReference type) {
-#line 846 "cs.ATG"
+#line 855 "cs.ATG"
string name = "";
int pointer = 0;
if (la.kind == 1 || la.kind == 90 || la.kind == 107) {
ClassType(
-#line 850 "cs.ATG"
+#line 859 "cs.ATG"
out name);
} else if (StartOf(14)) {
SimpleType(
-#line 851 "cs.ATG"
+#line 860 "cs.ATG"
out name);
} else if (la.kind == 122) {
lexer.NextToken();
Expect(6);
-#line 852 "cs.ATG"
+#line 861 "cs.ATG"
pointer = 1; name = "void";
} else SynErr(133);
-#line 853 "cs.ATG"
+#line 862 "cs.ATG"
ArrayList r = new ArrayList();
while (
-#line 854 "cs.ATG"
+#line 863 "cs.ATG"
IsPointerOrDims()) {
-#line 854 "cs.ATG"
+#line 863 "cs.ATG"
int i = 1;
if (la.kind == 6) {
lexer.NextToken();
-#line 855 "cs.ATG"
+#line 864 "cs.ATG"
++pointer;
} else if (la.kind == 16) {
lexer.NextToken();
while (la.kind == 12) {
lexer.NextToken();
-#line 856 "cs.ATG"
+#line 865 "cs.ATG"
++i;
}
Expect(17);
-#line 856 "cs.ATG"
+#line 865 "cs.ATG"
r.Add(i);
} else SynErr(134);
}
-#line 858 "cs.ATG"
+#line 867 "cs.ATG"
int[] rank = new int[r.Count]; r.CopyTo(rank);
type = new TypeReference(name, pointer, rank);
}
void FormalParameterList(
-#line 892 "cs.ATG"
+#line 901 "cs.ATG"
out ArrayList parameter) {
-#line 894 "cs.ATG"
+#line 903 "cs.ATG"
parameter = new ArrayList();
ParameterDeclarationExpression p;
AttributeSection section;
@@ -1466,18 +1484,18 @@
while (la.kind == 16) {
AttributeSection(
-#line 900 "cs.ATG"
+#line 909 "cs.ATG"
out section);
-#line 900 "cs.ATG"
+#line 909 "cs.ATG"
attributes.Add(section);
}
if (StartOf(15)) {
FixedParameter(
-#line 902 "cs.ATG"
+#line 911 "cs.ATG"
out p);
-#line 902 "cs.ATG"
+#line 911 "cs.ATG"
bool paramsFound = false;
p.Attributes = attributes;
parameter.Add(p);
@@ -1485,167 +1503,167 @@
while (la.kind == 12) {
lexer.NextToken();
-#line 907 "cs.ATG"
+#line 916 "cs.ATG"
attributes = new ArrayList(); if (paramsFound) Error("params array must be at end of parameter list");
while (la.kind == 16) {
AttributeSection(
-#line 908 "cs.ATG"
+#line 917 "cs.ATG"
out section);
-#line 908 "cs.ATG"
+#line 917 "cs.ATG"
attributes.Add(section);
}
if (StartOf(15)) {
FixedParameter(
-#line 910 "cs.ATG"
+#line 919 "cs.ATG"
out p);
-#line 910 "cs.ATG"
+#line 919 "cs.ATG"
p.Attributes = attributes; parameter.Add(p);
} else if (la.kind == 94) {
ParameterArray(
-#line 911 "cs.ATG"
+#line 920 "cs.ATG"
out p);
-#line 911 "cs.ATG"
+#line 920 "cs.ATG"
paramsFound = true; p.Attributes = attributes; parameter.Add(p);
} else SynErr(135);
}
} else if (la.kind == 94) {
ParameterArray(
-#line 914 "cs.ATG"
+#line 923 "cs.ATG"
out p);
-#line 914 "cs.ATG"
+#line 923 "cs.ATG"
p.Attributes = attributes; parameter.Add(p);
} else SynErr(136);
}
void ClassType(
-#line 950 "cs.ATG"
+#line 959 "cs.ATG"
out string name) {
-#line 950 "cs.ATG"
+#line 959 "cs.ATG"
string qualident; name = "";
if (la.kind == 1) {
Qualident(
-#line 952 "cs.ATG"
+#line 961 "cs.ATG"
out qualident);
-#line 952 "cs.ATG"
+#line 961 "cs.ATG"
name = qualident;
} else if (la.kind == 90) {
lexer.NextToken();
-#line 953 "cs.ATG"
+#line 962 "cs.ATG"
name = "object";
} else if (la.kind == 107) {
lexer.NextToken();
-#line 954 "cs.ATG"
+#line 963 "cs.ATG"
name = "string";
} else SynErr(137);
}
void MemberModifier(
-#line 970 "cs.ATG"
+#line 979 "cs.ATG"
Modifiers m) {
switch (la.kind) {
case 48: {
lexer.NextToken();
-#line 972 "cs.ATG"
+#line 981 "cs.ATG"
m.Add(Modifier.Abstract);
break;
}
case 70: {
lexer.NextToken();
-#line 973 "cs.ATG"
+#line 982 "cs.ATG"
m.Add(Modifier.Extern);
break;
}
case 83: {
lexer.NextToken();
-#line 974 "cs.ATG"
+#line 983 "cs.ATG"
m.Add(Modifier.Internal);
break;
}
case 88: {
lexer.NextToken();
-#line 975 "cs.ATG"
+#line 984 "cs.ATG"
m.Add(Modifier.New);
break;
}
case 93: {
lexer.NextToken();
-#line 976 "cs.ATG"
+#line 985 "cs.ATG"
m.Add(Modifier.Override);
break;
}
case 95: {
lexer.NextToken();
-#line 977 "cs.ATG"
+#line 986 "cs.ATG"
m.Add(Modifier.Private);
break;
}
case 96: {
lexer.NextToken();
-#line 978 "cs.ATG"
+#line 987 "cs.ATG"
m.Add(Modifier.Protected);
break;
}
case 97: {
lexer.NextToken();
-#line 979 "cs.ATG"
+#line 988 "cs.ATG"
m.Add(Modifier.Public);
break;
}
case 98: {
lexer.NextToken();
-#line 980 "cs.ATG"
+#line 989 "cs.ATG"
m.Add(Modifier.Readonly);
break;
}
case 102: {
lexer.NextToken();
-#line 981 "cs.ATG"
+#line 990 "cs.ATG"
m.Add(Modifier.Sealed);
break;
}
case 106: {
lexer.NextToken();
-#line 982 "cs.ATG"
+#line 991 "cs.ATG"
m.Add(Modifier.Static);
break;
}
case 118: {
lexer.NextToken();
-#line 983 "cs.ATG"
+#line 992 "cs.ATG"
m.Add(Modifier.Unsafe);
break;
}
case 121: {
lexer.NextToken();
-#line 984 "cs.ATG"
+#line 993 "cs.ATG"
m.Add(Modifier.Virtual);
break;
}
case 123: {
lexer.NextToken();
-#line 985 "cs.ATG"
+#line 994 "cs.ATG"
m.Add(Modifier.Volatile);
break;
}
@@ -1654,23 +1672,23 @@
}
void ClassMemberDecl(
-#line 1204 "cs.ATG"
+#line 1215 "cs.ATG"
Modifiers m, ArrayList attributes) {
-#line 1205 "cs.ATG"
+#line 1216 "cs.ATG"
Statement stmt = null;
if (StartOf(16)) {
StructMemberDecl(
-#line 1207 "cs.ATG"
+#line 1218 "cs.ATG"
m, attributes);
} else if (la.kind == 25) {
-#line 1208 "cs.ATG"
+#line 1219 "cs.ATG"
m.Check(Modifier.Destructors); Point startPos = t.Location;
lexer.NextToken();
Expect(1);
-#line 1209 "cs.ATG"
+#line 1220 "cs.ATG"
DestructorDeclaration d = new DestructorDeclaration(t.val, attributes);
d.Modifier = m.Modifier;
d.StartLocation = startPos;
@@ -1679,13 +1697,13 @@
Expect(19);
if (la.kind == 14) {
Block(
-#line 1213 "cs.ATG"
+#line 1224 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(139);
-#line 1213 "cs.ATG"
+#line 1224 "cs.ATG"
d.EndLocation = t.EndLocation;
d.Body = (BlockStatement)stmt;
compilationUnit.AddChild(d);
@@ -1694,10 +1712,10 @@
}
void StructMemberDecl(
-#line 996 "cs.ATG"
+#line 1005 "cs.ATG"
Modifiers m, ArrayList attributes) {
-#line 998 "cs.ATG"
+#line 1007 "cs.ATG"
string qualident = null;
TypeReference type;
Expression expr;
@@ -1707,68 +1725,68 @@
if (la.kind == 59) {
-#line 1006 "cs.ATG"
+#line 1015 "cs.ATG"
m.Check(Modifier.Constants);
lexer.NextToken();
Type(
-#line 1008 "cs.ATG"
+#line 1017 "cs.ATG"
out type);
Expect(1);
-#line 1008 "cs.ATG"
+#line 1017 "cs.ATG"
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const);
VariableDeclaration f = new VariableDeclaration(t.val);
fd.Fields.Add(f);
Expect(3);
Expr(
-#line 1012 "cs.ATG"
+#line 1021 "cs.ATG"
out expr);
-#line 1012 "cs.ATG"
+#line 1021 "cs.ATG"
f.Initializer = expr;
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1013 "cs.ATG"
+#line 1022 "cs.ATG"
f = new VariableDeclaration(t.val);
fd.Fields.Add(f);
Expect(3);
Expr(
-#line 1016 "cs.ATG"
+#line 1025 "cs.ATG"
out expr);
-#line 1016 "cs.ATG"
+#line 1025 "cs.ATG"
f.Initializer = expr;
}
Expect(10);
-#line 1017 "cs.ATG"
+#line 1026 "cs.ATG"
fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd);
} else if (
-#line 1020 "cs.ATG"
+#line 1029 "cs.ATG"
NotVoidPointer()) {
-#line 1020 "cs.ATG"
+#line 1029 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
Expect(122);
-#line 1021 "cs.ATG"
+#line 1030 "cs.ATG"
Point startPos = t.Location;
Qualident(
-#line 1022 "cs.ATG"
+#line 1031 "cs.ATG"
out qualident);
Expect(18);
if (StartOf(9)) {
FormalParameterList(
-#line 1023 "cs.ATG"
+#line 1032 "cs.ATG"
out p);
}
Expect(19);
-#line 1023 "cs.ATG"
+#line 1032 "cs.ATG"
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
@@ -1781,23 +1799,23 @@
if (la.kind == 14) {
Block(
-#line 1033 "cs.ATG"
+#line 1042 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(141);
-#line 1033 "cs.ATG"
+#line 1042 "cs.ATG"
compilationUnit.BlockEnd();
methodDeclaration.Body = (BlockStatement)stmt;
} else if (la.kind == 68) {
-#line 1037 "cs.ATG"
+#line 1046 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
lexer.NextToken();
-#line 1038 "cs.ATG"
+#line 1047 "cs.ATG"
EventDeclaration eventDecl = new EventDeclaration(m.Modifier, attributes);
eventDecl.StartLocation = t.Location;
compilationUnit.AddChild(eventDecl);
@@ -1806,102 +1824,102 @@
EventRemoveRegion removeBlock = null;
Type(
-#line 1045 "cs.ATG"
+#line 1054 "cs.ATG"
out type);
-#line 1045 "cs.ATG"
+#line 1054 "cs.ATG"
eventDecl.TypeReference = type;
if (
-#line 1047 "cs.ATG"
+#line 1056 "cs.ATG"
IsVarDecl()) {
VariableDeclarator(
-#line 1047 "cs.ATG"
+#line 1056 "cs.ATG"
variableDeclarators);
while (la.kind == 12) {
lexer.NextToken();
VariableDeclarator(
-#line 1048 "cs.ATG"
+#line 1057 "cs.ATG"
variableDeclarators);
}
Expect(10);
-#line 1048 "cs.ATG"
+#line 1057 "cs.ATG"
eventDecl.VariableDeclarators = variableDeclarators; eventDecl.EndLocation = t.EndLocation;
} else if (la.kind == 1) {
Qualident(
-#line 1049 "cs.ATG"
+#line 1058 "cs.ATG"
out qualident);
-#line 1049 "cs.ATG"
+#line 1058 "cs.ATG"
eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation;
Expect(14);
-#line 1050 "cs.ATG"
+#line 1059 "cs.ATG"
eventDecl.BodyStart = t.Location;
EventAccessorDecls(
-#line 1051 "cs.ATG"
+#line 1060 "cs.ATG"
out addBlock, out removeBlock);
Expect(15);
-#line 1052 "cs.ATG"
+#line 1061 "cs.ATG"
eventDecl.BodyEnd = t.EndLocation;
} else SynErr(142);
-#line 1053 "cs.ATG"
+#line 1062 "cs.ATG"
compilationUnit.BlockEnd();
eventDecl.AddRegion = addBlock;
eventDecl.RemoveRegion = removeBlock;
} else if (
-#line 1060 "cs.ATG"
+#line 1069 "cs.ATG"
IdentAndLPar()) {
-#line 1060 "cs.ATG"
+#line 1069 "cs.ATG"
m.Check(Modifier.Constructors | Modifier.StaticConstructors);
Expect(1);
-#line 1061 "cs.ATG"
+#line 1070 "cs.ATG"
string name = t.val; Point startPos = t.Location;
Expect(18);
if (StartOf(9)) {
-#line 1061 "cs.ATG"
+#line 1070 "cs.ATG"
m.Check(Modifier.Constructors);
FormalParameterList(
-#line 1062 "cs.ATG"
+#line 1071 "cs.ATG"
out p);
}
Expect(19);
-#line 1064 "cs.ATG"
+#line 1073 "cs.ATG"
ConstructorInitializer init = null;
if (la.kind == 9) {
-#line 1065 "cs.ATG"
+#line 1074 "cs.ATG"
m.Check(Modifier.Constructors);
ConstructorInitializer(
-#line 1066 "cs.ATG"
+#line 1075 "cs.ATG"
out init);
}
-#line 1068 "cs.ATG"
+#line 1077 "cs.ATG"
ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes);
cd.StartLocation = startPos;
cd.EndLocation = t.EndLocation;
if (la.kind == 14) {
Block(
-#line 1073 "cs.ATG"
+#line 1082 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(143);
-#line 1073 "cs.ATG"
+#line 1082 "cs.ATG"
cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd);
} else if (la.kind == 69 || la.kind == 79) {
-#line 1076 "cs.ATG"
+#line 1085 "cs.ATG"
m.Check(Modifier.Operators);
if (m.isNone) Error("at least one modifier must be set");
bool isImplicit = true;
@@ -1911,37 +1929,37 @@
} else {
lexer.NextToken();
-#line 1080 "cs.ATG"
+#line 1089 "cs.ATG"
isImplicit = false;
}
Expect(91);
Type(
-#line 1081 "cs.ATG"
+#line 1090 "cs.ATG"
out type);
-#line 1081 "cs.ATG"
+#line 1090 "cs.ATG"
TypeReference operatorType = type;
Expect(18);
Type(
-#line 1082 "cs.ATG"
+#line 1091 "cs.ATG"
out type);
Expect(1);
-#line 1082 "cs.ATG"
+#line 1091 "cs.ATG"
string varName = t.val;
Expect(19);
if (la.kind == 14) {
Block(
-#line 1082 "cs.ATG"
+#line 1091 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
-#line 1082 "cs.ATG"
+#line 1091 "cs.ATG"
stmt = null;
} else SynErr(144);
-#line 1085 "cs.ATG"
+#line 1094 "cs.ATG"
OperatorDeclarator operatorDeclarator = new OperatorDeclarator(isImplicit ? OperatorType.Implicit : OperatorType.Explicit,
operatorType,
type,
@@ -1951,55 +1969,66 @@
compilationUnit.AddChild(operatorDeclaration);
} else if (StartOf(17)) {
+
+#line 1104 "cs.ATG"
+ bool partial = false;
+ if (
+#line 1105 "cs.ATG"
+IdentIsPartial ()) {
+ lexer.NextToken();
+
+#line 1105 "cs.ATG"
+ partial = true;
+ }
TypeDecl(
-#line 1095 "cs.ATG"
-m, attributes);
+#line 1106 "cs.ATG"
+m, attributes, partial);
} else if (StartOf(8)) {
Type(
-#line 1096 "cs.ATG"
+#line 1107 "cs.ATG"
out type);
-#line 1096 "cs.ATG"
+#line 1107 "cs.ATG"
Point startPos = t.Location;
if (la.kind == 91) {
-#line 1098 "cs.ATG"
+#line 1109 "cs.ATG"
Token op;
m.Check(Modifier.Operators);
if (m.isNone) Error("at least one modifier must be set");
lexer.NextToken();
OverloadableOperator(
-#line 1102 "cs.ATG"
+#line 1113 "cs.ATG"
out op);
-#line 1102 "cs.ATG"
+#line 1113 "cs.ATG"
TypeReference firstType, secondType = null; string secondName = null;
Expect(18);
Type(
-#line 1103 "cs.ATG"
+#line 1114 "cs.ATG"
out firstType);
Expect(1);
-#line 1103 "cs.ATG"
+#line 1114 "cs.ATG"
string firstName = t.val;
if (la.kind == 12) {
lexer.NextToken();
Type(
-#line 1104 "cs.ATG"
+#line 1115 "cs.ATG"
out secondType);
Expect(1);
-#line 1104 "cs.ATG"
+#line 1115 "cs.ATG"
secondName = t.val;
-#line 1104 "cs.ATG"
+#line 1115 "cs.ATG"
if (ParserUtil.IsUnaryOperator(op) && !ParserUtil.IsBinaryOperator(op))
Error("too many operands for unary operator");
} else if (la.kind == 19) {
-#line 1107 "cs.ATG"
+#line 1118 "cs.ATG"
if (ParserUtil.IsBinaryOperator(op))
Error("too few operands for binary operator");
@@ -2007,13 +2036,13 @@
Expect(19);
if (la.kind == 14) {
Block(
-#line 1111 "cs.ATG"
+#line 1122 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(146);
-#line 1113 "cs.ATG"
+#line 1124 "cs.ATG"
OperatorDeclarator operatorDeclarator = new OperatorDeclarator(secondType != null ? OperatorType.Binary : OperatorType.Unary,
type,
op.kind,
@@ -2026,43 +2055,43 @@
compilationUnit.AddChild(operatorDeclaration);
} else if (
-#line 1126 "cs.ATG"
+#line 1137 "cs.ATG"
IsVarDecl()) {
-#line 1126 "cs.ATG"
+#line 1137 "cs.ATG"
m.Check(Modifier.Fields);
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
fd.StartLocation = startPos;
VariableDeclarator(
-#line 1130 "cs.ATG"
+#line 1141 "cs.ATG"
variableDeclarators);
while (la.kind == 12) {
lexer.NextToken();
VariableDeclarator(
-#line 1131 "cs.ATG"
+#line 1142 "cs.ATG"
variableDeclarators);
}
Expect(10);
-#line 1132 "cs.ATG"
+#line 1143 "cs.ATG"
fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd);
} else if (la.kind == 110) {
-#line 1135 "cs.ATG"
+#line 1146 "cs.ATG"
m.Check(Modifier.Indexers);
lexer.NextToken();
Expect(16);
FormalParameterList(
-#line 1136 "cs.ATG"
+#line 1147 "cs.ATG"
out p);
Expect(17);
-#line 1136 "cs.ATG"
+#line 1147 "cs.ATG"
Point endLocation = t.EndLocation;
Expect(14);
-#line 1137 "cs.ATG"
+#line 1148 "cs.ATG"
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = endLocation;
@@ -2071,11 +2100,11 @@
PropertySetRegion setRegion;
AccessorDecls(
-#line 1144 "cs.ATG"
+#line 1155 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1145 "cs.ATG"
+#line 1156 "cs.ATG"
indexer.BodyEnd = t.EndLocation;
indexer.GetRegion = getRegion;
indexer.SetRegion = setRegion;
@@ -2083,25 +2112,25 @@
} else if (la.kind == 1) {
Qualident(
-#line 1150 "cs.ATG"
+#line 1161 "cs.ATG"
out qualident);
-#line 1150 "cs.ATG"
+#line 1161 "cs.ATG"
Point qualIdentEndLocation = t.EndLocation;
if (la.kind == 14 || la.kind == 18) {
if (la.kind == 18) {
-#line 1153 "cs.ATG"
+#line 1164 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
lexer.NextToken();
if (StartOf(9)) {
FormalParameterList(
-#line 1154 "cs.ATG"
+#line 1165 "cs.ATG"
out p);
}
Expect(19);
-#line 1154 "cs.ATG"
+#line 1165 "cs.ATG"
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
type,
@@ -2113,18 +2142,18 @@
if (la.kind == 14) {
Block(
-#line 1163 "cs.ATG"
+#line 1174 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(147);
-#line 1163 "cs.ATG"
+#line 1174 "cs.ATG"
methodDeclaration.Body = (BlockStatement)stmt;
} else {
lexer.NextToken();
-#line 1166 "cs.ATG"
+#line 1177 "cs.ATG"
PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes);
pDecl.StartLocation = startPos;
pDecl.EndLocation = qualIdentEndLocation;
@@ -2133,11 +2162,11 @@
PropertySetRegion setRegion;
AccessorDecls(
-#line 1173 "cs.ATG"
+#line 1184 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1175 "cs.ATG"
+#line 1186 "cs.ATG"
pDecl.GetRegion = getRegion;
pDecl.SetRegion = setRegion;
pDecl.BodyEnd = t.EndLocation;
@@ -2146,17 +2175,17 @@
}
} else if (la.kind == 13) {
-#line 1183 "cs.ATG"
+#line 1194 "cs.ATG"
m.Check(Modifier.Indexers);
lexer.NextToken();
Expect(110);
Expect(16);
FormalParameterList(
-#line 1184 "cs.ATG"
+#line 1195 "cs.ATG"
out p);
Expect(17);
-#line 1185 "cs.ATG"
+#line 1196 "cs.ATG"
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = t.EndLocation;
@@ -2166,14 +2195,14 @@
Expect(14);
-#line 1192 "cs.ATG"
+#line 1203 "cs.ATG"
Point bodyStart = t.Location;
AccessorDecls(
-#line 1193 "cs.ATG"
+#line 1204 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1194 "cs.ATG"
+#line 1205 "cs.ATG"
indexer.BodyStart = bodyStart;
indexer.BodyEnd = t.EndLocation;
indexer.GetRegion = getRegion;
@@ -2187,7 +2216,7 @@
void InterfaceMemberDecl() {
-#line 1221 "cs.ATG"
+#line 1232 "cs.ATG"
TypeReference type;
ArrayList p;
AttributeSection section;
@@ -2201,39 +2230,39 @@
while (la.kind == 16) {
AttributeSection(
-#line 1233 "cs.ATG"
+#line 1244 "cs.ATG"
out section);
-#line 1233 "cs.ATG"
+#line 1244 "cs.ATG"
attributes.Add(section);
}
if (la.kind == 88) {
lexer.NextToken();
-#line 1234 "cs.ATG"
+#line 1245 "cs.ATG"
mod = Modifier.New; startLocation = t.Location;
}
if (
-#line 1237 "cs.ATG"
+#line 1248 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 1237 "cs.ATG"
+#line 1248 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
Expect(1);
-#line 1237 "cs.ATG"
+#line 1248 "cs.ATG"
name = t.val;
Expect(18);
if (StartOf(9)) {
FormalParameterList(
-#line 1238 "cs.ATG"
+#line 1249 "cs.ATG"
out parameters);
}
Expect(19);
Expect(10);
-#line 1238 "cs.ATG"
+#line 1249 "cs.ATG"
MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
md.StartLocation = startLocation;
md.EndLocation = t.EndLocation;
@@ -2242,27 +2271,27 @@
} else if (StartOf(18)) {
if (StartOf(8)) {
Type(
-#line 1244 "cs.ATG"
+#line 1255 "cs.ATG"
out type);
-#line 1244 "cs.ATG"
+#line 1255 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
if (la.kind == 1) {
lexer.NextToken();
-#line 1246 "cs.ATG"
+#line 1257 "cs.ATG"
name = t.val; Point qualIdentEndLocation = t.EndLocation;
if (la.kind == 18) {
lexer.NextToken();
if (StartOf(9)) {
FormalParameterList(
-#line 1249 "cs.ATG"
+#line 1260 "cs.ATG"
out parameters);
}
Expect(19);
Expect(10);
-#line 1249 "cs.ATG"
+#line 1260 "cs.ATG"
MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes);
md.StartLocation = startLocation;
md.EndLocation = t.EndLocation;
@@ -2270,72 +2299,72 @@
} else if (la.kind == 14) {
-#line 1255 "cs.ATG"
+#line 1266 "cs.ATG"
PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd);
lexer.NextToken();
-#line 1256 "cs.ATG"
+#line 1267 "cs.ATG"
Point bodyStart = t.Location;
InterfaceAccessors(
-#line 1256 "cs.ATG"
+#line 1267 "cs.ATG"
out getBlock, out setBlock);
Expect(15);
-#line 1256 "cs.ATG"
+#line 1267 "cs.ATG"
pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation;
} else SynErr(151);
} else if (la.kind == 110) {
lexer.NextToken();
Expect(16);
FormalParameterList(
-#line 1259 "cs.ATG"
+#line 1270 "cs.ATG"
out p);
Expect(17);
-#line 1259 "cs.ATG"
+#line 1270 "cs.ATG"
Point bracketEndLocation = t.EndLocation;
-#line 1259 "cs.ATG"
+#line 1270 "cs.ATG"
IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id);
Expect(14);
-#line 1260 "cs.ATG"
+#line 1271 "cs.ATG"
Point bodyStart = t.Location;
InterfaceAccessors(
-#line 1260 "cs.ATG"
+#line 1271 "cs.ATG"
out getBlock, out setBlock);
Expect(15);
-#line 1260 "cs.ATG"
+#line 1271 "cs.ATG"
id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation;
} else SynErr(152);
} else {
lexer.NextToken();
-#line 1263 "cs.ATG"
+#line 1274 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
Type(
-#line 1263 "cs.ATG"
+#line 1274 "cs.ATG"
out type);
Expect(1);
-#line 1263 "cs.ATG"
+#line 1274 "cs.ATG"
EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes);
compilationUnit.AddChild(ed);
Expect(10);
-#line 1266 "cs.ATG"
+#line 1277 "cs.ATG"
ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation;
}
} else SynErr(153);
}
void EnumMemberDecl(
-#line 1271 "cs.ATG"
+#line 1282 "cs.ATG"
out FieldDeclaration f) {
-#line 1273 "cs.ATG"
+#line 1284 "cs.ATG"
Expression expr = null;
ArrayList attributes = new ArrayList();
AttributeSection section = null;
@@ -2343,15 +2372,15 @@
while (la.kind == 16) {
AttributeSection(
-#line 1279 "cs.ATG"
+#line 1290 "cs.ATG"
out section);
-#line 1279 "cs.ATG"
+#line 1290 "cs.ATG"
attributes.Add(section);
}
Expect(1);
-#line 1280 "cs.ATG"
+#line 1291 "cs.ATG"
f = new FieldDeclaration(attributes);
varDecl = new VariableDeclaration(t.val);
f.Fields.Add(varDecl);
@@ -2360,89 +2389,89 @@
if (la.kind == 3) {
lexer.NextToken();
Expr(
-#line 1285 "cs.ATG"
+#line 1296 "cs.ATG"
out expr);
-#line 1285 "cs.ATG"
+#line 1296 "cs.ATG"
varDecl.Initializer = expr;
}
}
void SimpleType(
-#line 881 "cs.ATG"
+#line 890 "cs.ATG"
out string name) {
-#line 882 "cs.ATG"
+#line 891 "cs.ATG"
name = String.Empty;
if (StartOf(19)) {
IntegralType(
-#line 884 "cs.ATG"
+#line 893 "cs.ATG"
out name);
} else if (la.kind == 74) {
lexer.NextToken();
-#line 885 "cs.ATG"
+#line 894 "cs.ATG"
name = t.val;
} else if (la.kind == 65) {
lexer.NextToken();
-#line 886 "cs.ATG"
+#line 895 "cs.ATG"
name = t.val;
} else if (la.kind == 61) {
lexer.NextToken();
-#line 887 "cs.ATG"
+#line 896 "cs.ATG"
name = t.val;
} else if (la.kind == 51) {
lexer.NextToken();
-#line 888 "cs.ATG"
+#line 897 "cs.ATG"
name = t.val;
} else SynErr(154);
}
void NonArrayType(
-#line 863 "cs.ATG"
+#line 872 "cs.ATG"
out TypeReference type) {
-#line 865 "cs.ATG"
+#line 874 "cs.ATG"
string name = "";
int pointer = 0;
if (la.kind == 1 || la.kind == 90 || la.kind == 107) {
ClassType(
-#line 869 "cs.ATG"
+#line 878 "cs.ATG"
out name);
} else if (StartOf(14)) {
SimpleType(
-#line 870 "cs.ATG"
+#line 879 "cs.ATG"
out name);
} else if (la.kind == 122) {
lexer.NextToken();
Expect(6);
-#line 871 "cs.ATG"
+#line 880 "cs.ATG"
pointer = 1; name = "void";
} else SynErr(155);
while (
-#line 873 "cs.ATG"
+#line 882 "cs.ATG"
IsPointer()) {
Expect(6);
-#line 874 "cs.ATG"
+#line 883 "cs.ATG"
++pointer;
}
-#line 877 "cs.ATG"
+#line 886 "cs.ATG"
type = new TypeReference(name, pointer, null);
}
void FixedParameter(
-#line 918 "cs.ATG"
+#line 927 "cs.ATG"
out ParameterDeclarationExpression p) {
-#line 920 "cs.ATG"
+#line 929 "cs.ATG"
TypeReference type;
ParamModifiers mod = ParamModifiers.In;
@@ -2450,72 +2479,72 @@
if (la.kind == 99) {
lexer.NextToken();
-#line 925 "cs.ATG"
+#line 934 "cs.ATG"
mod = ParamModifiers.Ref;
} else {
lexer.NextToken();
-#line 926 "cs.ATG"
+#line 935 "cs.ATG"
mod = ParamModifiers.Out;
}
}
Type(
-#line 928 "cs.ATG"
+#line 937 "cs.ATG"
out type);
Expect(1);
-#line 928 "cs.ATG"
+#line 937 "cs.ATG"
p = new ParameterDeclarationExpression(type, t.val, mod);
}
void ParameterArray(
-#line 931 "cs.ATG"
+#line 940 "cs.ATG"
out ParameterDeclarationExpression p) {
-#line 932 "cs.ATG"
+#line 941 "cs.ATG"
TypeReference type;
Expect(94);
Type(
-#line 934 "cs.ATG"
+#line 943 "cs.ATG"
out type);
Expect(1);
-#line 934 "cs.ATG"
+#line 943 "cs.ATG"
p = new ParameterDeclarationExpression(type, t.val, ParamModifiers.Params);
}
void AccessorModifier(
-#line 988 "cs.ATG"
+#line 997 "cs.ATG"
Modifiers m) {
if (la.kind == 83) {
lexer.NextToken();
-#line 990 "cs.ATG"
+#line 999 "cs.ATG"
m.Add(Modifier.Internal);
} else if (la.kind == 97) {
lexer.NextToken();
-#line 991 "cs.ATG"
+#line 1000 "cs.ATG"
m.Add(Modifier.Public);
} else if (la.kind == 96) {
lexer.NextToken();
-#line 992 "cs.ATG"
+#line 1001 "cs.ATG"
m.Add(Modifier.Protected);
} else if (la.kind == 95) {
lexer.NextToken();
-#line 993 "cs.ATG"
+#line 1002 "cs.ATG"
m.Add(Modifier.Private);
} else SynErr(156);
}
void Block(
-#line 1393 "cs.ATG"
+#line 1404 "cs.ATG"
out Statement stmt) {
Expect(14);
-#line 1395 "cs.ATG"
+#line 1406 "cs.ATG"
BlockStatement blockStmt = new BlockStatement();
blockStmt.StartLocation = t.Location;
compilationUnit.BlockStart(blockStmt);
@@ -2525,7 +2554,7 @@
}
Expect(15);
-#line 1400 "cs.ATG"
+#line 1411 "cs.ATG"
stmt = blockStmt;
blockStmt.EndLocation = t.EndLocation;
compilationUnit.BlockEnd();
@@ -2533,34 +2562,34 @@
}
void VariableDeclarator(
-#line 1386 "cs.ATG"
+#line 1397 "cs.ATG"
ArrayList fieldDeclaration) {
-#line 1387 "cs.ATG"
+#line 1398 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1389 "cs.ATG"
+#line 1400 "cs.ATG"
VariableDeclaration f = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
VariableInitializer(
-#line 1390 "cs.ATG"
+#line 1401 "cs.ATG"
out expr);
-#line 1390 "cs.ATG"
+#line 1401 "cs.ATG"
f.Initializer = expr;
}
-#line 1390 "cs.ATG"
+#line 1401 "cs.ATG"
fieldDeclaration.Add(f);
}
void EventAccessorDecls(
-#line 1335 "cs.ATG"
+#line 1346 "cs.ATG"
out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
-#line 1336 "cs.ATG"
+#line 1347 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
Statement stmt;
@@ -2569,102 +2598,102 @@
while (la.kind == 16) {
AttributeSection(
-#line 1343 "cs.ATG"
+#line 1354 "cs.ATG"
out section);
-#line 1343 "cs.ATG"
+#line 1354 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1345 "cs.ATG"
+#line 1356 "cs.ATG"
IdentIsAdd()) {
-#line 1345 "cs.ATG"
+#line 1356 "cs.ATG"
addBlock = new EventAddRegion(attributes);
AddAccessorDecl(
-#line 1346 "cs.ATG"
+#line 1357 "cs.ATG"
out stmt);
-#line 1346 "cs.ATG"
+#line 1357 "cs.ATG"
attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt;
while (la.kind == 16) {
AttributeSection(
-#line 1347 "cs.ATG"
+#line 1358 "cs.ATG"
out section);
-#line 1347 "cs.ATG"
+#line 1358 "cs.ATG"
attributes.Add(section);
}
RemoveAccessorDecl(
-#line 1348 "cs.ATG"
+#line 1359 "cs.ATG"
out stmt);
-#line 1348 "cs.ATG"
+#line 1359 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt;
} else if (
-#line 1349 "cs.ATG"
+#line 1360 "cs.ATG"
IdentIsRemove()) {
RemoveAccessorDecl(
-#line 1350 "cs.ATG"
+#line 1361 "cs.ATG"
out stmt);
-#line 1350 "cs.ATG"
+#line 1361 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList();
while (la.kind == 16) {
AttributeSection(
-#line 1351 "cs.ATG"
+#line 1362 "cs.ATG"
out section);
-#line 1351 "cs.ATG"
+#line 1362 "cs.ATG"
attributes.Add(section);
}
AddAccessorDecl(
-#line 1352 "cs.ATG"
+#line 1363 "cs.ATG"
out stmt);
-#line 1352 "cs.ATG"
+#line 1363 "cs.ATG"
addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt;
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1353 "cs.ATG"
+#line 1364 "cs.ATG"
Error("add or remove accessor declaration expected");
} else SynErr(157);
}
void ConstructorInitializer(
-#line 1422 "cs.ATG"
+#line 1433 "cs.ATG"
out ConstructorInitializer ci) {
-#line 1423 "cs.ATG"
+#line 1434 "cs.ATG"
Expression expr; ci = new ConstructorInitializer();
Expect(9);
if (la.kind == 50) {
lexer.NextToken();
-#line 1427 "cs.ATG"
+#line 1438 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.Base;
} else if (la.kind == 110) {
lexer.NextToken();
-#line 1428 "cs.ATG"
+#line 1439 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.This;
} else SynErr(158);
Expect(18);
if (StartOf(21)) {
Argument(
-#line 1431 "cs.ATG"
+#line 1442 "cs.ATG"
out expr);
-#line 1431 "cs.ATG"
+#line 1442 "cs.ATG"
ci.Arguments.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1431 "cs.ATG"
+#line 1442 "cs.ATG"
out expr);
-#line 1431 "cs.ATG"
+#line 1442 "cs.ATG"
ci.Arguments.Add(expr);
}
}
@@ -2672,7 +2701,7 @@
}
void OverloadableOperator(
-#line 1443 "cs.ATG"
+#line 1454 "cs.ATG"
out Token op) {
switch (la.kind) {
case 4: {
@@ -2766,15 +2795,15 @@
default: SynErr(159); break;
}
-#line 1452 "cs.ATG"
+#line 1463 "cs.ATG"
op = t;
}
void AccessorDecls(
-#line 1289 "cs.ATG"
+#line 1300 "cs.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1291 "cs.ATG"
+#line 1302 "cs.ATG"
ArrayList attributes = new ArrayList();
Modifiers m = new Modifiers (this);
AttributeSection section;
@@ -2783,151 +2812,151 @@
while (la.kind == 16) {
AttributeSection(
-#line 1298 "cs.ATG"
+#line 1309 "cs.ATG"
out section);
-#line 1298 "cs.ATG"
+#line 1309 "cs.ATG"
attributes.Add(section);
}
while (StartOf(22)) {
AccessorModifier(
-#line 1299 "cs.ATG"
+#line 1310 "cs.ATG"
m);
}
if (
-#line 1301 "cs.ATG"
+#line 1312 "cs.ATG"
IdentIsGet()) {
GetAccessorDecl(
-#line 1302 "cs.ATG"
+#line 1313 "cs.ATG"
out getBlock, attributes, m.Modifier);
if (StartOf(23)) {
-#line 1303 "cs.ATG"
+#line 1314 "cs.ATG"
attributes = new ArrayList(); m = new Modifiers (this);
while (la.kind == 16) {
AttributeSection(
-#line 1304 "cs.ATG"
+#line 1315 "cs.ATG"
out section);
-#line 1304 "cs.ATG"
+#line 1315 "cs.ATG"
attributes.Add(section);
}
while (StartOf(22)) {
AccessorModifier(
-#line 1305 "cs.ATG"
+#line 1316 "cs.ATG"
m);
}
SetAccessorDecl(
-#line 1306 "cs.ATG"
+#line 1317 "cs.ATG"
out setBlock, attributes, m.Modifier);
}
} else if (
-#line 1308 "cs.ATG"
+#line 1319 "cs.ATG"
IdentIsSet()) {
SetAccessorDecl(
-#line 1309 "cs.ATG"
+#line 1320 "cs.ATG"
out setBlock, attributes, m.Modifier);
if (StartOf(23)) {
-#line 1310 "cs.ATG"
+#line 1321 "cs.ATG"
attributes = new ArrayList(); m = new Modifiers (this);
while (la.kind == 16) {
AttributeSection(
-#line 1311 "cs.ATG"
+#line 1322 "cs.ATG"
out section);
-#line 1311 "cs.ATG"
+#line 1322 "cs.ATG"
attributes.Add(section);
}
while (StartOf(22)) {
AccessorModifier(
-#line 1312 "cs.ATG"
+#line 1323 "cs.ATG"
m);
}
GetAccessorDecl(
-#line 1313 "cs.ATG"
+#line 1324 "cs.ATG"
out getBlock, attributes, m.Modifier);
}
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1315 "cs.ATG"
+#line 1326 "cs.ATG"
Error("get or set accessor declaration expected");
} else SynErr(160);
}
void InterfaceAccessors(
-#line 1357 "cs.ATG"
+#line 1368 "cs.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1359 "cs.ATG"
+#line 1370 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
getBlock = null; setBlock = null;
while (la.kind == 16) {
AttributeSection(
-#line 1364 "cs.ATG"
+#line 1375 "cs.ATG"
out section);
-#line 1364 "cs.ATG"
+#line 1375 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1366 "cs.ATG"
+#line 1377 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1366 "cs.ATG"
+#line 1377 "cs.ATG"
getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1367 "cs.ATG"
+#line 1378 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1367 "cs.ATG"
+#line 1378 "cs.ATG"
setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1368 "cs.ATG"
+#line 1379 "cs.ATG"
Error("set or get expected");
} else SynErr(161);
Expect(10);
-#line 1370 "cs.ATG"
+#line 1381 "cs.ATG"
attributes = new ArrayList();
if (la.kind == 1 || la.kind == 16) {
while (la.kind == 16) {
AttributeSection(
-#line 1372 "cs.ATG"
+#line 1383 "cs.ATG"
out section);
-#line 1372 "cs.ATG"
+#line 1383 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1374 "cs.ATG"
+#line 1385 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1374 "cs.ATG"
+#line 1385 "cs.ATG"
if (getBlock != null) Error("get already declared");
else getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1377 "cs.ATG"
+#line 1388 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1377 "cs.ATG"
+#line 1388 "cs.ATG"
if (setBlock != null) Error("set already declared");
else setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1380 "cs.ATG"
+#line 1391 "cs.ATG"
Error("set or get expected");
} else SynErr(162);
Expect(10);
@@ -2935,187 +2964,187 @@
}
void GetAccessorDecl(
-#line 1319 "cs.ATG"
+#line 1330 "cs.ATG"
out PropertyGetRegion getBlock, ArrayList attributes, Modifier m) {
-#line 1320 "cs.ATG"
+#line 1331 "cs.ATG"
Statement stmt = null;
Expect(1);
-#line 1323 "cs.ATG"
+#line 1334 "cs.ATG"
if (t.val != "get") Error("get expected");
if (la.kind == 14) {
Block(
-#line 1324 "cs.ATG"
+#line 1335 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(163);
-#line 1324 "cs.ATG"
+#line 1335 "cs.ATG"
getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes, m);
}
void SetAccessorDecl(
-#line 1327 "cs.ATG"
+#line 1338 "cs.ATG"
out PropertySetRegion setBlock, ArrayList attributes, Modifier m) {
-#line 1328 "cs.ATG"
+#line 1339 "cs.ATG"
Statement stmt = null;
Expect(1);
-#line 1331 "cs.ATG"
+#line 1342 "cs.ATG"
if (t.val != "set") Error("set expected");
if (la.kind == 14) {
Block(
-#line 1332 "cs.ATG"
+#line 1343 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(164);
-#line 1332 "cs.ATG"
+#line 1343 "cs.ATG"
setBlock = new PropertySetRegion((BlockStatement)stmt, attributes, m);
}
void AddAccessorDecl(
-#line 1406 "cs.ATG"
+#line 1417 "cs.ATG"
out Statement stmt) {
-#line 1407 "cs.ATG"
+#line 1418 "cs.ATG"
stmt = null;
Expect(1);
-#line 1410 "cs.ATG"
+#line 1421 "cs.ATG"
if (t.val != "add") Error("add expected");
Block(
-#line 1411 "cs.ATG"
+#line 1422 "cs.ATG"
out stmt);
}
void RemoveAccessorDecl(
-#line 1414 "cs.ATG"
+#line 1425 "cs.ATG"
out Statement stmt) {
-#line 1415 "cs.ATG"
+#line 1426 "cs.ATG"
stmt = null;
Expect(1);
-#line 1418 "cs.ATG"
+#line 1429 "cs.ATG"
if (t.val != "remove") Error("remove expected");
Block(
-#line 1419 "cs.ATG"
+#line 1430 "cs.ATG"
out stmt);
}
void VariableInitializer(
-#line 1435 "cs.ATG"
+#line 1446 "cs.ATG"
out Expression initializerExpression) {
-#line 1436 "cs.ATG"
+#line 1447 "cs.ATG"
TypeReference type = null; Expression expr = null; initializerExpression = null;
if (StartOf(4)) {
Expr(
-#line 1438 "cs.ATG"
+#line 1449 "cs.ATG"
out initializerExpression);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1439 "cs.ATG"
+#line 1450 "cs.ATG"
out initializerExpression);
} else if (la.kind == 105) {
lexer.NextToken();
Type(
-#line 1440 "cs.ATG"
+#line 1451 "cs.ATG"
out type);
Expect(16);
Expr(
-#line 1440 "cs.ATG"
+#line 1451 "cs.ATG"
out expr);
Expect(17);
-#line 1440 "cs.ATG"
+#line 1451 "cs.ATG"
initializerExpression = new StackAllocExpression(type, expr);
} else SynErr(165);
}
void Statement() {
-#line 1523 "cs.ATG"
+#line 1534 "cs.ATG"
TypeReference type;
Expression expr;
Statement stmt;
if (
-#line 1529 "cs.ATG"
+#line 1540 "cs.ATG"
IsLabel()) {
Expect(1);
-#line 1529 "cs.ATG"
+#line 1540 "cs.ATG"
compilationUnit.AddChild(new LabelStatement(t.val));
Expect(9);
Statement();
} else if (la.kind == 59) {
lexer.NextToken();
Type(
-#line 1532 "cs.ATG"
+#line 1543 "cs.ATG"
out type);
-#line 1532 "cs.ATG"
+#line 1543 "cs.ATG"
LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location;
Expect(1);
-#line 1533 "cs.ATG"
+#line 1544 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1534 "cs.ATG"
+#line 1545 "cs.ATG"
out expr);
-#line 1534 "cs.ATG"
+#line 1545 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1535 "cs.ATG"
+#line 1546 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1535 "cs.ATG"
+#line 1546 "cs.ATG"
out expr);
-#line 1535 "cs.ATG"
+#line 1546 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
}
Expect(10);
-#line 1536 "cs.ATG"
+#line 1547 "cs.ATG"
compilationUnit.AddChild(var);
} else if (
-#line 1538 "cs.ATG"
+#line 1549 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1538 "cs.ATG"
+#line 1549 "cs.ATG"
out stmt);
Expect(10);
-#line 1538 "cs.ATG"
+#line 1549 "cs.ATG"
compilationUnit.AddChild(stmt);
} else if (StartOf(24)) {
EmbeddedStatement(
-#line 1539 "cs.ATG"
+#line 1550 "cs.ATG"
out stmt);
-#line 1539 "cs.ATG"
+#line 1550 "cs.ATG"
compilationUnit.AddChild(stmt);
} else SynErr(166);
}
void Argument(
-#line 1455 "cs.ATG"
+#line 1466 "cs.ATG"
out Expression argumentexpr) {
-#line 1457 "cs.ATG"
+#line 1468 "cs.ATG"
Expression expr;
FieldDirection fd = FieldDirection.None;
@@ -3123,48 +3152,48 @@
if (la.kind == 99) {
lexer.NextToken();
-#line 1462 "cs.ATG"
+#line 1473 "cs.ATG"
fd = FieldDirection.Ref;
} else {
lexer.NextToken();
-#line 1463 "cs.ATG"
+#line 1474 "cs.ATG"
fd = FieldDirection.Out;
}
}
Expr(
-#line 1465 "cs.ATG"
+#line 1476 "cs.ATG"
out expr);
-#line 1465 "cs.ATG"
+#line 1476 "cs.ATG"
argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr;
}
void ArrayInitializer(
-#line 1484 "cs.ATG"
+#line 1495 "cs.ATG"
out Expression outExpr) {
-#line 1486 "cs.ATG"
+#line 1497 "cs.ATG"
Expression expr = null;
ArrayInitializerExpression initializer = new ArrayInitializerExpression();
Expect(14);
if (StartOf(25)) {
VariableInitializer(
-#line 1491 "cs.ATG"
+#line 1502 "cs.ATG"
out expr);
-#line 1491 "cs.ATG"
+#line 1502 "cs.ATG"
initializer.CreateExpressions.Add(expr);
while (
-#line 1491 "cs.ATG"
+#line 1502 "cs.ATG"
NotFinalComma()) {
Expect(12);
VariableInitializer(
-#line 1491 "cs.ATG"
+#line 1502 "cs.ATG"
out expr);
-#line 1491 "cs.ATG"
+#line 1502 "cs.ATG"
initializer.CreateExpressions.Add(expr);
}
if (la.kind == 12) {
@@ -3173,91 +3202,91 @@
}
Expect(15);
-#line 1492 "cs.ATG"
+#line 1503 "cs.ATG"
outExpr = initializer;
}
void AssignmentOperator(
-#line 1468 "cs.ATG"
+#line 1479 "cs.ATG"
out AssignmentOperatorType op) {
-#line 1469 "cs.ATG"
+#line 1480 "cs.ATG"
op = AssignmentOperatorType.None;
switch (la.kind) {
case 3: {
lexer.NextToken();
-#line 1471 "cs.ATG"
+#line 1482 "cs.ATG"
op = AssignmentOperatorType.Assign;
break;
}
case 37: {
lexer.NextToken();
-#line 1472 "cs.ATG"
+#line 1483 "cs.ATG"
op = AssignmentOperatorType.Add;
break;
}
case 38: {
lexer.NextToken();
-#line 1473 "cs.ATG"
+#line 1484 "cs.ATG"
op = AssignmentOperatorType.Subtract;
break;
}
case 39: {
lexer.NextToken();
-#line 1474 "cs.ATG"
+#line 1485 "cs.ATG"
op = AssignmentOperatorType.Multiply;
break;
}
case 40: {
lexer.NextToken();
-#line 1475 "cs.ATG"
+#line 1486 "cs.ATG"
op = AssignmentOperatorType.Divide;
break;
}
case 41: {
lexer.NextToken();
-#line 1476 "cs.ATG"
+#line 1487 "cs.ATG"
op = AssignmentOperatorType.Modulus;
break;
}
case 42: {
lexer.NextToken();
-#line 1477 "cs.ATG"
+#line 1488 "cs.ATG"
op = AssignmentOperatorType.BitwiseAnd;
break;
}
case 43: {
lexer.NextToken();
-#line 1478 "cs.ATG"
+#line 1489 "cs.ATG"
op = AssignmentOperatorType.BitwiseOr;
break;
}
case 44: {
lexer.NextToken();
-#line 1479 "cs.ATG"
+#line 1490 "cs.ATG"
op = AssignmentOperatorType.ExclusiveOr;
break;
}
case 45: {
lexer.NextToken();
-#line 1480 "cs.ATG"
+#line 1491 "cs.ATG"
op = AssignmentOperatorType.ShiftLeft;
break;
}
case 46: {
lexer.NextToken();
-#line 1481 "cs.ATG"
+#line 1492 "cs.ATG"
op = AssignmentOperatorType.ShiftRight;
break;
}
@@ -3266,83 +3295,83 @@
}
void LocalVariableDecl(
-#line 1495 "cs.ATG"
+#line 1506 "cs.ATG"
out Statement stmt) {
-#line 1497 "cs.ATG"
+#line 1508 "cs.ATG"
TypeReference type;
VariableDeclaration var = null;
LocalVariableDeclaration localVariableDeclaration;
Type(
-#line 1502 "cs.ATG"
+#line 1513 "cs.ATG"
out type);
-#line 1502 "cs.ATG"
+#line 1513 "cs.ATG"
localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location;
LocalVariableDeclarator(
-#line 1503 "cs.ATG"
+#line 1514 "cs.ATG"
out var);
-#line 1503 "cs.ATG"
+#line 1514 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
while (la.kind == 12) {
lexer.NextToken();
LocalVariableDeclarator(
-#line 1504 "cs.ATG"
+#line 1515 "cs.ATG"
out var);
-#line 1504 "cs.ATG"
+#line 1515 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
}
-#line 1505 "cs.ATG"
+#line 1516 "cs.ATG"
stmt = localVariableDeclaration;
}
void LocalVariableDeclarator(
-#line 1508 "cs.ATG"
+#line 1519 "cs.ATG"
out VariableDeclaration var) {
-#line 1509 "cs.ATG"
+#line 1520 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1511 "cs.ATG"
+#line 1522 "cs.ATG"
var = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
LocalVariableInitializer(
-#line 1511 "cs.ATG"
+#line 1522 "cs.ATG"
out expr);
-#line 1511 "cs.ATG"
+#line 1522 "cs.ATG"
var.Initializer = expr;
}
}
void LocalVariableInitializer(
-#line 1514 "cs.ATG"
+#line 1525 "cs.ATG"
out Expression expr) {
-#line 1515 "cs.ATG"
+#line 1526 "cs.ATG"
expr = null;
if (StartOf(4)) {
Expr(
-#line 1517 "cs.ATG"
+#line 1528 "cs.ATG"
out expr);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1518 "cs.ATG"
+#line 1529 "cs.ATG"
out expr);
} else SynErr(168);
}
void EmbeddedStatement(
-#line 1545 "cs.ATG"
+#line 1556 "cs.ATG"
out Statement statement) {
-#line 1547 "cs.ATG"
+#line 1558 "cs.ATG"
TypeReference type = null;
Expression expr = null;
Statement embeddedStatement = null;
@@ -3350,177 +3379,177 @@
if (la.kind == 14) {
Block(
-#line 1553 "cs.ATG"
+#line 1564 "cs.ATG"
out statement);
} else if (la.kind == 10) {
lexer.NextToken();
-#line 1555 "cs.ATG"
+#line 1566 "cs.ATG"
statement = new EmptyStatement();
} else if (
-#line 1557 "cs.ATG"
+#line 1568 "cs.ATG"
IdentIsYield ()) {
Expect(1);
if (la.kind == 100) {
lexer.NextToken();
Expr(
-#line 1558 "cs.ATG"
+#line 1569 "cs.ATG"
out expr);
} else if (la.kind == 52) {
lexer.NextToken();
} else SynErr(169);
Expect(10);
-#line 1558 "cs.ATG"
+#line 1569 "cs.ATG"
statement = new YieldStatement(expr);
} else if (
-#line 1560 "cs.ATG"
+#line 1571 "cs.ATG"
UnCheckedAndLBrace()) {
-#line 1560 "cs.ATG"
+#line 1571 "cs.ATG"
Statement block; bool isChecked = true;
if (la.kind == 57) {
lexer.NextToken();
} else if (la.kind == 117) {
lexer.NextToken();
-#line 1561 "cs.ATG"
+#line 1572 "cs.ATG"
isChecked = false;
} else SynErr(170);
Block(
-#line 1562 "cs.ATG"
+#line 1573 "cs.ATG"
out block);
-#line 1562 "cs.ATG"
+#line 1573 "cs.ATG"
statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block);
} else if (StartOf(4)) {
StatementExpr(
-#line 1564 "cs.ATG"
+#line 1575 "cs.ATG"
out statement);
Expect(10);
} else if (la.kind == 78) {
lexer.NextToken();
-#line 1566 "cs.ATG"
+#line 1577 "cs.ATG"
Statement elseStatement = null;
Expect(18);
Expr(
-#line 1567 "cs.ATG"
+#line 1578 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1568 "cs.ATG"
+#line 1579 "cs.ATG"
out embeddedStatement);
if (la.kind == 66) {
lexer.NextToken();
EmbeddedStatement(
-#line 1569 "cs.ATG"
+#line 1580 "cs.ATG"
out elseStatement);
}
-#line 1570 "cs.ATG"
+#line 1581 "cs.ATG"
statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) : (Statement)new IfStatement(expr, embeddedStatement);
} else if (la.kind == 109) {
lexer.NextToken();
-#line 1571 "cs.ATG"
+#line 1582 "cs.ATG"
ArrayList switchSections = new ArrayList();
Expect(18);
Expr(
-#line 1572 "cs.ATG"
+#line 1583 "cs.ATG"
out expr);
Expect(19);
Expect(14);
while (la.kind == 54 || la.kind == 62) {
SwitchSection(
-#line 1573 "cs.ATG"
+#line 1584 "cs.ATG"
out statement);
-#line 1573 "cs.ATG"
+#line 1584 "cs.ATG"
switchSections.Add(statement);
}
Expect(15);
-#line 1574 "cs.ATG"
+#line 1585 "cs.ATG"
statement = new SwitchStatement(expr, switchSections);
} else if (la.kind == 124) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1576 "cs.ATG"
+#line 1587 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1577 "cs.ATG"
+#line 1588 "cs.ATG"
out embeddedStatement);
-#line 1577 "cs.ATG"
+#line 1588 "cs.ATG"
statement = new WhileStatement(expr, embeddedStatement);
} else if (la.kind == 64) {
lexer.NextToken();
EmbeddedStatement(
-#line 1578 "cs.ATG"
+#line 1589 "cs.ATG"
out embeddedStatement);
Expect(124);
Expect(18);
Expr(
-#line 1579 "cs.ATG"
+#line 1590 "cs.ATG"
out expr);
Expect(19);
Expect(10);
-#line 1579 "cs.ATG"
+#line 1590 "cs.ATG"
statement = new DoWhileStatement(expr, embeddedStatement);
} else if (la.kind == 75) {
lexer.NextToken();
-#line 1580 "cs.ATG"
+#line 1591 "cs.ATG"
ArrayList initializer = null, iterator = null;
Expect(18);
if (StartOf(4)) {
ForInitializer(
-#line 1581 "cs.ATG"
+#line 1592 "cs.ATG"
out initializer);
}
Expect(10);
if (StartOf(4)) {
Expr(
-#line 1582 "cs.ATG"
+#line 1593 "cs.ATG"
out expr);
}
Expect(10);
if (StartOf(4)) {
ForIterator(
-#line 1583 "cs.ATG"
+#line 1594 "cs.ATG"
out iterator);
}
Expect(19);
EmbeddedStatement(
-#line 1584 "cs.ATG"
+#line 1595 "cs.ATG"
out embeddedStatement);
-#line 1584 "cs.ATG"
+#line 1595 "cs.ATG"
statement = new ForStatement(initializer, expr, iterator, embeddedStatement);
} else if (la.kind == 76) {
lexer.NextToken();
Expect(18);
Type(
-#line 1585 "cs.ATG"
+#line 1596 "cs.ATG"
out type);
Expect(1);
-#line 1585 "cs.ATG"
+#line 1596 "cs.ATG"
string varName = t.val;
Expect(80);
Expr(
-#line 1586 "cs.ATG"
+#line 1597 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1587 "cs.ATG"
+#line 1598 "cs.ATG"
out embeddedStatement);
-#line 1587 "cs.ATG"
+#line 1598 "cs.ATG"
statement = new ForeachStatement(type, varName , expr, embeddedStatement);
statement.EndLocation = t.EndLocation;
@@ -3528,363 +3557,363 @@
lexer.NextToken();
Expect(10);
-#line 1591 "cs.ATG"
+#line 1602 "cs.ATG"
statement = new BreakStatement();
} else if (la.kind == 60) {
lexer.NextToken();
Expect(10);
-#line 1592 "cs.ATG"
+#line 1603 "cs.ATG"
statement = new ContinueStatement();
} else if (la.kind == 77) {
GotoStatement(
-#line 1593 "cs.ATG"
+#line 1604 "cs.ATG"
out statement);
} else if (la.kind == 100) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1594 "cs.ATG"
+#line 1605 "cs.ATG"
out expr);
}
Expect(10);
-#line 1594 "cs.ATG"
+#line 1605 "cs.ATG"
statement = new ReturnStatement(expr);
} else if (la.kind == 111) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1595 "cs.ATG"
+#line 1606 "cs.ATG"
out expr);
}
Expect(10);
-#line 1595 "cs.ATG"
+#line 1606 "cs.ATG"
statement = new ThrowStatement(expr);
} else if (la.kind == 113) {
TryStatement(
-#line 1598 "cs.ATG"
+#line 1609 "cs.ATG"
out statement);
} else if (la.kind == 85) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1600 "cs.ATG"
+#line 1611 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1601 "cs.ATG"
+#line 1612 "cs.ATG"
out embeddedStatement);
-#line 1601 "cs.ATG"
+#line 1612 "cs.ATG"
statement = new LockStatement(expr, embeddedStatement);
} else if (la.kind == 120) {
-#line 1603 "cs.ATG"
+#line 1614 "cs.ATG"
Statement resourceAcquisitionStmt = null;
lexer.NextToken();
Expect(18);
ResourceAcquisition(
-#line 1605 "cs.ATG"
+#line 1616 "cs.ATG"
out resourceAcquisitionStmt);
Expect(19);
EmbeddedStatement(
-#line 1606 "cs.ATG"
+#line 1617 "cs.ATG"
out embeddedStatement);
-#line 1606 "cs.ATG"
+#line 1617 "cs.ATG"
statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement);
} else if (la.kind == 118) {
lexer.NextToken();
Block(
-#line 1608 "cs.ATG"
+#line 1619 "cs.ATG"
out embeddedStatement);
-#line 1608 "cs.ATG"
+#line 1619 "cs.ATG"
statement = new UnsafeStatement(embeddedStatement);
} else if (la.kind == 73) {
lexer.NextToken();
Expect(18);
Type(
-#line 1611 "cs.ATG"
+#line 1622 "cs.ATG"
out type);
-#line 1611 "cs.ATG"
+#line 1622 "cs.ATG"
if (type.PointerNestingLevel == 0) Error("can only fix pointer types");
FixedStatement fxStmt = new FixedStatement(type);
string identifier = null;
Expect(1);
-#line 1615 "cs.ATG"
+#line 1626 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1616 "cs.ATG"
+#line 1627 "cs.ATG"
out expr);
-#line 1616 "cs.ATG"
+#line 1627 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1618 "cs.ATG"
+#line 1629 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1619 "cs.ATG"
+#line 1630 "cs.ATG"
out expr);
-#line 1619 "cs.ATG"
+#line 1630 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
}
Expect(19);
EmbeddedStatement(
-#line 1621 "cs.ATG"
+#line 1632 "cs.ATG"
out embeddedStatement);
-#line 1621 "cs.ATG"
+#line 1632 "cs.ATG"
fxStmt.EmbeddedStatement = embeddedStatement; statement = fxStmt;
} else SynErr(171);
}
void StatementExpr(
-#line 1729 "cs.ATG"
+#line 1740 "cs.ATG"
out Statement stmt) {
-#line 1734 "cs.ATG"
+#line 1745 "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 1740 "cs.ATG"
+#line 1751 "cs.ATG"
out expr);
if (StartOf(6)) {
-#line 1743 "cs.ATG"
+#line 1754 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1743 "cs.ATG"
+#line 1754 "cs.ATG"
out op);
Expr(
-#line 1743 "cs.ATG"
+#line 1754 "cs.ATG"
out val);
-#line 1743 "cs.ATG"
+#line 1754 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else if (la.kind == 10 || la.kind == 12 || la.kind == 19) {
-#line 1744 "cs.ATG"
+#line 1755 "cs.ATG"
if (mustBeAssignment) Error("error in assignment.");
} else SynErr(172);
-#line 1745 "cs.ATG"
+#line 1756 "cs.ATG"
stmt = new StatementExpression(expr);
}
void SwitchSection(
-#line 1643 "cs.ATG"
+#line 1654 "cs.ATG"
out Statement stmt) {
-#line 1645 "cs.ATG"
+#line 1656 "cs.ATG"
SwitchSection switchSection = new SwitchSection();
Expression expr;
SwitchLabel(
-#line 1649 "cs.ATG"
+#line 1660 "cs.ATG"
out expr);
-#line 1649 "cs.ATG"
+#line 1660 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
while (la.kind == 54 || la.kind == 62) {
SwitchLabel(
-#line 1649 "cs.ATG"
+#line 1660 "cs.ATG"
out expr);
-#line 1649 "cs.ATG"
+#line 1660 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
}
-#line 1650 "cs.ATG"
+#line 1661 "cs.ATG"
compilationUnit.BlockStart(switchSection);
Statement();
while (StartOf(20)) {
Statement();
}
-#line 1653 "cs.ATG"
+#line 1664 "cs.ATG"
compilationUnit.BlockEnd();
stmt = switchSection;
}
void ForInitializer(
-#line 1624 "cs.ATG"
+#line 1635 "cs.ATG"
out ArrayList initializer) {
-#line 1626 "cs.ATG"
+#line 1637 "cs.ATG"
Statement stmt;
initializer = new ArrayList();
if (
-#line 1630 "cs.ATG"
+#line 1641 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1630 "cs.ATG"
+#line 1641 "cs.ATG"
out stmt);
-#line 1630 "cs.ATG"
+#line 1641 "cs.ATG"
initializer.Add(stmt);
} else if (StartOf(4)) {
StatementExpr(
-#line 1631 "cs.ATG"
+#line 1642 "cs.ATG"
out stmt);
-#line 1631 "cs.ATG"
+#line 1642 "cs.ATG"
initializer.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1631 "cs.ATG"
+#line 1642 "cs.ATG"
out stmt);
-#line 1631 "cs.ATG"
+#line 1642 "cs.ATG"
initializer.Add(stmt);
}
-#line 1631 "cs.ATG"
+#line 1642 "cs.ATG"
initializer.Add(stmt);
} else SynErr(173);
}
void ForIterator(
-#line 1634 "cs.ATG"
+#line 1645 "cs.ATG"
out ArrayList iterator) {
-#line 1636 "cs.ATG"
+#line 1647 "cs.ATG"
Statement stmt;
iterator = new ArrayList();
StatementExpr(
-#line 1640 "cs.ATG"
+#line 1651 "cs.ATG"
out stmt);
-#line 1640 "cs.ATG"
+#line 1651 "cs.ATG"
iterator.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1640 "cs.ATG"
+#line 1651 "cs.ATG"
out stmt);
-#line 1640 "cs.ATG"
+#line 1651 "cs.ATG"
iterator.Add(stmt);
}
}
void GotoStatement(
-#line 1702 "cs.ATG"
+#line 1713 "cs.ATG"
out Statement stmt) {
-#line 1703 "cs.ATG"
+#line 1714 "cs.ATG"
Expression expr; stmt = null;
Expect(77);
if (la.kind == 1) {
lexer.NextToken();
-#line 1707 "cs.ATG"
+#line 1718 "cs.ATG"
stmt = new GotoStatement(t.val);
Expect(10);
} else if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1708 "cs.ATG"
+#line 1719 "cs.ATG"
out expr);
Expect(10);
-#line 1708 "cs.ATG"
+#line 1719 "cs.ATG"
stmt = new GotoCaseStatement(expr);
} else if (la.kind == 62) {
lexer.NextToken();
Expect(10);
-#line 1709 "cs.ATG"
+#line 1720 "cs.ATG"
stmt = new GotoCaseStatement(null);
} else SynErr(174);
}
void TryStatement(
-#line 1665 "cs.ATG"
+#line 1676 "cs.ATG"
out Statement tryStatement) {
-#line 1667 "cs.ATG"
+#line 1678 "cs.ATG"
Statement blockStmt = null, finallyStmt = null;
ArrayList catchClauses = null;
Expect(113);
Block(
-#line 1671 "cs.ATG"
+#line 1682 "cs.ATG"
out blockStmt);
if (la.kind == 55) {
CatchClauses(
-#line 1673 "cs.ATG"
+#line 1684 "cs.ATG"
out catchClauses);
if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1673 "cs.ATG"
+#line 1684 "cs.ATG"
out finallyStmt);
}
} else if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1674 "cs.ATG"
+#line 1685 "cs.ATG"
out finallyStmt);
} else SynErr(175);
-#line 1677 "cs.ATG"
+#line 1688 "cs.ATG"
tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
}
void ResourceAcquisition(
-#line 1713 "cs.ATG"
+#line 1724 "cs.ATG"
out Statement stmt) {
-#line 1715 "cs.ATG"
+#line 1726 "cs.ATG"
stmt = null;
Expression expr;
if (
-#line 1720 "cs.ATG"
+#line 1731 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1720 "cs.ATG"
+#line 1731 "cs.ATG"
out stmt);
} else if (StartOf(4)) {
Expr(
-#line 1721 "cs.ATG"
+#line 1732 "cs.ATG"
out expr);
-#line 1725 "cs.ATG"
+#line 1736 "cs.ATG"
stmt = new StatementExpression(expr);
} else SynErr(176);
}
void SwitchLabel(
-#line 1658 "cs.ATG"
+#line 1669 "cs.ATG"
out Expression expr) {
-#line 1659 "cs.ATG"
+#line 1670 "cs.ATG"
expr = null;
if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1661 "cs.ATG"
+#line 1672 "cs.ATG"
out expr);
Expect(9);
} else if (la.kind == 62) {
@@ -3894,153 +3923,153 @@
}
void CatchClauses(
-#line 1682 "cs.ATG"
+#line 1693 "cs.ATG"
out ArrayList catchClauses) {
-#line 1684 "cs.ATG"
+#line 1695 "cs.ATG"
catchClauses = new ArrayList();
Expect(55);
-#line 1687 "cs.ATG"
+#line 1698 "cs.ATG"
string name;
string identifier;
Statement stmt;
if (la.kind == 14) {
Block(
-#line 1693 "cs.ATG"
+#line 1704 "cs.ATG"
out stmt);
-#line 1693 "cs.ATG"
+#line 1704 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
} else if (la.kind == 18) {
lexer.NextToken();
ClassType(
-#line 1695 "cs.ATG"
+#line 1706 "cs.ATG"
out name);
-#line 1695 "cs.ATG"
+#line 1706 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1695 "cs.ATG"
+#line 1706 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1695 "cs.ATG"
+#line 1706 "cs.ATG"
out stmt);
-#line 1695 "cs.ATG"
+#line 1706 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
while (
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
IsTypedCatch()) {
Expect(55);
Expect(18);
ClassType(
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
out name);
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
out stmt);
-#line 1696 "cs.ATG"
+#line 1707 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
}
if (la.kind == 55) {
lexer.NextToken();
Block(
-#line 1698 "cs.ATG"
+#line 1709 "cs.ATG"
out stmt);
-#line 1698 "cs.ATG"
+#line 1709 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
}
} else SynErr(178);
}
void UnaryExpr(
-#line 1761 "cs.ATG"
+#line 1772 "cs.ATG"
out Expression uExpr) {
-#line 1763 "cs.ATG"
+#line 1774 "cs.ATG"
TypeReference type = null;
Expression expr;
ArrayList expressions = new ArrayList();
uExpr = null;
while (StartOf(26) ||
-#line 1785 "cs.ATG"
+#line 1796 "cs.ATG"
IsTypeCast()) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1770 "cs.ATG"
+#line 1781 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus));
} else if (la.kind == 5) {
lexer.NextToken();
-#line 1771 "cs.ATG"
+#line 1782 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus));
} else if (la.kind == 22) {
lexer.NextToken();
-#line 1772 "cs.ATG"
+#line 1783 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not));
} else if (la.kind == 25) {
lexer.NextToken();
-#line 1773 "cs.ATG"
+#line 1784 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot));
} else if (la.kind == 6) {
lexer.NextToken();
-#line 1774 "cs.ATG"
+#line 1785 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star));
} else if (la.kind == 29) {
lexer.NextToken();
-#line 1775 "cs.ATG"
+#line 1786 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment));
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1776 "cs.ATG"
+#line 1787 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement));
} else if (la.kind == 26) {
lexer.NextToken();
-#line 1777 "cs.ATG"
+#line 1788 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd));
} else {
Expect(18);
Type(
-#line 1785 "cs.ATG"
+#line 1796 "cs.ATG"
out type);
Expect(19);
-#line 1785 "cs.ATG"
+#line 1796 "cs.ATG"
expressions.Add(new CastExpression(type));
}
}
PrimaryExpr(
-#line 1788 "cs.ATG"
+#line 1799 "cs.ATG"
out expr);
-#line 1788 "cs.ATG"
+#line 1799 "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) {
@@ -4058,33 +4087,33 @@
}
void ConditionalOrExpr(
-#line 1890 "cs.ATG"
+#line 1901 "cs.ATG"
ref Expression outExpr) {
-#line 1891 "cs.ATG"
+#line 1902 "cs.ATG"
Expression expr;
ConditionalAndExpr(
-#line 1893 "cs.ATG"
+#line 1904 "cs.ATG"
ref outExpr);
while (la.kind == 24) {
lexer.NextToken();
UnaryExpr(
-#line 1893 "cs.ATG"
+#line 1904 "cs.ATG"
out expr);
ConditionalAndExpr(
-#line 1893 "cs.ATG"
+#line 1904 "cs.ATG"
ref expr);
-#line 1893 "cs.ATG"
+#line 1904 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);
}
}
void PrimaryExpr(
-#line 1805 "cs.ATG"
+#line 1816 "cs.ATG"
out Expression pexpr) {
-#line 1807 "cs.ATG"
+#line 1818 "cs.ATG"
TypeReference type = null;
bool isArrayCreation = false;
Expression expr;
@@ -4094,46 +4123,46 @@
case 112: {
lexer.NextToken();
-#line 1814 "cs.ATG"
+#line 1825 "cs.ATG"
pexpr = new PrimitiveExpression(true, "true");
break;
}
case 71: {
lexer.NextToken();
-#line 1815 "cs.ATG"
+#line 1826 "cs.ATG"
pexpr = new PrimitiveExpression(false, "false");
break;
}
case 89: {
lexer.NextToken();
-#line 1816 "cs.ATG"
+#line 1827 "cs.ATG"
pexpr = new PrimitiveExpression(null, "null");
break;
}
case 2: {
lexer.NextToken();
-#line 1817 "cs.ATG"
+#line 1828 "cs.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val);
break;
}
case 1: {
lexer.NextToken();
-#line 1819 "cs.ATG"
+#line 1830 "cs.ATG"
pexpr = new IdentifierExpression(t.val);
break;
}
case 18: {
lexer.NextToken();
Expr(
-#line 1821 "cs.ATG"
+#line 1832 "cs.ATG"
out expr);
Expect(19);
-#line 1821 "cs.ATG"
+#line 1832 "cs.ATG"
pexpr = new ParenthesizedExpression(expr);
break;
}
@@ -4201,185 +4230,185 @@
}
}
-#line 1827 "cs.ATG"
+#line 1838 "cs.ATG"
string val = t.val; t.val = "";
Expect(13);
Expect(1);
-#line 1827 "cs.ATG"
+#line 1838 "cs.ATG"
pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val);
break;
}
case 110: {
lexer.NextToken();
-#line 1829 "cs.ATG"
+#line 1840 "cs.ATG"
pexpr = new ThisReferenceExpression();
break;
}
case 50: {
lexer.NextToken();
-#line 1831 "cs.ATG"
+#line 1842 "cs.ATG"
Expression retExpr = new BaseReferenceExpression();
if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1833 "cs.ATG"
+#line 1844 "cs.ATG"
retExpr = new FieldReferenceExpression(retExpr, t.val);
} else if (la.kind == 16) {
lexer.NextToken();
Expr(
-#line 1834 "cs.ATG"
+#line 1845 "cs.ATG"
out expr);
-#line 1834 "cs.ATG"
+#line 1845 "cs.ATG"
ArrayList indices = new ArrayList(); indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1835 "cs.ATG"
+#line 1846 "cs.ATG"
out expr);
-#line 1835 "cs.ATG"
+#line 1846 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1836 "cs.ATG"
+#line 1847 "cs.ATG"
retExpr = new IndexerExpression(retExpr, indices);
} else SynErr(179);
-#line 1837 "cs.ATG"
+#line 1848 "cs.ATG"
pexpr = retExpr;
break;
}
case 88: {
lexer.NextToken();
NonArrayType(
-#line 1838 "cs.ATG"
+#line 1849 "cs.ATG"
out type);
-#line 1838 "cs.ATG"
+#line 1849 "cs.ATG"
ArrayList parameters = new ArrayList();
if (la.kind == 18) {
lexer.NextToken();
-#line 1843 "cs.ATG"
+#line 1854 "cs.ATG"
ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters);
if (StartOf(21)) {
Argument(
-#line 1843 "cs.ATG"
+#line 1854 "cs.ATG"
out expr);
-#line 1843 "cs.ATG"
+#line 1854 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1844 "cs.ATG"
+#line 1855 "cs.ATG"
out expr);
-#line 1844 "cs.ATG"
+#line 1855 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1844 "cs.ATG"
+#line 1855 "cs.ATG"
pexpr = oce;
} else if (la.kind == 16) {
-#line 1846 "cs.ATG"
+#line 1857 "cs.ATG"
isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace;
lexer.NextToken();
-#line 1847 "cs.ATG"
+#line 1858 "cs.ATG"
int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList();
if (StartOf(4)) {
Expr(
-#line 1849 "cs.ATG"
+#line 1860 "cs.ATG"
out expr);
-#line 1849 "cs.ATG"
+#line 1860 "cs.ATG"
parameterExpression.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1849 "cs.ATG"
+#line 1860 "cs.ATG"
out expr);
-#line 1849 "cs.ATG"
+#line 1860 "cs.ATG"
parameterExpression.Add(expr);
}
Expect(17);
-#line 1849 "cs.ATG"
+#line 1860 "cs.ATG"
parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters;
while (
-#line 1850 "cs.ATG"
+#line 1861 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1850 "cs.ATG"
+#line 1861 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1850 "cs.ATG"
+#line 1861 "cs.ATG"
dims++;
}
-#line 1850 "cs.ATG"
+#line 1861 "cs.ATG"
rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
-#line 1851 "cs.ATG"
+#line 1862 "cs.ATG"
if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); }
if (la.kind == 14) {
ArrayInitializer(
-#line 1852 "cs.ATG"
+#line 1863 "cs.ATG"
out expr);
-#line 1852 "cs.ATG"
+#line 1863 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr;
}
} else if (la.kind == 12 || la.kind == 17) {
while (la.kind == 12) {
lexer.NextToken();
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
dims++;
}
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
while (
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
dims++;
}
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
ArrayInitializer(
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
out expr);
-#line 1854 "cs.ATG"
+#line 1865 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters;
} else SynErr(180);
} else SynErr(181);
@@ -4389,20 +4418,20 @@
lexer.NextToken();
Expect(18);
if (
-#line 1860 "cs.ATG"
+#line 1871 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 1860 "cs.ATG"
+#line 1871 "cs.ATG"
type = new TypeReference("void");
} else if (StartOf(8)) {
Type(
-#line 1861 "cs.ATG"
+#line 1872 "cs.ATG"
out type);
} else SynErr(182);
Expect(19);
-#line 1862 "cs.ATG"
+#line 1873 "cs.ATG"
pexpr = new TypeOfExpression(type);
break;
}
@@ -4410,11 +4439,11 @@
lexer.NextToken();
Expect(18);
Type(
-#line 1863 "cs.ATG"
+#line 1874 "cs.ATG"
out type);
Expect(19);
-#line 1863 "cs.ATG"
+#line 1874 "cs.ATG"
pexpr = new SizeOfExpression(type);
break;
}
@@ -4422,11 +4451,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1864 "cs.ATG"
+#line 1875 "cs.ATG"
out expr);
Expect(19);
-#line 1864 "cs.ATG"
+#line 1875 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4434,11 +4463,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1865 "cs.ATG"
+#line 1876 "cs.ATG"
out expr);
Expect(19);
-#line 1865 "cs.ATG"
+#line 1876 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4449,350 +4478,350 @@
if (la.kind == 29) {
lexer.NextToken();
-#line 1869 "cs.ATG"
+#line 1880 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement);
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1870 "cs.ATG"
+#line 1881 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement);
} else SynErr(184);
} else if (la.kind == 47) {
lexer.NextToken();
Expect(1);
-#line 1873 "cs.ATG"
+#line 1884 "cs.ATG"
pexpr = new PointerReferenceExpression(pexpr, t.val);
} else if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1874 "cs.ATG"
+#line 1885 "cs.ATG"
pexpr = new FieldReferenceExpression(pexpr, t.val);
} else if (la.kind == 18) {
lexer.NextToken();
-#line 1876 "cs.ATG"
+#line 1887 "cs.ATG"
ArrayList parameters = new ArrayList();
if (StartOf(21)) {
Argument(
-#line 1877 "cs.ATG"
+#line 1888 "cs.ATG"
out expr);
-#line 1877 "cs.ATG"
+#line 1888 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1878 "cs.ATG"
+#line 1889 "cs.ATG"
out expr);
-#line 1878 "cs.ATG"
+#line 1889 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1879 "cs.ATG"
+#line 1890 "cs.ATG"
pexpr = new InvocationExpression(pexpr, parameters);
} else {
-#line 1881 "cs.ATG"
+#line 1892 "cs.ATG"
if (isArrayCreation) Error("element access not allow on array creation");
ArrayList indices = new ArrayList();
lexer.NextToken();
Expr(
-#line 1884 "cs.ATG"
+#line 1895 "cs.ATG"
out expr);
-#line 1884 "cs.ATG"
+#line 1895 "cs.ATG"
indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1885 "cs.ATG"
+#line 1896 "cs.ATG"
out expr);
-#line 1885 "cs.ATG"
+#line 1896 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1886 "cs.ATG"
+#line 1897 "cs.ATG"
pexpr = new IndexerExpression(pexpr, indices);
}
}
}
void ConditionalAndExpr(
-#line 1896 "cs.ATG"
+#line 1907 "cs.ATG"
ref Expression outExpr) {
-#line 1897 "cs.ATG"
+#line 1908 "cs.ATG"
Expression expr;
InclusiveOrExpr(
-#line 1899 "cs.ATG"
+#line 1910 "cs.ATG"
ref outExpr);
while (la.kind == 23) {
lexer.NextToken();
UnaryExpr(
-#line 1899 "cs.ATG"
+#line 1910 "cs.ATG"
out expr);
InclusiveOrExpr(
-#line 1899 "cs.ATG"
+#line 1910 "cs.ATG"
ref expr);
-#line 1899 "cs.ATG"
+#line 1910 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr);
}
}
void InclusiveOrExpr(
-#line 1902 "cs.ATG"
+#line 1913 "cs.ATG"
ref Expression outExpr) {
-#line 1903 "cs.ATG"
+#line 1914 "cs.ATG"
Expression expr;
ExclusiveOrExpr(
-#line 1905 "cs.ATG"
+#line 1916 "cs.ATG"
ref outExpr);
while (la.kind == 27) {
lexer.NextToken();
UnaryExpr(
-#line 1905 "cs.ATG"
+#line 1916 "cs.ATG"
out expr);
ExclusiveOrExpr(
-#line 1905 "cs.ATG"
+#line 1916 "cs.ATG"
ref expr);
-#line 1905 "cs.ATG"
+#line 1916 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr);
}
}
void ExclusiveOrExpr(
-#line 1908 "cs.ATG"
+#line 1919 "cs.ATG"
ref Expression outExpr) {
-#line 1909 "cs.ATG"
+#line 1920 "cs.ATG"
Expression expr;
AndExpr(
-#line 1911 "cs.ATG"
+#line 1922 "cs.ATG"
ref outExpr);
while (la.kind == 28) {
lexer.NextToken();
UnaryExpr(
-#line 1911 "cs.ATG"
+#line 1922 "cs.ATG"
out expr);
AndExpr(
-#line 1911 "cs.ATG"
+#line 1922 "cs.ATG"
ref expr);
-#line 1911 "cs.ATG"
+#line 1922 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr);
}
}
void AndExpr(
-#line 1914 "cs.ATG"
+#line 1925 "cs.ATG"
ref Expression outExpr) {
-#line 1915 "cs.ATG"
+#line 1926 "cs.ATG"
Expression expr;
EqualityExpr(
-#line 1917 "cs.ATG"
+#line 1928 "cs.ATG"
ref outExpr);
while (la.kind == 26) {
lexer.NextToken();
UnaryExpr(
-#line 1917 "cs.ATG"
+#line 1928 "cs.ATG"
out expr);
EqualityExpr(
-#line 1917 "cs.ATG"
+#line 1928 "cs.ATG"
ref expr);
-#line 1917 "cs.ATG"
+#line 1928 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr);
}
}
void EqualityExpr(
-#line 1920 "cs.ATG"
+#line 1931 "cs.ATG"
ref Expression outExpr) {
-#line 1922 "cs.ATG"
+#line 1933 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
RelationalExpr(
-#line 1926 "cs.ATG"
+#line 1937 "cs.ATG"
ref outExpr);
while (la.kind == 31 || la.kind == 32) {
if (la.kind == 32) {
lexer.NextToken();
-#line 1929 "cs.ATG"
+#line 1940 "cs.ATG"
op = BinaryOperatorType.InEquality;
} else {
lexer.NextToken();
-#line 1930 "cs.ATG"
+#line 1941 "cs.ATG"
op = BinaryOperatorType.Equality;
}
UnaryExpr(
-#line 1932 "cs.ATG"
+#line 1943 "cs.ATG"
out expr);
RelationalExpr(
-#line 1932 "cs.ATG"
+#line 1943 "cs.ATG"
ref expr);
-#line 1932 "cs.ATG"
+#line 1943 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void RelationalExpr(
-#line 1936 "cs.ATG"
+#line 1947 "cs.ATG"
ref Expression outExpr) {
-#line 1938 "cs.ATG"
+#line 1949 "cs.ATG"
TypeReference type;
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
ShiftExpr(
-#line 1943 "cs.ATG"
+#line 1954 "cs.ATG"
ref outExpr);
while (StartOf(28)) {
if (StartOf(29)) {
if (la.kind == 21) {
lexer.NextToken();
-#line 1946 "cs.ATG"
+#line 1957 "cs.ATG"
op = BinaryOperatorType.LessThan;
} else if (la.kind == 20) {
lexer.NextToken();
-#line 1947 "cs.ATG"
+#line 1958 "cs.ATG"
op = BinaryOperatorType.GreaterThan;
} else if (la.kind == 34) {
lexer.NextToken();
-#line 1948 "cs.ATG"
+#line 1959 "cs.ATG"
op = BinaryOperatorType.LessThanOrEqual;
} else if (la.kind == 33) {
lexer.NextToken();
-#line 1949 "cs.ATG"
+#line 1960 "cs.ATG"
op = BinaryOperatorType.GreaterThanOrEqual;
} else SynErr(185);
UnaryExpr(
-#line 1951 "cs.ATG"
+#line 1962 "cs.ATG"
out expr);
ShiftExpr(
-#line 1951 "cs.ATG"
+#line 1962 "cs.ATG"
ref expr);
-#line 1951 "cs.ATG"
+#line 1962 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
} else {
if (la.kind == 84) {
lexer.NextToken();
-#line 1954 "cs.ATG"
+#line 1965 "cs.ATG"
op = BinaryOperatorType.IS;
} else if (la.kind == 49) {
lexer.NextToken();
-#line 1955 "cs.ATG"
+#line 1966 "cs.ATG"
op = BinaryOperatorType.AS;
} else SynErr(186);
Type(
-#line 1957 "cs.ATG"
+#line 1968 "cs.ATG"
out type);
-#line 1957 "cs.ATG"
+#line 1968 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type));
}
}
}
void ShiftExpr(
-#line 1961 "cs.ATG"
+#line 1972 "cs.ATG"
ref Expression outExpr) {
-#line 1963 "cs.ATG"
+#line 1974 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
AdditiveExpr(
-#line 1967 "cs.ATG"
+#line 1978 "cs.ATG"
ref outExpr);
while (la.kind == 35 || la.kind == 36) {
if (la.kind == 35) {
lexer.NextToken();
-#line 1970 "cs.ATG"
+#line 1981 "cs.ATG"
op = BinaryOperatorType.ShiftLeft;
} else {
lexer.NextToken();
-#line 1971 "cs.ATG"
+#line 1982 "cs.ATG"
op = BinaryOperatorType.ShiftRight;
}
UnaryExpr(
-#line 1973 "cs.ATG"
+#line 1984 "cs.ATG"
out expr);
AdditiveExpr(
-#line 1973 "cs.ATG"
+#line 1984 "cs.ATG"
ref expr);
-#line 1973 "cs.ATG"
+#line 1984 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void AdditiveExpr(
-#line 1977 "cs.ATG"
+#line 1988 "cs.ATG"
ref Expression outExpr) {
-#line 1979 "cs.ATG"
+#line 1990 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
MultiplicativeExpr(
-#line 1983 "cs.ATG"
+#line 1994 "cs.ATG"
ref outExpr);
while (la.kind == 4 || la.kind == 5) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1986 "cs.ATG"
+#line 1997 "cs.ATG"
op = BinaryOperatorType.Add;
} else {
lexer.NextToken();
-#line 1987 "cs.ATG"
+#line 1998 "cs.ATG"
op = BinaryOperatorType.Subtract;
}
UnaryExpr(
-#line 1989 "cs.ATG"
+#line 2000 "cs.ATG"
out expr);
MultiplicativeExpr(
-#line 1989 "cs.ATG"
+#line 2000 "cs.ATG"
ref expr);
-#line 1989 "cs.ATG"
+#line 2000 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void MultiplicativeExpr(
-#line 1993 "cs.ATG"
+#line 2004 "cs.ATG"
ref Expression outExpr) {
-#line 1995 "cs.ATG"
+#line 2006 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
@@ -4800,24 +4829,24 @@
if (la.kind == 6) {
lexer.NextToken();
-#line 2001 "cs.ATG"
+#line 2012 "cs.ATG"
op = BinaryOperatorType.Multiply;
} else if (la.kind == 7) {
lexer.NextToken();
-#line 2002 "cs.ATG"
+#line 2013 "cs.ATG"
op = BinaryOperatorType.Divide;
} else {
lexer.NextToken();
-#line 2003 "cs.ATG"
+#line 2014 "cs.ATG"
op = BinaryOperatorType.Modulus;
}
UnaryExpr(
-#line 2005 "cs.ATG"
+#line 2016 "cs.ATG"
out expr);
-#line 2005 "cs.ATG"
+#line 2016 "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-04-13 20:27:23 UTC (rev 2449)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG 2005-04-13 21:51:53 UTC (rev 2450)
@@ -328,6 +328,11 @@
return la.kind == Tokens.Identifier && la.val == "yield";
}
+/* True, if lookahead ident is "partial" */
+bool IdentIsPartial () {
+ return la.kind == Tokens.Identifier && la.val == "partial";
+}
+
/* True, if lookahead ident is "get" */
bool IdentIsGet () {
return la.kind == Tokens.Identifier && la.val == "get";
@@ -678,17 +683,19 @@
/*--- type declaration: */
| { AttributeSection<out section> (. attributes.Add(section); .) }
{ TypeModifier<m> }
- TypeDecl<m, attributes>
+ (. bool partial = false; .)
+ [ IF (IdentIsPartial ()) ident (. partial = true; .) ]
+ TypeDecl<m, attributes, partial>
.
-TypeDecl<Modifiers m, ArrayList attributes>
+TypeDecl<Modifiers m, ArrayList attributes, bool partial>
(.
TypeReference type;
StringCollection names;
ArrayList p; string name;
.)
= /*--- class declaration: */ (. m.Check(Modifier.Classes); .)
- "class" (. TypeDeclaration newType = new TypeDeclaration();
+ "class" (. TypeDeclaration newType = new TypeDeclaration (partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
@@ -703,7 +710,7 @@
compilationUnit.BlockEnd();
.)
| /*--- struct declaration: */ (. m.Check(Modifier.StructsInterfacesEnumsDelegates); .)
- ( "struct" (. TypeDeclaration newType = new TypeDeclaration();
+ ( "struct" (. TypeDeclaration newType = new TypeDeclaration(partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Struct;
@@ -717,7 +724,7 @@
compilationUnit.BlockEnd();
.)
| /*--- interface declaration: */
- "interface" (. TypeDeclaration newType = new TypeDeclaration();
+ "interface" (. TypeDeclaration newType = new TypeDeclaration(partial);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Interface;
@@ -730,7 +737,8 @@
compilationUnit.BlockEnd();
.)
| /*--- enumeration declaration: */
- "enum" (. TypeDeclaration newType = new TypeDeclaration();
+ "enum" (. if (partial) Error ("partial is not allowed for enum types");
+ TypeDeclaration newType = new TypeDeclaration();
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Enum;
@@ -746,7 +754,8 @@
compilationUnit.BlockEnd();
.)
| /*--- delegate declaration: */
- "delegate" (. DelegateDeclaration delegateDeclr = new DelegateDeclaration();
+ "delegate" (. if (partial) Error ("partial is not allowed for delegate types");
+ DelegateDeclaration delegateDeclr = new DelegateDeclaration();
delegateDeclr.StartLocation = t.Location;
delegateDeclr.Modifier = m.Modifier;
delegateDeclr.Attributes = attributes;
@@ -1092,7 +1101,9 @@
.)
/*--- inner type declaration: */
- | TypeDecl<m, attributes>
+ | (. bool partial = false; .)
+ [ IF (IdentIsPartial ()) ident (. partial = true; .) ]
+ TypeDecl<m, attributes, partial>
| Type<out type> (. Point startPos = t.Location; .)
(
/*--- operator declaration: */ (. Token op;
More information about the Monodevelop-patches-list
mailing list