com.inxar.syntacs.translator.regexp
Class Regexp

java.lang.Object
  |
  +--com.inxar.syntacs.translator.regexp.Regexp
All Implemented Interfaces:
Symbol

public abstract class Regexp
extends Object
implements Symbol

Base class for all regular expressions in the com.inxar.syntacs.translator.regexp package used during parsing. A Regexp is notable for its ability to be transformed into a org.inxar.syntacs.grammar.regular.RegularExpression, which is the representation used by DFA construction algorithms.


Field Summary
static int ATOM
           
static int CHARCLASS
           
static int CLOSURE
           
static int CONCAT
           
static int EPSILON
           
static int GROUP
           
static int OPTIONAL
           
static int PCLOSURE
           
static int RANGE
           
static int UNION
           
 
Method Summary
 int getRegexpType()
           
 int getSymbolType()
          Returns the symbol type.
 void setRegexpType(int regexpType)
           
 void setSymbolType(int symbolType)
          Sets the symbol type.
static Regexp toConcat(String s)
           
abstract  RegularExpression toRegularExpression(RegularGrammar g)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSILON

public static final int EPSILON

ATOM

public static final int ATOM

CLOSURE

public static final int CLOSURE

PCLOSURE

public static final int PCLOSURE

OPTIONAL

public static final int OPTIONAL

GROUP

public static final int GROUP

CHARCLASS

public static final int CHARCLASS

CONCAT

public static final int CONCAT

UNION

public static final int UNION

RANGE

public static final int RANGE
Method Detail

getRegexpType

public int getRegexpType()

setRegexpType

public void setRegexpType(int regexpType)

getSymbolType

public int getSymbolType()
Description copied from interface: Symbol
Returns the symbol type.
Specified by:
getSymbolType in interface Symbol

setSymbolType

public void setSymbolType(int symbolType)
Description copied from interface: Symbol
Sets the symbol type. This method is necessary because the design of the shift-reduce parser interacts with the symbol such that it automatically sets the type of the symbol returned to the parser after a reduction to the correct nonterminal (such that the user doesn't have to worry about it).
Specified by:
setSymbolType in interface Symbol

toRegularExpression

public abstract RegularExpression toRegularExpression(RegularGrammar g)

toConcat

public static Regexp toConcat(String s)