Concrete Syntax Tree - What is that ?



A concrete syntax tree (parse tree) is the syntax tree that stores the full representation of the parsed document.

It's is a low level representation of the parsed source in the structure defined by a grammar description. It should be possible to rewrite the original document for a concrete syntax tree.

It represents every detail (such as white-space in white-space insensitive languages)

This is the first tree build by a parser.

As a second pass, the parser would create an abstract syntax tree that holds only syntactic information. For instance, for literal:

  • the enclosing character (ie a single or double quote) would not be saved
  • neither it's location in the document

Documentation / Reference

Recommended Pages
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...
Compiler - Semantics Analysis

Semantic analysis is the phase in which the compiler: adds semantic information to the parse tree builds the symbol table. This phase performs semantic checks such as: type checking (checking...
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...
Card Puncher Data Processing
Idea Plugin dev - PSI File (Program Structure Interface - Tree Structured Content)

A PSI (Program Structure Interface) file is the root of a structure representing the contents of a file as a hierarchy of elements in a particular programming language. It represents a hierarchy of PSI...
Grammar Graphic Representation
Language - (Syntax|Structural) Tree

The graphical representations of a grammar are called Syntax or Structural tree. There is actually two well known tree: the concrete syntax tree (CST) (or parse tree). A low level representation of...
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...
Ast Explorer Php
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...

Share this page:
Follow us:
Task Runner