@sschepis/resolang
Version:
ResoLang - Core quantum resonance computation library
93 lines (90 loc) • 4.78 kB
text/typescript
// assembly/runtime/instructions.ts
import { IInstructionHandler } from './instructions/types';
import { HoloStore, HoloRetrieve, HoloFragment, HoloReconstruct } from './instructions/advanced/holographic';
import { BasisCreate, BasisTransform, BasisSyncAll, CrossBasisCoherence } from './instructions/advanced/multiBasis';
import { QuatCreate, QuatSend, QuatReceive, QuatPhaseLock } from './instructions/advanced/quaternionic';
import { Resonance, Factorize } from './instructions/advanced/resonance';
import coherence from './instructions/coherence/coherence';
import coherenceall from './instructions/coherence/coherenceall';
import threshold from './instructions/coherence/threshold';
import waitcoh from './instructions/coherence/waitcoh';
import breakInstruction from './instructions/flow/break';
import call from './instructions/flow/call';
import continueInstruction from './instructions/flow/continue';
import elseInstruction from './instructions/flow/else';
import endif from './instructions/flow/endif';
import endloop from './instructions/flow/endloop';
import endwhile from './instructions/flow/endwhile';
import gotoInstruction from './instructions/flow/goto';
import ifInstruction from './instructions/flow/if';
import ifcoh from './instructions/flow/ifcoh';
import setphase from './instructions/phase/setphase';
import advphase from './instructions/phase/advphase';
import decohere from './instructions/phase/decohere';
import entangle from './instructions/phase/entangle';
import collapse from './instructions/quantum/collapse';
import measure from './instructions/quantum/measure';
import observe from './instructions/quantum/observe';
import reconstruct from './instructions/quantum/reconstruct';
import entropy from './instructions/resonance/entropy';
import evolve from './instructions/resonance/evolve';
import factorize from './instructions/resonance/factorize';
import resonance from './instructions/resonance/resonance';
import add from './instructions/symbolic/add';
import load from './instructions/symbolic/load';
import mix from './instructions/symbolic/mix';
import scale from './instructions/symbolic/scale';
import halt from './instructions/system/halt';
import output from './instructions/system/output';
import random from './instructions/system/random';
import tick from './instructions/system/tick';
const instructionHandlers = new Map<string, IInstructionHandler>();
instructionHandlers.set("HOLO_STORE", HoloStore);
instructionHandlers.set("HOLO_RETRIEVE", HoloRetrieve);
instructionHandlers.set("HOLO_FRAGMENT", HoloFragment);
instructionHandlers.set("HOLO_RECONSTRUCT", HoloReconstruct);
instructionHandlers.set("BASIS_CREATE", BasisCreate);
instructionHandlers.set("BASIS_TRANSFORM", BasisTransform);
instructionHandlers.set("BASIS_SYNC_ALL", BasisSyncAll);
instructionHandlers.set("CROSS_BASIS_COHERENCE", CrossBasisCoherence);
instructionHandlers.set("QUAT_CREATE", QuatCreate);
instructionHandlers.set("QUAT_SEND", QuatSend);
instructionHandlers.set("QUAT_RECEIVE", QuatReceive);
instructionHandlers.set("QUAT_PHASE_LOCK", QuatPhaseLock);
instructionHandlers.set("ADV_RESONANCE", Resonance);
instructionHandlers.set("ADV_FACTORIZE", Factorize);
instructionHandlers.set("COHERENCE", coherence);
instructionHandlers.set("COHERENCEALL", coherenceall);
instructionHandlers.set("THRESHOLD", threshold);
instructionHandlers.set("WAITCOH", waitcoh);
instructionHandlers.set("BREAK", breakInstruction);
instructionHandlers.set("CALL", call);
instructionHandlers.set("CONTINUE", continueInstruction);
instructionHandlers.set("ELSE", elseInstruction);
instructionHandlers.set("ENDIF", endif);
instructionHandlers.set("ENDLOOP", endloop);
instructionHandlers.set("ENDWHILE", endwhile);
instructionHandlers.set("GOTO", gotoInstruction);
instructionHandlers.set("IF", ifInstruction);
instructionHandlers.set("IFCOH", ifcoh);
instructionHandlers.set("SETPHASE", setphase);
instructionHandlers.set("ADVPHASE", advphase);
instructionHandlers.set("DECOHERE", decohere);
instructionHandlers.set("ENTANGLE", entangle);
instructionHandlers.set("COLLAPSE", collapse);
instructionHandlers.set("MEASURE", measure);
instructionHandlers.set("OBSERVE", observe);
instructionHandlers.set("RECONSTRUCT", reconstruct);
instructionHandlers.set("ENTROPY", entropy);
instructionHandlers.set("EVOLVE", evolve);
instructionHandlers.set("FACTORIZE", factorize);
instructionHandlers.set("RESONANCE", resonance);
instructionHandlers.set("ADD", add);
instructionHandlers.set("LOAD", load);
instructionHandlers.set("MIX", mix);
instructionHandlers.set("SCALE", scale);
instructionHandlers.set("HALT", halt);
instructionHandlers.set("OUTPUT", output);
instructionHandlers.set("RANDOM", random);
instructionHandlers.set("TICK", tick);
export default instructionHandlers;