Ejemplo n.º 1
0
 public static void CloseScop(bool safe = false)
 {
     if (!safe)
     {
         CurrentScop.Dispose();
         CleanedScop.Push(CurrentScop);
     }
     CurrentScop = Scops.Pop();
 }
Ejemplo n.º 2
0
 public static void OpenScop()
 {
     Scops.Push(CurrentScop);
     CurrentScop = CleanedScop.Pop() ?? new Scop(null)
     {
         isMultiScops = true
     };
     CurrentScop.Initialize();
 }
Ejemplo n.º 3
0
        public static void _Test()
        {
            while (true)
            {
                __test();

                var parse = new BasicParse {
                    Pile = new Pile(Prg_Example)
                };
                var parent = new Tree(parse.Pile, null, Kind.Program);
                var glob   = CurrentScop.Initialize("globe");
                Update(parse);
                var s = new Space(parse);
                if (s.Parse(parent))
                {
                    var byteCode = new ByteCodeMapper(glob);
                    var load     = new LoadClasses(byteCode);
                    load.Add(parent[0]);
                    load.Compile();
                    var inst = load.Optimum.Instructs;
                    var sw   = new IO.Stream.StreamWriter(true);
                    for (int i = 0; i < inst.Count; i++)
                    {
                        inst[i].Push(sw);
                    }
                    var tt = inst[0].Length;
                    var sr = new IO.Stream.StreamReader(sw);
                    for (int i = 0; i < inst.Count; i++)
                    {
                        var x     = Instruct.Pop(sr);
                        var isieq = x.Equals(inst[i]);
                        if (!isieq)
                        {
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        static Assembly()
        {
            if (Initialized)
            {
                return;
            }
            Initialized = true;
            var ns = (Namespace)CurrentScop.Initialize("System").Current;

            BaseClasses = new[]
            {
                Object = Class.LoadAsClass(ns, null, "object", 4),
                Void   = Class.LoadAsClass(ns, Object, "void", 0),

                Bool = Class.LoadAsStruct(ns, "bool", 1, true),
                Char = Class.LoadAsStruct(ns, "char", 2),
                Byte = Class.LoadAsStruct(ns, "byte", 1, true),

                Short  = Class.LoadAsStruct(ns, "short", 2, true),
                UShort = Class.LoadAsStruct(ns, "short", 2, true),

                Int  = Class.LoadAsStruct(ns, "int", 4, true),
                UInt = Class.LoadAsStruct(ns, "uint", 4, true),

                Long  = Class.LoadAsStruct(ns, "long", 8, true),
                ULong = Class.LoadAsStruct(ns, "ulong", 8, true),

                Float  = Class.LoadAsStruct(ns, "float", 4, true),
                Double = Class.LoadAsStruct(ns, "double", 8, true),

                Class.LoadAsStruct(ns, "complex", 16),
                String = Class.LoadAsClass(ns, Object, "string", 4),
                Class.LoadAsClass(ns, Object, "array", 4)
            };
            CPUClasses = new[] { Void, Bool, Char, Byte, Short, Int, Long, UShort, UInt, ULong, Float, Double };
            _shareProTypes(ns);
        }
Ejemplo n.º 5
0
 public Finder(CurrentScop @this)
 {
     _this = @this;
 }
Ejemplo n.º 6
0
 internal static void AddFunction(Function function)
 {
     CurrentScop.Add(function);
 }