Package org.apache.flex.compiler.tree

This package and its subpackages contain classes and interfaces related to abstract syntax trees.

See: Description

Package org.apache.flex.compiler.tree Description

This package and its subpackages contain classes and interfaces related to abstract syntax trees.

An abstract syntax tree or AST represents almost every detail of a source file in a hierarchical structure that reflects the logical structure of the source language. Each node in an AST is a type of IASNode.

The information stored in each node is minimal and unimportant, such as the name of an identifier or keyword, or the text of a string literal. It is the many different node types, and the many ways that the nodes can be arranged -- in other words, the tree shape -- that contain the semantics of the AST.

Each AST node stores location information about what source file it was in and the offsets where it starts and ends, which is useful for IDEs. For command-line error reporting, and for the code generation of debug opcodes, nodes also store line and column information. Deriving line and column from starting offset is too slow for code generation.

In order to allow an IDE to efficiently search an AST for the node containing a particular offset, the nodes of an AST must obey the following rules regarding location information:

The immediate contents of this package is ASTNodeID, an enum containing a node ID for every kind of AST node. The node ID is used to identify nodes in the .jbg files that create the code generator's BURM (Bottom-Up Rewrite Machine).

See the org.apache.flex.compiler.tree.as and org.apache.flex.compiler.tree.mxml subpackages for more information about AS and MXML trees.

Copyright © 2016 The Apache Software Foundation. All rights reserved.