org.extex.ocpware.compiler.left
Class ChoiceLeft

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Left>
              extended by org.extex.ocpware.compiler.left.ChoiceLeft
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Left>, java.util.Collection<Left>, java.util.List<Left>, java.util.RandomAccess, Left

public class ChoiceLeft
extends java.util.ArrayList<Left>
implements Left

This class represents a list of alternative left items.

Version:
$Revision:6007 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ChoiceLeft()
          Creates a new object.
 
Method Summary
 java.util.List<java.lang.Integer> genLeft(State state, CompilerState cs)
          Compile the left item and add the appropriate instructions to the state.
 java.lang.String toString()
          
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ChoiceLeft

public ChoiceLeft()
Creates a new object.

Method Detail

genLeft

public java.util.List<java.lang.Integer> genLeft(State state,
                                                 CompilerState cs)
                                          throws java.io.IOException,
                                                 ArgmentTooBigException,
                                                 AliasNotDefinedException,
                                                 IllegalOpcodeException
Compile the left item and add the appropriate instructions to the state. As a result a list of indices into the code is returned which should need to be fixed. This fix inserts the position of the code into the places given. Thus it is possible to put destinations for goto statements into the holes.

Specified by:
genLeft in interface Left
Parameters:
state - the current state
cs - the compiler state
Returns:
the list of instructions to fix
Throws:
AliasNotDefinedException - in case that no matching alias is known for a symbolic table reference
java.io.IOException - in case of an I/O error
ArgmentTooBigException - in case that an argument is encountered which does not fit into two bytes
IllegalOpcodeException - in case of an illegal op code
See Also:
Left.genLeft( org.extex.ocpware.compiler.parser.State, CompilerState)

toString

public java.lang.String toString()

Overrides:
toString in class java.util.AbstractCollection<Left>
See Also:
Object.toString()