Tree Description Language (TreeDL) is a computer language for description of strictly-typed
tree data structuresIn computer science, a tree is a widely-used data structure that emulates a hierarchical tree structure with a set of linked nodes.Mathematically, it is not a tree, but an arborescence: an acyclic connected graph where each node has zero or more children nodes and at most one parent node...
and operations on them. The main use of TreeDL is in the development of language-oriented tools (
compilerA compiler is a computer program that transforms source code written in a computer language into another computer language...
s, translators, etc) for the description of a structure of
abstract syntax treeIn computer science, an abstract syntax tree , or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a certain programming language. Each node of the tree denotes a construct occurring in the source code...
s.
Tree description can be used as
- a documentation of interface between parser and other subsystems;
- a source for generation of data types representing a tree in target programming languages;
- a source for generation of various support code: visitor
In object-oriented programming and software engineering, the visitor design pattern is a way of separating an algorithm from an object structure upon which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying those...
s, walkers, factoriesIn object-oriented computer programming, a factory object is an object for creating other objects. It is an abstraction of a constructor, and can be used to implement various allocation schemes, such as the singleton pattern....
, etc.
TreeDL can be used with any parser generator that allows custom actions during parsing (for example,
ANTLRIn computer based language recognition, ANother Tool for Language Recognition is the name of a parser generator that uses LL parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set , first developed in 1989, and is under active development...
,
JavaCCJavaCC is an open source parser generator for the Java programming language. JavaCC is similar to Yacc in that it generates a parser for a formal grammar provided in EBNF notation, except the output is Java source code...
).
Tree description lists the node types allowed in a tree.
Discussion
Ask a question about 'TreeDL'
Start a new discussion about 'TreeDL'
Answer questions from other users
|
Tree Description Language (TreeDL) is a computer language for description of strictly-typed
tree data structuresIn computer science, a tree is a widely-used data structure that emulates a hierarchical tree structure with a set of linked nodes.Mathematically, it is not a tree, but an arborescence: an acyclic connected graph where each node has zero or more children nodes and at most one parent node...
and operations on them. The main use of TreeDL is in the development of language-oriented tools (
compilerA compiler is a computer program that transforms source code written in a computer language into another computer language...
s, translators, etc) for the description of a structure of
abstract syntax treeIn computer science, an abstract syntax tree , or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a certain programming language. Each node of the tree denotes a construct occurring in the source code...
s.
Tree description can be used as
- a documentation of interface between parser and other subsystems;
- a source for generation of data types representing a tree in target programming languages;
- a source for generation of various support code: visitor
In object-oriented programming and software engineering, the visitor design pattern is a way of separating an algorithm from an object structure upon which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying those...
s, walkers, factoriesIn object-oriented computer programming, a factory object is an object for creating other objects. It is an abstraction of a constructor, and can be used to implement various allocation schemes, such as the singleton pattern....
, etc.
TreeDL can be used with any parser generator that allows custom actions during parsing (for example,
ANTLRIn computer based language recognition, ANother Tool for Language Recognition is the name of a parser generator that uses LL parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set , first developed in 1989, and is under active development...
,
JavaCCJavaCC is an open source parser generator for the Java programming language. JavaCC is similar to Yacc in that it generates a parser for a formal grammar provided in EBNF notation, except the output is Java source code...
).
Language overview
Tree description lists the node types allowed in a 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 syntaxIn computer science, higher-order abstract syntax is a technique for the representation of abstract syntax trees for languages with variable binders.-Relation to first-order abstract syntax:...
).
Operations over a tree are defined as multimethods. Advantages of this approach are described in the article
Treecc: An Aspect-Oriented Approach to Writing Compilers
Tree descriptions support inheritance to allow modularity and reuse of base language tree descriptions for language extensions.
See also
- ANTLR
In computer based language recognition, ANother Tool for Language Recognition is the name of a parser generator that uses LL parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set , first developed in 1989, and is under active development...
- parser generator that offers a different approach to tree processing: tree grammars.
- SableCC
SableCC is an open source compiler generator in Java. It is licensed under the GNU Lesser General Public License.SableCC includes the following features:...
- parser generator that generates strictly-typed abstract syntax treeIn computer science, an abstract syntax tree , or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a certain programming language. Each node of the tree denotes a construct occurring in the source code...
s.
External links