org.extex.ocpware.compiler.expression
Class Expression

java.lang.Object
  extended by org.extex.ocpware.compiler.expression.Expression

public class Expression
extends java.lang.Object

This class represents an expression.

Version:
$Revision$
Author:
Gerd Neugebauer

Constructor Summary
Expression()
          Creates a new object.
 
Method Summary
 void compile(CompilerState cs)
          Compile an expression in ΩCP instructions and store them in a compiler state.
 java.lang.String getLeftState()
          Getter for leftState.
 java.util.List<Expr> getPushBack()
          Getter for pushBack.
 Right getRight()
          Getter for right.
 RightState getState()
          Getter for state.
 java.util.List<Left> getTotalLeft()
          Getter for totalLeft.
static Expression parse(ParserStream stream)
          Parse an expression.
static java.util.List<Expression> parseExpressions(ParserStream stream)
          Parse a list of expressions.
 void setLeftState(java.lang.String leftState)
          Setter for leftState.
 void setPushBack(java.util.List<Expr> pushBack)
          Setter for pushBack.
 void setRight(Right right)
          Setter for right item.
 void setState(RightState state)
          Setter for state.
 void setTotalLeft(java.util.List<Left> totalLeft)
          Setter for totalLeft.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Creates a new object.

Method Detail

parse

public static Expression parse(ParserStream stream)
                        throws java.io.IOException,
                               SyntaxException
Parse an expression.

Parameters:
stream - the input stream
Returns:
the list of expressions found
Throws:
java.io.IOException - in case of an I/O error
SyntaxException - in case of a syntax error

parseExpressions

public static java.util.List<Expression> parseExpressions(ParserStream stream)
                                                   throws java.io.IOException,
                                                          SyntaxException
Parse a list of expressions.

Parameters:
stream - the input stream
Returns:
the list of expressions found
Throws:
java.io.IOException - in case of an I/O error
SyntaxException - in case of a syntax error

compile

public void compile(CompilerState cs)
             throws ArgmentTooBigException,
                    java.io.IOException,
                    IllegalOpcodeException,
                    StateNotDefinedException,
                    TableNotDefinedException,
                    AliasNotDefinedException
Compile an expression in ΩCP instructions and store them in a compiler state.

Parameters:
cs - the compiler state
Throws:
AliasNotDefinedException - in case that no matching alias is known for a symbolic table reference
ArgmentTooBigException - in case that an argument is encountered which does not fit into two bytes
java.io.IOException - in case of an I/O error
StateNotDefinedException
TableNotDefinedException - in case that no matching table is known for a symbolic table reference
IllegalOpcodeException - in case of an illegal op code

getLeftState

public java.lang.String getLeftState()
Getter for leftState.

Returns:
the leftState

getPushBack

public java.util.List<Expr> getPushBack()
Getter for pushBack.

Returns:
the pushBack

getRight

public Right getRight()
Getter for right.

Returns:
the right

getState

public RightState getState()
Getter for state.

Returns:
the state

getTotalLeft

public java.util.List<Left> getTotalLeft()
Getter for totalLeft.

Returns:
the totalLeft

setLeftState

public void setLeftState(java.lang.String leftState)
Setter for leftState.

Parameters:
leftState - the leftState to set

setPushBack

public void setPushBack(java.util.List<Expr> pushBack)
Setter for pushBack.

Parameters:
pushBack - the pushBack to set

setRight

public void setRight(Right right)
Setter for right item.

Parameters:
right - the right item to set

setState

public void setState(RightState state)
Setter for state.

Parameters:
state - the state to set

setTotalLeft

public void setTotalLeft(java.util.List<Left> totalLeft)
Setter for totalLeft.

Parameters:
totalLeft - the totalLeft to set

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()