|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectdk.brics.servletvalidator.grammar.Terminal
public final class Terminal
A terminal symbol. A terminal symbol contains a string (typically of length 1 that
it derives. It captures the type of the Σ set in the Grammar. A terminal
can also be a range of characters in which case the range between min and max should not
include >, < or /. In that case it could break the analysis. If the check parameter
in the range constructor is set to true, this property will be cheked.
The CharRangeSplitter can be used to break char ranges
up into a number of char ranges to ensure this invariant.
Terminals are immutable.
| Constructor Summary | |
|---|---|
Terminal(char min,
char max)
Constructs a new Terminal by invoking Terminal(char, char, boolean) with (min, max, false) |
|
Terminal(char min,
char max,
boolean check)
Constructs a new Terminal. |
|
Terminal(String symbol)
Constructs a new Terminal with only 1 symbol, namely that given |
|
Terminal(Terminal t)
Clones the terminal t |
|
| Method Summary | ||
|---|---|---|
void |
accept(GrammarEntityVisitor visitor)
Accepts the given grammar entity visitor in a visitor pattern |
|
boolean |
equals(Object o)
|
|
|
getData()
|
|
char |
getMax()
Returns the maximum character of the terminal range |
|
char |
getMin()
Returns the minimum character of the terminal range |
|
String |
getSymbol()
Returns the symbol if the terminal only has 1 symbol, else return a textual representation of the range. |
|
int |
hashCode()
|
|
boolean |
isEpsilon()
Returns whether this terminal has the language ε. |
|
boolean |
isRange()
Returns whether this terminal represents a range |
|
|
setData(T data)
|
|
String |
toString()
Returns the same as getSymbol() |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Terminal(char min,
char max)
Terminal(char, char, boolean) with (min, max, false)
public Terminal(char min,
char max,
boolean check)
Terminal(String)
min - The minimum character in the rangemax - The maximum character in the rangecheck - whether to check that the ranges do not contain <, > or "public Terminal(String symbol)
symbol - Symbol of the Terminalpublic Terminal(Terminal t)
t - | Method Detail |
|---|
public void accept(GrammarEntityVisitor visitor)
GrammarEntity
accept in interface GrammarEntitypublic boolean equals(Object o)
equals in class Objectpublic <T> T getData()
public char getMax()
public char getMin()
public String getSymbol()
public int hashCode()
hashCode in class Objectpublic boolean isEpsilon()
public boolean isRange()
public <T> T setData(T data)
public String toString()
getSymbol()
toString in class Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||