Package COM.activesw.api.client.parser
Class Parser
- java.lang.Object
-
- COM.activesw.api.client.parser.Parser
-
public class Parser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static byte
BYTE_MAX
static byte
BYTE_MIN
static double
DOUBLE_MAX
static double
DOUBLE_MIN
static int
FATAL
static double
FLOAT_MAX
static double
FLOAT_MIN
static int
INT_MAX
static int
INT_MIN
static long
LONGLONG_MAX
static long
LONGLONG_MIN
static int
NUM_32
static int
NUM_64
static int
NUM_FLOAT
static int
OK
static int
SERIOUS
static short
SHORT_MAX
static short
SHORT_MIN
static int
SYNTAX
static int
WARNING
-
Constructor Summary
Constructors Constructor Description Parser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
ABORT()
static void
ACCEPT()
static void
CLEARIN()
static void
CLINEROK()
static void
CLINERR()
void
enumerateReservedWords(ParserEnumHandler handler, java.lang.Object rock)
void
error(int severity, java.lang.String msg)
static void
ERROR()
static void
ERROROK()
int
getErrorState()
ParserKill
getKillVal()
int
getMaxSeverity()
int
getNErrors()
int
getNTokens()
java.lang.Object
getRock()
java.lang.String[]
getTokenNames()
protected java.lang.Class
makeClass(java.lang.String className)
static void
OK()
int
parse(ParserLexer lexer, java.lang.Object lexrock)
static int
parseNumber(java.lang.String string, int offset, BrokerLongHolder integral64, BrokerDoubleHolder floating, BrokerIntHolder extent, boolean neg)
first char should be [0-9-+.]static boolean
setDebug(boolean value)
void
setErrorFunc(ParserError err)
void
setKillVal(ParserKill kv)
void
setMaxSeverity(int s)
void
setNErrors(int n)
void
setRock(java.lang.Object r)
void
setTables(ParserTables t)
int
tokenNumberFromName(java.lang.String name)
int
translateTokenNumber(int x)
-
-
-
Field Detail
-
OK
public static final int OK
- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
- See Also:
- Constant Field Values
-
SERIOUS
public static final int SERIOUS
- See Also:
- Constant Field Values
-
SYNTAX
public static final int SYNTAX
- See Also:
- Constant Field Values
-
FATAL
public static final int FATAL
- See Also:
- Constant Field Values
-
NUM_32
public static final int NUM_32
- See Also:
- Constant Field Values
-
NUM_64
public static final int NUM_64
- See Also:
- Constant Field Values
-
NUM_FLOAT
public static final int NUM_FLOAT
- See Also:
- Constant Field Values
-
BYTE_MAX
public static final byte BYTE_MAX
- See Also:
- Constant Field Values
-
BYTE_MIN
public static final byte BYTE_MIN
- See Also:
- Constant Field Values
-
SHORT_MAX
public static final short SHORT_MAX
- See Also:
- Constant Field Values
-
SHORT_MIN
public static final short SHORT_MIN
- See Also:
- Constant Field Values
-
INT_MAX
public static final int INT_MAX
- See Also:
- Constant Field Values
-
INT_MIN
public static final int INT_MIN
- See Also:
- Constant Field Values
-
FLOAT_MAX
public static final double FLOAT_MAX
- See Also:
- Constant Field Values
-
FLOAT_MIN
public static final double FLOAT_MIN
- See Also:
- Constant Field Values
-
DOUBLE_MAX
public static final double DOUBLE_MAX
- See Also:
- Constant Field Values
-
DOUBLE_MIN
public static final double DOUBLE_MIN
- See Also:
- Constant Field Values
-
LONGLONG_MAX
public static final long LONGLONG_MAX
- See Also:
- Constant Field Values
-
LONGLONG_MIN
public static final long LONGLONG_MIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDebug
public static boolean setDebug(boolean value)
-
error
public void error(int severity, java.lang.String msg)
-
enumerateReservedWords
public void enumerateReservedWords(ParserEnumHandler handler, java.lang.Object rock)
-
tokenNumberFromName
public int tokenNumberFromName(java.lang.String name)
-
parse
public int parse(ParserLexer lexer, java.lang.Object lexrock)
-
setRock
public void setRock(java.lang.Object r)
-
getRock
public java.lang.Object getRock()
-
setErrorFunc
public void setErrorFunc(ParserError err)
-
getErrorState
public int getErrorState()
-
setKillVal
public void setKillVal(ParserKill kv)
-
getKillVal
public ParserKill getKillVal()
-
setMaxSeverity
public void setMaxSeverity(int s)
-
getMaxSeverity
public int getMaxSeverity()
-
setNErrors
public void setNErrors(int n)
-
getNErrors
public int getNErrors()
-
getTokenNames
public java.lang.String[] getTokenNames()
-
getNTokens
public int getNTokens()
-
setTables
public void setTables(ParserTables t)
-
translateTokenNumber
public int translateTokenNumber(int x)
-
OK
public static void OK()
-
ACCEPT
public static void ACCEPT()
-
ABORT
public static void ABORT()
-
ERROR
public static void ERROR()
-
CLEARIN
public static void CLEARIN()
-
ERROROK
public static void ERROROK()
-
CLINEROK
public static void CLINEROK()
-
CLINERR
public static void CLINERR()
-
makeClass
protected java.lang.Class makeClass(java.lang.String className)
-
parseNumber
public static int parseNumber(java.lang.String string, int offset, BrokerLongHolder integral64, BrokerDoubleHolder floating, BrokerIntHolder extent, boolean neg)
first char should be [0-9-+.]note that the radix is hardcoded to '.', this may be different in another locale.
return values: < 0 error 1 32-bit integral 2 64-bit integral 3 floating point
error codes: -1 string == NULL -2 '+', '-', or '0x' with no following digits -3 invalid char -4 invalid number (cannot form a number) -5 invalid char (floating) -6 floating point overflow -7 floating point underflow -9 invalid octel/hex char -10 numeric overflow
If successful, *extent will be set to length of string parsed. In the case of errors, *extent will be set to the index of character that caused error (might point to '\0')
-
-