Пример #1
0
        public override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
        {
            CLRType t = m_clrTypes.Value.Last.Value;
            string name = fieldDeclaration.Variables.Single().Name;
            string returnType =  fieldDeclaration.ReturnType.ToString();
            Visibility v = new Visibility(VisibilityMapper.Map(fieldDeclaration.Modifiers));

            if (CheckFlag(fieldDeclaration.Modifiers, Modifiers.Const))
            {
                ConstField cf = new ConstField(v, name, returnType, fieldDeclaration.Variables.Single().Initializer.ToString());
                t.ConstantFields.Add(cf);   // connect
            }

            else
            {
                Field f = new Field(
                     CheckFlag(fieldDeclaration.Modifiers, Modifiers.Static),
                     CheckFlag(fieldDeclaration.Modifiers, Modifiers.Readonly),
                     v,
                     CheckFlag(fieldDeclaration.Modifiers, Modifiers.Virtual),
                     name,
                     CheckFlag(fieldDeclaration.Modifiers, Modifiers.Abstract),
                     returnType
                );

                t.Fields.Add(f);    // connect
            }
            AddToNotDefaultReferencedTypes(returnType);

            // call base to forward execution
            base.VisitFieldDeclaration(fieldDeclaration);
        }
Пример #2
0
        public Method(bool overrided, bool ctor, bool @static, Visibility visibility, bool @virtual, string name, bool @abstract, List<KeyValuePair<string, string>> args, string returnType)
            : base(overrided, @static, visibility, @virtual, name, @abstract,  returnType)
        {
            if (args != null && args.Count > 0)
                Arguments = new List<KeyValuePair<string, string>>(args);

            Ctor = ctor;
        }
        public CLRType(bool @static, Visibility visibility, bool @virtual, string name, bool @abstract, CLRAvailableTypeMode _CLRType, string baseName)
            : base(@static, visibility, @virtual,name, @abstract)
        {
            ConstantFields = new LinkedList<ConstField>();

            Fields = new LinkedList<Field>();
            Properties = new LinkedList<Property>();
            Methods = new LinkedList<Method>();
            ReferencedTypes = new HashSet<String>();

            Type = _CLRType;
            BaseName = baseName;
        }
 public Field(bool @static, bool @readonly, Visibility visibility, bool @virtual, string name, bool @abstract, string returnType)
     : base(false, @static, visibility, @virtual, name, @abstract, returnType)
 {
     Readonly = @readonly;
 }
 public Property(bool overrided, bool @static, Visibility visibility, bool @virtual, string name, bool @abstract, string returnType, bool getter, bool setter)
     : base(overrided, @static, visibility, @virtual, name, @abstract, returnType)
 {
     Getter = getter;
     Setter = setter;
 }