Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Abstract Syntax Tree

Basic Knowledge

  1. 美团:抽象语法树在JavaScript中的应用
  2. 轻松搞定JavaScript预解析机制
  3. JavaScript编译运行原理
  4. PPT: Building JavaScript Tools
  5. SlideShare: JavaScript: Abstract Syntax Tree
  6. SlideShare: Esprima, what is that

Tools

  1. SpiderMonkey: Reflect.parse - Mozilla's Parser API
  2. Esprima: most popular ECMAScript parser in JS
  3. Acorn - faster alternative ECMAScript parser in JS
  4. UglifyJS - has own parser with custom AST format
  5. Estraverse - taraverse and update the AST
  6. Escodegen - generates code from an AST

Esprima解析得到的抽象语法树AST遵循SpiderMonkey的API

Helpers

  1. Esprima Online Parser
  2. ESLint - The pluggable linting utility for JavaScript and JSX
  3. aster - AST-based code builder

Tutorial

  1. Esprima tutorial
  2. Fun with Esprima and Static Analysis
  3. Parsing and modifying JavaScript code with Esprima and Scodegen