Common type operations for
Rats! ASTs.
This class supports two views on a grammar's generic AST. The first view is dynamically typed, with all generic AST nodes represented by the canonical node type. The second view is statically typed, with all generic AST nodes represented by tuples organized into variants. Either way, this class supports the following types:
- The void type represented by {@link VoidT}.
- The unit type represented by {@link UnitT}.
- Characters represented by an {@link InternalT} with name"char".
- Strings represented by an {@link InternalT} with name"string".
- Tokens represented by an {@link InternalT} with name"token".
- Dynamically typed nodes represented by an {@link InternalT}with name "node".
- Statically typed nodes represented by a {@link VariantT} with{@link TupleT} elements.
- Parse tree annotations represented by an {@link InternalT}with name "formatting".
- Lists represented by an {@link InternalT} with name"list".
- Actions represented by an {@link InternalT} with name"action".
All node types have the {@link Constants#ATT_NODE} attribute; thedynamically typed node representing generic productions also has the {@link Constants#ATT_GENERIC} attribute.
In addition to generic ASTs, this class also supports user-defined types, which must be represented by types that are not listed above.
Concrete subclasses specify the mapping between strings and types. For mapping internal representations back to strings, the void type has name "void", the unit type has name "unit", and the wildcard has name "?".
@author Robert Grimm
@version $Revision: 1.39 $