public virtual void IncludeTo(ClassDefinition cls, FeatureModifier featureModifier) { }
public virtual void IncludeTo(ClassDefinition cls, FeatureModifier featureModifier) { ConstDefinition constDef = (ConstDefinition) Clone(); constDef.name = featureModifier.NewName; switch (featureModifier.NewModifier) { case IncludeModifier.None: constDef.modifier = ConstModifier.None; break; case IncludeModifier.Private: constDef.modifier = ConstModifier.Private; break; } cls.AddChild(constDef); }
public virtual void IncludeTo(ClassDefinition cls, FeatureModifier featureModifier) { RoutineDefinition rout = (RoutineDefinition) Clone(); rout.name = featureModifier.NewName; switch (featureModifier.NewModifier) { case IncludeModifier.None: rout.modifier = RoutineModifier.None; break; case IncludeModifier.Private: rout.modifier = RoutineModifier.Private; break; case IncludeModifier.Readonly: // FIXME break; } cls.AddChild(rout); }
public virtual void IncludeTo(ClassDefinition cls, FeatureModifier featureModifier) { AttrDefinition attr = (AttrDefinition) Clone(); attr.name = featureModifier.NewName; switch (featureModifier.NewModifier) { case IncludeModifier.None: attr.modifier = AttrModifier.None; break; case IncludeModifier.Private: attr.modifier = AttrModifier.Private; break; case IncludeModifier.Readonly: attr.modifier = AttrModifier.Readonly; break; } cls.AddChild(attr); }
public override void VisitInclude(IncludeClause include) { include.TypeSpecifier.Accept(this); ClassDefinition cls = typeManager.GetClass(include.TypeSpecifier.Name); if (cls == null) { report.Error(include.Location, "cannot find the definition of {0}", include.TypeSpecifier.Name); return; } foreach (ClassElement element in cls.Children) { FeatureModifier featureModifier = null; foreach (FeatureModifier fm in include.FeatureModifierList) { if (fm.Name == element.Name) { featureModifier = fm; break; } } if (featureModifier == null) { featureModifier = new FeatureModifier(element.Name, element.Name, include.Modifier, Location.Null); } else { if (featureModifier.NewName == "") continue; } element.IncludeTo(currentClass, featureModifier); } }