public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { throw new global::System.NotImplementedException("TemplateDefinition"); }
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; }
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; }
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); }
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; } }
public sealed override object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { this.BeginVisit(templateDefinition); object result = this.TrackedVisitTemplateDefinition(templateDefinition, data); this.EndVisit(templateDefinition); return result; }
public virtual object TrackedVisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { return base.VisitTemplateDefinition(templateDefinition, data); }