|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metasyntactic.math.automata.AbstractRegularExpression
Class implementing base funcitonality for a RegularExpression. Extendors
must only implement equals(Object)
, toString()
and
hashCode()
.
Nested Class Summary | |
protected static class |
AbstractRegularExpression.NFAState
Convenience class used in the implementations of toNondeterministicFiniteAutomata() |
Field Summary | |
protected boolean |
complement
|
Constructor Summary | |
AbstractRegularExpression()
|
Method Summary | |
boolean |
accept(java.util.Iterator i)
|
RegularExpression |
complement()
Complements the language that this regular expression accepts. |
RegularExpression |
concatenate(RegularExpression regexp)
Let N1 = (Q1, Σ, δ1, q1, F1) recognize A1, and N2, Σ, δ2, q2, F2) recognize A2. |
boolean |
equals(java.lang.Object o)
|
abstract boolean |
equals(RegularExpression o)
|
boolean |
equivalent(RegularExpression r2)
|
protected static java.lang.String |
escapedRegexpChars(java.lang.String unsafe)
When we output a regular expression as a string we have to take care as to how it is formatted. |
protected RegularExpression |
internalConcatenate(RegularExpression regexp)
|
protected RegularExpression |
internalStar()
|
protected RegularExpression |
internalUnion(RegularExpression regexp)
|
protected static java.lang.String |
parenthesizedRegexp(java.lang.String unsafe)
|
protected static java.lang.String |
parenthesizedRegexp(java.lang.String unsafe,
boolean parenSingleChars)
|
protected static boolean |
properlyParenthesized(java.lang.String string)
|
RegularExpression |
star()
Let N1 = (Q1, Σ, δ1, q1, F1) recognize A1. |
RegularExpression |
union(RegularExpression regexp)
Let N1 = (Q1, Σ, δ1, q1, F1) recognize A1, and N2 = (Q2, Σ, δ2, q2, F2) recognize A2. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.metasyntactic.math.automata.RegularExpression |
hashCode, toNondeterministicFiniteAutomata, toString |
Field Detail |
protected boolean complement
Constructor Detail |
public AbstractRegularExpression()
Method Detail |
protected RegularExpression internalConcatenate(RegularExpression regexp)
protected RegularExpression internalUnion(RegularExpression regexp)
protected RegularExpression internalStar()
public boolean accept(java.util.Iterator i)
accept
in interface FiniteAutomata
i
- A string over some alphabet Σ
true
if this machine accepts wpublic RegularExpression union(RegularExpression regexp)
RegularExpression
Construct N = (Q, Σ, δ, q0, F) to recognize A1∪A2.
union
in interface RegularExpression
public RegularExpression concatenate(RegularExpression regexp)
RegularExpression
Construct N = (Q, Σ, δ, q1, F2) to recognize A1⋅A2.
concatenate
in interface RegularExpression
public RegularExpression star()
RegularExpression
star
in interface RegularExpression
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public abstract boolean equals(RegularExpression o)
equals
in interface RegularExpression
protected static final java.lang.String escapedRegexpChars(java.lang.String unsafe)
protected static final java.lang.String parenthesizedRegexp(java.lang.String unsafe)
protected static final java.lang.String parenthesizedRegexp(java.lang.String unsafe, boolean parenSingleChars)
protected static final boolean properlyParenthesized(java.lang.String string)
public RegularExpression complement()
RegularExpression
complement
in interface RegularExpression
public boolean equivalent(RegularExpression r2)
equivalent
in interface RegularExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |