com.inxar.syntacs.grammar.regular
Class REUnion

java.lang.Object
  |
  +--com.inxar.syntacs.grammar.regular.REUnion
All Implemented Interfaces:
Cloneable, RegularExpression, Union

public class REUnion
extends Object
implements Union

Standard Union implementation.


Constructor Summary
REUnion()
          Constructs the REUnion.
 
Method Summary
 Union addAllele(RegularExpression e)
          Adds the given RegularExpression to the list of alternatives.
 int alleles()
          Returns the number of alternatives.
 Object clone()
          See the general explanation of clone() given above.
 void follow()
          Triggers the process of computing the follow sets.
 RegularExpression getAllele(int index)
           
 RegularExpression[] getAlleles()
          Returns the list of alternatives which are currently in the set as an array.
 IntSet getFirstSet()
          Returns the IntSet of Intervals which are visible at the logical beginning of the the expression.
 IntSet getLastSet()
          Returns the IntSet of Intervals which are visible at the logical end of the the expression.
 boolean isNullable()
          Returns true if this RegularExpression either *is* Epsilon or derives it.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REUnion

public REUnion()
Constructs the REUnion.
Method Detail

addAllele

public Union addAllele(RegularExpression e)
Description copied from interface: Union
Adds the given RegularExpression to the list of alternatives. If the alternative is already in the set of alternatives, no action is taken. This method returns the Union simply to support a coding style reminiscent of java.lang.StringBuffer.
Specified by:
addAllele in interface Union

toString

public String toString()
Overrides:
toString in class Object

isNullable

public boolean isNullable()
Description copied from interface: RegularExpression
Returns true if this RegularExpression either *is* Epsilon or derives it.
Specified by:
isNullable in interface RegularExpression

getFirstSet

public IntSet getFirstSet()
Description copied from interface: RegularExpression
Returns the IntSet of Intervals which are visible at the logical beginning of the the expression.
Specified by:
getFirstSet in interface RegularExpression

getLastSet

public IntSet getLastSet()
Description copied from interface: RegularExpression
Returns the IntSet of Intervals which are visible at the logical end of the the expression.
Specified by:
getLastSet in interface RegularExpression

follow

public void follow()
Description copied from interface: RegularExpression
Triggers the process of computing the follow sets.
Specified by:
follow in interface RegularExpression

alleles

public int alleles()
Description copied from interface: Union
Returns the number of alternatives.
Specified by:
alleles in interface Union

getAllele

public RegularExpression getAllele(int index)

getAlleles

public RegularExpression[] getAlleles()
Description copied from interface: Union
Returns the list of alternatives which are currently in the set as an array.
Specified by:
getAlleles in interface Union

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: RegularExpression
See the general explanation of clone() given above.
Specified by:
clone in interface RegularExpression