java.lang.Object antlr.CharScanner
Field Summary | |
static char |
EOF_CHAR
|
Constructor Summary | |
CharScanner()
|
|
CharScanner(InputBuffer cb)
|
|
CharScanner(LexerSharedInputState sharedState)
|
Method Summary | |
void |
append(char c)
|
void |
append(java.lang.String s)
|
void |
commit()
|
void |
consume()
|
void |
consumeUntil(BitSet set)
Consume chars until one matches the given set |
void |
consumeUntil(int c)
Consume chars until one matches the given char |
boolean |
getCaseSensitive()
|
boolean |
getCaseSensitiveLiterals()
|
int |
getColumn()
|
boolean |
getCommitToPath()
|
java.lang.String |
getFilename()
|
InputBuffer |
getInputBuffer()
|
LexerSharedInputState |
getInputState()
|
int |
getLine()
|
int |
getTabSize()
|
java.lang.String |
getText()
return a copy of the current text buffer |
Token |
getTokenObject()
|
char |
LA(int i)
|
int |
mark()
|
void |
match(BitSet b)
|
void |
match(char c)
|
void |
match(java.lang.String s)
|
void |
matchNot(char c)
|
void |
matchRange(char c1,
char c2)
|
void |
newline()
|
void |
panic()
|
void |
panic(java.lang.String s)
This method is executed by ANTLR internally when it detected an illegal state that cannot be recovered from. |
void |
reportError(RecognitionException ex)
Parser error-reporting function can be overridden in subclass |
void |
reportError(java.lang.String s)
Parser error-reporting function can be overridden in subclass |
void |
reportWarning(java.lang.String s)
Parser warning-reporting function can be overridden in subclass |
void |
resetText()
|
void |
rewind(int pos)
|
void |
setCaseSensitive(boolean t)
|
void |
setColumn(int c)
|
void |
setCommitToPath(boolean commit)
|
void |
setFilename(java.lang.String f)
|
void |
setInputState(LexerSharedInputState state)
|
void |
setLine(int line)
|
void |
setTabSize(int size)
|
void |
setText(java.lang.String s)
|
void |
setTokenObjectClass(java.lang.String cl)
|
void |
tab()
advance the current column number by an appropriate amount according to tab size. |
int |
testLiteralsTable(int ttype)
|
int |
testLiteralsTable(java.lang.String text,
int ttype)
Test the text passed in against the literals table Override this method to perform a different literals test This is used primarily when you want to test a portion of a token. |
char |
toLower(char c)
|
void |
traceIn(java.lang.String rname)
|
void |
traceIndent()
|
void |
traceOut(java.lang.String rname)
|
void |
uponEOF()
This method is called by YourLexer.nextToken() when the lexer has hit EOF condition. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface antlr.TokenStream |
nextToken |
Field Detail |
public static final char EOF_CHAR
Constructor Detail |
public CharScanner()
public CharScanner(InputBuffer cb)
public CharScanner(LexerSharedInputState sharedState)
Method Detail |
public void append(char c)
public void append(java.lang.String s)
public void commit()
public void consume() throws CharStreamException
CharStreamException
public void consumeUntil(int c) throws CharStreamException
CharStreamException
public void consumeUntil(BitSet set) throws CharStreamException
CharStreamException
public boolean getCaseSensitive()
public final boolean getCaseSensitiveLiterals()
public int getColumn()
public void setColumn(int c)
public boolean getCommitToPath()
public java.lang.String getFilename()
public InputBuffer getInputBuffer()
public LexerSharedInputState getInputState()
public void setInputState(LexerSharedInputState state)
public int getLine()
public java.lang.String getText()
public Token getTokenObject()
public char LA(int i) throws CharStreamException
CharStreamException
public int mark()
public void match(char c) throws MismatchedCharException, CharStreamException
MismatchedCharException
CharStreamException
public void match(BitSet b) throws MismatchedCharException, CharStreamException
MismatchedCharException
CharStreamException
public void match(java.lang.String s) throws MismatchedCharException, CharStreamException
MismatchedCharException
CharStreamException
public void matchNot(char c) throws MismatchedCharException, CharStreamException
MismatchedCharException
CharStreamException
public void matchRange(char c1, char c2) throws MismatchedCharException, CharStreamException
MismatchedCharException
CharStreamException
public void newline()
public void tab()
public void setTabSize(int size)
public int getTabSize()
public void panic()
panic(String)
public void panic(java.lang.String s)
java.lang.System.exit(int)
and writes directly to
java.lang.System.err)
, which is usually not appropriate when
a translator is embedded into a larger application. It is highly
recommended that this method be overridden to handle the error in a
way appropriate for your application (e.g. throw an unchecked
exception).
public void reportError(RecognitionException ex)
public void reportError(java.lang.String s)
public void reportWarning(java.lang.String s)
public void resetText()
public void rewind(int pos)
public void setCaseSensitive(boolean t)
public void setCommitToPath(boolean commit)
public void setFilename(java.lang.String f)
public void setLine(int line)
public void setText(java.lang.String s)
public void setTokenObjectClass(java.lang.String cl)
public int testLiteralsTable(int ttype)
public int testLiteralsTable(java.lang.String text, int ttype)
public char toLower(char c)
public void traceIndent()
public void traceIn(java.lang.String rname) throws CharStreamException
CharStreamException
public void traceOut(java.lang.String rname) throws CharStreamException
CharStreamException
public void uponEOF() throws TokenStreamException, CharStreamException
TokenStreamException
CharStreamException