import { Instruction, Program } from "./high-level"; import { ConcreteType } from "../ast"; import { StructMap } from "../typecheck/structs"; export declare type PointerValue = { tag: "basepointer"; value: string | HeapValue[]; cast?: string; }; export declare type HeapPointerValue = { tag: "basepointer"; value: HeapValue[]; cast?: string; }; export declare type LocationValue = { tag: "loc"; value: HeapValue[]; index: number; offset: string[]; }; export declare type Value = string | number | null | { tag: "double"; value: number; } | PointerValue | { tag: "VOID"; }; export declare function valueToString(v: Value | LocationValue, stop?: boolean): string | null; export interface Frame { stack: (Value | LocationValue)[]; pc: number; bytecode: Instruction[]; labels: Map; locals: Map; } export declare type Struct = { tag: "Struct"; struct: string; value: Map; }; export declare type HeapValue = Value | Struct; export interface State { stack: (Value | LocationValue)[]; pc: number; bytecode: Instruction[]; labels: Map; locals: Map; callstack: Frame[]; } export declare function execute(prog: Program, gas?: number): Value; export declare function executeInstructions(prog: Program, locals: Map, bytecode: Instruction[], gas?: number): number; export declare function init(structs: StructMap, t: ConcreteType): HeapValue; export declare function step(prog: Program, state: State): undefined | number;