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
33 lines (27 loc) • 817 B
text/typescript
import {
AssignmentTargetIdentifier,
BindingIdentifier,
Block,
DoWhileStatement,
Expression,
ForInStatement,
ForOfStatement,
ForStatement,
FunctionBody,
FunctionDeclaration,
FunctionExpression,
Getter,
IdentifierExpression,
Method,
Script,
Setter,
Statement,
Super,
VariableDeclarator,
WhileStatement,
} from 'shift-ast';
export type Identifier = BindingIdentifier | IdentifierExpression | AssignmentTargetIdentifier;
export type Loop = ForStatement | WhileStatement | ForOfStatement | ForInStatement | DoWhileStatement;
export type BlockType = Script | Block | FunctionBody;
export type FuncType = FunctionDeclaration | FunctionExpression | Method | Getter | Setter;
export type InstructionNode = Script | Statement | Expression | Super | BlockType | VariableDeclarator;