📄 parser.cs
字号:
out constraint);
#line 636 "VBNET.ATG"
if (constraint != null) { template.Bases.Add(constraint); }
while (la.kind == 12) {
lexer.NextToken();
TypeName(
#line 639 "VBNET.ATG"
out constraint);
#line 639 "VBNET.ATG"
if (constraint != null) { template.Bases.Add(constraint); }
}
Expect(23);
} else if (StartOf(5)) {
TypeName(
#line 642 "VBNET.ATG"
out constraint);
#line 642 "VBNET.ATG"
if (constraint != null) { template.Bases.Add(constraint); }
} else SynErr(217);
}
void ClassBaseType(
#line 943 "VBNET.ATG"
out TypeReference typeRef) {
#line 945 "VBNET.ATG"
typeRef = null;
Expect(110);
TypeName(
#line 948 "VBNET.ATG"
out typeRef);
EndOfStmt();
}
void TypeImplementsClause(
#line 1683 "VBNET.ATG"
out List<TypeReference> baseInterfaces) {
#line 1685 "VBNET.ATG"
baseInterfaces = new List<TypeReference>();
TypeReference type = null;
Expect(107);
TypeName(
#line 1688 "VBNET.ATG"
out type);
#line 1690 "VBNET.ATG"
baseInterfaces.Add(type);
while (la.kind == 12) {
lexer.NextToken();
TypeName(
#line 1693 "VBNET.ATG"
out type);
#line 1694 "VBNET.ATG"
baseInterfaces.Add(type);
}
EndOfStmt();
}
void ClassBody(
#line 776 "VBNET.ATG"
TypeDeclaration newType) {
#line 777 "VBNET.ATG"
AttributeSection section;
while (StartOf(6)) {
#line 779 "VBNET.ATG"
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 27) {
AttributeSection(
#line 782 "VBNET.ATG"
out section);
#line 782 "VBNET.ATG"
attributes.Add(section);
}
while (StartOf(7)) {
MemberModifier(
#line 783 "VBNET.ATG"
m);
}
ClassMemberDecl(
#line 784 "VBNET.ATG"
m, attributes);
}
Expect(88);
Expect(67);
#line 786 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void ModuleBody(
#line 805 "VBNET.ATG"
TypeDeclaration newType) {
#line 806 "VBNET.ATG"
AttributeSection section;
while (StartOf(6)) {
#line 808 "VBNET.ATG"
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 27) {
AttributeSection(
#line 811 "VBNET.ATG"
out section);
#line 811 "VBNET.ATG"
attributes.Add(section);
}
while (StartOf(7)) {
MemberModifier(
#line 812 "VBNET.ATG"
m);
}
ClassMemberDecl(
#line 813 "VBNET.ATG"
m, attributes);
}
Expect(88);
Expect(121);
#line 815 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void StructureBody(
#line 790 "VBNET.ATG"
TypeDeclaration newType) {
#line 791 "VBNET.ATG"
AttributeSection section;
while (StartOf(6)) {
#line 793 "VBNET.ATG"
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 27) {
AttributeSection(
#line 796 "VBNET.ATG"
out section);
#line 796 "VBNET.ATG"
attributes.Add(section);
}
while (StartOf(7)) {
MemberModifier(
#line 797 "VBNET.ATG"
m);
}
StructureMemberDecl(
#line 798 "VBNET.ATG"
m, attributes);
}
Expect(88);
Expect(166);
#line 800 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void NonArrayTypeName(
#line 2100 "VBNET.ATG"
out TypeReference typeref, bool canBeUnbound) {
#line 2102 "VBNET.ATG"
string name;
typeref = null;
bool isGlobal = false;
if (StartOf(8)) {
if (la.kind == 198) {
lexer.NextToken();
Expect(10);
#line 2107 "VBNET.ATG"
isGlobal = true;
}
QualIdentAndTypeArguments(
#line 2108 "VBNET.ATG"
out typeref, canBeUnbound);
#line 2109 "VBNET.ATG"
typeref.IsGlobal = isGlobal;
while (la.kind == 10) {
lexer.NextToken();
#line 2110 "VBNET.ATG"
TypeReference nestedTypeRef;
QualIdentAndTypeArguments(
#line 2111 "VBNET.ATG"
out nestedTypeRef, canBeUnbound);
#line 2112 "VBNET.ATG"
typeref = new InnerClassTypeReference(typeref, nestedTypeRef.Type, nestedTypeRef.GenericTypes);
}
} else if (la.kind == 133) {
lexer.NextToken();
#line 2115 "VBNET.ATG"
typeref = new TypeReference("System.Object");
} else if (StartOf(9)) {
PrimitiveTypeName(
#line 2116 "VBNET.ATG"
out name);
#line 2116 "VBNET.ATG"
typeref = new TypeReference(name);
} else SynErr(218);
}
void EnumBody(
#line 819 "VBNET.ATG"
TypeDeclaration newType) {
#line 820 "VBNET.ATG"
FieldDeclaration f;
while (StartOf(10)) {
EnumMemberDecl(
#line 822 "VBNET.ATG"
out f);
#line 822 "VBNET.ATG"
compilationUnit.AddChild(f);
}
Expect(88);
Expect(90);
#line 824 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void InterfaceBase(
#line 1668 "VBNET.ATG"
out List<TypeReference> bases) {
#line 1670 "VBNET.ATG"
TypeReference type;
bases = new List<TypeReference>();
Expect(110);
TypeName(
#line 1674 "VBNET.ATG"
out type);
#line 1674 "VBNET.ATG"
bases.Add(type);
while (la.kind == 12) {
lexer.NextToken();
TypeName(
#line 1677 "VBNET.ATG"
out type);
#line 1677 "VBNET.ATG"
bases.Add(type);
}
Expect(1);
}
void InterfaceBody(
#line 828 "VBNET.ATG"
TypeDeclaration newType) {
while (StartOf(11)) {
InterfaceMemberDecl();
}
Expect(88);
Expect(112);
#line 830 "VBNET.ATG"
newType.EndLocation = t.EndLocation;
Expect(1);
}
void FormalParameterList(
#line 2287 "VBNET.ATG"
List<ParameterDeclarationExpression> parameter) {
#line 2289 "VBNET.ATG"
ParameterDeclarationExpression p;
AttributeSection section;
List<AttributeSection> attributes = new List<AttributeSection>();
while (la.kind == 27) {
AttributeSection(
#line 2293 "VBNET.ATG"
out section);
#line 2293 "VBNET.ATG"
attributes.Add(section);
}
FormalParameter(
#line 2295 "VBNET.ATG"
out p);
#line 2297 "VBNET.ATG"
bool paramsFound = false;
p.Attributes = attributes;
parameter.Add(p);
while (la.kind == 12) {
lexer.NextToken();
#line 2302 "VBNET.ATG"
if (paramsFound) Error("params array must be at end of parameter list");
while (la.kind == 27) {
AttributeSection(
#line 2303 "VBNET.ATG"
out section);
#line 2303 "VBNET.ATG"
attributes.Add(section);
}
FormalParameter(
#line 2305 "VBNET.ATG"
out p);
#line 2305 "VBNET.ATG"
p.Attributes = attributes; parameter.Add(p);
}
}
void MemberModifier(
#line 2985 "VBNET.ATG"
Modifiers m) {
switch (la.kind) {
case 122: {
lexer.NextToken();
#line 2986 "VBNET.ATG"
m.Add(Modifier.Abstract, t.Location);
break;
}
case 79: {
lexer.NextToken();
#line 2987 "VBNET.ATG"
m.Add(Modifier.Default, t.Location);
break;
}
case 99: {
lexer.NextToken();
#line 2988 "VBNET.ATG"
m.Add(Modifier.Internal, t.Location);
break;
}
case 157: {
lexer.NextToken();
#line 2989 "VBNET.ATG"
m.Add(Modifier.New, t.Location);
break;
}
case 142: {
lexer.NextToken();
#line 2990 "VBNET.ATG"
m.Add(Modifier.Override, t.Location);
break;
}
case 123: {
lexer.NextToken();
#line 2991 "VBNET.ATG"
m.Add(Modifier.Abstract, t.Location);
break;
}
case 145: {
lexer.NextToken();
#line 2992 "VBNET.ATG"
m.Add(Modifier.Private, t.Location);
break;
}
case 147: {
lexer.NextToken();
#line 2993 "VBNET.ATG"
m.Add(Modifier.Protected, t.Location);
break;
}
case 148: {
lexer.NextToken();
#line 2994 "VBNET.ATG"
m.Add(Modifier.Public, t.Location);
break;
}
case 131: {
lexer.NextToken();
#line 2995 "VBNET.ATG"
m.Add(Modifier.Sealed, t.Location);
break;
}
case 132: {
lexer.NextToken();
#line 2996 "VBNET.ATG"
m.Add(Modifier.Sealed, t.Location);
break;
}
case 158: {
lexer.NextToken();
#line 2997 "VBNET.ATG"
m.Add(Modifier.Static, t.Location);
break;
}
case 141: {
lexer.NextToken();
#line 2998 "VBNET.ATG"
m.Add(Modifier.Virtual, t.Location);
break;
}
case 140: {
lexer.NextToken();
#line 2999 "VBNET.ATG"
m.Add(Modifier.Overloads, t.Location);
break;
}
case 150: {
lexer.NextToken();
#line 3000 "VBNET.ATG"
m.Add(Modifier.ReadOnly, t.Location);
break;
}
case 184: {
lexer.NextToken();
#line 3001 "VBNET.ATG"
m.Add(Modifier.WriteOnly, t.Location);
break;
}
case 183: {
lexer.NextToken();
#line 3002 "VBNET.ATG"
m.Add(Modifier.WithEvents, t.Location);
break;
}
case 81: {
lexer.NextToken();
#line 3003 "VBNET.ATG"
m.Add(Modifier.Dim, t.Location);
break;
}
default: SynErr(219); break;
}
}
void ClassMemberDecl(
#line 939 "VBNET.ATG"
Modifiers m, List<AttributeSection> attributes) {
StructureMemberDecl(
#line 940 "VBNET.ATG"
m, attributes);
}
void StructureMemberDecl(
#line 953 "VBNET.ATG"
Modifiers m, List<AttributeSection> attributes) {
#line 955 "VBNET.ATG"
TypeReference type = null;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null;
List<VariableDeclaration> variableDeclarators = new List<VariableDeclaration>();
List<TemplateDefinition> templates = new List<TemplateDefinition>();
switch (la.kind) {
case 67: case 80: case 90: case 112: case 121: case 166: {
NonModuleDeclaration(
#line 961 "VBNET.ATG"
m, attributes);
break;
}
case 167: {
lexer.NextToken();
#line 965 "VBNET.ATG"
Point startPos = t.Location;
if (StartOf(12)) {
#line 969 "VBNET.ATG"
string name = String.Empty;
MethodDeclaration methodDeclaration; List<string> handlesClause = null;
List<InterfaceImplementation> implementsClause = null;
Identifier();
#line 975 "VBNET.ATG"
name = t.val;
m.Check(Modifier.VBMethods);
TypeParameterList(
#line 978 "VBNET.ATG"
templates);
if (la.kind == 24) {
lexer.NextToken();
if (StartOf(4)) {
FormalParameterList(
#line 979 "VBNET.ATG"
p);
}
Expect(25);
}
if (la.kind == 105 || la.kind == 107) {
if (la.kind == 107) {
ImplementsClause(
#line 982 "VBNET.ATG"
out implementsClause);
} else {
HandlesClause(
#line 984 "VBNET.ATG"
out handlesClause);
}
}
#line 987 "VBNET.ATG"
Point endLocation = t.EndLocation;
Expect(1);
if (
#line 991 "VBNET.ATG"
IsMustOverride(m)) {
#line 993 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes);
methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos);
methodDeclaration.EndLocation = endLocation;
methodDeclaration.TypeReference = new TypeReference("", "System.Void");
methodDeclaration.Templates = templates;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.InterfaceImplementations = implementsClause;
compilationUnit.AddChild(methodDeclaration);
} else if (StartOf(13)) {
#line 1006 "VBNET.ATG"
methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes);
methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos);
methodDeclaration.EndLocation = endLocation;
methodDeclaration.TypeReference = new TypeReference("", "System.Void");
methodDeclaration.Templates = templates;
methodDeclaration.HandlesClause = handlesClause;
methodDeclaration.InterfaceImplementations = implementsClause;
compilationUnit.AddChild(methodDeclaration);
compilationUnit.BlockStart(methodDeclaration);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -