private void GenLoadEntity(IL.IEntity e)
 {
     if (e == null)
     {
         // This should not happen.
         throw new NotImplementedException();
     }
     else if (e is IL.Variable var)
     {
         // The entity is a variable.
         // (This includes IL.Variable and Optimization.Variable.)
         GenLoadVariable(var);
     }
     else if (e is IL.UnresolvedObject obj)
     {
         // The entity represents an unresolved name, i.e. a library object.
         GenLoadUnresolvedObject(obj);
     }
     else
     {
         // The entity is an immediate number.
         IL.ImmediateNumber imm = e as IL.ImmediateNumber;
         GenLoadConst(imm.Imm);
     }
 }
        public void Call(IL.IEntity f, params IL.IEntity[] args)
        {
            var ins = new IL.CallInstruction(f, Env.rax);

            ins.Parameters.AddRange(args);
            Add(ins);
        }
 public static void Init()
 {
     if (!inited)
     {
         inited = true;
         Core.Init();
         SO.Init();
         nil      = env.FindOrExtern(Symbol.FindOrCreate("NIL"));
         env.Name = "global";
         Macro.Init();
     }
 }
Beispiel #4
0
 public void Push(Function f, IL.IEntity value)
 {
     f.Call(Global.env.FindOrExtern(Symbol.FindOrCreate("#SPECIAL-PUSH")), new IL.ImmediateNumber(name), value);
 }