[Monodevelop-patches-list] r2233 - in trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory: . src src/Parser/AST src/Parser/generated
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Feb 4 12:08:08 EST 2005
Author: jluke
Date: 2005-02-04 12:08:08 -0500 (Fri, 04 Feb 2005)
New Revision: 2233
Modified:
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/Makefile.am
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Main.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/Modifier.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Modifiers.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
Log:
add static modifier as valid for classes
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/ChangeLog 2005-02-04 17:08:08 UTC (rev 2233)
@@ -1,3 +1,10 @@
+2005-02-04 John Luke <john.luke at gmail.com>
+
+ * src/Parser/AST/Modifier.cs: add Static to Class
+ * src/Parser/generated/cs.ATG: add Modifier.Static to TypeModifiers
+ * src/Parser/generated/Modifiers.cs: static & abstract or
+ static & sealed is invalid
+
2005-02-03 John Luke <john.luke at gmail.com>
* Makefile.am: add PrettyPrintOptions.cs
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/Makefile.am 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/Makefile.am 2005-02-04 17:08:08 UTC (rev 2233)
@@ -127,6 +127,9 @@
$(TEST): $(DLL) src/Main.cs
$(CSC) -out:$@ -r:$(DLL) src/Main.cs
+run-test: test
+ mono $(TEST) a.cs
+
assemblydir = $(libdir)/monodevelop/bin
assembly_DATA = $(DLL)
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Main.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Main.cs 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Main.cs 2005-02-04 17:08:08 UTC (rev 2233)
@@ -75,12 +75,21 @@
Console.ReadLine();
}
*/
+ static void PrintUsage ()
+ {
+ Console.WriteLine ("usage: test-parser.exe <file>");
+ Environment.Exit (0);
+ }
+
public static void Main (string[] args)
{
+ if (args.Length != 1)
+ PrintUsage ();
+
// PrettyPrintDirectories();
Parser p = new Parser();
+
string fileName = args[0];
- Console.WriteLine ("Converting : " + fileName);
p.Parse (new Lexer (new FileReader (fileName)));
if (p.Errors.count == 0) {
StreamReader sr = File.OpenText(fileName);
@@ -88,10 +97,7 @@
sr.Close();
PrettyPrintVisitor ppv = new PrettyPrintVisitor(content);
ppv.Visit(p.compilationUnit, null);
-
Console.WriteLine(ppv.Text);
-
- Console.WriteLine(" done.");
} else {
Console.WriteLine (" Source code errors:");
foreach (ErrorInfo error in p.Errors.ErrorInformation)
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/Modifier.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/Modifier.cs 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/AST/Modifier.cs 2005-02-04 17:08:08 UTC (rev 2233)
@@ -29,7 +29,7 @@
// Modifier scopes
None = 0x0000,
- Classes = New | Public | Protected | Internal | Private | Abstract | Sealed,
+ Classes = New | Public | Protected | Internal | Private | Abstract | Sealed | Static,
Fields = New | Public | Protected | Internal | Private | Static | Readonly | Volatile,
PropertysEventsMethods = New | Public | Protected | Internal | Private | Static | Virtual | Sealed | Override | Abstract | Extern,
Indexers = New | Public | Protected | Internal | Private | Virtual | Sealed | Override | Abstract | Extern,
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Modifiers.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Modifiers.cs 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Modifiers.cs 2005-02-04 17:08:08 UTC (rev 2233)
@@ -1,3 +1,5 @@
+using System;
+
namespace ICSharpCode.SharpRefactory.Parser
{
public class Modifiers
@@ -33,12 +35,17 @@
Add(m.cur);
}
- public void Check(Modifier allowed)
+ // FIXME: probably need more flexible method
+ public void Check (Modifier allowed)
{
Modifier wrong = cur & (allowed ^ Modifier.All);
- if (wrong != Modifier.None) {
- parser.Error("modifier(s) " + wrong + " not allowed here");
- }
+ if (wrong != Modifier.None)
+ parser.Error ("modifier(s) " + wrong + " not allowed here");
+
+ if ((cur & (Modifier.Sealed | Modifier.Static)) == (Modifier.Sealed | Modifier.Static))
+ parser.Error ("cannot be both static and sealed");
+ if ((cur & (Modifier.Abstract | Modifier.Static)) == (Modifier.Abstract | Modifier.Static))
+ parser.Error ("cannot be both static and abstract");
}
}
}
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/Parser.cs 2005-02-04 17:08:08 UTC (rev 2233)
@@ -730,43 +730,43 @@
}
void Expr(
-#line 1714 "cs.ATG"
+#line 1715 "cs.ATG"
out Expression expr) {
-#line 1715 "cs.ATG"
+#line 1716 "cs.ATG"
expr = null; Expression expr1 = null, expr2 = null;
UnaryExpr(
-#line 1717 "cs.ATG"
+#line 1718 "cs.ATG"
out expr);
if (StartOf(5)) {
ConditionalOrExpr(
-#line 1720 "cs.ATG"
+#line 1721 "cs.ATG"
ref expr);
if (la.kind == 11) {
lexer.NextToken();
Expr(
-#line 1720 "cs.ATG"
+#line 1721 "cs.ATG"
out expr1);
Expect(9);
Expr(
-#line 1720 "cs.ATG"
+#line 1721 "cs.ATG"
out expr2);
-#line 1720 "cs.ATG"
+#line 1721 "cs.ATG"
expr = new ConditionalExpression(expr, expr1, expr2);
}
} else if (StartOf(6)) {
-#line 1722 "cs.ATG"
+#line 1723 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1722 "cs.ATG"
+#line 1723 "cs.ATG"
out op);
Expr(
-#line 1722 "cs.ATG"
+#line 1723 "cs.ATG"
out val);
-#line 1722 "cs.ATG"
+#line 1723 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else SynErr(128);
}
@@ -901,6 +901,13 @@
m.Add(Modifier.Sealed);
break;
}
+ case 106: {
+ lexer.NextToken();
+
+#line 930 "cs.ATG"
+ m.Add(Modifier.Static);
+ break;
+ }
default: SynErr(129); break;
}
}
@@ -1260,72 +1267,72 @@
}
void IntegralType(
-#line 939 "cs.ATG"
+#line 940 "cs.ATG"
out string name) {
-#line 939 "cs.ATG"
+#line 940 "cs.ATG"
name = "";
switch (la.kind) {
case 101: {
lexer.NextToken();
-#line 941 "cs.ATG"
+#line 942 "cs.ATG"
name = "sbyte";
break;
}
case 53: {
lexer.NextToken();
-#line 942 "cs.ATG"
+#line 943 "cs.ATG"
name = "byte";
break;
}
case 103: {
lexer.NextToken();
-#line 943 "cs.ATG"
+#line 944 "cs.ATG"
name = "short";
break;
}
case 119: {
lexer.NextToken();
-#line 944 "cs.ATG"
+#line 945 "cs.ATG"
name = "ushort";
break;
}
case 81: {
lexer.NextToken();
-#line 945 "cs.ATG"
+#line 946 "cs.ATG"
name = "int";
break;
}
case 115: {
lexer.NextToken();
-#line 946 "cs.ATG"
+#line 947 "cs.ATG"
name = "uint";
break;
}
case 86: {
lexer.NextToken();
-#line 947 "cs.ATG"
+#line 948 "cs.ATG"
name = "long";
break;
}
case 116: {
lexer.NextToken();
-#line 948 "cs.ATG"
+#line 949 "cs.ATG"
name = "ulong";
break;
}
case 56: {
lexer.NextToken();
-#line 949 "cs.ATG"
+#line 950 "cs.ATG"
name = "char";
break;
}
@@ -1489,130 +1496,130 @@
}
void ClassType(
-#line 932 "cs.ATG"
+#line 933 "cs.ATG"
out string name) {
-#line 932 "cs.ATG"
+#line 933 "cs.ATG"
string qualident; name = "";
if (la.kind == 1) {
Qualident(
-#line 934 "cs.ATG"
+#line 935 "cs.ATG"
out qualident);
-#line 934 "cs.ATG"
+#line 935 "cs.ATG"
name = qualident;
} else if (la.kind == 90) {
lexer.NextToken();
-#line 935 "cs.ATG"
+#line 936 "cs.ATG"
name = "object";
} else if (la.kind == 107) {
lexer.NextToken();
-#line 936 "cs.ATG"
+#line 937 "cs.ATG"
name = "string";
} else SynErr(137);
}
void MemberModifier(
-#line 952 "cs.ATG"
+#line 953 "cs.ATG"
Modifiers m) {
switch (la.kind) {
case 48: {
lexer.NextToken();
-#line 954 "cs.ATG"
+#line 955 "cs.ATG"
m.Add(Modifier.Abstract);
break;
}
case 70: {
lexer.NextToken();
-#line 955 "cs.ATG"
+#line 956 "cs.ATG"
m.Add(Modifier.Extern);
break;
}
case 83: {
lexer.NextToken();
-#line 956 "cs.ATG"
+#line 957 "cs.ATG"
m.Add(Modifier.Internal);
break;
}
case 88: {
lexer.NextToken();
-#line 957 "cs.ATG"
+#line 958 "cs.ATG"
m.Add(Modifier.New);
break;
}
case 93: {
lexer.NextToken();
-#line 958 "cs.ATG"
+#line 959 "cs.ATG"
m.Add(Modifier.Override);
break;
}
case 95: {
lexer.NextToken();
-#line 959 "cs.ATG"
+#line 960 "cs.ATG"
m.Add(Modifier.Private);
break;
}
case 96: {
lexer.NextToken();
-#line 960 "cs.ATG"
+#line 961 "cs.ATG"
m.Add(Modifier.Protected);
break;
}
case 97: {
lexer.NextToken();
-#line 961 "cs.ATG"
+#line 962 "cs.ATG"
m.Add(Modifier.Public);
break;
}
case 98: {
lexer.NextToken();
-#line 962 "cs.ATG"
+#line 963 "cs.ATG"
m.Add(Modifier.Readonly);
break;
}
case 102: {
lexer.NextToken();
-#line 963 "cs.ATG"
+#line 964 "cs.ATG"
m.Add(Modifier.Sealed);
break;
}
case 106: {
lexer.NextToken();
-#line 964 "cs.ATG"
+#line 965 "cs.ATG"
m.Add(Modifier.Static);
break;
}
case 118: {
lexer.NextToken();
-#line 965 "cs.ATG"
+#line 966 "cs.ATG"
m.Add(Modifier.Unsafe);
break;
}
case 121: {
lexer.NextToken();
-#line 966 "cs.ATG"
+#line 967 "cs.ATG"
m.Add(Modifier.Virtual);
break;
}
case 123: {
lexer.NextToken();
-#line 967 "cs.ATG"
+#line 968 "cs.ATG"
m.Add(Modifier.Volatile);
break;
}
@@ -1621,23 +1628,23 @@
}
void ClassMemberDecl(
-#line 1178 "cs.ATG"
+#line 1179 "cs.ATG"
Modifiers m, ArrayList attributes) {
-#line 1179 "cs.ATG"
+#line 1180 "cs.ATG"
Statement stmt = null;
if (StartOf(16)) {
StructMemberDecl(
-#line 1181 "cs.ATG"
+#line 1182 "cs.ATG"
m, attributes);
} else if (la.kind == 25) {
-#line 1182 "cs.ATG"
+#line 1183 "cs.ATG"
m.Check(Modifier.Destructors); Point startPos = t.Location;
lexer.NextToken();
Expect(1);
-#line 1183 "cs.ATG"
+#line 1184 "cs.ATG"
DestructorDeclaration d = new DestructorDeclaration(t.val, attributes);
d.Modifier = m.Modifier;
d.StartLocation = startPos;
@@ -1646,13 +1653,13 @@
Expect(19);
if (la.kind == 14) {
Block(
-#line 1187 "cs.ATG"
+#line 1188 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(139);
-#line 1187 "cs.ATG"
+#line 1188 "cs.ATG"
d.EndLocation = t.EndLocation;
d.Body = (BlockStatement)stmt;
compilationUnit.AddChild(d);
@@ -1661,10 +1668,10 @@
}
void StructMemberDecl(
-#line 970 "cs.ATG"
+#line 971 "cs.ATG"
Modifiers m, ArrayList attributes) {
-#line 972 "cs.ATG"
+#line 973 "cs.ATG"
string qualident = null;
TypeReference type;
Expression expr;
@@ -1674,68 +1681,68 @@
if (la.kind == 59) {
-#line 980 "cs.ATG"
+#line 981 "cs.ATG"
m.Check(Modifier.Constants);
lexer.NextToken();
Type(
-#line 982 "cs.ATG"
+#line 983 "cs.ATG"
out type);
Expect(1);
-#line 982 "cs.ATG"
+#line 983 "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 986 "cs.ATG"
+#line 987 "cs.ATG"
out expr);
-#line 986 "cs.ATG"
+#line 987 "cs.ATG"
f.Initializer = expr;
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 987 "cs.ATG"
+#line 988 "cs.ATG"
f = new VariableDeclaration(t.val);
fd.Fields.Add(f);
Expect(3);
Expr(
-#line 990 "cs.ATG"
+#line 991 "cs.ATG"
out expr);
-#line 990 "cs.ATG"
+#line 991 "cs.ATG"
f.Initializer = expr;
}
Expect(10);
-#line 991 "cs.ATG"
+#line 992 "cs.ATG"
fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd);
} else if (
-#line 994 "cs.ATG"
+#line 995 "cs.ATG"
NotVoidPointer()) {
-#line 994 "cs.ATG"
+#line 995 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
Expect(122);
-#line 995 "cs.ATG"
+#line 996 "cs.ATG"
Point startPos = t.Location;
Qualident(
-#line 996 "cs.ATG"
+#line 997 "cs.ATG"
out qualident);
Expect(18);
if (StartOf(9)) {
FormalParameterList(
-#line 997 "cs.ATG"
+#line 998 "cs.ATG"
out p);
}
Expect(19);
-#line 997 "cs.ATG"
+#line 998 "cs.ATG"
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
@@ -1748,23 +1755,23 @@
if (la.kind == 14) {
Block(
-#line 1007 "cs.ATG"
+#line 1008 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(141);
-#line 1007 "cs.ATG"
+#line 1008 "cs.ATG"
compilationUnit.BlockEnd();
methodDeclaration.Body = (BlockStatement)stmt;
} else if (la.kind == 68) {
-#line 1011 "cs.ATG"
+#line 1012 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
lexer.NextToken();
-#line 1012 "cs.ATG"
+#line 1013 "cs.ATG"
EventDeclaration eventDecl = new EventDeclaration(m.Modifier, attributes);
eventDecl.StartLocation = t.Location;
compilationUnit.AddChild(eventDecl);
@@ -1773,103 +1780,103 @@
EventRemoveRegion removeBlock = null;
Type(
-#line 1019 "cs.ATG"
+#line 1020 "cs.ATG"
out type);
-#line 1019 "cs.ATG"
+#line 1020 "cs.ATG"
eventDecl.TypeReference = type;
if (
-#line 1021 "cs.ATG"
+#line 1022 "cs.ATG"
IsVarDecl()) {
VariableDeclarator(
-#line 1021 "cs.ATG"
+#line 1022 "cs.ATG"
variableDeclarators);
while (la.kind == 12) {
lexer.NextToken();
VariableDeclarator(
-#line 1022 "cs.ATG"
+#line 1023 "cs.ATG"
variableDeclarators);
}
Expect(10);
-#line 1022 "cs.ATG"
+#line 1023 "cs.ATG"
eventDecl.VariableDeclarators = variableDeclarators; eventDecl.EndLocation = t.EndLocation;
} else if (la.kind == 1) {
Qualident(
-#line 1023 "cs.ATG"
+#line 1024 "cs.ATG"
out qualident);
-#line 1023 "cs.ATG"
+#line 1024 "cs.ATG"
eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation;
Expect(14);
-#line 1024 "cs.ATG"
+#line 1025 "cs.ATG"
eventDecl.BodyStart = t.Location;
EventAccessorDecls(
-#line 1025 "cs.ATG"
+#line 1026 "cs.ATG"
out addBlock, out removeBlock);
Expect(15);
-#line 1026 "cs.ATG"
+#line 1027 "cs.ATG"
eventDecl.BodyEnd = t.EndLocation;
} else SynErr(142);
-#line 1027 "cs.ATG"
+#line 1028 "cs.ATG"
compilationUnit.BlockEnd();
eventDecl.AddRegion = addBlock;
eventDecl.RemoveRegion = removeBlock;
} else if (
-#line 1034 "cs.ATG"
+#line 1035 "cs.ATG"
IdentAndLPar()) {
-#line 1034 "cs.ATG"
+#line 1035 "cs.ATG"
m.Check(Modifier.Constructors | Modifier.StaticConstructors);
Expect(1);
-#line 1035 "cs.ATG"
+#line 1036 "cs.ATG"
string name = t.val; Point startPos = t.Location;
Expect(18);
if (StartOf(9)) {
-#line 1035 "cs.ATG"
+#line 1036 "cs.ATG"
m.Check(Modifier.Constructors);
FormalParameterList(
-#line 1036 "cs.ATG"
+#line 1037 "cs.ATG"
out p);
}
Expect(19);
-#line 1038 "cs.ATG"
+#line 1039 "cs.ATG"
ConstructorInitializer init = null;
if (la.kind == 9) {
-#line 1039 "cs.ATG"
+#line 1040 "cs.ATG"
m.Check(Modifier.Constructors);
ConstructorInitializer(
-#line 1040 "cs.ATG"
+#line 1041 "cs.ATG"
out init);
}
-#line 1042 "cs.ATG"
+#line 1043 "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 1047 "cs.ATG"
+#line 1048 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(143);
-#line 1047 "cs.ATG"
+#line 1048 "cs.ATG"
cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd);
} else if (la.kind == 69 || la.kind == 79) {
-#line 1050 "cs.ATG"
+#line 1051 "cs.ATG"
m.Check(Modifier.Operators);
if (m.isNone) Error("at least one modifier must be set");
bool isImplicit = true;
@@ -1879,37 +1886,37 @@
} else {
lexer.NextToken();
-#line 1054 "cs.ATG"
+#line 1055 "cs.ATG"
isImplicit = false;
}
Expect(91);
Type(
-#line 1055 "cs.ATG"
+#line 1056 "cs.ATG"
out type);
-#line 1055 "cs.ATG"
+#line 1056 "cs.ATG"
TypeReference operatorType = type;
Expect(18);
Type(
-#line 1056 "cs.ATG"
+#line 1057 "cs.ATG"
out type);
Expect(1);
-#line 1056 "cs.ATG"
+#line 1057 "cs.ATG"
string varName = t.val;
Expect(19);
if (la.kind == 14) {
Block(
-#line 1056 "cs.ATG"
+#line 1057 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
-#line 1056 "cs.ATG"
+#line 1057 "cs.ATG"
stmt = null;
} else SynErr(144);
-#line 1059 "cs.ATG"
+#line 1060 "cs.ATG"
OperatorDeclarator operatorDeclarator = new OperatorDeclarator(isImplicit ? OperatorType.Implicit : OperatorType.Explicit,
operatorType,
type,
@@ -1920,54 +1927,54 @@
} else if (StartOf(17)) {
TypeDecl(
-#line 1069 "cs.ATG"
+#line 1070 "cs.ATG"
m, attributes);
} else if (StartOf(8)) {
Type(
-#line 1070 "cs.ATG"
+#line 1071 "cs.ATG"
out type);
-#line 1070 "cs.ATG"
+#line 1071 "cs.ATG"
Point startPos = t.Location;
if (la.kind == 91) {
-#line 1072 "cs.ATG"
+#line 1073 "cs.ATG"
Token op;
m.Check(Modifier.Operators);
if (m.isNone) Error("at least one modifier must be set");
lexer.NextToken();
OverloadableOperator(
-#line 1076 "cs.ATG"
+#line 1077 "cs.ATG"
out op);
-#line 1076 "cs.ATG"
+#line 1077 "cs.ATG"
TypeReference firstType, secondType = null; string secondName = null;
Expect(18);
Type(
-#line 1077 "cs.ATG"
+#line 1078 "cs.ATG"
out firstType);
Expect(1);
-#line 1077 "cs.ATG"
+#line 1078 "cs.ATG"
string firstName = t.val;
if (la.kind == 12) {
lexer.NextToken();
Type(
-#line 1078 "cs.ATG"
+#line 1079 "cs.ATG"
out secondType);
Expect(1);
-#line 1078 "cs.ATG"
+#line 1079 "cs.ATG"
secondName = t.val;
-#line 1078 "cs.ATG"
+#line 1079 "cs.ATG"
if (ParserUtil.IsUnaryOperator(op) && !ParserUtil.IsBinaryOperator(op))
Error("too many operands for unary operator");
} else if (la.kind == 19) {
-#line 1081 "cs.ATG"
+#line 1082 "cs.ATG"
if (ParserUtil.IsBinaryOperator(op))
Error("too few operands for binary operator");
@@ -1975,13 +1982,13 @@
Expect(19);
if (la.kind == 14) {
Block(
-#line 1085 "cs.ATG"
+#line 1086 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(146);
-#line 1087 "cs.ATG"
+#line 1088 "cs.ATG"
OperatorDeclarator operatorDeclarator = new OperatorDeclarator(secondType != null ? OperatorType.Binary : OperatorType.Unary,
type,
op.kind,
@@ -1994,43 +2001,43 @@
compilationUnit.AddChild(operatorDeclaration);
} else if (
-#line 1100 "cs.ATG"
+#line 1101 "cs.ATG"
IsVarDecl()) {
-#line 1100 "cs.ATG"
+#line 1101 "cs.ATG"
m.Check(Modifier.Fields);
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
fd.StartLocation = startPos;
VariableDeclarator(
-#line 1104 "cs.ATG"
+#line 1105 "cs.ATG"
variableDeclarators);
while (la.kind == 12) {
lexer.NextToken();
VariableDeclarator(
-#line 1105 "cs.ATG"
+#line 1106 "cs.ATG"
variableDeclarators);
}
Expect(10);
-#line 1106 "cs.ATG"
+#line 1107 "cs.ATG"
fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd);
} else if (la.kind == 110) {
-#line 1109 "cs.ATG"
+#line 1110 "cs.ATG"
m.Check(Modifier.Indexers);
lexer.NextToken();
Expect(16);
FormalParameterList(
-#line 1110 "cs.ATG"
+#line 1111 "cs.ATG"
out p);
Expect(17);
-#line 1110 "cs.ATG"
+#line 1111 "cs.ATG"
Point endLocation = t.EndLocation;
Expect(14);
-#line 1111 "cs.ATG"
+#line 1112 "cs.ATG"
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = endLocation;
@@ -2039,11 +2046,11 @@
PropertySetRegion setRegion;
AccessorDecls(
-#line 1118 "cs.ATG"
+#line 1119 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1119 "cs.ATG"
+#line 1120 "cs.ATG"
indexer.BodyEnd = t.EndLocation;
indexer.GetRegion = getRegion;
indexer.SetRegion = setRegion;
@@ -2051,25 +2058,25 @@
} else if (la.kind == 1) {
Qualident(
-#line 1124 "cs.ATG"
+#line 1125 "cs.ATG"
out qualident);
-#line 1124 "cs.ATG"
+#line 1125 "cs.ATG"
Point qualIdentEndLocation = t.EndLocation;
if (la.kind == 14 || la.kind == 18) {
if (la.kind == 18) {
-#line 1127 "cs.ATG"
+#line 1128 "cs.ATG"
m.Check(Modifier.PropertysEventsMethods);
lexer.NextToken();
if (StartOf(9)) {
FormalParameterList(
-#line 1128 "cs.ATG"
+#line 1129 "cs.ATG"
out p);
}
Expect(19);
-#line 1128 "cs.ATG"
+#line 1129 "cs.ATG"
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
type,
@@ -2081,18 +2088,18 @@
if (la.kind == 14) {
Block(
-#line 1137 "cs.ATG"
+#line 1138 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(147);
-#line 1137 "cs.ATG"
+#line 1138 "cs.ATG"
methodDeclaration.Body = (BlockStatement)stmt;
} else {
lexer.NextToken();
-#line 1140 "cs.ATG"
+#line 1141 "cs.ATG"
PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes);
pDecl.StartLocation = startPos;
pDecl.EndLocation = qualIdentEndLocation;
@@ -2101,11 +2108,11 @@
PropertySetRegion setRegion;
AccessorDecls(
-#line 1147 "cs.ATG"
+#line 1148 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1149 "cs.ATG"
+#line 1150 "cs.ATG"
pDecl.GetRegion = getRegion;
pDecl.SetRegion = setRegion;
pDecl.BodyEnd = t.EndLocation;
@@ -2114,17 +2121,17 @@
}
} else if (la.kind == 13) {
-#line 1157 "cs.ATG"
+#line 1158 "cs.ATG"
m.Check(Modifier.Indexers);
lexer.NextToken();
Expect(110);
Expect(16);
FormalParameterList(
-#line 1158 "cs.ATG"
+#line 1159 "cs.ATG"
out p);
Expect(17);
-#line 1159 "cs.ATG"
+#line 1160 "cs.ATG"
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = t.EndLocation;
@@ -2134,14 +2141,14 @@
Expect(14);
-#line 1166 "cs.ATG"
+#line 1167 "cs.ATG"
Point bodyStart = t.Location;
AccessorDecls(
-#line 1167 "cs.ATG"
+#line 1168 "cs.ATG"
out getRegion, out setRegion);
Expect(15);
-#line 1168 "cs.ATG"
+#line 1169 "cs.ATG"
indexer.BodyStart = bodyStart;
indexer.BodyEnd = t.EndLocation;
indexer.GetRegion = getRegion;
@@ -2155,7 +2162,7 @@
void InterfaceMemberDecl() {
-#line 1195 "cs.ATG"
+#line 1196 "cs.ATG"
TypeReference type;
ArrayList p;
AttributeSection section;
@@ -2169,39 +2176,39 @@
while (la.kind == 16) {
AttributeSection(
-#line 1207 "cs.ATG"
+#line 1208 "cs.ATG"
out section);
-#line 1207 "cs.ATG"
+#line 1208 "cs.ATG"
attributes.Add(section);
}
if (la.kind == 88) {
lexer.NextToken();
-#line 1208 "cs.ATG"
+#line 1209 "cs.ATG"
mod = Modifier.New; startLocation = t.Location;
}
if (
-#line 1211 "cs.ATG"
+#line 1212 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 1211 "cs.ATG"
+#line 1212 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
Expect(1);
-#line 1211 "cs.ATG"
+#line 1212 "cs.ATG"
name = t.val;
Expect(18);
if (StartOf(9)) {
FormalParameterList(
-#line 1212 "cs.ATG"
+#line 1213 "cs.ATG"
out parameters);
}
Expect(19);
Expect(10);
-#line 1212 "cs.ATG"
+#line 1213 "cs.ATG"
MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
md.StartLocation = startLocation;
md.EndLocation = t.EndLocation;
@@ -2210,27 +2217,27 @@
} else if (StartOf(18)) {
if (StartOf(8)) {
Type(
-#line 1218 "cs.ATG"
+#line 1219 "cs.ATG"
out type);
-#line 1218 "cs.ATG"
+#line 1219 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
if (la.kind == 1) {
lexer.NextToken();
-#line 1220 "cs.ATG"
+#line 1221 "cs.ATG"
name = t.val; Point qualIdentEndLocation = t.EndLocation;
if (la.kind == 18) {
lexer.NextToken();
if (StartOf(9)) {
FormalParameterList(
-#line 1223 "cs.ATG"
+#line 1224 "cs.ATG"
out parameters);
}
Expect(19);
Expect(10);
-#line 1223 "cs.ATG"
+#line 1224 "cs.ATG"
MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes);
md.StartLocation = startLocation;
md.EndLocation = t.EndLocation;
@@ -2238,72 +2245,72 @@
} else if (la.kind == 14) {
-#line 1229 "cs.ATG"
+#line 1230 "cs.ATG"
PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd);
lexer.NextToken();
-#line 1230 "cs.ATG"
+#line 1231 "cs.ATG"
Point bodyStart = t.Location;
InterfaceAccessors(
-#line 1230 "cs.ATG"
+#line 1231 "cs.ATG"
out getBlock, out setBlock);
Expect(15);
-#line 1230 "cs.ATG"
+#line 1231 "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 1233 "cs.ATG"
+#line 1234 "cs.ATG"
out p);
Expect(17);
-#line 1233 "cs.ATG"
+#line 1234 "cs.ATG"
Point bracketEndLocation = t.EndLocation;
-#line 1233 "cs.ATG"
+#line 1234 "cs.ATG"
IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id);
Expect(14);
-#line 1234 "cs.ATG"
+#line 1235 "cs.ATG"
Point bodyStart = t.Location;
InterfaceAccessors(
-#line 1234 "cs.ATG"
+#line 1235 "cs.ATG"
out getBlock, out setBlock);
Expect(15);
-#line 1234 "cs.ATG"
+#line 1235 "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 1237 "cs.ATG"
+#line 1238 "cs.ATG"
if (startLocation.X == -1) startLocation = t.Location;
Type(
-#line 1237 "cs.ATG"
+#line 1238 "cs.ATG"
out type);
Expect(1);
-#line 1237 "cs.ATG"
+#line 1238 "cs.ATG"
EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes);
compilationUnit.AddChild(ed);
Expect(10);
-#line 1240 "cs.ATG"
+#line 1241 "cs.ATG"
ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation;
}
} else SynErr(153);
}
void EnumMemberDecl(
-#line 1245 "cs.ATG"
+#line 1246 "cs.ATG"
out FieldDeclaration f) {
-#line 1247 "cs.ATG"
+#line 1248 "cs.ATG"
Expression expr = null;
ArrayList attributes = new ArrayList();
AttributeSection section = null;
@@ -2311,15 +2318,15 @@
while (la.kind == 16) {
AttributeSection(
-#line 1253 "cs.ATG"
+#line 1254 "cs.ATG"
out section);
-#line 1253 "cs.ATG"
+#line 1254 "cs.ATG"
attributes.Add(section);
}
Expect(1);
-#line 1254 "cs.ATG"
+#line 1255 "cs.ATG"
f = new FieldDeclaration(attributes);
varDecl = new VariableDeclaration(t.val);
f.Fields.Add(varDecl);
@@ -2328,10 +2335,10 @@
if (la.kind == 3) {
lexer.NextToken();
Expr(
-#line 1259 "cs.ATG"
+#line 1260 "cs.ATG"
out expr);
-#line 1259 "cs.ATG"
+#line 1260 "cs.ATG"
varDecl.Initializer = expr;
}
}
@@ -2453,11 +2460,11 @@
}
void Block(
-#line 1363 "cs.ATG"
+#line 1364 "cs.ATG"
out Statement stmt) {
Expect(14);
-#line 1365 "cs.ATG"
+#line 1366 "cs.ATG"
BlockStatement blockStmt = new BlockStatement();
blockStmt.StartLocation = t.Location;
compilationUnit.BlockStart(blockStmt);
@@ -2467,7 +2474,7 @@
}
Expect(15);
-#line 1370 "cs.ATG"
+#line 1371 "cs.ATG"
stmt = blockStmt;
blockStmt.EndLocation = t.EndLocation;
compilationUnit.BlockEnd();
@@ -2475,34 +2482,34 @@
}
void VariableDeclarator(
-#line 1356 "cs.ATG"
+#line 1357 "cs.ATG"
ArrayList fieldDeclaration) {
-#line 1357 "cs.ATG"
+#line 1358 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1359 "cs.ATG"
+#line 1360 "cs.ATG"
VariableDeclaration f = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
VariableInitializer(
-#line 1360 "cs.ATG"
+#line 1361 "cs.ATG"
out expr);
-#line 1360 "cs.ATG"
+#line 1361 "cs.ATG"
f.Initializer = expr;
}
-#line 1360 "cs.ATG"
+#line 1361 "cs.ATG"
fieldDeclaration.Add(f);
}
void EventAccessorDecls(
-#line 1305 "cs.ATG"
+#line 1306 "cs.ATG"
out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
-#line 1306 "cs.ATG"
+#line 1307 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
Statement stmt;
@@ -2511,102 +2518,102 @@
while (la.kind == 16) {
AttributeSection(
-#line 1313 "cs.ATG"
+#line 1314 "cs.ATG"
out section);
-#line 1313 "cs.ATG"
+#line 1314 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1315 "cs.ATG"
+#line 1316 "cs.ATG"
IdentIsAdd()) {
-#line 1315 "cs.ATG"
+#line 1316 "cs.ATG"
addBlock = new EventAddRegion(attributes);
AddAccessorDecl(
-#line 1316 "cs.ATG"
+#line 1317 "cs.ATG"
out stmt);
-#line 1316 "cs.ATG"
+#line 1317 "cs.ATG"
attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt;
while (la.kind == 16) {
AttributeSection(
-#line 1317 "cs.ATG"
+#line 1318 "cs.ATG"
out section);
-#line 1317 "cs.ATG"
+#line 1318 "cs.ATG"
attributes.Add(section);
}
RemoveAccessorDecl(
-#line 1318 "cs.ATG"
+#line 1319 "cs.ATG"
out stmt);
-#line 1318 "cs.ATG"
+#line 1319 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt;
} else if (
-#line 1319 "cs.ATG"
+#line 1320 "cs.ATG"
IdentIsRemove()) {
RemoveAccessorDecl(
-#line 1320 "cs.ATG"
+#line 1321 "cs.ATG"
out stmt);
-#line 1320 "cs.ATG"
+#line 1321 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList();
while (la.kind == 16) {
AttributeSection(
-#line 1321 "cs.ATG"
+#line 1322 "cs.ATG"
out section);
-#line 1321 "cs.ATG"
+#line 1322 "cs.ATG"
attributes.Add(section);
}
AddAccessorDecl(
-#line 1322 "cs.ATG"
+#line 1323 "cs.ATG"
out stmt);
-#line 1322 "cs.ATG"
+#line 1323 "cs.ATG"
addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt;
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1323 "cs.ATG"
+#line 1324 "cs.ATG"
Error("add or remove accessor declaration expected");
} else SynErr(156);
}
void ConstructorInitializer(
-#line 1392 "cs.ATG"
+#line 1393 "cs.ATG"
out ConstructorInitializer ci) {
-#line 1393 "cs.ATG"
+#line 1394 "cs.ATG"
Expression expr; ci = new ConstructorInitializer();
Expect(9);
if (la.kind == 50) {
lexer.NextToken();
-#line 1397 "cs.ATG"
+#line 1398 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.Base;
} else if (la.kind == 110) {
lexer.NextToken();
-#line 1398 "cs.ATG"
+#line 1399 "cs.ATG"
ci.ConstructorInitializerType = ConstructorInitializerType.This;
} else SynErr(157);
Expect(18);
if (StartOf(21)) {
Argument(
-#line 1401 "cs.ATG"
+#line 1402 "cs.ATG"
out expr);
-#line 1401 "cs.ATG"
+#line 1402 "cs.ATG"
ci.Arguments.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1401 "cs.ATG"
+#line 1402 "cs.ATG"
out expr);
-#line 1401 "cs.ATG"
+#line 1402 "cs.ATG"
ci.Arguments.Add(expr);
}
}
@@ -2614,7 +2621,7 @@
}
void OverloadableOperator(
-#line 1413 "cs.ATG"
+#line 1414 "cs.ATG"
out Token op) {
switch (la.kind) {
case 4: {
@@ -2708,15 +2715,15 @@
default: SynErr(158); break;
}
-#line 1422 "cs.ATG"
+#line 1423 "cs.ATG"
op = t;
}
void AccessorDecls(
-#line 1263 "cs.ATG"
+#line 1264 "cs.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1265 "cs.ATG"
+#line 1266 "cs.ATG"
ArrayList attributes = new ArrayList();
AttributeSection section;
getBlock = null;
@@ -2724,136 +2731,136 @@
while (la.kind == 16) {
AttributeSection(
-#line 1271 "cs.ATG"
+#line 1272 "cs.ATG"
out section);
-#line 1271 "cs.ATG"
+#line 1272 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1273 "cs.ATG"
+#line 1274 "cs.ATG"
IdentIsGet()) {
GetAccessorDecl(
-#line 1274 "cs.ATG"
+#line 1275 "cs.ATG"
out getBlock, attributes);
if (la.kind == 1 || la.kind == 16) {
-#line 1275 "cs.ATG"
+#line 1276 "cs.ATG"
attributes = new ArrayList();
while (la.kind == 16) {
AttributeSection(
-#line 1276 "cs.ATG"
+#line 1277 "cs.ATG"
out section);
-#line 1276 "cs.ATG"
+#line 1277 "cs.ATG"
attributes.Add(section);
}
SetAccessorDecl(
-#line 1277 "cs.ATG"
+#line 1278 "cs.ATG"
out setBlock, attributes);
}
} else if (
-#line 1279 "cs.ATG"
+#line 1280 "cs.ATG"
IdentIsSet()) {
SetAccessorDecl(
-#line 1280 "cs.ATG"
+#line 1281 "cs.ATG"
out setBlock, attributes);
if (la.kind == 1 || la.kind == 16) {
-#line 1281 "cs.ATG"
+#line 1282 "cs.ATG"
attributes = new ArrayList();
while (la.kind == 16) {
AttributeSection(
-#line 1282 "cs.ATG"
+#line 1283 "cs.ATG"
out section);
-#line 1282 "cs.ATG"
+#line 1283 "cs.ATG"
attributes.Add(section);
}
GetAccessorDecl(
-#line 1283 "cs.ATG"
+#line 1284 "cs.ATG"
out getBlock, attributes);
}
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1285 "cs.ATG"
+#line 1286 "cs.ATG"
Error("get or set accessor declaration expected");
} else SynErr(159);
}
void InterfaceAccessors(
-#line 1327 "cs.ATG"
+#line 1328 "cs.ATG"
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
-#line 1329 "cs.ATG"
+#line 1330 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
getBlock = null; setBlock = null;
while (la.kind == 16) {
AttributeSection(
-#line 1334 "cs.ATG"
+#line 1335 "cs.ATG"
out section);
-#line 1334 "cs.ATG"
+#line 1335 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1336 "cs.ATG"
+#line 1337 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1336 "cs.ATG"
+#line 1337 "cs.ATG"
getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1337 "cs.ATG"
+#line 1338 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1337 "cs.ATG"
+#line 1338 "cs.ATG"
setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1338 "cs.ATG"
+#line 1339 "cs.ATG"
Error("set or get expected");
} else SynErr(160);
Expect(10);
-#line 1340 "cs.ATG"
+#line 1341 "cs.ATG"
attributes = new ArrayList();
if (la.kind == 1 || la.kind == 16) {
while (la.kind == 16) {
AttributeSection(
-#line 1342 "cs.ATG"
+#line 1343 "cs.ATG"
out section);
-#line 1342 "cs.ATG"
+#line 1343 "cs.ATG"
attributes.Add(section);
}
if (
-#line 1344 "cs.ATG"
+#line 1345 "cs.ATG"
IdentIsGet()) {
Expect(1);
-#line 1344 "cs.ATG"
+#line 1345 "cs.ATG"
if (getBlock != null) Error("get already declared");
else getBlock = new PropertyGetRegion(null, attributes);
} else if (
-#line 1347 "cs.ATG"
+#line 1348 "cs.ATG"
IdentIsSet()) {
Expect(1);
-#line 1347 "cs.ATG"
+#line 1348 "cs.ATG"
if (setBlock != null) Error("set already declared");
else setBlock = new PropertySetRegion(null, attributes);
} else if (la.kind == 1) {
lexer.NextToken();
-#line 1350 "cs.ATG"
+#line 1351 "cs.ATG"
Error("set or get expected");
} else SynErr(161);
Expect(10);
@@ -2861,187 +2868,187 @@
}
void GetAccessorDecl(
-#line 1289 "cs.ATG"
+#line 1290 "cs.ATG"
out PropertyGetRegion getBlock, ArrayList attributes) {
-#line 1290 "cs.ATG"
+#line 1291 "cs.ATG"
Statement stmt = null;
Expect(1);
-#line 1293 "cs.ATG"
+#line 1294 "cs.ATG"
if (t.val != "get") Error("get expected");
if (la.kind == 14) {
Block(
-#line 1294 "cs.ATG"
+#line 1295 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(162);
-#line 1294 "cs.ATG"
+#line 1295 "cs.ATG"
getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes);
}
void SetAccessorDecl(
-#line 1297 "cs.ATG"
+#line 1298 "cs.ATG"
out PropertySetRegion setBlock, ArrayList attributes) {
-#line 1298 "cs.ATG"
+#line 1299 "cs.ATG"
Statement stmt = null;
Expect(1);
-#line 1301 "cs.ATG"
+#line 1302 "cs.ATG"
if (t.val != "set") Error("set expected");
if (la.kind == 14) {
Block(
-#line 1302 "cs.ATG"
+#line 1303 "cs.ATG"
out stmt);
} else if (la.kind == 10) {
lexer.NextToken();
} else SynErr(163);
-#line 1302 "cs.ATG"
+#line 1303 "cs.ATG"
setBlock = new PropertySetRegion((BlockStatement)stmt, attributes);
}
void AddAccessorDecl(
-#line 1376 "cs.ATG"
+#line 1377 "cs.ATG"
out Statement stmt) {
-#line 1377 "cs.ATG"
+#line 1378 "cs.ATG"
stmt = null;
Expect(1);
-#line 1380 "cs.ATG"
+#line 1381 "cs.ATG"
if (t.val != "add") Error("add expected");
Block(
-#line 1381 "cs.ATG"
+#line 1382 "cs.ATG"
out stmt);
}
void RemoveAccessorDecl(
-#line 1384 "cs.ATG"
+#line 1385 "cs.ATG"
out Statement stmt) {
-#line 1385 "cs.ATG"
+#line 1386 "cs.ATG"
stmt = null;
Expect(1);
-#line 1388 "cs.ATG"
+#line 1389 "cs.ATG"
if (t.val != "remove") Error("remove expected");
Block(
-#line 1389 "cs.ATG"
+#line 1390 "cs.ATG"
out stmt);
}
void VariableInitializer(
-#line 1405 "cs.ATG"
+#line 1406 "cs.ATG"
out Expression initializerExpression) {
-#line 1406 "cs.ATG"
+#line 1407 "cs.ATG"
TypeReference type = null; Expression expr = null; initializerExpression = null;
if (StartOf(4)) {
Expr(
-#line 1408 "cs.ATG"
+#line 1409 "cs.ATG"
out initializerExpression);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1409 "cs.ATG"
+#line 1410 "cs.ATG"
out initializerExpression);
} else if (la.kind == 105) {
lexer.NextToken();
Type(
-#line 1410 "cs.ATG"
+#line 1411 "cs.ATG"
out type);
Expect(16);
Expr(
-#line 1410 "cs.ATG"
+#line 1411 "cs.ATG"
out expr);
Expect(17);
-#line 1410 "cs.ATG"
+#line 1411 "cs.ATG"
initializerExpression = new StackAllocExpression(type, expr);
} else SynErr(164);
}
void Statement() {
-#line 1493 "cs.ATG"
+#line 1494 "cs.ATG"
TypeReference type;
Expression expr;
Statement stmt;
if (
-#line 1499 "cs.ATG"
+#line 1500 "cs.ATG"
IsLabel()) {
Expect(1);
-#line 1499 "cs.ATG"
+#line 1500 "cs.ATG"
compilationUnit.AddChild(new LabelStatement(t.val));
Expect(9);
Statement();
} else if (la.kind == 59) {
lexer.NextToken();
Type(
-#line 1502 "cs.ATG"
+#line 1503 "cs.ATG"
out type);
-#line 1502 "cs.ATG"
+#line 1503 "cs.ATG"
LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location;
Expect(1);
-#line 1503 "cs.ATG"
+#line 1504 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1504 "cs.ATG"
+#line 1505 "cs.ATG"
out expr);
-#line 1504 "cs.ATG"
+#line 1505 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1505 "cs.ATG"
+#line 1506 "cs.ATG"
ident = t.val;
Expect(3);
Expr(
-#line 1505 "cs.ATG"
+#line 1506 "cs.ATG"
out expr);
-#line 1505 "cs.ATG"
+#line 1506 "cs.ATG"
var.Variables.Add(new VariableDeclaration(ident, expr));
}
Expect(10);
-#line 1506 "cs.ATG"
+#line 1507 "cs.ATG"
compilationUnit.AddChild(var);
} else if (
-#line 1508 "cs.ATG"
+#line 1509 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1508 "cs.ATG"
+#line 1509 "cs.ATG"
out stmt);
Expect(10);
-#line 1508 "cs.ATG"
+#line 1509 "cs.ATG"
compilationUnit.AddChild(stmt);
} else if (StartOf(22)) {
EmbeddedStatement(
-#line 1509 "cs.ATG"
+#line 1510 "cs.ATG"
out stmt);
-#line 1509 "cs.ATG"
+#line 1510 "cs.ATG"
compilationUnit.AddChild(stmt);
} else SynErr(165);
}
void Argument(
-#line 1425 "cs.ATG"
+#line 1426 "cs.ATG"
out Expression argumentexpr) {
-#line 1427 "cs.ATG"
+#line 1428 "cs.ATG"
Expression expr;
FieldDirection fd = FieldDirection.None;
@@ -3049,48 +3056,48 @@
if (la.kind == 99) {
lexer.NextToken();
-#line 1432 "cs.ATG"
+#line 1433 "cs.ATG"
fd = FieldDirection.Ref;
} else {
lexer.NextToken();
-#line 1433 "cs.ATG"
+#line 1434 "cs.ATG"
fd = FieldDirection.Out;
}
}
Expr(
-#line 1435 "cs.ATG"
+#line 1436 "cs.ATG"
out expr);
-#line 1435 "cs.ATG"
+#line 1436 "cs.ATG"
argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr;
}
void ArrayInitializer(
-#line 1454 "cs.ATG"
+#line 1455 "cs.ATG"
out Expression outExpr) {
-#line 1456 "cs.ATG"
+#line 1457 "cs.ATG"
Expression expr = null;
ArrayInitializerExpression initializer = new ArrayInitializerExpression();
Expect(14);
if (StartOf(23)) {
VariableInitializer(
-#line 1461 "cs.ATG"
+#line 1462 "cs.ATG"
out expr);
-#line 1461 "cs.ATG"
+#line 1462 "cs.ATG"
initializer.CreateExpressions.Add(expr);
while (
-#line 1461 "cs.ATG"
+#line 1462 "cs.ATG"
NotFinalComma()) {
Expect(12);
VariableInitializer(
-#line 1461 "cs.ATG"
+#line 1462 "cs.ATG"
out expr);
-#line 1461 "cs.ATG"
+#line 1462 "cs.ATG"
initializer.CreateExpressions.Add(expr);
}
if (la.kind == 12) {
@@ -3099,91 +3106,91 @@
}
Expect(15);
-#line 1462 "cs.ATG"
+#line 1463 "cs.ATG"
outExpr = initializer;
}
void AssignmentOperator(
-#line 1438 "cs.ATG"
+#line 1439 "cs.ATG"
out AssignmentOperatorType op) {
-#line 1439 "cs.ATG"
+#line 1440 "cs.ATG"
op = AssignmentOperatorType.None;
switch (la.kind) {
case 3: {
lexer.NextToken();
-#line 1441 "cs.ATG"
+#line 1442 "cs.ATG"
op = AssignmentOperatorType.Assign;
break;
}
case 37: {
lexer.NextToken();
-#line 1442 "cs.ATG"
+#line 1443 "cs.ATG"
op = AssignmentOperatorType.Add;
break;
}
case 38: {
lexer.NextToken();
-#line 1443 "cs.ATG"
+#line 1444 "cs.ATG"
op = AssignmentOperatorType.Subtract;
break;
}
case 39: {
lexer.NextToken();
-#line 1444 "cs.ATG"
+#line 1445 "cs.ATG"
op = AssignmentOperatorType.Multiply;
break;
}
case 40: {
lexer.NextToken();
-#line 1445 "cs.ATG"
+#line 1446 "cs.ATG"
op = AssignmentOperatorType.Divide;
break;
}
case 41: {
lexer.NextToken();
-#line 1446 "cs.ATG"
+#line 1447 "cs.ATG"
op = AssignmentOperatorType.Modulus;
break;
}
case 42: {
lexer.NextToken();
-#line 1447 "cs.ATG"
+#line 1448 "cs.ATG"
op = AssignmentOperatorType.BitwiseAnd;
break;
}
case 43: {
lexer.NextToken();
-#line 1448 "cs.ATG"
+#line 1449 "cs.ATG"
op = AssignmentOperatorType.BitwiseOr;
break;
}
case 44: {
lexer.NextToken();
-#line 1449 "cs.ATG"
+#line 1450 "cs.ATG"
op = AssignmentOperatorType.ExclusiveOr;
break;
}
case 45: {
lexer.NextToken();
-#line 1450 "cs.ATG"
+#line 1451 "cs.ATG"
op = AssignmentOperatorType.ShiftLeft;
break;
}
case 46: {
lexer.NextToken();
-#line 1451 "cs.ATG"
+#line 1452 "cs.ATG"
op = AssignmentOperatorType.ShiftRight;
break;
}
@@ -3192,83 +3199,83 @@
}
void LocalVariableDecl(
-#line 1465 "cs.ATG"
+#line 1466 "cs.ATG"
out Statement stmt) {
-#line 1467 "cs.ATG"
+#line 1468 "cs.ATG"
TypeReference type;
VariableDeclaration var = null;
LocalVariableDeclaration localVariableDeclaration;
Type(
-#line 1472 "cs.ATG"
+#line 1473 "cs.ATG"
out type);
-#line 1472 "cs.ATG"
+#line 1473 "cs.ATG"
localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location;
LocalVariableDeclarator(
-#line 1473 "cs.ATG"
+#line 1474 "cs.ATG"
out var);
-#line 1473 "cs.ATG"
+#line 1474 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
while (la.kind == 12) {
lexer.NextToken();
LocalVariableDeclarator(
-#line 1474 "cs.ATG"
+#line 1475 "cs.ATG"
out var);
-#line 1474 "cs.ATG"
+#line 1475 "cs.ATG"
localVariableDeclaration.Variables.Add(var);
}
-#line 1475 "cs.ATG"
+#line 1476 "cs.ATG"
stmt = localVariableDeclaration;
}
void LocalVariableDeclarator(
-#line 1478 "cs.ATG"
+#line 1479 "cs.ATG"
out VariableDeclaration var) {
-#line 1479 "cs.ATG"
+#line 1480 "cs.ATG"
Expression expr = null;
Expect(1);
-#line 1481 "cs.ATG"
+#line 1482 "cs.ATG"
var = new VariableDeclaration(t.val);
if (la.kind == 3) {
lexer.NextToken();
LocalVariableInitializer(
-#line 1481 "cs.ATG"
+#line 1482 "cs.ATG"
out expr);
-#line 1481 "cs.ATG"
+#line 1482 "cs.ATG"
var.Initializer = expr;
}
}
void LocalVariableInitializer(
-#line 1484 "cs.ATG"
+#line 1485 "cs.ATG"
out Expression expr) {
-#line 1485 "cs.ATG"
+#line 1486 "cs.ATG"
expr = null;
if (StartOf(4)) {
Expr(
-#line 1487 "cs.ATG"
+#line 1488 "cs.ATG"
out expr);
} else if (la.kind == 14) {
ArrayInitializer(
-#line 1488 "cs.ATG"
+#line 1489 "cs.ATG"
out expr);
} else SynErr(167);
}
void EmbeddedStatement(
-#line 1515 "cs.ATG"
+#line 1516 "cs.ATG"
out Statement statement) {
-#line 1517 "cs.ATG"
+#line 1518 "cs.ATG"
TypeReference type = null;
Expression expr = null;
Statement embeddedStatement = null;
@@ -3276,161 +3283,161 @@
if (la.kind == 14) {
Block(
-#line 1523 "cs.ATG"
+#line 1524 "cs.ATG"
out statement);
} else if (la.kind == 10) {
lexer.NextToken();
-#line 1525 "cs.ATG"
+#line 1526 "cs.ATG"
statement = new EmptyStatement();
} else if (
-#line 1527 "cs.ATG"
+#line 1528 "cs.ATG"
UnCheckedAndLBrace()) {
-#line 1527 "cs.ATG"
+#line 1528 "cs.ATG"
Statement block; bool isChecked = true;
if (la.kind == 57) {
lexer.NextToken();
} else if (la.kind == 117) {
lexer.NextToken();
-#line 1528 "cs.ATG"
+#line 1529 "cs.ATG"
isChecked = false;
} else SynErr(168);
Block(
-#line 1529 "cs.ATG"
+#line 1530 "cs.ATG"
out block);
-#line 1529 "cs.ATG"
+#line 1530 "cs.ATG"
statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block);
} else if (StartOf(4)) {
StatementExpr(
-#line 1531 "cs.ATG"
+#line 1532 "cs.ATG"
out statement);
Expect(10);
} else if (la.kind == 78) {
lexer.NextToken();
-#line 1533 "cs.ATG"
+#line 1534 "cs.ATG"
Statement elseStatement = null;
Expect(18);
Expr(
-#line 1534 "cs.ATG"
+#line 1535 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1535 "cs.ATG"
+#line 1536 "cs.ATG"
out embeddedStatement);
if (la.kind == 66) {
lexer.NextToken();
EmbeddedStatement(
-#line 1536 "cs.ATG"
+#line 1537 "cs.ATG"
out elseStatement);
}
-#line 1537 "cs.ATG"
+#line 1538 "cs.ATG"
statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) : (Statement)new IfStatement(expr, embeddedStatement);
} else if (la.kind == 109) {
lexer.NextToken();
-#line 1538 "cs.ATG"
+#line 1539 "cs.ATG"
ArrayList switchSections = new ArrayList();
Expect(18);
Expr(
-#line 1539 "cs.ATG"
+#line 1540 "cs.ATG"
out expr);
Expect(19);
Expect(14);
while (la.kind == 54 || la.kind == 62) {
SwitchSection(
-#line 1540 "cs.ATG"
+#line 1541 "cs.ATG"
out statement);
-#line 1540 "cs.ATG"
+#line 1541 "cs.ATG"
switchSections.Add(statement);
}
Expect(15);
-#line 1541 "cs.ATG"
+#line 1542 "cs.ATG"
statement = new SwitchStatement(expr, switchSections);
} else if (la.kind == 124) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1543 "cs.ATG"
+#line 1544 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1544 "cs.ATG"
+#line 1545 "cs.ATG"
out embeddedStatement);
-#line 1544 "cs.ATG"
+#line 1545 "cs.ATG"
statement = new WhileStatement(expr, embeddedStatement);
} else if (la.kind == 64) {
lexer.NextToken();
EmbeddedStatement(
-#line 1545 "cs.ATG"
+#line 1546 "cs.ATG"
out embeddedStatement);
Expect(124);
Expect(18);
Expr(
-#line 1546 "cs.ATG"
+#line 1547 "cs.ATG"
out expr);
Expect(19);
Expect(10);
-#line 1546 "cs.ATG"
+#line 1547 "cs.ATG"
statement = new DoWhileStatement(expr, embeddedStatement);
} else if (la.kind == 75) {
lexer.NextToken();
-#line 1547 "cs.ATG"
+#line 1548 "cs.ATG"
ArrayList initializer = null, iterator = null;
Expect(18);
if (StartOf(4)) {
ForInitializer(
-#line 1548 "cs.ATG"
+#line 1549 "cs.ATG"
out initializer);
}
Expect(10);
if (StartOf(4)) {
Expr(
-#line 1549 "cs.ATG"
+#line 1550 "cs.ATG"
out expr);
}
Expect(10);
if (StartOf(4)) {
ForIterator(
-#line 1550 "cs.ATG"
+#line 1551 "cs.ATG"
out iterator);
}
Expect(19);
EmbeddedStatement(
-#line 1551 "cs.ATG"
+#line 1552 "cs.ATG"
out embeddedStatement);
-#line 1551 "cs.ATG"
+#line 1552 "cs.ATG"
statement = new ForStatement(initializer, expr, iterator, embeddedStatement);
} else if (la.kind == 76) {
lexer.NextToken();
Expect(18);
Type(
-#line 1552 "cs.ATG"
+#line 1553 "cs.ATG"
out type);
Expect(1);
-#line 1552 "cs.ATG"
+#line 1553 "cs.ATG"
string varName = t.val;
Expect(80);
Expr(
-#line 1553 "cs.ATG"
+#line 1554 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1554 "cs.ATG"
+#line 1555 "cs.ATG"
out embeddedStatement);
-#line 1554 "cs.ATG"
+#line 1555 "cs.ATG"
statement = new ForeachStatement(type, varName , expr, embeddedStatement);
statement.EndLocation = t.EndLocation;
@@ -3438,363 +3445,363 @@
lexer.NextToken();
Expect(10);
-#line 1558 "cs.ATG"
+#line 1559 "cs.ATG"
statement = new BreakStatement();
} else if (la.kind == 60) {
lexer.NextToken();
Expect(10);
-#line 1559 "cs.ATG"
+#line 1560 "cs.ATG"
statement = new ContinueStatement();
} else if (la.kind == 77) {
GotoStatement(
-#line 1560 "cs.ATG"
+#line 1561 "cs.ATG"
out statement);
} else if (la.kind == 100) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1561 "cs.ATG"
+#line 1562 "cs.ATG"
out expr);
}
Expect(10);
-#line 1561 "cs.ATG"
+#line 1562 "cs.ATG"
statement = new ReturnStatement(expr);
} else if (la.kind == 111) {
lexer.NextToken();
if (StartOf(4)) {
Expr(
-#line 1562 "cs.ATG"
+#line 1563 "cs.ATG"
out expr);
}
Expect(10);
-#line 1562 "cs.ATG"
+#line 1563 "cs.ATG"
statement = new ThrowStatement(expr);
} else if (la.kind == 113) {
TryStatement(
-#line 1564 "cs.ATG"
+#line 1565 "cs.ATG"
out statement);
} else if (la.kind == 85) {
lexer.NextToken();
Expect(18);
Expr(
-#line 1566 "cs.ATG"
+#line 1567 "cs.ATG"
out expr);
Expect(19);
EmbeddedStatement(
-#line 1567 "cs.ATG"
+#line 1568 "cs.ATG"
out embeddedStatement);
-#line 1567 "cs.ATG"
+#line 1568 "cs.ATG"
statement = new LockStatement(expr, embeddedStatement);
} else if (la.kind == 120) {
-#line 1569 "cs.ATG"
+#line 1570 "cs.ATG"
Statement resourceAcquisitionStmt = null;
lexer.NextToken();
Expect(18);
ResourceAcquisition(
-#line 1571 "cs.ATG"
+#line 1572 "cs.ATG"
out resourceAcquisitionStmt);
Expect(19);
EmbeddedStatement(
-#line 1572 "cs.ATG"
+#line 1573 "cs.ATG"
out embeddedStatement);
-#line 1572 "cs.ATG"
+#line 1573 "cs.ATG"
statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement);
} else if (la.kind == 118) {
lexer.NextToken();
Block(
-#line 1574 "cs.ATG"
+#line 1575 "cs.ATG"
out embeddedStatement);
-#line 1574 "cs.ATG"
+#line 1575 "cs.ATG"
statement = new UnsafeStatement(embeddedStatement);
} else if (la.kind == 73) {
lexer.NextToken();
Expect(18);
Type(
-#line 1577 "cs.ATG"
+#line 1578 "cs.ATG"
out type);
-#line 1577 "cs.ATG"
+#line 1578 "cs.ATG"
if (type.PointerNestingLevel == 0) Error("can only fix pointer types");
FixedStatement fxStmt = new FixedStatement(type);
string identifier = null;
Expect(1);
-#line 1581 "cs.ATG"
+#line 1582 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1582 "cs.ATG"
+#line 1583 "cs.ATG"
out expr);
-#line 1582 "cs.ATG"
+#line 1583 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
while (la.kind == 12) {
lexer.NextToken();
Expect(1);
-#line 1584 "cs.ATG"
+#line 1585 "cs.ATG"
identifier = t.val;
Expect(3);
Expr(
-#line 1585 "cs.ATG"
+#line 1586 "cs.ATG"
out expr);
-#line 1585 "cs.ATG"
+#line 1586 "cs.ATG"
fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr));
}
Expect(19);
EmbeddedStatement(
-#line 1587 "cs.ATG"
+#line 1588 "cs.ATG"
out embeddedStatement);
-#line 1587 "cs.ATG"
+#line 1588 "cs.ATG"
fxStmt.EmbeddedStatement = embeddedStatement; statement = fxStmt;
} else SynErr(169);
}
void StatementExpr(
-#line 1695 "cs.ATG"
+#line 1696 "cs.ATG"
out Statement stmt) {
-#line 1700 "cs.ATG"
+#line 1701 "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 1706 "cs.ATG"
+#line 1707 "cs.ATG"
out expr);
if (StartOf(6)) {
-#line 1709 "cs.ATG"
+#line 1710 "cs.ATG"
AssignmentOperatorType op; Expression val;
AssignmentOperator(
-#line 1709 "cs.ATG"
+#line 1710 "cs.ATG"
out op);
Expr(
-#line 1709 "cs.ATG"
+#line 1710 "cs.ATG"
out val);
-#line 1709 "cs.ATG"
+#line 1710 "cs.ATG"
expr = new AssignmentExpression(expr, op, val);
} else if (la.kind == 10 || la.kind == 12 || la.kind == 19) {
-#line 1710 "cs.ATG"
+#line 1711 "cs.ATG"
if (mustBeAssignment) Error("error in assignment.");
} else SynErr(170);
-#line 1711 "cs.ATG"
+#line 1712 "cs.ATG"
stmt = new StatementExpression(expr);
}
void SwitchSection(
-#line 1609 "cs.ATG"
+#line 1610 "cs.ATG"
out Statement stmt) {
-#line 1611 "cs.ATG"
+#line 1612 "cs.ATG"
SwitchSection switchSection = new SwitchSection();
Expression expr;
SwitchLabel(
-#line 1615 "cs.ATG"
+#line 1616 "cs.ATG"
out expr);
-#line 1615 "cs.ATG"
+#line 1616 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
while (la.kind == 54 || la.kind == 62) {
SwitchLabel(
-#line 1615 "cs.ATG"
+#line 1616 "cs.ATG"
out expr);
-#line 1615 "cs.ATG"
+#line 1616 "cs.ATG"
switchSection.SwitchLabels.Add(expr);
}
-#line 1616 "cs.ATG"
+#line 1617 "cs.ATG"
compilationUnit.BlockStart(switchSection);
Statement();
while (StartOf(20)) {
Statement();
}
-#line 1619 "cs.ATG"
+#line 1620 "cs.ATG"
compilationUnit.BlockEnd();
stmt = switchSection;
}
void ForInitializer(
-#line 1590 "cs.ATG"
+#line 1591 "cs.ATG"
out ArrayList initializer) {
-#line 1592 "cs.ATG"
+#line 1593 "cs.ATG"
Statement stmt;
initializer = new ArrayList();
if (
-#line 1596 "cs.ATG"
+#line 1597 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1596 "cs.ATG"
+#line 1597 "cs.ATG"
out stmt);
-#line 1596 "cs.ATG"
+#line 1597 "cs.ATG"
initializer.Add(stmt);
} else if (StartOf(4)) {
StatementExpr(
-#line 1597 "cs.ATG"
+#line 1598 "cs.ATG"
out stmt);
-#line 1597 "cs.ATG"
+#line 1598 "cs.ATG"
initializer.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1597 "cs.ATG"
+#line 1598 "cs.ATG"
out stmt);
-#line 1597 "cs.ATG"
+#line 1598 "cs.ATG"
initializer.Add(stmt);
}
-#line 1597 "cs.ATG"
+#line 1598 "cs.ATG"
initializer.Add(stmt);
} else SynErr(171);
}
void ForIterator(
-#line 1600 "cs.ATG"
+#line 1601 "cs.ATG"
out ArrayList iterator) {
-#line 1602 "cs.ATG"
+#line 1603 "cs.ATG"
Statement stmt;
iterator = new ArrayList();
StatementExpr(
-#line 1606 "cs.ATG"
+#line 1607 "cs.ATG"
out stmt);
-#line 1606 "cs.ATG"
+#line 1607 "cs.ATG"
iterator.Add(stmt);
while (la.kind == 12) {
lexer.NextToken();
StatementExpr(
-#line 1606 "cs.ATG"
+#line 1607 "cs.ATG"
out stmt);
-#line 1606 "cs.ATG"
+#line 1607 "cs.ATG"
iterator.Add(stmt);
}
}
void GotoStatement(
-#line 1668 "cs.ATG"
+#line 1669 "cs.ATG"
out Statement stmt) {
-#line 1669 "cs.ATG"
+#line 1670 "cs.ATG"
Expression expr; stmt = null;
Expect(77);
if (la.kind == 1) {
lexer.NextToken();
-#line 1673 "cs.ATG"
+#line 1674 "cs.ATG"
stmt = new GotoStatement(t.val);
Expect(10);
} else if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1674 "cs.ATG"
+#line 1675 "cs.ATG"
out expr);
Expect(10);
-#line 1674 "cs.ATG"
+#line 1675 "cs.ATG"
stmt = new GotoCaseStatement(expr);
} else if (la.kind == 62) {
lexer.NextToken();
Expect(10);
-#line 1675 "cs.ATG"
+#line 1676 "cs.ATG"
stmt = new GotoCaseStatement(null);
} else SynErr(172);
}
void TryStatement(
-#line 1631 "cs.ATG"
+#line 1632 "cs.ATG"
out Statement tryStatement) {
-#line 1633 "cs.ATG"
+#line 1634 "cs.ATG"
Statement blockStmt = null, finallyStmt = null;
ArrayList catchClauses = null;
Expect(113);
Block(
-#line 1637 "cs.ATG"
+#line 1638 "cs.ATG"
out blockStmt);
if (la.kind == 55) {
CatchClauses(
-#line 1639 "cs.ATG"
+#line 1640 "cs.ATG"
out catchClauses);
if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1639 "cs.ATG"
+#line 1640 "cs.ATG"
out finallyStmt);
}
} else if (la.kind == 72) {
lexer.NextToken();
Block(
-#line 1640 "cs.ATG"
+#line 1641 "cs.ATG"
out finallyStmt);
} else SynErr(173);
-#line 1643 "cs.ATG"
+#line 1644 "cs.ATG"
tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
}
void ResourceAcquisition(
-#line 1679 "cs.ATG"
+#line 1680 "cs.ATG"
out Statement stmt) {
-#line 1681 "cs.ATG"
+#line 1682 "cs.ATG"
stmt = null;
Expression expr;
if (
-#line 1686 "cs.ATG"
+#line 1687 "cs.ATG"
IsLocalVarDecl()) {
LocalVariableDecl(
-#line 1686 "cs.ATG"
+#line 1687 "cs.ATG"
out stmt);
} else if (StartOf(4)) {
Expr(
-#line 1687 "cs.ATG"
+#line 1688 "cs.ATG"
out expr);
-#line 1691 "cs.ATG"
+#line 1692 "cs.ATG"
stmt = new StatementExpression(expr);
} else SynErr(174);
}
void SwitchLabel(
-#line 1624 "cs.ATG"
+#line 1625 "cs.ATG"
out Expression expr) {
-#line 1625 "cs.ATG"
+#line 1626 "cs.ATG"
expr = null;
if (la.kind == 54) {
lexer.NextToken();
Expr(
-#line 1627 "cs.ATG"
+#line 1628 "cs.ATG"
out expr);
Expect(9);
} else if (la.kind == 62) {
@@ -3804,153 +3811,153 @@
}
void CatchClauses(
-#line 1648 "cs.ATG"
+#line 1649 "cs.ATG"
out ArrayList catchClauses) {
-#line 1650 "cs.ATG"
+#line 1651 "cs.ATG"
catchClauses = new ArrayList();
Expect(55);
-#line 1653 "cs.ATG"
+#line 1654 "cs.ATG"
string name;
string identifier;
Statement stmt;
if (la.kind == 14) {
Block(
-#line 1659 "cs.ATG"
+#line 1660 "cs.ATG"
out stmt);
-#line 1659 "cs.ATG"
+#line 1660 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
} else if (la.kind == 18) {
lexer.NextToken();
ClassType(
-#line 1661 "cs.ATG"
+#line 1662 "cs.ATG"
out name);
-#line 1661 "cs.ATG"
+#line 1662 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1661 "cs.ATG"
+#line 1662 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1661 "cs.ATG"
+#line 1662 "cs.ATG"
out stmt);
-#line 1661 "cs.ATG"
+#line 1662 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
while (
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
IsTypedCatch()) {
Expect(55);
Expect(18);
ClassType(
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
out name);
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
identifier = null;
if (la.kind == 1) {
lexer.NextToken();
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
identifier = t.val;
}
Expect(19);
Block(
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
out stmt);
-#line 1662 "cs.ATG"
+#line 1663 "cs.ATG"
catchClauses.Add(new CatchClause(name, identifier, stmt));
}
if (la.kind == 55) {
lexer.NextToken();
Block(
-#line 1664 "cs.ATG"
+#line 1665 "cs.ATG"
out stmt);
-#line 1664 "cs.ATG"
+#line 1665 "cs.ATG"
catchClauses.Add(new CatchClause(stmt));
}
} else SynErr(176);
}
void UnaryExpr(
-#line 1727 "cs.ATG"
+#line 1728 "cs.ATG"
out Expression uExpr) {
-#line 1729 "cs.ATG"
+#line 1730 "cs.ATG"
TypeReference type = null;
Expression expr;
ArrayList expressions = new ArrayList();
uExpr = null;
while (StartOf(24) ||
-#line 1751 "cs.ATG"
+#line 1752 "cs.ATG"
IsTypeCast()) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1736 "cs.ATG"
+#line 1737 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus));
} else if (la.kind == 5) {
lexer.NextToken();
-#line 1737 "cs.ATG"
+#line 1738 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus));
} else if (la.kind == 22) {
lexer.NextToken();
-#line 1738 "cs.ATG"
+#line 1739 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not));
} else if (la.kind == 25) {
lexer.NextToken();
-#line 1739 "cs.ATG"
+#line 1740 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot));
} else if (la.kind == 6) {
lexer.NextToken();
-#line 1740 "cs.ATG"
+#line 1741 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star));
} else if (la.kind == 29) {
lexer.NextToken();
-#line 1741 "cs.ATG"
+#line 1742 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment));
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1742 "cs.ATG"
+#line 1743 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement));
} else if (la.kind == 26) {
lexer.NextToken();
-#line 1743 "cs.ATG"
+#line 1744 "cs.ATG"
expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd));
} else {
Expect(18);
Type(
-#line 1751 "cs.ATG"
+#line 1752 "cs.ATG"
out type);
Expect(19);
-#line 1751 "cs.ATG"
+#line 1752 "cs.ATG"
expressions.Add(new CastExpression(type));
}
}
PrimaryExpr(
-#line 1754 "cs.ATG"
+#line 1755 "cs.ATG"
out expr);
-#line 1754 "cs.ATG"
+#line 1755 "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) {
@@ -3968,33 +3975,33 @@
}
void ConditionalOrExpr(
-#line 1856 "cs.ATG"
+#line 1857 "cs.ATG"
ref Expression outExpr) {
-#line 1857 "cs.ATG"
+#line 1858 "cs.ATG"
Expression expr;
ConditionalAndExpr(
-#line 1859 "cs.ATG"
+#line 1860 "cs.ATG"
ref outExpr);
while (la.kind == 24) {
lexer.NextToken();
UnaryExpr(
-#line 1859 "cs.ATG"
+#line 1860 "cs.ATG"
out expr);
ConditionalAndExpr(
-#line 1859 "cs.ATG"
+#line 1860 "cs.ATG"
ref expr);
-#line 1859 "cs.ATG"
+#line 1860 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);
}
}
void PrimaryExpr(
-#line 1771 "cs.ATG"
+#line 1772 "cs.ATG"
out Expression pexpr) {
-#line 1773 "cs.ATG"
+#line 1774 "cs.ATG"
TypeReference type = null;
bool isArrayCreation = false;
Expression expr;
@@ -4004,46 +4011,46 @@
case 112: {
lexer.NextToken();
-#line 1780 "cs.ATG"
+#line 1781 "cs.ATG"
pexpr = new PrimitiveExpression(true, "true");
break;
}
case 71: {
lexer.NextToken();
-#line 1781 "cs.ATG"
+#line 1782 "cs.ATG"
pexpr = new PrimitiveExpression(false, "false");
break;
}
case 89: {
lexer.NextToken();
-#line 1782 "cs.ATG"
+#line 1783 "cs.ATG"
pexpr = new PrimitiveExpression(null, "null");
break;
}
case 2: {
lexer.NextToken();
-#line 1783 "cs.ATG"
+#line 1784 "cs.ATG"
pexpr = new PrimitiveExpression(t.literalValue, t.val);
break;
}
case 1: {
lexer.NextToken();
-#line 1785 "cs.ATG"
+#line 1786 "cs.ATG"
pexpr = new IdentifierExpression(t.val);
break;
}
case 18: {
lexer.NextToken();
Expr(
-#line 1787 "cs.ATG"
+#line 1788 "cs.ATG"
out expr);
Expect(19);
-#line 1787 "cs.ATG"
+#line 1788 "cs.ATG"
pexpr = new ParenthesizedExpression(expr);
break;
}
@@ -4111,185 +4118,185 @@
}
}
-#line 1793 "cs.ATG"
+#line 1794 "cs.ATG"
string val = t.val; t.val = "";
Expect(13);
Expect(1);
-#line 1793 "cs.ATG"
+#line 1794 "cs.ATG"
pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val);
break;
}
case 110: {
lexer.NextToken();
-#line 1795 "cs.ATG"
+#line 1796 "cs.ATG"
pexpr = new ThisReferenceExpression();
break;
}
case 50: {
lexer.NextToken();
-#line 1797 "cs.ATG"
+#line 1798 "cs.ATG"
Expression retExpr = new BaseReferenceExpression();
if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1799 "cs.ATG"
+#line 1800 "cs.ATG"
retExpr = new FieldReferenceExpression(retExpr, t.val);
} else if (la.kind == 16) {
lexer.NextToken();
Expr(
-#line 1800 "cs.ATG"
+#line 1801 "cs.ATG"
out expr);
-#line 1800 "cs.ATG"
+#line 1801 "cs.ATG"
ArrayList indices = new ArrayList(); indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1801 "cs.ATG"
+#line 1802 "cs.ATG"
out expr);
-#line 1801 "cs.ATG"
+#line 1802 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1802 "cs.ATG"
+#line 1803 "cs.ATG"
retExpr = new IndexerExpression(retExpr, indices);
} else SynErr(177);
-#line 1803 "cs.ATG"
+#line 1804 "cs.ATG"
pexpr = retExpr;
break;
}
case 88: {
lexer.NextToken();
NonArrayType(
-#line 1804 "cs.ATG"
+#line 1805 "cs.ATG"
out type);
-#line 1804 "cs.ATG"
+#line 1805 "cs.ATG"
ArrayList parameters = new ArrayList();
if (la.kind == 18) {
lexer.NextToken();
-#line 1809 "cs.ATG"
+#line 1810 "cs.ATG"
ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters);
if (StartOf(21)) {
Argument(
-#line 1809 "cs.ATG"
+#line 1810 "cs.ATG"
out expr);
-#line 1809 "cs.ATG"
+#line 1810 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1810 "cs.ATG"
+#line 1811 "cs.ATG"
out expr);
-#line 1810 "cs.ATG"
+#line 1811 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1810 "cs.ATG"
+#line 1811 "cs.ATG"
pexpr = oce;
} else if (la.kind == 16) {
-#line 1812 "cs.ATG"
+#line 1813 "cs.ATG"
isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace;
lexer.NextToken();
-#line 1813 "cs.ATG"
+#line 1814 "cs.ATG"
int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList();
if (StartOf(4)) {
Expr(
-#line 1815 "cs.ATG"
+#line 1816 "cs.ATG"
out expr);
-#line 1815 "cs.ATG"
+#line 1816 "cs.ATG"
parameterExpression.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1815 "cs.ATG"
+#line 1816 "cs.ATG"
out expr);
-#line 1815 "cs.ATG"
+#line 1816 "cs.ATG"
parameterExpression.Add(expr);
}
Expect(17);
-#line 1815 "cs.ATG"
+#line 1816 "cs.ATG"
parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters;
while (
-#line 1816 "cs.ATG"
+#line 1817 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1816 "cs.ATG"
+#line 1817 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1816 "cs.ATG"
+#line 1817 "cs.ATG"
dims++;
}
-#line 1816 "cs.ATG"
+#line 1817 "cs.ATG"
rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
-#line 1817 "cs.ATG"
+#line 1818 "cs.ATG"
if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); }
if (la.kind == 14) {
ArrayInitializer(
-#line 1818 "cs.ATG"
+#line 1819 "cs.ATG"
out expr);
-#line 1818 "cs.ATG"
+#line 1819 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr;
}
} else if (la.kind == 12 || la.kind == 17) {
while (la.kind == 12) {
lexer.NextToken();
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
dims++;
}
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
while (
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
IsDims()) {
Expect(16);
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
dims =0;
while (la.kind == 12) {
lexer.NextToken();
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
dims++;
}
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
parameters.Add(new ArrayCreationParameter(dims));
Expect(17);
}
ArrayInitializer(
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
out expr);
-#line 1820 "cs.ATG"
+#line 1821 "cs.ATG"
ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters;
} else SynErr(178);
} else SynErr(179);
@@ -4299,20 +4306,20 @@
lexer.NextToken();
Expect(18);
if (
-#line 1826 "cs.ATG"
+#line 1827 "cs.ATG"
NotVoidPointer()) {
Expect(122);
-#line 1826 "cs.ATG"
+#line 1827 "cs.ATG"
type = new TypeReference("void");
} else if (StartOf(8)) {
Type(
-#line 1827 "cs.ATG"
+#line 1828 "cs.ATG"
out type);
} else SynErr(180);
Expect(19);
-#line 1828 "cs.ATG"
+#line 1829 "cs.ATG"
pexpr = new TypeOfExpression(type);
break;
}
@@ -4320,11 +4327,11 @@
lexer.NextToken();
Expect(18);
Type(
-#line 1829 "cs.ATG"
+#line 1830 "cs.ATG"
out type);
Expect(19);
-#line 1829 "cs.ATG"
+#line 1830 "cs.ATG"
pexpr = new SizeOfExpression(type);
break;
}
@@ -4332,11 +4339,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1830 "cs.ATG"
+#line 1831 "cs.ATG"
out expr);
Expect(19);
-#line 1830 "cs.ATG"
+#line 1831 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4344,11 +4351,11 @@
lexer.NextToken();
Expect(18);
Expr(
-#line 1831 "cs.ATG"
+#line 1832 "cs.ATG"
out expr);
Expect(19);
-#line 1831 "cs.ATG"
+#line 1832 "cs.ATG"
pexpr = new CheckedExpression(expr);
break;
}
@@ -4359,350 +4366,350 @@
if (la.kind == 29) {
lexer.NextToken();
-#line 1835 "cs.ATG"
+#line 1836 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement);
} else if (la.kind == 30) {
lexer.NextToken();
-#line 1836 "cs.ATG"
+#line 1837 "cs.ATG"
pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement);
} else SynErr(182);
} else if (la.kind == 47) {
lexer.NextToken();
Expect(1);
-#line 1839 "cs.ATG"
+#line 1840 "cs.ATG"
pexpr = new PointerReferenceExpression(pexpr, t.val);
} else if (la.kind == 13) {
lexer.NextToken();
Expect(1);
-#line 1840 "cs.ATG"
+#line 1841 "cs.ATG"
pexpr = new FieldReferenceExpression(pexpr, t.val);
} else if (la.kind == 18) {
lexer.NextToken();
-#line 1842 "cs.ATG"
+#line 1843 "cs.ATG"
ArrayList parameters = new ArrayList();
if (StartOf(21)) {
Argument(
-#line 1843 "cs.ATG"
+#line 1844 "cs.ATG"
out expr);
-#line 1843 "cs.ATG"
+#line 1844 "cs.ATG"
parameters.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Argument(
-#line 1844 "cs.ATG"
+#line 1845 "cs.ATG"
out expr);
-#line 1844 "cs.ATG"
+#line 1845 "cs.ATG"
parameters.Add(expr);
}
}
Expect(19);
-#line 1845 "cs.ATG"
+#line 1846 "cs.ATG"
pexpr = new InvocationExpression(pexpr, parameters);
} else {
-#line 1847 "cs.ATG"
+#line 1848 "cs.ATG"
if (isArrayCreation) Error("element access not allow on array creation");
ArrayList indices = new ArrayList();
lexer.NextToken();
Expr(
-#line 1850 "cs.ATG"
+#line 1851 "cs.ATG"
out expr);
-#line 1850 "cs.ATG"
+#line 1851 "cs.ATG"
indices.Add(expr);
while (la.kind == 12) {
lexer.NextToken();
Expr(
-#line 1851 "cs.ATG"
+#line 1852 "cs.ATG"
out expr);
-#line 1851 "cs.ATG"
+#line 1852 "cs.ATG"
indices.Add(expr);
}
Expect(17);
-#line 1852 "cs.ATG"
+#line 1853 "cs.ATG"
pexpr = new IndexerExpression(pexpr, indices);
}
}
}
void ConditionalAndExpr(
-#line 1862 "cs.ATG"
+#line 1863 "cs.ATG"
ref Expression outExpr) {
-#line 1863 "cs.ATG"
+#line 1864 "cs.ATG"
Expression expr;
InclusiveOrExpr(
-#line 1865 "cs.ATG"
+#line 1866 "cs.ATG"
ref outExpr);
while (la.kind == 23) {
lexer.NextToken();
UnaryExpr(
-#line 1865 "cs.ATG"
+#line 1866 "cs.ATG"
out expr);
InclusiveOrExpr(
-#line 1865 "cs.ATG"
+#line 1866 "cs.ATG"
ref expr);
-#line 1865 "cs.ATG"
+#line 1866 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr);
}
}
void InclusiveOrExpr(
-#line 1868 "cs.ATG"
+#line 1869 "cs.ATG"
ref Expression outExpr) {
-#line 1869 "cs.ATG"
+#line 1870 "cs.ATG"
Expression expr;
ExclusiveOrExpr(
-#line 1871 "cs.ATG"
+#line 1872 "cs.ATG"
ref outExpr);
while (la.kind == 27) {
lexer.NextToken();
UnaryExpr(
-#line 1871 "cs.ATG"
+#line 1872 "cs.ATG"
out expr);
ExclusiveOrExpr(
-#line 1871 "cs.ATG"
+#line 1872 "cs.ATG"
ref expr);
-#line 1871 "cs.ATG"
+#line 1872 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr);
}
}
void ExclusiveOrExpr(
-#line 1874 "cs.ATG"
+#line 1875 "cs.ATG"
ref Expression outExpr) {
-#line 1875 "cs.ATG"
+#line 1876 "cs.ATG"
Expression expr;
AndExpr(
-#line 1877 "cs.ATG"
+#line 1878 "cs.ATG"
ref outExpr);
while (la.kind == 28) {
lexer.NextToken();
UnaryExpr(
-#line 1877 "cs.ATG"
+#line 1878 "cs.ATG"
out expr);
AndExpr(
-#line 1877 "cs.ATG"
+#line 1878 "cs.ATG"
ref expr);
-#line 1877 "cs.ATG"
+#line 1878 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr);
}
}
void AndExpr(
-#line 1880 "cs.ATG"
+#line 1881 "cs.ATG"
ref Expression outExpr) {
-#line 1881 "cs.ATG"
+#line 1882 "cs.ATG"
Expression expr;
EqualityExpr(
-#line 1883 "cs.ATG"
+#line 1884 "cs.ATG"
ref outExpr);
while (la.kind == 26) {
lexer.NextToken();
UnaryExpr(
-#line 1883 "cs.ATG"
+#line 1884 "cs.ATG"
out expr);
EqualityExpr(
-#line 1883 "cs.ATG"
+#line 1884 "cs.ATG"
ref expr);
-#line 1883 "cs.ATG"
+#line 1884 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr);
}
}
void EqualityExpr(
-#line 1886 "cs.ATG"
+#line 1887 "cs.ATG"
ref Expression outExpr) {
-#line 1888 "cs.ATG"
+#line 1889 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
RelationalExpr(
-#line 1892 "cs.ATG"
+#line 1893 "cs.ATG"
ref outExpr);
while (la.kind == 31 || la.kind == 32) {
if (la.kind == 32) {
lexer.NextToken();
-#line 1895 "cs.ATG"
+#line 1896 "cs.ATG"
op = BinaryOperatorType.InEquality;
} else {
lexer.NextToken();
-#line 1896 "cs.ATG"
+#line 1897 "cs.ATG"
op = BinaryOperatorType.Equality;
}
UnaryExpr(
-#line 1898 "cs.ATG"
+#line 1899 "cs.ATG"
out expr);
RelationalExpr(
-#line 1898 "cs.ATG"
+#line 1899 "cs.ATG"
ref expr);
-#line 1898 "cs.ATG"
+#line 1899 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void RelationalExpr(
-#line 1902 "cs.ATG"
+#line 1903 "cs.ATG"
ref Expression outExpr) {
-#line 1904 "cs.ATG"
+#line 1905 "cs.ATG"
TypeReference type;
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
ShiftExpr(
-#line 1909 "cs.ATG"
+#line 1910 "cs.ATG"
ref outExpr);
while (StartOf(26)) {
if (StartOf(27)) {
if (la.kind == 21) {
lexer.NextToken();
-#line 1912 "cs.ATG"
+#line 1913 "cs.ATG"
op = BinaryOperatorType.LessThan;
} else if (la.kind == 20) {
lexer.NextToken();
-#line 1913 "cs.ATG"
+#line 1914 "cs.ATG"
op = BinaryOperatorType.GreaterThan;
} else if (la.kind == 34) {
lexer.NextToken();
-#line 1914 "cs.ATG"
+#line 1915 "cs.ATG"
op = BinaryOperatorType.LessThanOrEqual;
} else if (la.kind == 33) {
lexer.NextToken();
-#line 1915 "cs.ATG"
+#line 1916 "cs.ATG"
op = BinaryOperatorType.GreaterThanOrEqual;
} else SynErr(183);
UnaryExpr(
-#line 1917 "cs.ATG"
+#line 1918 "cs.ATG"
out expr);
ShiftExpr(
-#line 1917 "cs.ATG"
+#line 1918 "cs.ATG"
ref expr);
-#line 1917 "cs.ATG"
+#line 1918 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
} else {
if (la.kind == 84) {
lexer.NextToken();
-#line 1920 "cs.ATG"
+#line 1921 "cs.ATG"
op = BinaryOperatorType.IS;
} else if (la.kind == 49) {
lexer.NextToken();
-#line 1921 "cs.ATG"
+#line 1922 "cs.ATG"
op = BinaryOperatorType.AS;
} else SynErr(184);
Type(
-#line 1923 "cs.ATG"
+#line 1924 "cs.ATG"
out type);
-#line 1923 "cs.ATG"
+#line 1924 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type));
}
}
}
void ShiftExpr(
-#line 1927 "cs.ATG"
+#line 1928 "cs.ATG"
ref Expression outExpr) {
-#line 1929 "cs.ATG"
+#line 1930 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
AdditiveExpr(
-#line 1933 "cs.ATG"
+#line 1934 "cs.ATG"
ref outExpr);
while (la.kind == 35 || la.kind == 36) {
if (la.kind == 35) {
lexer.NextToken();
-#line 1936 "cs.ATG"
+#line 1937 "cs.ATG"
op = BinaryOperatorType.ShiftLeft;
} else {
lexer.NextToken();
-#line 1937 "cs.ATG"
+#line 1938 "cs.ATG"
op = BinaryOperatorType.ShiftRight;
}
UnaryExpr(
-#line 1939 "cs.ATG"
+#line 1940 "cs.ATG"
out expr);
AdditiveExpr(
-#line 1939 "cs.ATG"
+#line 1940 "cs.ATG"
ref expr);
-#line 1939 "cs.ATG"
+#line 1940 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void AdditiveExpr(
-#line 1943 "cs.ATG"
+#line 1944 "cs.ATG"
ref Expression outExpr) {
-#line 1945 "cs.ATG"
+#line 1946 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
MultiplicativeExpr(
-#line 1949 "cs.ATG"
+#line 1950 "cs.ATG"
ref outExpr);
while (la.kind == 4 || la.kind == 5) {
if (la.kind == 4) {
lexer.NextToken();
-#line 1952 "cs.ATG"
+#line 1953 "cs.ATG"
op = BinaryOperatorType.Add;
} else {
lexer.NextToken();
-#line 1953 "cs.ATG"
+#line 1954 "cs.ATG"
op = BinaryOperatorType.Subtract;
}
UnaryExpr(
-#line 1955 "cs.ATG"
+#line 1956 "cs.ATG"
out expr);
MultiplicativeExpr(
-#line 1955 "cs.ATG"
+#line 1956 "cs.ATG"
ref expr);
-#line 1955 "cs.ATG"
+#line 1956 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
void MultiplicativeExpr(
-#line 1959 "cs.ATG"
+#line 1960 "cs.ATG"
ref Expression outExpr) {
-#line 1961 "cs.ATG"
+#line 1962 "cs.ATG"
Expression expr;
BinaryOperatorType op = BinaryOperatorType.None;
@@ -4710,24 +4717,24 @@
if (la.kind == 6) {
lexer.NextToken();
-#line 1967 "cs.ATG"
+#line 1968 "cs.ATG"
op = BinaryOperatorType.Multiply;
} else if (la.kind == 7) {
lexer.NextToken();
-#line 1968 "cs.ATG"
+#line 1969 "cs.ATG"
op = BinaryOperatorType.Divide;
} else {
lexer.NextToken();
-#line 1969 "cs.ATG"
+#line 1970 "cs.ATG"
op = BinaryOperatorType.Modulus;
}
UnaryExpr(
-#line 1971 "cs.ATG"
+#line 1972 "cs.ATG"
out expr);
-#line 1971 "cs.ATG"
+#line 1972 "cs.ATG"
outExpr = new BinaryOperatorExpression(outExpr, op, expr);
}
}
@@ -4942,9 +4949,9 @@
static bool[,] set = {
{T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,T, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,T, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x},
{x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,T,x, x,T,T,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,T,x,x, T,T,x,x, x,T,x,x, x,T,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,T,x,T, T,x,x,T, x,x,T,x, T,x,T,T, T,T,x,T, x,x,x,x, x,x,x},
{x,x,x,x, T,T,T,T, T,T,T,T, T,x,x,T, x,T,x,T, T,T,x,T, T,x,T,T, T,x,x,T, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
{x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
Modified: trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG
===================================================================
--- trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG 2005-02-04 16:55:59 UTC (rev 2232)
+++ trunk/MonoDevelop/Core/src/ICSharpCode.SharpRefactory/src/Parser/generated/cs.ATG 2005-02-04 17:08:08 UTC (rev 2233)
@@ -927,6 +927,7 @@
| "unsafe" (. m.Add(Modifier.Unsafe); .)
| "abstract" (. m.Add(Modifier.Abstract); .)
| "sealed" (. m.Add(Modifier.Sealed); .)
+ | "static" (. m.Add(Modifier.Static); .)
.
ClassType<out string name> (. string qualident; name = "";.)
More information about the Monodevelop-patches-list
mailing list