public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
			throw new global::System.NotImplementedException("TemplateDefinition");
		}
예제 #2
0
		public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
			Debug.Assert((templateDefinition != null));
			Debug.Assert((templateDefinition.Attributes != null));
			Debug.Assert((templateDefinition.Bases != null));
			foreach (AttributeSection o in templateDefinition.Attributes) {
				Debug.Assert(o != null);
				o.AcceptVisitor(this, data);
			}
			foreach (TypeReference o in templateDefinition.Bases) {
				Debug.Assert(o != null);
				o.AcceptVisitor(this, data);
			}
			return null;
		}
예제 #3
0
		public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
			Debug.Assert((templateDefinition != null));
			Debug.Assert((templateDefinition.Attributes != null));
			Debug.Assert((templateDefinition.Bases != null));
			for (int i = 0; i < templateDefinition.Attributes.Count; i++) {
				AttributeSection o = templateDefinition.Attributes[i];
				Debug.Assert(o != null);
				nodeStack.Push(o);
				o.AcceptVisitor(this, data);
				o = (AttributeSection)nodeStack.Pop();
				if (o == null)
					templateDefinition.Attributes.RemoveAt(i--);
				else
					templateDefinition.Attributes[i] = o;
			}
			for (int i = 0; i < templateDefinition.Bases.Count; i++) {
				TypeReference o = templateDefinition.Bases[i];
				Debug.Assert(o != null);
				nodeStack.Push(o);
				o.AcceptVisitor(this, data);
				o = (TypeReference)nodeStack.Pop();
				if (o == null)
					templateDefinition.Bases.RemoveAt(i--);
				else
					templateDefinition.Bases[i] = o;
			}
			return null;
		}
예제 #4
0
	void TypeParameterConstraints(TemplateDefinition template) {
		TypeReference constraint;

		Expect(63);
		if (la.kind == 35) {
			Get();
			TypeParameterConstraint(out constraint);
			if (constraint != null) { template.Bases.Add(constraint); }
			while (la.kind == 22) {
				Get();
				TypeParameterConstraint(out constraint);
				if (constraint != null) { template.Bases.Add(constraint); }
			}
			Expect(36);
		} else if (StartOf(8)) {
			TypeParameterConstraint(out constraint);
			if (constraint != null) { template.Bases.Add(constraint); }
		} else SynErr(253);
	}
예제 #5
0
	void TypeParameter(out TemplateDefinition template) {
		VarianceModifier modifier = VarianceModifier.Invariant; Location startLocation = la.Location;
		if (la.kind == 138 || (la.kind == Tokens.Out && IsIdentifierToken(Peek(1)))) {
			if (la.kind == 138) {
				Get();
				modifier = VarianceModifier.Contravariant;
			} else {
				Expect(178);
				modifier = VarianceModifier.Covariant;
			}
		}
		Identifier();
		template = new TemplateDefinition(t.val, null) { VarianceModifier = modifier };
		if (la.kind == 63) {
			TypeParameterConstraints(template);
		}
		if (template != null) {
				template.StartLocation = startLocation;
				template.EndLocation = t.EndLocation;
			}

	}
예제 #6
0
		public sealed override object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
			this.BeginVisit(templateDefinition);
			object result = this.TrackedVisitTemplateDefinition(templateDefinition, data);
			this.EndVisit(templateDefinition);
			return result;
		}
예제 #7
0
		public virtual object TrackedVisitTemplateDefinition(TemplateDefinition templateDefinition, object data) {
			return base.VisitTemplateDefinition(templateDefinition, data);
		}