public final class ParseError extends Result
| Modifier and Type | Field and Description |
|---|---|
static ParseError |
DUMMY
The dummy parse error.
|
java.lang.String |
msg
The error message.
|
| Constructor and Description |
|---|
ParseError(java.lang.String msg,
int index)
Create a new parse error.
|
| Modifier and Type | Method and Description |
|---|---|
SemanticValue |
createValue(java.lang.Object value,
ParseError error)
Create a semantic value based on this result.
|
boolean |
hasValue()
Determine whether this result has a value.
|
boolean |
hasValue(java.lang.String s)
Determine whether this result has the specified string value.
|
boolean |
hasValueIgnoreCase(java.lang.String s)
Determine whether this result has the specified string value,
ignoring case.
|
ParseError |
parseError()
Get the parse error for this result.
|
ParseError |
select(ParseError other)
Select the more specific parse error.
|
ParseError |
select(ParseError other,
int index)
Select the more specific parse error.
|
ParseError |
select(java.lang.String msg,
int index)
Select the more specific parse error.
|
<T> T |
semanticValue()
Get the semantic value for this result.
|
public static final ParseError DUMMY
null value.SemanticValue.errorpublic final java.lang.String msg
public ParseError(java.lang.String msg,
int index)
msg - The error message.index - The index for the error location.public boolean hasValue()
Resultpublic boolean hasValue(java.lang.String s)
Resultnull.public boolean hasValueIgnoreCase(java.lang.String s)
Resultnull.hasValueIgnoreCase in class Results - The string value.true if this result has the specified string
value, ignoring case.public <T> T semanticValue()
ResultsemanticValue in class Resultpublic ParseError parseError()
Resultdummy parse
error.parseError in class Resultpublic ParseError select(ParseError other)
Resultpublic ParseError select(ParseError other, int index)
Resultpublic ParseError select(java.lang.String msg, int index)
msg - The error message.index - The index of the parse error.public SemanticValue createValue(java.lang.Object value, ParseError error)
Result
public SemanticValue value(Object value, ParseError error) {
return new SemanticValue(value, index, error);
}
However, for a result that already is a semantic value, a
more sophisticated implementation can avoid creating a new
semantic value if the specified actual value and parse error are
identical to those for this result.createValue in class Resultvalue - The actual value.error - The embedded parse error.Copyright © 2012. All Rights Reserved.