Example #1
0
	void NonModuleDeclaration(
#line  554 "VBNET.ATG" 
Modifiers m, ArrayList attributes) {

#line  556 "VBNET.ATG" 
		string name = String.Empty;
		ArrayList names = null;
		
		switch (la.kind) {
		case 68: {

#line  559 "VBNET.ATG" 
			m.Check(Modifier.Classes); 
			lexer.NextToken();

#line  562 "VBNET.ATG" 
			TypeDeclaration newType = new TypeDeclaration();
			compilationUnit.AddChild(newType);
			compilationUnit.BlockStart(newType);
			newType.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			newType.Type = Types.Class;
			newType.Modifier = m.Modifier;
			newType.Attributes = attributes;
			
			Identifier();

#line  570 "VBNET.ATG" 
			newType.Name = t.val; newType.StartLocation = t.EndLocation; 
			EndOfStmt();
			if (la.kind == 111) {
				ClassBaseType(
#line  572 "VBNET.ATG" 
out name);

#line  572 "VBNET.ATG" 
				newType.BaseType = name; 
			}
			while (la.kind == 108) {
				TypeImplementsClause(
#line  573 "VBNET.ATG" 
out names);

#line  573 "VBNET.ATG" 
				newType.BaseInterfaces = names; 
			}
			ClassBody(
#line  574 "VBNET.ATG" 
newType);

#line  576 "VBNET.ATG" 
			compilationUnit.BlockEnd();
			
			break;
		}
		case 122: {
			lexer.NextToken();

#line  580 "VBNET.ATG" 
			m.Check(Modifier.Modules);
			TypeDeclaration newType = new TypeDeclaration();
			newType.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			compilationUnit.AddChild(newType);
			compilationUnit.BlockStart(newType);
			newType.StartLocation = t.Location;
			newType.Type = Types.Module;
			newType.Modifier = m.Modifier;
			newType.Attributes = attributes;
			
			Identifier();

#line  590 "VBNET.ATG" 
			newType.Name = t.val; newType.StartLocation = t.EndLocation;  
			Expect(1);
			ModuleBody(
#line  592 "VBNET.ATG" 
newType);

#line  594 "VBNET.ATG" 
			newType.EndLocation = t.Location;
			compilationUnit.BlockEnd();
			
			break;
		}
		case 168: {
			lexer.NextToken();

#line  599 "VBNET.ATG" 
			m.Check(Modifier.Structures);
			TypeDeclaration newType = new TypeDeclaration();
			compilationUnit.AddChild(newType);
			compilationUnit.BlockStart(newType);
			newType.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			newType.StartLocation = t.Location;
			newType.Type = Types.Structure;
			newType.Modifier = m.Modifier;
			newType.Attributes = attributes;
			ArrayList baseInterfaces = new ArrayList();
			
			Identifier();

#line  610 "VBNET.ATG" 
			newType.Name = t.val; newType.StartLocation = t.EndLocation; 
			Expect(1);
			while (la.kind == 108) {
				TypeImplementsClause(
#line  611 "VBNET.ATG" 
out baseInterfaces);
			}
			StructureBody(
#line  612 "VBNET.ATG" 
newType);

#line  614 "VBNET.ATG" 
			newType.EndLocation = t.Location;
			compilationUnit.BlockEnd();
			
			break;
		}
		case 91: {
			lexer.NextToken();

#line  620 "VBNET.ATG" 
			m.Check(Modifier.Enums);
			TypeDeclaration newType = new TypeDeclaration();
			newType.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			compilationUnit.AddChild(newType);
			compilationUnit.BlockStart(newType);
			
			newType.Type = Types.Enum;
			newType.Modifier = m.Modifier;
			newType.Attributes = attributes;
			
			Identifier();

#line  631 "VBNET.ATG" 
			newType.Name = t.val; newType.StartLocation = t.EndLocation; 
			if (la.kind == 49) {
				lexer.NextToken();
				PrimitiveTypeName(
#line  632 "VBNET.ATG" 
out name);

#line  632 "VBNET.ATG" 
				newType.BaseType = name; 
			}
			Expect(1);
			EnumBody(
#line  634 "VBNET.ATG" 
newType);

#line  636 "VBNET.ATG" 
			newType.EndLocation = t.Location;
			compilationUnit.BlockEnd();
			
			break;
		}
		case 113: {
			lexer.NextToken();

#line  642 "VBNET.ATG" 
			m.Check(Modifier.Interfaces);
			TypeDeclaration newType = new TypeDeclaration();
			compilationUnit.AddChild(newType);
			compilationUnit.BlockStart(newType);
			newType.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			
			newType.Type = Types.Interface;
			newType.Modifier = m.Modifier;
			newType.Attributes = attributes;
			ArrayList baseInterfaces = new ArrayList();
			
			Identifier();

#line  653 "VBNET.ATG" 
			newType.Name = t.val; newType.StartLocation = t.EndLocation; 
			EndOfStmt();
			while (la.kind == 111) {
				InterfaceBase(
#line  654 "VBNET.ATG" 
out baseInterfaces);

#line  654 "VBNET.ATG" 
				newType.BaseInterfaces = baseInterfaces; 
			}
			InterfaceBody(
#line  655 "VBNET.ATG" 
newType);

#line  657 "VBNET.ATG" 
			newType.EndLocation = t.Location;
			compilationUnit.BlockEnd();
			
			break;
		}
		case 81: {
			lexer.NextToken();

#line  663 "VBNET.ATG" 
			m.Check(Modifier.Delegates);
			DelegateDeclaration delegateDeclr = new DelegateDeclaration();
			ArrayList p = null;
			TypeReference type = null;
			delegateDeclr.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			delegateDeclr.StartLocation = t.Location;
			delegateDeclr.Modifier = m.Modifier;
			delegateDeclr.Attributes = attributes;
			
			if (la.kind == 169) {
				lexer.NextToken();
				Identifier();

#line  673 "VBNET.ATG" 
				delegateDeclr.Name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  674 "VBNET.ATG" 
out p);
					}
					Expect(26);

#line  674 "VBNET.ATG" 
					delegateDeclr.Parameters = p; 
				}
			} else if (la.kind == 101) {
				lexer.NextToken();
				Identifier();

#line  676 "VBNET.ATG" 
				delegateDeclr.Name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  677 "VBNET.ATG" 
out p);
					}
					Expect(26);

#line  677 "VBNET.ATG" 
					delegateDeclr.Parameters = p; 
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  678 "VBNET.ATG" 
out type);

#line  678 "VBNET.ATG" 
					delegateDeclr.ReturnType = type; 
				}
			} else SynErr(197);

#line  680 "VBNET.ATG" 
			delegateDeclr.EndLocation = t.EndLocation; 
			Expect(1);

#line  683 "VBNET.ATG" 
			compilationUnit.AddChild(delegateDeclr);
			
			break;
		}
		default: SynErr(198); break;
		}
	}
Example #2
0
	void LocalDeclarationStatement(
#line  2038 "VBNET.ATG" 
out Statement statement) {

#line  2040 "VBNET.ATG" 
		Modifiers m = new Modifiers(this);
		ArrayList vars = new ArrayList();
		LocalVariableDeclaration localVariableDeclaration;
		bool dimfound = false;
		
		while (la.kind == 72 || la.kind == 82 || la.kind == 163) {
			if (la.kind == 72) {
				lexer.NextToken();

#line  2047 "VBNET.ATG" 
				m.Add(Modifier.Constant); 
			} else if (la.kind == 163) {
				lexer.NextToken();

#line  2048 "VBNET.ATG" 
				m.Add(Modifier.Static); 
			} else {
				lexer.NextToken();

#line  2049 "VBNET.ATG" 
				dimfound = true; 
			}
		}

#line  2052 "VBNET.ATG" 
		if(dimfound && (m.Modifier & Modifier.Constant) != 0) {
		Error("Dim is not allowed on constants.");
		}
		
		if(m.isNone && dimfound == false) {
			Error("Const, Dim or Static expected");
		}
		
		localVariableDeclaration = new LocalVariableDeclaration(m.Modifier);
		localVariableDeclaration.StartLocation = t.Location;
		
		VariableDeclarator(
#line  2063 "VBNET.ATG" 
vars);
		while (la.kind == 12) {
			lexer.NextToken();
			VariableDeclarator(
#line  2064 "VBNET.ATG" 
vars);
		}

#line  2066 "VBNET.ATG" 
		localVariableDeclaration.Variables = vars;
		statement = localVariableDeclaration;
		
	}
Example #3
0
	void TypeModifier(
#line  2715 "VBNET.ATG" 
Modifiers m) {
		switch (la.kind) {
		case 150: {
			lexer.NextToken();

#line  2716 "VBNET.ATG" 
			m.Add(Modifier.Public); 
			break;
		}
		case 149: {
			lexer.NextToken();

#line  2717 "VBNET.ATG" 
			m.Add(Modifier.Protected); 
			break;
		}
		case 100: {
			lexer.NextToken();

#line  2718 "VBNET.ATG" 
			m.Add(Modifier.Friend); 
			break;
		}
		case 147: {
			lexer.NextToken();

#line  2719 "VBNET.ATG" 
			m.Add(Modifier.Private); 
			break;
		}
		case 160: {
			lexer.NextToken();

#line  2720 "VBNET.ATG" 
			m.Add(Modifier.Shared); 
			break;
		}
		case 159: {
			lexer.NextToken();

#line  2721 "VBNET.ATG" 
			m.Add(Modifier.Shadows); 
			break;
		}
		case 123: {
			lexer.NextToken();

#line  2722 "VBNET.ATG" 
			m.Add(Modifier.MustInherit); 
			break;
		}
		case 132: {
			lexer.NextToken();

#line  2723 "VBNET.ATG" 
			m.Add(Modifier.NotInheritable); 
			break;
		}
		default: SynErr(196); break;
		}
	}
Example #4
0
bool IsMustOverride(Modifiers m)
{
	return m.Contains(Modifier.MustOverride);
}
Example #5
0
	void NamespaceMemberDecl() {

#line  526 "VBNET.ATG" 
		Modifiers m = new Modifiers(this);
		AttributeSection section;
		ArrayList attributes = new ArrayList();
		string qualident;
		
		if (la.kind == 127) {
			lexer.NextToken();

#line  533 "VBNET.ATG" 
			Point startPos = t.Location;
			
			Qualident(
#line  535 "VBNET.ATG" 
out qualident);

#line  537 "VBNET.ATG" 
			INode node =  new NamespaceDeclaration(qualident);
			node.StartLocation = startPos;
			compilationUnit.AddChild(node);
			compilationUnit.BlockStart(node);
			
			Expect(1);
			NamespaceBody();

#line  545 "VBNET.ATG" 
			node.EndLocation = t.Location;
			compilationUnit.BlockEnd();
			
		} else if (StartOf(2)) {
			while (la.kind == 28) {
				AttributeSection(
#line  549 "VBNET.ATG" 
out section);

#line  549 "VBNET.ATG" 
				attributes.Add(section); 
			}
			while (StartOf(3)) {
				TypeModifier(
#line  550 "VBNET.ATG" 
m);
			}
			NonModuleDeclaration(
#line  550 "VBNET.ATG" 
m, attributes);
		} else SynErr(192);
	}
Example #6
0
	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; 
				}
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1054 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				Expect(1);

#line  1057 "VBNET.ATG" 
				DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer);
				declareDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				declareDeclaration.StartLocation = startPos;
				declareDeclaration.EndLocation   = t.EndLocation;
				compilationUnit.AddChild(declareDeclaration);
				
			} else if (la.kind == 101) {
				lexer.NextToken();
				Identifier();

#line  1065 "VBNET.ATG" 
				name = t.val; 
				Expect(116);
				Expect(3);

#line  1066 "VBNET.ATG" 
				library = t.val; 
				if (la.kind == 45) {
					lexer.NextToken();
					Expect(3);

#line  1067 "VBNET.ATG" 
					alias = t.val; 
				}
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1068 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  1069 "VBNET.ATG" 
out type);
				}
				Expect(1);

#line  1072 "VBNET.ATG" 
				DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, type, p, attributes, library, alias, charsetModifer);
				declareDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				declareDeclaration.StartLocation = startPos;
				declareDeclaration.EndLocation   = t.EndLocation;
				compilationUnit.AddChild(declareDeclaration);
				
			} else SynErr(204);
			break;
		}
		case 94: {
			lexer.NextToken();

#line  1083 "VBNET.ATG" 
			m.Check(Modifier.Events);
			Point startPos = t.Location;
			EventDeclaration eventDeclaration;
			string name = String.Empty;
			ImplementsClause implementsClause = null;
			
			Identifier();

#line  1089 "VBNET.ATG" 
			name= t.val; 
			if (la.kind == 49) {
				lexer.NextToken();
				TypeName(
#line  1091 "VBNET.ATG" 
out type);
			} else if (la.kind == 1 || la.kind == 25 || la.kind == 108) {
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1093 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
			} else SynErr(205);
			if (la.kind == 108) {
				ImplementsClause(
#line  1095 "VBNET.ATG" 
out implementsClause);
			}

#line  1097 "VBNET.ATG" 
			eventDeclaration = new EventDeclaration(type, m.Modifier, p, attributes, name, implementsClause);
			eventDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			eventDeclaration.StartLocation = startPos;
			eventDeclaration.EndLocation = t.EndLocation;
			compilationUnit.AddChild(eventDeclaration);
			
			Expect(1);
			break;
		}
		case 2: case 52: case 71: case 171: {

#line  1105 "VBNET.ATG" 
			Point startPos = t.Location; 

#line  1107 "VBNET.ATG" 
			m.Check(Modifier.Fields);
			FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
			ArrayList comments = lexer.SpecialTracker.RetreiveComments();
			fd.StartLocation = startPos;
			
			VariableDeclarator(
#line  1112 "VBNET.ATG" 
variableDeclarators);

#line  1114 "VBNET.ATG" 
			((INode)variableDeclarators[0]).Specials["before"] = comments;
			
			while (la.kind == 12) {
				lexer.NextToken();
				VariableDeclarator(
#line  1116 "VBNET.ATG" 
variableDeclarators);
			}
			Expect(1);

#line  1119 "VBNET.ATG" 
			fd.EndLocation = t.EndLocation;
			fd.Fields = variableDeclarators;
			compilationUnit.AddChild(fd);
			
			break;
		}
		case 72: {

#line  1124 "VBNET.ATG" 
			m.Check(Modifier.Fields); 
			lexer.NextToken();

#line  1125 "VBNET.ATG" 
			m.Add(Modifier.Constant);  

#line  1127 "VBNET.ATG" 
			FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
			fd.StartLocation = t.Location;
			ArrayList comments = lexer.SpecialTracker.RetreiveComments();
			ArrayList constantDeclarators = new ArrayList();
			
			ConstantDeclarator(
#line  1132 "VBNET.ATG" 
constantDeclarators);

#line  1134 "VBNET.ATG" 
			((INode)constantDeclarators[0]).Specials["before"] = comments;
			
			while (la.kind == 12) {
				lexer.NextToken();
				ConstantDeclarator(
#line  1136 "VBNET.ATG" 
constantDeclarators);
			}

#line  1138 "VBNET.ATG" 
			fd.Fields = constantDeclarators;
			fd.EndLocation = t.Location;
			
			Expect(1);

#line  1143 "VBNET.ATG" 
			fd.EndLocation = t.EndLocation;
			compilationUnit.AddChild(fd);
			
			break;
		}
		case 148: {
			lexer.NextToken();

#line  1149 "VBNET.ATG" 
			m.Check(Modifier.Properties);
			Point startPos = t.Location;
			ImplementsClause implementsClause = null;
			
			Identifier();

#line  1153 "VBNET.ATG" 
			string propertyName = t.val; 
			if (la.kind == 25) {
				lexer.NextToken();
				if (StartOf(4)) {
					FormalParameterList(
#line  1154 "VBNET.ATG" 
out p);
				}
				Expect(26);
			}
			if (la.kind == 49) {
				lexer.NextToken();
				TypeName(
#line  1155 "VBNET.ATG" 
out type);
			}

#line  1157 "VBNET.ATG" 
			if(type == null) {
			type = new TypeReference("System.Object");
			}
			
			if (la.kind == 108) {
				ImplementsClause(
#line  1161 "VBNET.ATG" 
out implementsClause);
			}
			Expect(1);
			if (
#line  1165 "VBNET.ATG" 
IsMustOverride(m)) {

#line  1167 "VBNET.ATG" 
				PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes);
				pDecl.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				pDecl.StartLocation = startPos;
				pDecl.EndLocation   = t.Location;
				pDecl.TypeReference = type;
				pDecl.ImplementsClause = implementsClause;
				pDecl.Parameters = p;
				compilationUnit.AddChild(pDecl);
				
			} else if (la.kind == 28 || la.kind == 102 || la.kind == 158) {

#line  1178 "VBNET.ATG" 
				PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes);
				pDecl.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				pDecl.StartLocation = startPos;
				pDecl.EndLocation   = t.Location;
				pDecl.BodyStart   = t.Location;
				pDecl.TypeReference = type;
				pDecl.ImplementsClause = implementsClause;
				pDecl.Parameters = p;
				PropertyGetRegion getRegion;
				PropertySetRegion setRegion;
				
				AccessorDecls(
#line  1189 "VBNET.ATG" 
out getRegion, out setRegion);
				Expect(89);
				Expect(148);
				Expect(1);

#line  1193 "VBNET.ATG" 
				pDecl.GetRegion = getRegion;
				pDecl.SetRegion = setRegion;
				pDecl.BodyEnd = t.EndLocation;
				compilationUnit.AddChild(pDecl);
				
			} else SynErr(206);
			break;
		}
		default: SynErr(207); break;
		}
	}
Example #7
0
	void InterfaceMemberDecl() {

#line  760 "VBNET.ATG" 
		TypeReference type =null;
		ArrayList p = null;
		AttributeSection section;
		Modifiers mod = new Modifiers(this);
		ArrayList attributes = new ArrayList();
		/*ArrayList parameters = new ArrayList();*/
		string name;
		
		if (StartOf(12)) {
			while (la.kind == 28) {
				AttributeSection(
#line  768 "VBNET.ATG" 
out section);

#line  768 "VBNET.ATG" 
				attributes.Add(section); 
			}
			while (StartOf(6)) {
				MemberModifier(
#line  772 "VBNET.ATG" 
mod);
			}
			if (la.kind == 94) {
				lexer.NextToken();

#line  775 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceEvents); 
				Identifier();

#line  776 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  777 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  778 "VBNET.ATG" 
out type);
				}
				Expect(1);

#line  781 "VBNET.ATG" 
				EventDeclaration ed = new EventDeclaration(type, mod.Modifier, p, attributes, name, null);
				ed.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				compilationUnit.AddChild(ed);
				ed.EndLocation = t.EndLocation;
				
			} else if (la.kind == 169) {
				lexer.NextToken();

#line  789 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceMethods);
				ArrayList comments = lexer.SpecialTracker.RetreiveComments();
				
				Identifier();

#line  792 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  793 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				Expect(1);

#line  796 "VBNET.ATG" 
				MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, null, p, attributes);
				md.Specials["before"] = comments;
				md.EndLocation = t.EndLocation;
				compilationUnit.AddChild(md);
				
			} else if (la.kind == 101) {
				lexer.NextToken();

#line  804 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceMethods);
				AttributeSection attributeSection = null;
				
				Identifier();

#line  807 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  808 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					if (la.kind == 28) {
						AttributeSection(
#line  809 "VBNET.ATG" 
out attributeSection);
					}
					TypeName(
#line  809 "VBNET.ATG" 
out type);
				}

#line  811 "VBNET.ATG" 
				if(type == null) {
				type = new TypeReference("System.Object");
				}
				type.Attributes = attributeSection;
				MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, type, p, attributes);
				md.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				md.EndLocation = t.EndLocation;
				compilationUnit.AddChild(md);
				
				Expect(1);
			} else if (la.kind == 148) {
				lexer.NextToken();

#line  824 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceProperties);
				ArrayList comments = lexer.SpecialTracker.RetreiveComments();
				
				Identifier();

#line  827 "VBNET.ATG" 
				name = t.val;  
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  828 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  829 "VBNET.ATG" 
out type);
				}

#line  831 "VBNET.ATG" 
				if(type == null) {
				type = new TypeReference("System.Object");
				}
				
				Expect(1);

#line  837 "VBNET.ATG" 
				PropertyDeclaration pd = new PropertyDeclaration(name, type, mod.Modifier, attributes);
				pd.Parameters = p;
				pd.Specials["before"] = comments;
				pd.EndLocation = t.EndLocation;
				compilationUnit.AddChild(pd);
				
			} else SynErr(208);
		} else if (StartOf(13)) {
			NonModuleDeclaration(
#line  845 "VBNET.ATG" 
mod, attributes);
		} else SynErr(209);
	}
Example #8
0
	void ClassMemberDecl(
#line  869 "VBNET.ATG" 
Modifiers m, ArrayList attributes) {
		StructureMemberDecl(
#line  870 "VBNET.ATG" 
m, attributes);
	}
Example #9
0
	void MemberModifier(
#line  2726 "VBNET.ATG" 
Modifiers m) {
		switch (la.kind) {
		case 123: {
			lexer.NextToken();

#line  2727 "VBNET.ATG" 
			m.Add(Modifier.MustInherit);
			break;
		}
		case 80: {
			lexer.NextToken();

#line  2728 "VBNET.ATG" 
			m.Add(Modifier.Default);
			break;
		}
		case 100: {
			lexer.NextToken();

#line  2729 "VBNET.ATG" 
			m.Add(Modifier.Friend);
			break;
		}
		case 159: {
			lexer.NextToken();

#line  2730 "VBNET.ATG" 
			m.Add(Modifier.Shadows);
			break;
		}
		case 144: {
			lexer.NextToken();

#line  2731 "VBNET.ATG" 
			m.Add(Modifier.Overrides);
			break;
		}
		case 124: {
			lexer.NextToken();

#line  2732 "VBNET.ATG" 
			m.Add(Modifier.MustOverride);
			break;
		}
		case 147: {
			lexer.NextToken();

#line  2733 "VBNET.ATG" 
			m.Add(Modifier.Private);
			break;
		}
		case 149: {
			lexer.NextToken();

#line  2734 "VBNET.ATG" 
			m.Add(Modifier.Protected);
			break;
		}
		case 150: {
			lexer.NextToken();

#line  2735 "VBNET.ATG" 
			m.Add(Modifier.Public);
			break;
		}
		case 132: {
			lexer.NextToken();

#line  2736 "VBNET.ATG" 
			m.Add(Modifier.NotInheritable);
			break;
		}
		case 133: {
			lexer.NextToken();

#line  2737 "VBNET.ATG" 
			m.Add(Modifier.NotOverridable);
			break;
		}
		case 160: {
			lexer.NextToken();

#line  2738 "VBNET.ATG" 
			m.Add(Modifier.Shared);
			break;
		}
		case 142: {
			lexer.NextToken();

#line  2739 "VBNET.ATG" 
			m.Add(Modifier.Overridable);
			break;
		}
		case 141: {
			lexer.NextToken();

#line  2740 "VBNET.ATG" 
			m.Add(Modifier.Overloads);
			break;
		}
		case 152: {
			lexer.NextToken();

#line  2741 "VBNET.ATG" 
			m.Add(Modifier.ReadOnly);
			break;
		}
		case 186: {
			lexer.NextToken();

#line  2742 "VBNET.ATG" 
			m.Add(Modifier.WriteOnly);
			break;
		}
		case 185: {
			lexer.NextToken();

#line  2743 "VBNET.ATG" 
			m.Add(Modifier.WithEvents);
			break;
		}
		case 82: {
			lexer.NextToken();

#line  2744 "VBNET.ATG" 
			m.Add(Modifier.Dim);
			break;
		}
		default: SynErr(200); break;
		}
	}
Example #10
0
	void StructureBody(
#line  708 "VBNET.ATG" 
TypeDeclaration newType) {

#line  709 "VBNET.ATG" 
		AttributeSection section; 
		while (StartOf(5)) {

#line  712 "VBNET.ATG" 
			ArrayList attributes = new ArrayList();
			Modifiers m = new Modifiers(this);
			
			while (la.kind == 28) {
				AttributeSection(
#line  715 "VBNET.ATG" 
out section);

#line  715 "VBNET.ATG" 
				attributes.Add(section); 
			}
			while (StartOf(6)) {
				MemberModifier(
#line  716 "VBNET.ATG" 
m);
			}
			StructureMemberDecl(
#line  717 "VBNET.ATG" 
m, attributes);
		}
		Expect(89);
		Expect(168);

#line  719 "VBNET.ATG" 
		newType.EndLocation = t.EndLocation; 
		Expect(1);
	}
Example #11
0
	void ModuleBody(
#line  724 "VBNET.ATG" 
TypeDeclaration newType) {

#line  725 "VBNET.ATG" 
		AttributeSection section; 
		while (StartOf(5)) {

#line  728 "VBNET.ATG" 
			ArrayList attributes = new ArrayList();
			Modifiers m = new Modifiers(this);
			
			while (la.kind == 28) {
				AttributeSection(
#line  731 "VBNET.ATG" 
out section);

#line  731 "VBNET.ATG" 
				attributes.Add(section); 
			}
			while (StartOf(6)) {
				MemberModifier(
#line  732 "VBNET.ATG" 
m);
			}
			ClassMemberDecl(
#line  733 "VBNET.ATG" 
m, attributes);
		}
		Expect(89);
		Expect(122);

#line  735 "VBNET.ATG" 
		newType.EndLocation = t.EndLocation; 
		Expect(1);
	}
 public void Add(Modifiers m)
 {
     Add(m.cur);
 }