|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.parser.NumberRangeParser
public class NumberRangeParser
Parser that assembles number range objects from an input string, for example
[1,100]
(-Infinity,Infinity)
[lowerBound",20)
(-Infinity, upperBound]
[1.2,1.2]
(-1.3e-2,1.3e-2)
One can use the parser via the parseString, parseStringToRange
methods. If parseString
is used, symbol names may be specified
for the bounds. Valid symbol names start with a non digit and may contain
letters, digits and "_" . Reserved keywords are ("+" | "-")? "Infinity" and
"NaN" (all case insensititve). If a bound is specified as "NaN", the parser
throws an exception. If parseStringToRange
is used, only
numbers are allowed for the bounds, not symbol names.
NumberRange
Field Summary | |
---|---|
Token |
jj_nt
|
Token |
token
|
NumberRangeParserTokenManager |
token_source
|
Fields inherited from interface com.jstatcom.parser.NumberRangeParserConstants |
---|
CONSTANT, DEFAULT, DELIM, DIGIT, EOF, EOL, FLOAT, INTEGER, LEFT_BRACKET, LETTER, MINUS, NAN, NEG_INF, POS_INF, RIGHT_BRACKET, SYMBOL_NAME, tokenImage |
Constructor Summary | |
---|---|
NumberRangeParser()
Default constructor. |
|
NumberRangeParser(java.io.InputStream stream)
|
|
NumberRangeParser(NumberRangeParserTokenManager tm)
|
|
NumberRangeParser(java.io.Reader stream)
|
Method Summary | |
---|---|
void |
disable_tracing()
|
void |
enable_tracing()
|
ParseException |
generateParseException()
|
Token |
getNextToken()
|
Token |
getToken(int index)
|
void |
leftBracket()
|
void |
lowerBound_noSymbols()
|
void |
lowerBound()
|
static void |
main(java.lang.String[] args)
|
java.lang.Object[] |
parseString(java.lang.String inputString)
Reinitializes this engine and parses an input string. |
NumberRange |
parseStringToRange(java.lang.String inputString)
Reinitializes this engine and parses an input string. |
void |
ReInit(java.io.InputStream stream)
|
void |
ReInit(NumberRangeParserTokenManager tm)
|
void |
ReInit(java.io.Reader stream)
|
void |
rightBracket()
|
int |
toeval_noSymbols()
Parses the expression allowing only for numbers. |
int |
toeval()
Parses the expression allowing for symbol names as well as numbers. |
void |
upperBound_noSymbols()
|
void |
upperBound()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public NumberRangeParserTokenManager token_source
public Token token
public Token jj_nt
Constructor Detail |
---|
public NumberRangeParser()
public NumberRangeParser(NumberRangeParserTokenManager tm)
public NumberRangeParser(java.io.InputStream stream)
public NumberRangeParser(java.io.Reader stream)
Method Detail |
---|
public final void disable_tracing()
public final void enable_tracing()
public final ParseException generateParseException()
public final Token getNextToken()
public final Token getToken(int index)
public final void leftBracket() throws ParseException
ParseException
public final void lowerBound() throws ParseException
ParseException
public final void lowerBound_noSymbols() throws ParseException
ParseException
public static void main(java.lang.String[] args) throws ParseException
ParseException
public java.lang.Object[] parseString(java.lang.String inputString) throws ParseException, TokenMgrError
Valid symbol names start with a non digit and may contain letters, digits and "_" . Reserved keywords are ("+" | "-")? "Infinity" and "NaN" (all case insensititve). If a bound is specified as "NaN", the parser throws an exception, because this stands usually for missing value.
inputString
- the string to parse
ParseException
- if parsing failed, contains error description
TokenMgrError
- if tokenizing failed, contains error descriptionpublic NumberRange parseStringToRange(java.lang.String inputString) throws ParseException, TokenMgrError
inputString
- the string to parse
ParseException
- if parsing failed, contains error description
TokenMgrError
- if tokenizing failed, contains error descriptionpublic void ReInit(NumberRangeParserTokenManager tm)
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.Reader stream)
public final void rightBracket() throws ParseException
ParseException
public final int toeval() throws ParseException
ParseException
public final int toeval_noSymbols() throws ParseException
ParseException
public final void upperBound() throws ParseException
ParseException
public final void upperBound_noSymbols() throws ParseException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |