edu.toronto.cs.expr
Class ExprFactoryImpl

java.lang.Object
  extended by edu.toronto.cs.expr.ExprFactoryImpl
All Implemented Interfaces:
ExprFactory

public class ExprFactoryImpl
extends java.lang.Object
implements ExprFactory


Constructor Summary
ExprFactoryImpl()
           
 
Method Summary
 Expr cannonize(Expr expr)
          Returns a cannonical version of an expression
 Expr falseExpr()
          Returns the 'false' constant
 Expr intExpr(int num)
          returns an integer expression
static void main(java.lang.String[] args)
          test code
 Expr op(Operator op)
          Expression with an arbitrary operator
 Expr ratExpr(int n, int d)
           
 Expr trueExpr()
          Returns the 'true' constant
 Expr var(java.lang.String name)
          expression with a nullary opertor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExprFactoryImpl

public ExprFactoryImpl()
Method Detail

intExpr

public Expr intExpr(int num)
Description copied from interface: ExprFactory
returns an integer expression

Specified by:
intExpr in interface ExprFactory
Parameters:
num - an int value
Returns:
an Expr value

ratExpr

public Expr ratExpr(int n,
                    int d)

trueExpr

public Expr trueExpr()
Description copied from interface: ExprFactory
Returns the 'true' constant

Specified by:
trueExpr in interface ExprFactory
Returns:
an Expr value

falseExpr

public Expr falseExpr()
Description copied from interface: ExprFactory
Returns the 'false' constant

Specified by:
falseExpr in interface ExprFactory
Returns:
an Expr value

var

public Expr var(java.lang.String name)
Description copied from interface: ExprFactory
expression with a nullary opertor

Specified by:
var in interface ExprFactory
Parameters:
name - a String value
Returns:
an Expr value

op

public Expr op(Operator op)
Description copied from interface: ExprFactory
Expression with an arbitrary operator

Specified by:
op in interface ExprFactory
Parameters:
op - an Opeartor value
Returns:
an Expr value

cannonize

public Expr cannonize(Expr expr)
Description copied from interface: ExprFactory
Returns a cannonical version of an expression

Specified by:
cannonize in interface ExprFactory
Parameters:
expr - an Expr value
Returns:
an Expr value

main

public static void main(java.lang.String[] args)
test code

Parameters:
args - a String[] value