js-slang
Version:
Javascript-based implementations of Source, written in Typescript
27 lines (26 loc) • 1.96 kB
TypeScript
/**
* Utility functions for creating the various control instructions.
*/
import * as es from 'estree';
import { Environment, Node } from '../types';
import { AppInstr, ArrLitInstr, AssmtInstr, BinOpInstr, BranchInstr, EnvInstr, ForInstr, Instr, UnOpInstr, WhileInstr } from './types';
import { Transformers } from './interpreter';
export declare const resetInstr: (srcNode: Node) => Instr;
export declare const whileInstr: (test: es.Expression, body: es.Statement, srcNode: Node) => WhileInstr;
export declare const forInstr: (init: es.VariableDeclaration | es.Expression, test: es.Expression, update: es.Expression, body: es.Statement, srcNode: Node) => ForInstr;
export declare const assmtInstr: (symbol: string, constant: boolean, declaration: boolean, srcNode: Node) => AssmtInstr;
export declare const unOpInstr: (symbol: es.UnaryOperator, srcNode: Node) => UnOpInstr;
export declare const binOpInstr: (symbol: es.BinaryOperator, srcNode: Node) => BinOpInstr;
export declare const popInstr: (srcNode: Node) => Instr;
export declare const appInstr: (numOfArgs: number, srcNode: es.CallExpression) => AppInstr;
export declare const branchInstr: (consequent: es.Expression | es.Statement, alternate: es.Expression | es.Statement | null | undefined, srcNode: Node) => BranchInstr;
export declare const envInstr: (env: Environment, transformers: Transformers, srcNode: Node) => EnvInstr;
export declare const arrLitInstr: (arity: number, srcNode: Node) => ArrLitInstr;
export declare const arrAccInstr: (srcNode: Node) => Instr;
export declare const arrAssmtInstr: (srcNode: Node) => Instr;
export declare const markerInstr: (srcNode: Node) => Instr;
export declare const contInstr: (srcNode: Node) => Instr;
export declare const contMarkerInstr: (srcNode: Node) => Instr;
export declare const breakInstr: (srcNode: Node) => Instr;
export declare const breakMarkerInstr: (srcNode: Node) => Instr;
export declare const spreadInstr: (srcNode: Node) => Instr;