Parser / Compiler - (Abstract) Syntax Tree (AST)



An Abstract Syntax Tree (AST) is a syntax tree. It represents the structure of the grammar at a higher level than a concrete syntax tree (parse tree) and thus easier to manipulate.

At the opposite of a concrete syntax tree, an abstract syntax tree has only the syntactic structure of the code.

For instance, an AST would not known if a literal was enclosed by a double or single quote.

An Abstract Syntax Tree (AST) is created by a parser.


The site astexporer 1) permits to create AST from compiler library for different languages.

  • Choose your language
  • Choose your compiler if many
  • Copy your code
  • And explore the AST in the right pane.

Ast Explorer Php


Discover More
Antlr Idea Plugin
Antlr - Parse Tree (AST)

The tree parser is an AST that is created by the parser from a text input. with grun, see the -tree of -gui option of Example: Type your text and end with a End of File character (Ctrl+Z or...
Compiler - Code generation

Code generation is one of the last compiler step. The process takes a parse tree (generally an AST) created by the parser and turns it into a sequence of instructions. In general it is the most involved...
Computer Language - (Compiler|Interpreter) - Language translator

Computer Language are written in plain text. However, computers interpret only particular sequence of instructions. This transformation from a plain text language to instructions is called compilation...
Concrete Syntax Tree - What is that ?

A concrete syntax tree is a tree representation of a grammar that contains the whole parsed document
Graph (Network - Nodes and edges)

A graph is a set of vertices connected by edges. See Data representation that naturally captures complex relationships is a graph (or network). Except of the special graph that a tree is, the data...
Ast Groovy Console
Groovy - AST (Abstract Syntax Tree)

From the groovy Console > Script > Inspect AST, you can see the Abstract Syntax Tree
Prosemirror Dom
How Rich Text editor in HTML are made (Principles and Demo)

How do you create a Rich Text editor in HTML, what are the well-known text editor and what are the principals. This article includes also a basic example where you can extend from to build your own
Language - (Grammar|Production) Rule

Recursive rules (known as production): are essential for describing the syntax of programming languages, and are a part of every compiler. play an important role in describing the syntax of natural...
Grammar Graphic Representation
Language - (Syntax|Structural) Tree

The graphical representations of a grammar are called Syntax or Structural tree. Whether your language input is (Markdown, HTML, or prose, ..), it needs to be parsed to a workable format. Such a format...
Lexical Analysis - Parser (Syntax analysis|Linter)

A parser create a parse tree data structure from a series of token created by the lexer. The creation of the tree is based on the rules declared in the grammar (which defines the syntactic structure of...

Share this page:
Follow us:
Task Runner