|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.javatools.parser.AbstractLexer
oracle.javatools.parser.java.v1.JavaLexer
public class JavaLexer
The JavaLexer
is an implementation of the Lexer
interface for the Java language. Details of the Java Language taken from
Java Language Specification
Lexer
,
JavaTokens
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.javatools.parser.AbstractLexer |
---|
AbstractLexer.DefaultLexerToken |
Field Summary |
---|
Fields inherited from class oracle.javatools.parser.AbstractLexer |
---|
currentPos, textBuffer |
Fields inherited from interface oracle.javatools.parser.Lexer |
---|
TK_EOF, TK_NOT_FOUND |
Constructor Summary | |
---|---|
JavaLexer()
Constructs a default JavaLexer with a starting
position of 0. |
Method Summary | |
---|---|
void |
backup()
Unlexes the last found token. |
static boolean |
isDecimalDigit(char digit)
Utility routine to check whether the given digit is a decimal digit. |
static boolean |
isHexDigit(char digit)
Utility routine to check whether the given digit is a hexadecimal digit. |
static boolean |
isOctalDigit(char digit)
Utility routine to check whether the given digit is an octal digit. |
int |
lex(LexerToken lexedToken)
Scans the text buffer at the current position and returns the token that was found. |
void |
setPosition(int offset)
Sets the current lex (read) position to the given offset in the buffer. |
void |
setRecognizeSQLJ(boolean recognizeSQLJ)
Sets whether the JavaLexer should recognize SQLJ
statements and return a single token for them (instead of trying
to lex it as Java.) |
void |
setSkipComments(boolean skipComments)
Sets whether the JavaLexer should generate tokens
for Java comments. |
static java.lang.String |
tokenToString(int token)
Utility routine to map the token to a string representation of the token (for debug printing.) |
static java.lang.String |
tokenToText(int token)
Utility routine to map the token to the original text (if retrievable) of the token (for debug printing.) |
Methods inherited from class oracle.javatools.parser.AbstractLexer |
---|
createLexerToken, getTextBuffer, setTextBuffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaLexer()
JavaLexer
with a starting
position of 0. Clients must call setTextBuffer()
to
initialize the text buffer used for the Lexer. To start lexing
from an offset other than 0, call setPosition()
.
Method Detail |
---|
public void setSkipComments(boolean skipComments)
JavaLexer
should generate tokens
for Java comments.
skipComments
- true to ignore comments in token generationpublic void setRecognizeSQLJ(boolean recognizeSQLJ)
JavaLexer
should recognize SQLJ
statements and return a single token for them (instead of trying
to lex it as Java.)
recognizeSQLJ
- true to recognize SQLJ statements as a tokenpublic int lex(LexerToken lexedToken)
lexedToken
instance passed in to the
call.
lex
in interface Lexer
lex
in class AbstractLexer
lexedToken
- the instance passed in where token info is stored
lexedToken.getToken()
(for convenience)public void backup()
lex()
will return the last token and offset information found.
backup
in interface Lexer
backup
in class AbstractLexer
public void setPosition(int offset)
setPosition
in interface Lexer
setPosition
in class AbstractLexer
offset
- the offset for the next lex()
operation.public static boolean isDecimalDigit(char digit)
digit
- the digit to checkpublic static boolean isOctalDigit(char digit)
digit
- the digit to checkpublic static boolean isHexDigit(char digit)
digit
- the digit to checkpublic static java.lang.String tokenToString(int token)
token
- the token to map
public static java.lang.String tokenToText(int token)
token
- the token to map
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |