Class Parser
- java.lang.Object
-
- com.yahoo.search.query.textserialize.parser.Parser
-
- All Implemented Interfaces:
ParserConstants
public class Parser extends java.lang.Object implements ParserConstants
-
-
Field Summary
Fields Modifier and Type Field Description Token
jj_nt
Next token.Token
token
Current token.ParserTokenManager
token_source
Generated Token Manager.-
Fields inherited from interface com.yahoo.search.query.textserialize.parser.ParserConstants
BOOLEAN, CLOSE_CURLY, CLOSE_PAREN, CLOSE_SQUARE, DEFAULT, DIGIT, EOF, EXPONENT, NULL, NUMBER, OPEN_CURLY, OPEN_PAREN, OPEN_SQUARE, QUOTE, SIGN, STRING, STRING_CHARACTER, SYMBOL, SYMBOL_FIRST, SYMBOL_REST, tokenImage
-
-
Constructor Summary
Constructors Constructor Description Parser(ParserTokenManager tm)
Constructor with generated Token Manager.Parser(java.io.InputStream stream)
Constructor with InputStream.Parser(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encodingParser(java.io.Reader stream)
Constructor with InputStream.Parser(java.io.Reader stream, DispatchFormHandler dispatchFormHandler, java.lang.Object dispatchContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Object>
array()
java.lang.Boolean
bool()
void
disable_tracing()
Disable tracing.java.lang.Object
dispatchForm()
void
enable_tracing()
Enable tracing.java.lang.Object
form()
java.util.List<java.lang.Object>
forms()
ParseException
generateParseException()
Generate ParseException.Token
getNextToken()
Token
getToken(int index)
java.lang.Object
literal()
java.util.Map<java.lang.Object,java.lang.Object>
map()
java.lang.Object
null_()
java.lang.Double
number()
void
ReInit(ParserTokenManager tm)
Reinitialisevoid
ReInit(java.io.InputStream stream)
Reinitialisevoid
ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialisevoid
ReInit(java.io.Reader stream)
Reinitialisejava.lang.Object
start()
java.lang.String
string()
boolean
trace_enabled()
-
-
-
Field Detail
-
token_source
public ParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
Parser
public Parser(java.io.Reader stream, DispatchFormHandler dispatchFormHandler, java.lang.Object dispatchContext)
-
Parser
public Parser(java.io.InputStream stream)
Constructor with InputStream.- Parameters:
stream
- input stream
-
Parser
public Parser(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encoding- Parameters:
stream
- input streamencoding
- charset to be used
-
Parser
public Parser(java.io.Reader stream)
Constructor with InputStream.- Parameters:
stream
- char stream
-
Parser
public Parser(ParserTokenManager tm)
Constructor with generated Token Manager.- Parameters:
tm
- Token manager to use
-
-
Method Detail
-
start
public final java.lang.Object start() throws ParseException
- Throws:
ParseException
-
form
public final java.lang.Object form() throws ParseException
- Throws:
ParseException
-
literal
public final java.lang.Object literal() throws ParseException
- Throws:
ParseException
-
string
public final java.lang.String string() throws ParseException
- Throws:
ParseException
-
number
public final java.lang.Double number() throws ParseException
- Throws:
ParseException
-
bool
public final java.lang.Boolean bool() throws ParseException
- Throws:
ParseException
-
null_
public final java.lang.Object null_() throws ParseException
- Throws:
ParseException
-
map
public final java.util.Map<java.lang.Object,java.lang.Object> map() throws ParseException
- Throws:
ParseException
-
dispatchForm
public final java.lang.Object dispatchForm() throws ParseException
- Throws:
ParseException
-
forms
public final java.util.List<java.lang.Object> forms() throws ParseException
- Throws:
ParseException
-
array
public final java.util.List<java.lang.Object> array() throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(java.io.InputStream stream)
Reinitialise- Parameters:
stream
- input stream
-
ReInit
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialise- Parameters:
stream
- input streamencoding
- charset to be used
-
ReInit
public void ReInit(java.io.Reader stream)
Reinitialise- Parameters:
stream
- char stream
-
ReInit
public void ReInit(ParserTokenManager tm)
Reinitialise- Parameters:
tm
- Token manager to use
-
getNextToken
public final Token getNextToken()
- Returns:
- the next Token.
-
getToken
public final Token getToken(int index)
- Parameters:
index
- index to be retrieved- Returns:
- the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.- Returns:
- new Exception object. Never
null
-
trace_enabled
public final boolean trace_enabled()
- Returns:
- Always
false
.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-