org.inxar.syntacs.grammar.regular
Interface RegularSet

All Known Implementing Classes:
REGrammar

public interface RegularSet

The RegularSet interface is an optimized version of the RegularGrammar object generally used by DFA construction algorithms. By supplying a 'first set' and acting as a repository for Interval object accessible by id, a DFA can be constructed.


Method Summary
 int getID()
          Returns the globally allocated ID for this RegularSet.
 Interval getInterval(int id)
          Returns the Interval by the given id.
 String getName()
          Returns the name of this RegularSet.
 RegularGrammar getRegularGrammar()
          Returns the parent RegularGrammar.
 IntSet getStart()
          Returns the IntSet of intervals which are visible from some abstract initial state.
 Token getToken(int id)
          Returns the Token with the given id.
 int intervals()
          Returns the number of Intervals used by the grammar.
 int tokens()
          Returns the number of tokens in the RegularSet.
 

Method Detail

getRegularGrammar

public RegularGrammar getRegularGrammar()
Returns the parent RegularGrammar.

getID

public int getID()
Returns the globally allocated ID for this RegularSet. This is useful for lexer construction algorithms which use "start states" or multiple DFA's and switch between them.

getName

public String getName()
Returns the name of this RegularSet. This is generally relevant only when PushdownRegularGrammars are being created.

getInterval

public Interval getInterval(int id)
Returns the Interval by the given id.

intervals

public int intervals()
Returns the number of Intervals used by the grammar.

getStart

public IntSet getStart()
Returns the IntSet of intervals which are visible from some abstract initial state. This is the first set over the collection of tokens (each with its regular expression). Therefore, this set represents the first state in a DFA.

getToken

public Token getToken(int id)
Returns the Token with the given id.

tokens

public int tokens()
Returns the number of tokens in the RegularSet.