|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.compiler.tools.antlr.extra.Scanner
public abstract class Scanner
This class describes the capabilities of lexers (token streams) to share a common input buffer and to handle line numbers.
Field Summary | |
---|---|
static CToken |
TOKEN_EOF
|
Constructor Summary | |
---|---|
protected |
Scanner(Compiler compiler,
InputBuffer buffer)
Constructs a new hand written scanner |
Method Summary | |
---|---|
void |
addComment(JavaStyleComment comment)
|
InputBuffer |
getBuffer()
Returns the input buffer. |
abstract InputBufferState |
getBufferState()
Returns the buffer state. |
JavadocComment |
getJavadocComment()
|
int |
getLine()
Returns the current line number in the source code. |
JavaStyleComment[] |
getStatementComment()
|
TokenReference |
getTokenReference()
Returns the reference of the current token in the source file. |
void |
incrementLine()
Sets the current line number in the source code. |
Token |
nextToken()
Returns the next token in the input. |
abstract Token |
nextTokenImpl()
Returns the next token in the input. |
protected void |
reportTrouble(MessageDescription mess,
Object[] params)
Reports that an error has been detected in the lexical analyser. |
protected void |
reportTrouble(PositionedError trouble)
Reports that an error has been detected in the lexical analyser. |
void |
setFile(String file)
|
void |
setLine(int line)
Sets the current line number in the source code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CToken TOKEN_EOF
Constructor Detail |
---|
protected Scanner(Compiler compiler, InputBuffer buffer)
Method Detail |
---|
public final Token nextToken()
nextToken
in interface TokenStream
public abstract Token nextTokenImpl() throws IOException
IOException
public final TokenReference getTokenReference()
protected final void reportTrouble(PositionedError trouble)
trouble
- the error to reportprotected final void reportTrouble(MessageDescription mess, Object[] params)
mess
- the error messageparams
- the array of message parameterspublic final void addComment(JavaStyleComment comment)
public JavaStyleComment[] getStatementComment()
public JavadocComment getJavadocComment()
public final InputBuffer getBuffer()
public void setFile(String file)
public final int getLine()
public final void setLine(int line)
public final void incrementLine()
public abstract InputBufferState getBufferState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |