ant.compiler.ast
Class Tree

java.lang.Object
  extended byant.compiler.ast.Tree
Direct Known Subclasses:
Tree.Assign, Tree.Block, Tree.Call, Tree.DropCommand, Tree.Expression, Tree.Goto, Tree.If, Tree.Label, Tree.MarkCommand, Tree.MoveCommand, Tree.PickUpCommand, Tree.Proc, Tree.Set, Tree.TurnCommand, Tree.UnmarkCommand, Tree.Var

public abstract class Tree
extends java.lang.Object

Super class for all tree AST nodes of the Ant Control Language.

License: GPL

Author:
Bernhard Haumacher

Nested Class Summary
static class Tree.AndExpression
          Tree node representing the construct expression && expression.
static class Tree.Assign
          Tree node representing var = expr; statements.
static class Tree.BinaryExpression
          Tree node representing binary expressions.
static class Tree.Block
          Tree node representing {...} statements.
static class Tree.Call
          Tree node representing foo(arg, ...) statements.
static class Tree.ConditionTest
          Tree node representing the construct Home[Ahead] and so on.
static class Tree.Const
          Tree node representing the construct true|false.
static class Tree.DropCommand
          Tree node representing drop statements.
static class Tree.Expression
          Tree node representing expressions.
static class Tree.FoodTest
          Tree node representing the construct FoundFood.
static class Tree.Goto
          Tree node representing goto label; statements.
static class Tree.If
          Tree node representing if (expr) {...} else {}; statements.
static class Tree.Label
          Tree class for representing labels name: statement;.
static class Tree.MarkCommand
          Tree node representing mark n statements.
static class Tree.MoveCommand
          Tree node representing move statements.
static class Tree.NotExpression
          Tree node representing the construct ! expression.
static class Tree.OrExpression
          Tree node representing the construct expression || expression.
static class Tree.PickUpCommand
          Tree node representing pick statements.
static class Tree.Proc
          Tree node representing proc(var param, ...) {}; statements.
static class Tree.RandomTest
          Tree node representing the construct random(n).
static class Tree.Set
          Tree node representing set var|unset var; statements.
static class Tree.Test
          Tree node representing the construct var.
static class Tree.TurnCommand
          Tree node representing turn Left|Right statements.
static class Tree.UnmarkCommand
          Tree node representing unmark n statements.
static class Tree.Var
          Tree node representing var name; statements.
static interface Tree.Visitor
          Visitor interface that is implemented by all Tree nodes.
static class Tree.WallTest
          Tree node representing the construct HitWall.
 
Field Summary
 Tree parent
           
 
Constructor Summary
Tree()
           
 
Method Summary
 Tree.Block enclosingBlock()
          Finds the enclosing Tree.Block of a tree.
 boolean isChildOf(Tree father)
           
static Tree newNopStatement()
           
abstract  void visit(Tree.Visitor v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

public Tree parent
Constructor Detail

Tree

public Tree()
Method Detail

visit

public abstract void visit(Tree.Visitor v)

enclosingBlock

public Tree.Block enclosingBlock()
Finds the enclosing Tree.Block of a tree. For most statements, this is tree.parent, if the statement is not labeled.


isChildOf

public boolean isChildOf(Tree father)

newNopStatement

public static Tree newNopStatement()