TreeDL

TreeDL

Tree Description Language (TreeDL) is a computer language for description of strictly-typed tree data structures and operations on them. The main use of TreeDL is in the development of language-oriented tools (compilers, translators, etc) for the description of a structure of abstract syntax trees.

Tree description can be used as
* a documentation of interface between parser and other subsystems;
* a source for generation of data types representing tree in target programming language;
* a source for generation of various support code: visitors, walkers, factories, etc.

TreeDL can be used with any parser generator that allows custom actions during parsing (for example, ANTLR, JavaCC).

Language overview

Tree description lists node types allowed in tree. Node types support single inheritance. Node types have children and attributes. Children must be of defined node type. Attributes may be of primitive type (numeric, string, boolean), enum type or node type. Attributes are used to store literals during tree construction and additional information gathered during tree analysis (for example, links between reference and definition, to represent higher-order abstract syntax).

Operations over tree are defined as multimethods. Advantages of this approach described in the article [http://www.southern-storm.com.au/treecc_essay.html Treecc: An Aspect-Oriented Approach to Writing Compilers]

Tree descriptions support inheritance to allow modularity and reuse of base language tree description for language extensions.

See also

* ANTLR - parser generator that offers different approach to tree processing: tree grammars.
* SableCC - parser generator that generates strictly-typed abstract syntax trees.

External links

* [http://treedl.org TreeDL home]
* [http://treedl.sourceforge.net old TreeDL home]
* [http://www.southern-storm.com.au/treecc.html treecc]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Abstract syntax tree — In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the syntax of some source code (that has been written in a programming language). Each node of the tree denotes a construct occurring in the… …   Wikipedia

  • Árbol de sintaxis abstracta — En ciencias de la computación, un árbol de sintaxis abstracta (AST), o simplemente un árbol de sintaxis, es una representación de árbol de la estructura sintáctica abstracta (simplificada) del código fuente escrito en cierto lenguaje de… …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”