DapAST

The Basis

Alma2 derived from Alma system. Alma stores the information of the program in a DAST (Decorated Abstract Syntax Tree), which derives, in its turn, from the AST (Abstract Syntax Tree). Figure below shows the main differences between the AST and the DAST and how the second can be constructed from the first.
A DAST stores the meaning of the program, resorting to semantic patterns. These patterns represent language constructs, which are concepts present in every programming language. Regarding the Figure, the AST (the leftmost tree) represents the program, resorting to the essential syntactic constructs of the language. On the other hand, the DAST (the rightmost tree) also represents the program, but uses the generic semantics underneath the syntactic constructs, to explain the meaning of the program. For example: a = 2 means that the variable a will be assigned the constant 2. AST into DAST


Then this structure is traversed in a top-down, depth-first strategy, and each non-processed leaf node is processed. For that, there are used databases of rules for rewriting the tree, and creating the visualizations of the program domain. The visualization created resorting to these rules is based on a tree representing the semantics and the control flow of the program.

The New Concept

The DAST structure is not enough to create animation of the problem domain concepts. This way we extended it and created a new concept: the DapAST (Decorated, with animation patterns, Abstract Syntax Tree).
In a DapAST the semantic patterns, that decorated the AST to generate a DAST, are incremented with extra information attributes, and are called Animation Nodes. This extra information consists of images to represent the concepts in the problem domain; and animation functions to create the animation of the concepts by relating the images with each other and with the dynamic information extracted from the program interpretation. The information added to the semantic patterns, constituting the animation nodes, is called Animation Patterns. Figure below shows the DapAST resulting from the decoration of the DAST with several animation patterns. The nodes in orange (darker ones) are the animation nodes, and the clouds are the representation of the animation patterns.
A single animation pattern is composed of one image (called Actor) and one animation function. But the animation nodes are not restricted to have only one animation pattern associated; instead they have a list of animation patterns. The animation patterns in this list can repeat the actors and the animation function. The way the animation nodes are configured is responsibility of the person who defines the visualization of the problem domain for the DSL.

DapAST


This structure is traversed in a way similar to that used to traverse a DAST. But this time, the nodes, in case of being animation nodes and are not processed yet, are processed resorting to the same database of rules and a new one, Animation Rules, which will create the animation of the actors (that is, the objects of the real world).

NEXT DETAIL