import { ArrowFunctionExpression , Expression , FunctionDeclaration , FunctionExpression , Statement , } from "@babel/types" ; export class AnalysisContext { VariableEnvironment : AnalysisEnvironment ; LexicalEnvironment : AnalysisEnvironment ; } export class AnalysisEnvironment { readonly OuterEnv : AnalysisEnvironment ; private readonly bindingSet = new Set < string > ( ) ; constructor ( outer ) { this . OuterEnv = outer ; } HasBinding ( name ) { return this . bindingSet . has ( name ) ; } CreateBinding ( name ) { this . bindingSet . add ( name ) ; } } export interface AnalysisFunctionObject { Function : FunctionDeclaration | FunctionExpression | ArrowFunctionExpression ; FormalParameters : FunctionDeclaration [ "params" ] ; ECMAScriptCode : Statement [ ] | Expression ; Environment : AnalysisEnvironment ; }