예제 #1
0
파일: class.cs 프로젝트: shugo/babel
 public virtual void IncludeTo(ClassDefinition cls,
                       FeatureModifier featureModifier)
 {
 }
예제 #2
0
파일: class.cs 프로젝트: shugo/babel
 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);
 }
예제 #3
0
파일: class.cs 프로젝트: shugo/babel
 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);
 }
예제 #4
0
파일: class.cs 프로젝트: shugo/babel
 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);
 }
예제 #5
0
파일: eltcreate.cs 프로젝트: shugo/babel
 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);
     }
 }