UNPKG

shift-interpreter

Version:

Shift-interpreter is an experimental JavaScript meta-interpreter useful for reverse engineering and analysis. One notable difference from other projects is that shift-interpreter retains state over an entire script but can be fed expressions and statement

21 lines 931 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.interpret = exports.interpretTree = exports.interpretSource = void 0; const shift_parser_1 = require("shift-parser"); const interpreter_1 = require("./interpreter"); function interpretSource(source, context = {}) { return interpretTree(shift_parser_1.parseScript(source), context); } exports.interpretSource = interpretSource; function interpretTree(tree, context = {}) { const interpreter = new interpreter_1.Interpreter(); interpreter.pushContext(context); interpreter.load(tree); return interpreter.run(); } exports.interpretTree = interpretTree; exports.default = interpretSource; exports.interpret = interpretSource; var interpreter_2 = require("./interpreter"); Object.defineProperty(exports, "Interpreter", { enumerable: true, get: function () { return interpreter_2.Interpreter; } }); //# sourceMappingURL=index.js.map