import { LogicCommandNode, LogicLabel } from '../Extract/Logic/LogicDecompile'; import { LogicCommand, LogicConditionClause, LogicInstruction } from '../Types/Logic'; import { BasicBlock, BasicBlockGraph, IfExitBasicBlock, SinglePathBasicBlock } from '../Extract/Logic/ControlFlowAnalysis'; declare type SinglePathCompiledBlock = { type: 'singlePath'; basicBlock: SinglePathBasicBlock; instructions: LogicInstruction[]; next?: BasicBlock; }; declare type ConditionalCompiledBlock = { type: 'conditional'; basicBlock: IfExitBasicBlock; clauses: LogicConditionClause[]; instructions: LogicInstruction[]; skip: BasicBlock; then?: BasicBlock; }; declare type CompiledBlock = SinglePathCompiledBlock | ConditionalCompiledBlock; declare type StitchedBlock = LogicInstruction[]; export declare type LogicCompilerResult = { instructions: LogicInstruction[]; labels: LogicLabel[]; }; export declare class LogicCompiler { basicBlockGraph: BasicBlockGraph; labels: Map; private postDominatorTree; private compiledBlocks; private stitchedBlocks; private instructionsByAddress; constructor(basicBlockGraph: BasicBlockGraph, labels: LogicLabel[]); compile(): LogicCompilerResult; storeInstruction(instruction: LogicInstruction): void; findFreeAddress(): number; compileCommandNode(node: LogicCommandNode): LogicCommand; findOrBuildLabelForAddress(address: number): LogicLabel; findBlockAddress(basicBlock: BasicBlock): number; stitchBlocks(basicBlock: BasicBlock): StitchedBlock; generateElseVirtualReturn(from: IfExitBasicBlock): BasicBlock; compileBlock(block: BasicBlock): CompiledBlock; } export {};