org.inxar.syntacs.grammar.regular
Interface Interval

All Superinterfaces:
Cloneable, RegularExpression
All Known Subinterfaces:
ExpressionTerminator
All Known Implementing Classes:
REInterval

public interface Interval
extends RegularExpression

The Interval interface abstracts a contiguous bounded block of characters. Intervals take the place of normal input characters since it makes it easier to throw around and otherwise manipulate large sets of characters. For example, if we want to represent the ascii character charset, we chould use 256 individual char objects, or one Interval object.


Method Summary
 IntSet getFollowSet()
          Returns the "follow set", or the Intervals (input) that may occur directly after encountering this one.
 int getID()
          Returns the globally allocated ID for this Interval.
 int hi()
          Returns the high char in the Interval.
 boolean includes(int c)
          Returns true if the given char (as an int) is within the bounds of this character set.
 boolean isTerminator()
          Returns the RTTI specifically to check if this Interval is an instanceof ExpressionTerminator.
 IntIterator iterator()
          Returns an IntIterator over the chars named by this Interval of characters.
 int lo()
          Returns the low char in the Interval.
 
Methods inherited from interface org.inxar.syntacs.grammar.regular.RegularExpression
clone, follow, getFirstSet, getLastSet, isNullable
 

Method Detail

iterator

public IntIterator iterator()
Returns an IntIterator over the chars named by this Interval of characters.

isTerminator

public boolean isTerminator()
Returns the RTTI specifically to check if this Interval is an instanceof ExpressionTerminator. This method is used by some DFA algorithms to find final NFA states in a DFA state. It is faster than the instanceof operator.

includes

public boolean includes(int c)
Returns true if the given char (as an int) is within the bounds of this character set.

lo

public int lo()
Returns the low char in the Interval.

hi

public int hi()
Returns the high char in the Interval.

getID

public int getID()
Returns the globally allocated ID for this Interval.

getFollowSet

public IntSet getFollowSet()
Returns the "follow set", or the Intervals (input) that may occur directly after encountering this one.