public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) {
			Debug.Assert((attributeSection != null));
			Debug.Assert((attributeSection.Attributes != null));
			foreach (ICSharpCode.NRefactory.VB.Ast.Attribute o in attributeSection.Attributes) {
				Debug.Assert(o != null);
				o.AcceptVisitor(this, data);
			}
			return null;
		}
		public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) {
			Debug.Assert((attributeSection != null));
			Debug.Assert((attributeSection.Attributes != null));
			for (int i = 0; i < attributeSection.Attributes.Count; i++) {
				ICSharpCode.NRefactory.VB.Ast.Attribute o = attributeSection.Attributes[i];
				Debug.Assert(o != null);
				nodeStack.Push(o);
				o.AcceptVisitor(this, data);
				o = (ICSharpCode.NRefactory.VB.Ast.Attribute)nodeStack.Pop();
				if (o == null)
					attributeSection.Attributes.RemoveAt(i--);
				else
					attributeSection.Attributes[i] = o;
			}
			return null;
		}
		public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) {
			throw new global::System.NotImplementedException("AttributeSection");
		}
Example #4
0
	void AttributeSection(out AttributeSection section) {
		string attributeTarget = "";
		List<ASTAttribute> attributes = new List<ASTAttribute>();
		ASTAttribute attribute;
		Location startLocation = la.Location;

		Expect(40);
		if (IsLocalAttrTarget()) {
			if (la.kind == 119) {
				Get();
				attributeTarget = "event";
			} else if (la.kind == 195) {
				Get();
				attributeTarget = "return";
			} else if (StartOf(5)) {
				Identifier();
				string val = t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture);
					if (val != "field"	|| val != "method" ||
						val != "module" || val != "param"  ||
						val != "property" || val != "type")
					Error("attribute target specifier (event, return, field," +
							"method, module, param, property, or type) expected");
					attributeTarget = t.val;

			} else SynErr(249);
			Expect(21);
		}
		Attribute(out attribute);
		attributes.Add(attribute);
		while (NotFinalComma()) {
			Expect(22);
			Attribute(out attribute);
			attributes.Add(attribute);
		}
		if (la.kind == 22) {
			Get();
		}
		Expect(39);
		section = new AttributeSection {
				AttributeTarget = attributeTarget,
				Attributes = attributes,
				StartLocation = startLocation,
				EndLocation = t.EndLocation
			};

	}
Example #5
0
	void GlobalAttributeSection() {
		Expect(40);
		Location startPos = t.Location;
		if (la.kind == 65) {
			Get();
		} else if (la.kind == 155) {
			Get();
		} else SynErr(243);
		string attributeTarget = t.val != null ? t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture) : null;
			List<ASTAttribute> attributes = new List<ASTAttribute>();
			ASTAttribute attribute;

		Expect(21);
		Attribute(out attribute);
		attributes.Add(attribute);
		while (NotFinalComma()) {
			if (la.kind == 22) {
				Get();
				if (la.kind == 65) {
					Get();
				} else if (la.kind == 155) {
					Get();
				} else SynErr(244);
				Expect(21);
			}
			Attribute(out attribute);
			attributes.Add(attribute);
		}
		if (la.kind == 22) {
			Get();
		}
		Expect(39);
		EndOfStmt();
		AttributeSection section = new AttributeSection {
				AttributeTarget = attributeTarget,
				Attributes = attributes,
				StartLocation = startPos,
				EndLocation = t.EndLocation
			};
			AddChild(section);

	}
		public virtual object TrackedVisitAttributeSection(AttributeSection attributeSection, object data) {
			return base.VisitAttributeSection(attributeSection, data);
		}
		public sealed override object VisitAttributeSection(AttributeSection attributeSection, object data) {
			this.BeginVisit(attributeSection);
			object result = this.TrackedVisitAttributeSection(attributeSection, data);
			this.EndVisit(attributeSection);
			return result;
		}
		public override object VisitAttributeSection(AttributeSection attributeSection, object data)
		{
			return null;
		}