📄 parser.cs
字号:
#line 2717 "VBNET.ATG"
type = "Char";
break;
}
case 167: {
lexer.NextToken();
#line 2718 "VBNET.ATG"
type = "String";
break;
}
case 78: {
lexer.NextToken();
#line 2719 "VBNET.ATG"
type = "Decimal";
break;
}
case 55: {
lexer.NextToken();
#line 2720 "VBNET.ATG"
type = "Byte";
break;
}
case 161: {
lexer.NextToken();
#line 2721 "VBNET.ATG"
type = "Short";
break;
}
case 112: {
lexer.NextToken();
#line 2722 "VBNET.ATG"
type = "Integer";
break;
}
case 118: {
lexer.NextToken();
#line 2723 "VBNET.ATG"
type = "Long";
break;
}
case 162: {
lexer.NextToken();
#line 2724 "VBNET.ATG"
type = "Single";
break;
}
case 85: {
lexer.NextToken();
#line 2725 "VBNET.ATG"
type = "Double";
break;
}
default: SynErr(199); break;
}
}
void EnumBody(
#line 739 "VBNET.ATG"
TypeDeclaration newType) {
#line 740 "VBNET.ATG"
FieldDeclaration f;
while (StartOf(7)) {
EnumMemberDecl(
#line 742 "VBNET.ATG"
out f);
#line 742 "VBNET.ATG"
compilationUnit.AddChild(f);
}
Expect(89);
Expect(91);
#line 744 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void InterfaceBase(
#line 1393 "VBNET.ATG"
out ArrayList bases) {
#line 1395 "VBNET.ATG"
TypeReference type;
bases = new ArrayList();
Expect(111);
TypeName(
#line 1399 "VBNET.ATG"
out type);
#line 1399 "VBNET.ATG"
bases.Add(type);
while (la.kind == 12) {
lexer.NextToken();
TypeName(
#line 1402 "VBNET.ATG"
out type);
#line 1402 "VBNET.ATG"
bases.Add(type);
}
Expect(1);
}
void InterfaceBody(
#line 748 "VBNET.ATG"
TypeDeclaration newType) {
while (StartOf(8)) {
InterfaceMemberDecl();
}
Expect(89);
Expect(113);
#line 750 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void FormalParameterList(
#line 1966 "VBNET.ATG"
out ArrayList parameter) {
#line 1968 "VBNET.ATG"
parameter = new ArrayList();
ParameterDeclarationExpression p;
AttributeSection section;
ArrayList attributes = new ArrayList();
while (la.kind == 28) {
AttributeSection(
#line 1973 "VBNET.ATG"
out section);
#line 1973 "VBNET.ATG"
attributes.Add(section);
}
FormalParameter(
#line 1975 "VBNET.ATG"
out p);
#line 1977 "VBNET.ATG"
bool paramsFound = false;
p.Attributes = attributes;
parameter.Add(p);
while (la.kind == 12) {
lexer.NextToken();
#line 1982 "VBNET.ATG"
attributes = new ArrayList(); if (paramsFound) Error("params array must be at end of parameter list");
while (la.kind == 28) {
AttributeSection(
#line 1983 "VBNET.ATG"
out section);
#line 1983 "VBNET.ATG"
attributes.Add(section);
}
FormalParameter(
#line 1985 "VBNET.ATG"
out p);
#line 1985 "VBNET.ATG"
p.Attributes = attributes; parameter.Add(p);
}
}
void TypeName(
#line 1758 "VBNET.ATG"
out TypeReference typeref) {
#line 1760 "VBNET.ATG"
ArrayList rank = null;
NonArrayTypeName(
#line 1762 "VBNET.ATG"
out typeref);
ArrayTypeModifiers(
#line 1763 "VBNET.ATG"
out rank);
#line 1765 "VBNET.ATG"
typeref = new TypeReference(typeref == null ? "UNKNOWN" : typeref.Type, rank);
}
void MemberModifier(
#line 2746 "VBNET.ATG"
Modifiers m) {
switch (la.kind) {
case 123: {
lexer.NextToken();
#line 2747 "VBNET.ATG"
m.Add(Modifier.MustInherit);
break;
}
case 80: {
lexer.NextToken();
#line 2748 "VBNET.ATG"
m.Add(Modifier.Default);
break;
}
case 100: {
lexer.NextToken();
#line 2749 "VBNET.ATG"
m.Add(Modifier.Friend);
break;
}
case 159: {
lexer.NextToken();
#line 2750 "VBNET.ATG"
m.Add(Modifier.Shadows);
break;
}
case 144: {
lexer.NextToken();
#line 2751 "VBNET.ATG"
m.Add(Modifier.Overrides);
break;
}
case 124: {
lexer.NextToken();
#line 2752 "VBNET.ATG"
m.Add(Modifier.MustOverride);
break;
}
case 147: {
lexer.NextToken();
#line 2753 "VBNET.ATG"
m.Add(Modifier.Private);
break;
}
case 149: {
lexer.NextToken();
#line 2754 "VBNET.ATG"
m.Add(Modifier.Protected);
break;
}
case 150: {
lexer.NextToken();
#line 2755 "VBNET.ATG"
m.Add(Modifier.Public);
break;
}
case 132: {
lexer.NextToken();
#line 2756 "VBNET.ATG"
m.Add(Modifier.NotInheritable);
break;
}
case 133: {
lexer.NextToken();
#line 2757 "VBNET.ATG"
m.Add(Modifier.NotOverridable);
break;
}
case 160: {
lexer.NextToken();
#line 2758 "VBNET.ATG"
m.Add(Modifier.Shared);
break;
}
case 142: {
lexer.NextToken();
#line 2759 "VBNET.ATG"
m.Add(Modifier.Overridable);
break;
}
case 141: {
lexer.NextToken();
#line 2760 "VBNET.ATG"
m.Add(Modifier.Overloads);
break;
}
case 152: {
lexer.NextToken();
#line 2761 "VBNET.ATG"
m.Add(Modifier.ReadOnly);
break;
}
case 186: {
lexer.NextToken();
#line 2762 "VBNET.ATG"
m.Add(Modifier.WriteOnly);
break;
}
case 185: {
lexer.NextToken();
#line 2763 "VBNET.ATG"
m.Add(Modifier.WithEvents);
break;
}
case 82: {
lexer.NextToken();
#line 2764 "VBNET.ATG"
m.Add(Modifier.Dim);
break;
}
default: SynErr(200); break;
}
}
void ClassMemberDecl(
#line 869 "VBNET.ATG"
Modifiers m, ArrayList attributes) {
StructureMemberDecl(
#line 870 "VBNET.ATG"
m, attributes);
}
void StructureMemberDecl(
#line 884 "VBNET.ATG"
Modifiers m, ArrayList attributes) {
#line 886 "VBNET.ATG"
TypeReference type = null;
ArrayList p = null;
Statement stmt = null;
ArrayList variableDeclarators = new ArrayList();
switch (la.kind) {
case 68: case 81: case 91: case 113: case 122: case 168: {
NonModuleDeclaration(
#line 891 "VBNET.ATG"
m, attributes);
break;
}
case 169: {
lexer.NextToken();
#line 895 "VBNET.ATG"
Point startPos = t.Location;
ArrayList comments = lexer.SpecialTracker.RetreiveComments();
if (StartOf(9)) {
#line 900 "VBNET.ATG"
string name = String.Empty;
MethodDeclaration methodDeclaration;
HandlesClause handlesClause = null;
ImplementsClause implementsClause = null;
Identifier();
#line 907 "VBNET.ATG"
name = t.val;
m.Check(Modifier.Methods);
if (la.kind == 25) {
lexer.NextToken();
if (StartOf(4)) {
FormalParameterList(
#line 910 "VBNET.ATG"
out p);
}
Expect(26);
}
if (la.kind == 106 || la.kind == 108) {
if (la.kind == 108) {
ImplementsClause(
#line 913 "VBNET.ATG"
out implementsClause);
} else {
HandlesClause(
#line 915 "VBNET.ATG"
out handlesClause);
}
}
#line 918 "VBNET.ATG"
Point endLocation = t.EndLocation;
Expect(1);
if (
#line 922 "VBNET.ATG"
IsMustOverride(m)) {
#line 924 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes);
methodDeclaration.Specials["before"] = comments;
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = endLocation;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.ImplementsClause = implementsClause;
compilationUnit.AddChild(methodDeclaration);
} else if (StartOf(10)) {
#line 936 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes);
methodDeclaration.Specials["before"] = comments;
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = endLocation;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.ImplementsClause = implementsClause;
compilationUnit.AddChild(methodDeclaration);
compilationUnit.BlockStart(methodDeclaration);
Block(
#line 947 "VBNET.ATG"
out stmt);
#line 949 "VBNET.ATG"
compilationUnit.BlockEnd();
methodDeclaration.Body = (BlockStatement)stmt;
Expect(89);
Expect(169);
#line 952 "VBNET.ATG"
methodDeclaration.Body.EndLocation = t.EndLocation;
Expect(1);
} else SynErr(201);
} else if (la.kind == 128) {
lexer.NextToken();
if (la.kind == 25) {
lexer.NextToken();
if (StartOf(4)) {
FormalParameterList(
#line 955 "VBNET.ATG"
out p);
}
Expect(26);
}
#line 956 "VBNET.ATG"
m.Check(Modifier.Constructors);
#line 957 "VBNET.ATG"
Point constructorEndLocation = t.EndLocation;
Expect(1);
Block(
#line 959 "VBNET.ATG"
out stmt);
Expect(89);
Expect(169);
#line 960 "VBNET.ATG"
Point endLocation = t.EndLocation;
Expect(1);
#line 962 "VBNET.ATG"
ConstructorDeclaration cd = new ConstructorDeclaration("New", m.Modifier, p, attributes);
cd.StartLocation = startPos;
cd.Specials["before"] = comments;
cd.EndLocation = constructorEndLocation;
cd.Body = (BlockStatement)stmt;
cd.Body.EndLocation = endLocation;
compilationUnit.AddChild(cd);
} else SynErr(202);
break;
}
case 101: {
lexer.NextToken();
#line 975 "VBNET.ATG"
m.Check(Modifier.Methods);
string name = String.Empty;
Point startPos = t.Location;
MethodDeclaration methodDeclaration;
HandlesClause handlesClause = null;
ImplementsClause implementsClause = null;
AttributeSection attributeSection = null;
Identifier();
#line 983 "VBNET.ATG"
name = t.val;
if (la.kind == 25) {
lexer.NextToken();
if (StartOf(4)) {
FormalParameterList(
#line 984 "VBNET.ATG"
out p);
}
Expect(26);
}
if (la.kind == 49) {
lexer.NextToken();
if (la.kind == 28) {
AttributeSection(
#line 985 "VBNET.ATG"
out attributeSection);
}
TypeName(
#line 985 "VBNET.ATG"
out type);
}
#line 987 "VBNET.ATG"
if(type == null) {
type = new TypeReference("System.Object");
}
type.Attributes = attributeSection;
if (la.kind == 106 || la.kind == 108) {
if (la.kind == 108) {
ImplementsClause(
#line 994 "VBNET.ATG"
out implementsClause);
} else {
HandlesClause(
#line 996 "VBNET.ATG"
out handlesClause);
}
}
Expect(1);
if (
#line 1002 "VBNET.ATG"
IsMustOverride(m)) {
#line 1004 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes);
methodDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = t.EndLocation;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.ImplementsClause = implementsClause;
compilationUnit.AddChild(methodDeclaration);
} else if (StartOf(10)) {
#line 1014 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes);
methodDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = t.EndLocation;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.ImplementsClause = implementsClause;
compilationUnit.AddChild(methodDeclaration);
compilationUnit.BlockStart(methodDeclaration);
Block(
#line 1025 "VBNET.ATG"
out stmt);
#line 1027 "VBNET.ATG"
compilationUnit.BlockEnd();
methodDeclaration.Body = (BlockStatement)stmt;
Expect(89);
Expect(101);
#line 1032 "VBNET.ATG"
methodDeclaration.Body.StartLocation = methodDeclaration.EndLocation;
methodDeclaration.Body.EndLocation = t.EndLocation;
Expect(1);
} else SynErr(203);
break;
}
case 79: {
lexer.NextToken();
#line 1041 "VBNET.ATG"
m.Check(Modifier.ExternalMethods);
Point startPos = t.Location;
CharsetModifier charsetModifer = CharsetModifier.None;
string library = String.Empty;
string alias = null;
string name = String.Empty;
if (StartOf(11)) {
Charset(
#line 1048 "VBNET.ATG"
out charsetModifer);
}
if (la.kind == 169) {
lexer.NextToken();
Identifier();
#line 1051 "VBNET.ATG"
name = t.val;
Expect(116);
Expect(3);
#line 1052 "VBNET.ATG"
library = t.val;
if (la.kind == 45) {
lexer.NextToken();
Expect(3);
#line 1053 "VBNET.ATG"
alias = t.val;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -