|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.compiler.Scanner
This class describes the capabilities of lexers (token streams) to share a common input buffer and to handle line numbers.
Field Summary | |
protected InputBuffer |
buffer
The data source for this scanner. |
Constructor Summary | |
protected |
Scanner(Compiler compiler,
InputBuffer buffer)
Constructs a new hand written scanner. |
Method Summary | |
InputBuffer |
getBuffer()
Returns the input buffer. |
java.lang.String |
getFile()
Returns the name of the source code file. |
JavadocComment |
getJavadocComment()
|
int |
getLine()
Returns the current line number in the source code. |
int |
getPosition()
Returns the current position in the input stream. |
JavaStyleComment[] |
getStatementComment()
|
protected abstract antlr.Token |
getToken()
Returns the next token in the input. |
TokenReference |
getTokenReference()
Returns the reference of the current token in the source file. |
protected static boolean |
isJavaIdentifierStart(char c)
Determines if the specified character is permissible as the first character in a Java identifier. |
antlr.Token |
nextToken()
Identifiers/Keywords/true/false/null (start with java letter) numeric literal (start with number) character literal (start with single quote) string (start with double quote) separator (parens, braces, brackets, semicolon, comma, period) operator (equals, plus, minus, etc) whitespace comment (start with slash) |
protected boolean |
readJavaComment()
Reads a Java style comment (with leading // or |
protected void |
reportTrouble(MessageDescription mess,
java.lang.Object param1,
java.lang.Object param2)
Reports that an error has been detected in the lexical analyzer. |
protected void |
reportTrouble(PositionedError trouble)
Reports that an error has been detected in the lexical analyzer. |
protected char |
scanEscapeSequence()
Scans an escape sequence. |
void |
setLine(int line)
Sets the current line number in the source code. |
void |
setPosition(int pos)
Sets the current position in the input stream. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected final InputBuffer buffer
Constructor Detail |
protected Scanner(Compiler compiler, InputBuffer buffer)
Method Detail |
public final InputBuffer getBuffer()
public final java.lang.String getFile()
public final int getLine()
public final void setLine(int line)
public final int getPosition()
public final void setPosition(int pos)
public final TokenReference getTokenReference()
protected final void reportTrouble(PositionedError trouble)
error
- The error to report.protected final void reportTrouble(MessageDescription mess, java.lang.Object param1, java.lang.Object param2)
mess
- the error message.param1
- the first message parameter.param2
- the second message parameter.protected abstract antlr.Token getToken() throws PositionedError
public final antlr.Token nextToken()
nextToken
in interface antlr.TokenStream
protected char scanEscapeSequence() throws PositionedError
protected static boolean isJavaIdentifierStart(char c)
protected boolean readJavaComment() throws PositionedError
public JavaStyleComment[] getStatementComment()
public JavadocComment getJavadocComment()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |