dRegAut
Class RegExp

java.lang.Object
  extended by dRegAut.RegExp

public class RegExp
extends Object

Regular expression. [Martin, Def. 3.1]

We use the following special notation for regular expressions:


Constructor Summary
RegExp(String string, Alphabet alphabet)
          Constructs a regular expression from a string.
 
Method Summary
 void simplify()
          Simplifies this regular expression (using some very simple rewrite rules).
 NFA toNFA()
          Converts this regular expression to an NFA.
 String toString()
          Returns a string representation of this regular expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegExp

public RegExp(String string,
              Alphabet alphabet)
       throws IllegalArgumentException
Constructs a regular expression from a string. [Martin, Def. 3.1]

Parameters:
string - string representation of regular expression
alphabet - the alphabet
Throws:
IllegalArgumentException - if an alphabet symbol in the string is not in the alphabet or the string is not a syntactically correct regular expression
Method Detail

simplify

public void simplify()
Simplifies this regular expression (using some very simple rewrite rules).


toNFA

public NFA toNFA()
Converts this regular expression to an NFA. [Martin, Th. 3.25]


toString

public String toString()
Returns a string representation of this regular expression. The resulting string may contain superfluous parentheses.

Overrides:
toString in class Object


Copyright © 2003-2012 Anders Møller.