Esempio n. 1
0
        public Context(XmlTextReader reader, CsharpGen generator)
            : base(reader, generator)
        {
            GenStructors = false;
            if(Attr.Export)
                GenStructors = true;
            _typedef = null;

            switch(reader.Name)
            {
            case "Class":		type_ = "class"; break;
            case "Struct":		type_ = "struct"; break;
            case "Namespace":	type_ = "namespace"; break;
            case "Union":		type_ = "union"; break;
            default:			Console.WriteLine("cannot process context type \"" + reader.Name + "\""); break;
            }

            _bases = new List<string>();
            string baseList = reader["bases"];
            if(baseList != null && baseList.Length != 0)
            {
                string[] baseSplit = baseList.Split(new string[]{" "}, StringSplitOptions.RemoveEmptyEntries);
                foreach(string str in baseSplit)
                    _bases.Add(str);
            }

            functions_ = new List<Function>();
            contexts_ = new List<Context>();
            _enums = new List<Enumeration>();
            _fields = new List<Field>();

            if(Name == "Mathf")
                Console.Write ("");
        }
Esempio n. 2
0
        public Arg(XmlTextReader reader, CsharpGen cc)
        {
            _name = reader["name"];
            if(_name == null)
                _name = "amp";
            _typeId = reader["type"];
            _id = reader["id"];

            _cc = cc;
        }
Esempio n. 3
0
 public ContextObject(ContextObject obj)
 {
     _id = obj._id;
     _name = obj._name;
     _contextId = obj._contextId;
     _access = obj._access;
     _attr = obj._attr;
     _file = obj._file;
     _line = obj._line;
     _cc = obj._cc;
 }
Esempio n. 4
0
        public Arg(DataType type, CsharpGen cc)
        {
            _name = "amp";
            if(type.ContextId != null)
                _typeId = type.ContextId;
            else
                _typeId = type.Id;

            _id = type.Id;

            _cc = cc;
        }
Esempio n. 5
0
        public Field(XmlTextReader reader, CsharpGen cc)
            : base(reader, cc)
        {
            _typeId = reader["type"];
            String staticc = reader["static"];
            _static = false;
            if(staticc != null)
                if(staticc == "1") _static = true;

            if(Attr.Set != null)
                _arg = new Arg(Type, CC);
        }
Esempio n. 6
0
 public ContextObject(XmlTextReader reader, CsharpGen cc)
 {
     _id = reader["id"];
     _name = reader["name"];
     _contextId = reader["context"];
     _access = reader["access"];
     if(_access == null) _access = "public";
     _attr = new Attributes(reader);
     _file = reader["file"];
     _line = reader["line"];
     _cc = cc;
 }
Esempio n. 7
0
 public Enumeration(XmlTextReader reader, CsharpGen generator)
     : base(reader, generator)
 {
     _values = new List<Value>();
 }
Esempio n. 8
0
 public Function(Field field)
 {
     _cc = field.CC;
     _id = field.Id;
     _name = field.Name;
     _access = "public";
     _context = field.ContextId;
     if(field.Attr.Get != null)
         _returnId = field.TypeId;
     else
         _returnId = CC.Types.VoidTypeId;
     _file = field.File;
     _line = field.Line;
     _memberFunc = true;
     _artificial = false;
     _attr = field.Attr;
     if(_attr.Get != null || _attr.Set != null)
     {
         if(_context != null)
             CC.ContextMap[_context].GenStructors = true;
     }
     _static = false;
     _head = field.Args;
 }
Esempio n. 9
0
        public Function(String type, XmlTextReader reader, CsharpGen cc)
        {
            _cc = cc;
            _id = reader["id"];
            _name = reader["name"];
            _access = reader["access"];
            if(_access == null) _access = "public";
            _context = reader["context"];
            _returnId = reader["returns"];
            _file = reader["file"];
            _line = reader["line"];
            _memberFunc = true;

            _artificial = false;
            string artificial = reader["artificial"];
            if(artificial != null)
                if(artificial == "1")
                    _artificial = true;

            //*****************************************************************
            //  setup the attributes for this function
            _attr = new Attributes(reader);
            if(_attr.Export)
            {
                if(_context != null)
                    CC.ContextMap[_context].GenStructors = true;
            }

            // TODO handle __import

            String staticc = reader["static"];
            _static = false;
            if(staticc != null)
                if(staticc == "1") _static = true;
        }
Esempio n. 10
0
 public Function(Function func)
 {
     _cc = func._cc;
     _id = func._id;
     _name = func._name;
     _access = func._access;
     _context = func._context;
     _returnId = func._returnId;
     _file = func._file;
     _line = func._line;
     _attr = new Attributes(func._attr);
     _static = func._static;
     _head = func._head;
     _artificial = func._artificial;
     _memberFunc = false;
 }
Esempio n. 11
0
 public Destructor(String type, XmlTextReader reader, CsharpGen generator)
     : base(type, reader, generator)
 {
 }