com.inxar.syntacs.grammar.regular
Class RECharClass

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

public class RECharClass
extends Object
implements CharClass

Standard CharClass implementation.


Constructor Summary
RECharClass(REGrammar grammar)
          Constructs the RECharClass on the given REGrammar.
 
Method Summary
 void add(char c)
          Adds the given char to the list of alternatives.
 void add(char lo, char hi)
          Adds the given range of characters to the character class.
 Object clone()
          See the general explanation of clone() given above.
 void follow()
          Triggers the process of computing the follow sets.
 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 isNegated()
          True if this is a negated character class
 void isNegated(boolean value)
          Sets the negate flag
 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

RECharClass

public RECharClass(REGrammar grammar)
Constructs the RECharClass on the given REGrammar.
Method Detail

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

isNegated

public boolean isNegated()
True if this is a negated character class
Specified by:
isNegated in interface CharClass

isNegated

public void isNegated(boolean value)
Sets the negate flag
Specified by:
isNegated in interface CharClass

add

public void add(char c)
Description copied from interface: CharClass
Adds the given char to the list of alternatives.
Specified by:
add in interface CharClass

add

public void add(char lo,
                char hi)
Description copied from interface: CharClass
Adds the given range of characters to the character class. For example, 'a-z' would be encoded by a the call CharClass.add('a','z');
Specified by:
add in interface CharClass

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