public class TokenParser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
TokenParser.cc_lexer |
Modifier and Type | Field and Description |
---|---|
private int |
_yyBaseState |
private byte[] |
_yyBuffer |
private int |
_yyBufferEnd |
private int |
_yyBufferSize |
private java.io.InputStream |
_yyIs |
private int |
_yyLength |
private int |
_yyMatchStart |
private int |
_yyTextStart |
protected static int |
INITIAL |
private java.util.LinkedList<java.lang.String> |
m_tokenList |
Modifier | Constructor and Description |
---|---|
private |
TokenParser() |
Modifier and Type | Method and Description |
---|---|
protected void |
begin(int baseState)
Set the lexer's current state.
|
void |
echo()
Print the current string token to the standard output.
|
java.io.InputStream |
getInput() |
static void |
main(java.lang.String[] args)
This is a stub main function that either reads the file that user specified
or from the standard input.
|
static java.lang.String[] |
parseString(java.lang.String input) |
void |
setBufferSize(int bufferSize)
Set the internal buffer size.
|
void |
setInput(java.io.InputStream is) |
int |
yyLength()
Get the current text token's length.
|
protected void |
yyLess(int n)
Put all but n characters back to the input stream.
|
int |
yyLex()
Call this function to start the scanning of the input.
|
protected boolean |
yyRefreshBuffer() |
void |
yyResetBuffer()
Reset the internal buffer.
|
java.lang.String |
yyText()
Get the current token text.
|
protected static final int INITIAL
private java.io.InputStream _yyIs
private byte[] _yyBuffer
private int _yyBufferSize
private int _yyMatchStart
private int _yyBufferEnd
private int _yyBaseState
private int _yyTextStart
private int _yyLength
private final java.util.LinkedList<java.lang.String> m_tokenList
public void setInput(java.io.InputStream is)
public java.io.InputStream getInput()
public java.lang.String yyText()
Avoid calling this function unless it is absolutely necessary since it creates a copy of the token string. The string length can be found by reading _yyLength or calling yyLength () function.
public int yyLength()
public void echo()
protected void yyLess(int n)
n
- The number of characters.protected void begin(int baseState)
baseState
- the base state indexprotected boolean yyRefreshBuffer() throws java.io.IOException
java.io.IOException
public void yyResetBuffer()
public void setBufferSize(int bufferSize)
bufferSize
- the new buffer size.public int yyLex() throws java.io.IOException
java.io.IOException
- in case of I/O error.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- command line arguments.java.lang.Exception
- in case of any errors.public static java.lang.String[] parseString(java.lang.String input) throws java.io.IOException
java.io.IOException