JavaScript ~ Stuff - rohit120582sharma/Documentation GitHub Wiki

JavaScript Parser

Parsing is taking raw code and turning it into a more abstract representation of the code.

A parser takes input in the form of a sequence of tokens or program instructions and usually builds a data structure in the form of a parse tree or an abstract syntax tree.

A parser is commonly used as a component of an interpreter or a compiler. The overall process of parsing involves three stages:

  • Lexical Analysis: A lexical analyzer is used to produce tokens from a stream of input string characters, which are broken into small components to form meaningful expressions.
  • Syntactic Analysis: Checks whether the generated tokens form a meaningful expression. These work to form an expression and define the particular order in which tokens must be placed.
  • Semantic Parsing: The final parsing stage in which the meaning and implications of the validated expression are determined and necessary actions are taken.

JavaScript Parser gets the JavaScript code and constructs the data structure called ATS (Abstract Syntax Tree) and Scope based on it. Then the bytecode generator walks those structure and generates the bytecode. It is then interpreted by the interpreter.

⚠️ **GitHub.com Fallback** ⚠️