Object-oriented Parser System
v3.6

gl
Class Tree

Object
  extended by Gl.Tree
      extended by Tree
All Implemented Interfaces:
Serializable

public class Tree
extends Gl.Tree

tree factory to evaluate a Guarded Language program. Each factory method is overridden to substitute the interpreter class. Each branch node class is extended for interpretation.

See Also:
Serialized Form

Nested Class Summary
static class Tree.Add
          tree node class.
static class Tree.AndIf
          tree node class.
static class Tree.Assign
          tree node class.
static class Tree.Deref
          tree node class.
static class Tree.Div
          tree node class.
static class Tree.Eq
          tree node class.
static class Tree.Ge
          tree node class.
static class Tree.Gt
          tree node class.
static interface Tree.Interpreter
          what an interpreter branch node can do.
static class Tree.Le
          tree node class.
static class Tree.Lit
          tree node class.
static class Tree.Loop
          tree node class.
static class Tree.Lt
          tree node class.
static class Tree.Mul
          tree node class.
static class Tree.Ne
          tree node class.
static class Tree.OrIf
          tree node class.
static class Tree.Print
          tree node class.
static class Tree.Rem
          tree node class.
static class Tree.Select
          tree node class.
static class Tree.Sub
          tree node class.
static class Tree.With
          tree node class.
 
Nested classes/interfaces inherited from class Gl.Tree
Gl.Tree.Guard, Gl.Tree.Stmt, Gl.Tree.Var, Gl.Tree.Visit, Gl.Tree.Visitor
 
Constructor Summary
Tree()
           
 
Method Summary
 Tree.Add add(int position, List args)
          factory method.
 Tree.AndIf andif(int position, List args)
          factory method.
 Tree.Assign assign(int position, List args)
          factory method.
 Tree.Deref deref(int position, List args)
          factory method.
 Tree.Div div(int position, List args)
          factory method.
 Tree.Eq eq(int position, List args)
          factory method.
protected static List<Gl.Tree.Guard> evalGuards(List guards, Env env)
          return true guards.
protected static void evalRandomStmts(List<Gl.Tree.Guard> guards, Env env)
          evaluate tail of randomly selected guard.
protected static void evalStmts(List stmts, int offset, Env env)
          evaluate tail of list.
 Tree.Ge ge(int position, List args)
          factory method.
 Tree.Gt gt(int position, List args)
          factory method.
 Tree.Le le(int position, List args)
          factory method.
 Tree.Loop loop(int position, List args)
          factory method.
 Tree.Lt lt(int position, List args)
          factory method.
static void main(String[] args)
          main program to compile and interpret a Guarded Language program.
 Tree.Mul mul(int position, List args)
          factory method.
 Tree.Ne ne(int position, List args)
          factory method.
 Tree.Lit number(int position, List args)
          factory method.
 Tree.OrIf orif(int position, List args)
          factory method.
 Tree.Print print(int position, List args)
          factory method.
 Tree.Rem rem(int position, List args)
          factory method.
 Tree.Select select(int position, List args)
          factory method.
 Tree.Sub sub(int position, List args)
          factory method.
 Tree.With with(int position, List args)
          factory method.
 
Methods inherited from class Gl.Tree
add, guard, remove, stmt, var
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tree

public Tree()
Method Detail

evalGuards

protected static List<Gl.Tree.Guard> evalGuards(List guards,
                                                Env env)
return true guards.


evalRandomStmts

protected static void evalRandomStmts(List<Gl.Tree.Guard> guards,
                                      Env env)
evaluate tail of randomly selected guard.


evalStmts

protected static void evalStmts(List stmts,
                                int offset,
                                Env env)
evaluate tail of list.


main

public static void main(String[] args)
                 throws Exception
main program to compile and interpret a Guarded Language program.

Throws:
Exception

select

public Tree.Select select(int position,
                          List args)
factory method.

Overrides:
select in class Gl.Tree

loop

public Tree.Loop loop(int position,
                      List args)
factory method.

Overrides:
loop in class Gl.Tree

print

public Tree.Print print(int position,
                        List args)
factory method.

Overrides:
print in class Gl.Tree

with

public Tree.With with(int position,
                      List args)
factory method.

Overrides:
with in class Gl.Tree

orif

public Tree.OrIf orif(int position,
                      List args)
factory method.

Overrides:
orif in class Gl.Tree

andif

public Tree.AndIf andif(int position,
                        List args)
factory method.

Overrides:
andif in class Gl.Tree

eq

public Tree.Eq eq(int position,
                  List args)
factory method.

Overrides:
eq in class Gl.Tree

ne

public Tree.Ne ne(int position,
                  List args)
factory method.

Overrides:
ne in class Gl.Tree

lt

public Tree.Lt lt(int position,
                  List args)
factory method.

Overrides:
lt in class Gl.Tree

le

public Tree.Le le(int position,
                  List args)
factory method.

Overrides:
le in class Gl.Tree

gt

public Tree.Gt gt(int position,
                  List args)
factory method.

Overrides:
gt in class Gl.Tree

ge

public Tree.Ge ge(int position,
                  List args)
factory method.

Overrides:
ge in class Gl.Tree

add

public Tree.Add add(int position,
                    List args)
factory method.

Overrides:
add in class Gl.Tree

sub

public Tree.Sub sub(int position,
                    List args)
factory method.

Overrides:
sub in class Gl.Tree

mul

public Tree.Mul mul(int position,
                    List args)
factory method.

Overrides:
mul in class Gl.Tree

div

public Tree.Div div(int position,
                    List args)
factory method.

Overrides:
div in class Gl.Tree

rem

public Tree.Rem rem(int position,
                    List args)
factory method.

Overrides:
rem in class Gl.Tree

number

public Tree.Lit number(int position,
                       List args)
factory method.

Overrides:
number in class Gl.Tree

deref

public Tree.Deref deref(int position,
                        List args)
factory method.

Overrides:
deref in class Gl.Tree

assign

public Tree.Assign assign(int position,
                          List args)
factory method.

Overrides:
assign in class Gl.Tree


(c) 2008 Axel T. Schreiner