Пример #1
0
 private void CreateEmbedIdentifier()
 {
     Void = new VoidSymbol();
     Unknown = new UnknownSymbol();
     ErrorType = new ErrorTypeSymbol();
     ErrorVariant = new ErrorVariantSymbol();
     ErrorRoutine = new ErrorRoutineSymbol();
     Default = new DefaultSymbol();
     Refer = new ModifyTypeSymbol(ModifyType.Refer);
     Typeof = new ModifyTypeSymbol(ModifyType.Typeof);
     Nullable = new ModifyTypeSymbol(ModifyType.Nullable);
     Pointer = new ModifyTypeSymbol(ModifyType.Pointer);
     EmbedArray = new ModifyTypeSymbol(ModifyType.EmbedArray);
     Contravariant = new AttributeSymbol(AttributeType.Contravariant);
     Covariant = new AttributeSymbol(AttributeType.Covariant);
     ConstructorConstraint = new AttributeSymbol(AttributeType.ConstructorConstraint);
     ValueConstraint = new AttributeSymbol(AttributeType.ValueConstraint);
     ReferenceConstraint = new AttributeSymbol(AttributeType.ReferenceConstraint);
     Variadic = new AttributeSymbol(AttributeType.Variadic, "variadic");
     Optional = new AttributeSymbol(AttributeType.Optional);
     GlobalScope = new AttributeSymbol(AttributeType.GlobalScope);
     Abstract = new AttributeSymbol(AttributeType.Abstract);
     Virtual = new AttributeSymbol(AttributeType.Virtual);
     Final = new AttributeSymbol(AttributeType.Final, "final");
     Static = new AttributeSymbol(AttributeType.Static, "static");
     Public = new AttributeSymbol(AttributeType.Public, "public");
     Internal = new AttributeSymbol(AttributeType.Internal, "internal");
     Protected = new AttributeSymbol(AttributeType.Protected, "protected");
     Private = new AttributeSymbol(AttributeType.Private, "private");
     EmbedList.AppendChild(Void);
     EmbedList.AppendChild(Unknown);
     EmbedList.AppendChild(ErrorType);
     EmbedList.AppendChild(ErrorVariant);
     EmbedList.AppendChild(ErrorRoutine);
     EmbedList.AppendChild(Default);
     EmbedList.AppendChild(Refer);
     EmbedList.AppendChild(Typeof);
     EmbedList.AppendChild(Nullable);
     EmbedList.AppendChild(Pointer);
     EmbedList.AppendChild(EmbedArray);
     EmbedList.AppendChild(Variadic);
     EmbedList.AppendChild(Optional);
     EmbedList.AppendChild(GlobalScope);
     EmbedList.AppendChild(Virtual);
     EmbedList.AppendChild(Final);
     EmbedList.AppendChild(Static);
     EmbedList.AppendChild(Public);
     EmbedList.AppendChild(Internal);
     EmbedList.AppendChild(Protected);
     EmbedList.AppendChild(Private);
     EmbedList.AppendChild(new BooleanSymbol(false));
     EmbedList.AppendChild(new BooleanSymbol(true));
 }
Пример #2
0
 private void InitInitializers()
 {
     var i = new List<RoutineSymbol>();
     var def = new DefaultSymbol(RoutineSymbol.ConstructorIdentifier, this);
     Block.Append(def);
     i.Add(def);
     Initializers = i;
 }
Пример #3
0
 private void InitInitializers()
 {
     var i = new List<RoutineSymbol>();
     var newFlag = false;
     foreach (var e in Block)
     {
         var r = e as RoutineSymbol;
         if (r == null)
         {
             continue;
         }
         if (r.IsConstructor)
         {
             i.Add(r);
             newFlag = true;
         }
     }
     if (!newFlag)
     {
         var def = new DefaultSymbol(RoutineSymbol.ConstructorIdentifier, this);
         Block.Append(def);
         i.Add(def);
     }
     Initializers = i;
 }