コード例 #1
0
 private MachineState(RootEnvironment rootEnv, int nArgs, int nLocals, InnerMachineState innerState)
 {
     RootEnv         = rootEnv;
     this.nArgs      = nArgs;
     this.nLocals    = nLocals;
     this.innerState = new LogicVar <InnerMachineState>(innerState);
 }
コード例 #2
0
 // New empty stack and bottom args and locals state
 public MachineState(RootEnvironment rootEnv, int nArgs, int nLocals)
 {
     RootEnv      = rootEnv;
     this.nArgs   = nArgs;
     this.nLocals = nLocals;
     innerState   = new LogicVar <InnerMachineState>(new InnerMachineState(nArgs, nLocals));
 }
コード例 #3
0
ファイル: LogicVar.cs プロジェクト: tralivali1234/IL2JS
        public void Unify(LogicVar <T> other, Action <T, T, BoolRef> unifyValues, BoolRef changed)
        {
            var thislv = Follow();

            other = other.Follow();

            if (thislv.id == other.id)
            {
                return;
            }

            if (thislv.value != null && other.value != null)
            {
                unifyValues(thislv.value, other.value, changed);
                other.value   = null;
                other.chained = thislv;
            }
            else if (thislv.value != null)
            {
                other.chained = thislv;
            }
            else
            {
                thislv.chained = other;
            }
        }
コード例 #4
0
ファイル: LogicVar.cs プロジェクト: tralivali1234/IL2JS
        private LogicVar <T> Follow()
        {
            if (chained == null)
            {
                return(this);
            }
            var lv = chained;

            while (lv.chained != null)
            {
                lv = lv.chained;
            }
            chained = lv;
            return(lv);
        }
コード例 #5
0
ファイル: LogicVar.cs プロジェクト: tralivali1234/IL2JS
 public LogicVar(T value)
 {
     id         = nextId++;
     chained    = null;
     this.value = value;
 }
コード例 #6
0
ファイル: LogicVar.cs プロジェクト: tralivali1234/IL2JS
 public LogicVar()
 {
     id      = nextId++;
     chained = null;
     value   = null;
 }