|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.parser.Result
xtc.parser.SemanticValue
public final class SemanticValue
A semantic value.
| Field Summary | |
|---|---|
ParseError |
error
The embedded parse error. |
java.lang.Object |
value
The actual value. |
| Fields inherited from class xtc.parser.Result |
|---|
index |
| Constructor Summary | |
|---|---|
SemanticValue(java.lang.Object value,
int index)
Create a new semantic value. |
|
SemanticValue(java.lang.Object value,
int index,
ParseError error)
Create a new semantic value. |
|
| Method Summary | ||
|---|---|---|
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 error)
Select the more specific parse error. |
|
ParseError |
select(ParseError error,
int index)
Select the more specific parse error. |
|
|
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 java.lang.Object value
public final ParseError error
null; instead, a dummy parse error should be used.
| Constructor Detail |
|---|
public SemanticValue(java.lang.Object value,
int index)
value - The value.index - The index into the rest of the input.
public SemanticValue(java.lang.Object value,
int index,
ParseError error)
value - The value.index - The index into the rest of the input.error - The embedded parse error.| Method Detail |
|---|
public boolean hasValue()
Result
hasValue in class Resulttrue if this result has a value.public boolean hasValue(java.lang.String s)
Resultnull.
hasValue in class Results - The string value.
true if this result has the specified string
value.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()
Result
semanticValue in class Resultpublic ParseError parseError()
Resultdummy parse
error.
parseError in class Resultpublic ParseError select(ParseError error)
Result
select in class Resulterror - The error.
public ParseError select(ParseError error,
int index)
Result
select in class Resulterror - The error.index - The index.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||