|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.parser.Result
public abstract class Result
The superclass of all parser results.
| Field Summary | |
|---|---|
int |
index
The index into the parser's memoization table. |
| Constructor Summary | |
|---|---|
Result(int index)
Create a new result with the specified index. |
|
| Method Summary | ||
|---|---|---|
abstract SemanticValue |
createValue(java.lang.Object value,
ParseError error)
Create a semantic value based on this result. |
|
abstract boolean |
hasValue()
Determine whether this result has a value. |
|
abstract boolean |
hasValue(java.lang.String s)
Determine whether this result has the specified string value. |
|
abstract boolean |
hasValueIgnoreCase(java.lang.String s)
Determine whether this result has the specified string value, ignoring case. |
|
abstract ParseError |
parseError()
Get the parse error for this result. |
|
abstract ParseError |
select(ParseError error)
Select the more specific parse error. |
|
abstract ParseError |
select(ParseError error,
int index)
Select the more specific parse error. |
|
abstract
|
semanticValue()
Get the semantic value for this result. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final int index
| Constructor Detail |
|---|
public Result(int index)
index - The index.| Method Detail |
|---|
public abstract boolean hasValue()
true if this result has a value.public abstract boolean hasValue(java.lang.String s)
null.
s - The string value.
true if this result has the specified string
value.public abstract boolean hasValueIgnoreCase(java.lang.String s)
null.
s - The string value.
true if this result has the specified string
value, ignoring case.public abstract <T> T semanticValue()
java.lang.IllegalStateException - Signals that this result does not have a semantic value.public abstract ParseError parseError()
dummy parse
error.
public abstract ParseError select(ParseError error)
error - The error.
public abstract ParseError select(ParseError error,
int index)
error - The error.index - The index.
public abstract SemanticValue createValue(java.lang.Object value,
ParseError error)
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.
value - The actual value.error - The embedded parse error.
java.lang.IllegalStateException - Signals that this result is a
parse error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||