|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectantlr.CharScanner
de.hunsicker.jalopy.language.antlr.InternalJavaLexer
de.hunsicker.jalopy.language.antlr.JavaLexer
public class JavaLexer
Field Summary | |
---|---|
boolean |
formatMLComments
Should multi-line comments be formatted? |
static int |
JDK_1_3
Indicates JDK version 1.3. |
static int |
JDK_1_4
Indicates JDK version 1.4. |
boolean |
parseJavadocComments
Should Javadoc comments be parsed or added AS IS? |
boolean |
removeJavadocComments
Should Javadoc comments be ignored? |
boolean |
removeMLComments
Should multi-line comments be ignored? |
boolean |
removeSLComments
Should single-line comments be ignored? |
int |
sourceVersion
Specifies the Java release version to be compatible with. |
Fields inherited from class de.hunsicker.jalopy.language.antlr.InternalJavaLexer |
---|
_tokenSet_0, _tokenSet_1, _tokenSet_2, _tokenSet_3, _tokenSet_4 |
Fields inherited from class antlr.CharScanner |
---|
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, tabsize, text, tokenObjectClass, traceDepth |
Constructor Summary | |
---|---|
JavaLexer(CompositeFactory factory)
Creates a new JavaLexer object. |
|
JavaLexer(antlr.InputBuffer ib,
CompositeFactory factory)
|
|
JavaLexer(antlr.LexerSharedInputState state,
CompositeFactory factory)
|
|
JavaLexer(java.io.Reader in,
CompositeFactory factory)
|
Method Summary | |
---|---|
int |
getCompatibility()
Gets the current source compatiblity version. |
FileFormat |
getFileFormat()
Returns the detected file format. |
JavadocParser |
getJavadocParser()
Returns the internal parser for Javadoc comments. |
Parser |
getParser()
Returns the corresponding parser for this lexer. |
boolean |
isFormatMLComments()
Indicates whether multi-line comments should be formatted. |
boolean |
isParseJavadocComments()
Indicates whether Javadoc comments will be parsed during processing. |
boolean |
isRemoveJavadocComments()
Indicates whether Javadoc comments should be removed during processing. |
boolean |
isRemoveMLComments()
Indicates whether multi-line comments should be removed during processing. |
boolean |
isRemoveSLComments()
Indicates whether single-line comments should be removed during processing. |
protected antlr.Token |
makeJavaDoc(antlr.Token node,
java.lang.String newText)
|
protected antlr.Token |
makeToken(int t)
Creates a token of the given tpye. |
void |
panic()
|
void |
panic(java.lang.String message)
|
void |
reportError(antlr.RecognitionException ex)
Reports the given error. |
void |
reportError(java.lang.String message)
Reports the given error. |
void |
reportWarning(java.lang.String message)
Reports the given warning. |
void |
reset()
Resets the lexer. |
void |
setCompatibility(int version)
Sets the source compatiblity to the given release version. |
void |
setFormatMLComments(boolean format)
Sets whether multi-line comments should be formatted. |
void |
setInputBuffer(antlr.InputBuffer buf)
Sets the input buffer to use. |
void |
setInputBuffer(java.io.Reader in)
Sets the input buffer to use. |
void |
setParseJavadocComments(boolean parse)
Sets whether Javadoc comments should be parsed during processing. |
void |
setRemoveJavadocComments(boolean remove)
Sets whether Javadoc comments should be removed during processing. |
void |
setRemoveMLComments(boolean remove)
Sets whether multi-line comments should be removed during processing. |
void |
setRemoveSLComments(boolean remove)
Sets whether single-line comments should be removed during processing. |
void |
setTokenObjectClass(java.lang.String clazz)
Sets the class to use for tokens. |
int |
testLiteralsTable(int ttype)
Test the token type against the literals table. |
int |
testLiteralsTable(java.lang.String tokenText,
int ttype)
Test the text passed in against the literals table. |
Methods inherited from class de.hunsicker.jalopy.language.antlr.InternalJavaLexer |
---|
enableAssert, enableEnum, isAssertEnabled, isEnumEnabled, mASSIGN, mAT, mBAND_ASSIGN, mBAND, mBNOT, mBOR_ASSIGN, mBOR, mBSR_ASSIGN, mBSR, mBXOR_ASSIGN, mBXOR, mCHAR_LITERAL, mCOLON, mCOMMA, mCOMMENT, mDEC, mDIV_ASSIGN, mDIV, mEQUAL, mESC, mEXPONENT, mFLOAT_SUFFIX, mGE, mGT, mHEX_DIGIT, mIDENT, mINC, mLAND, mLBRACK, mLCURLY, mLE, mLNOT, mLOR, mLPAREN, mLT, mMINUS_ASSIGN, mMINUS, mML_COMMENT, mMOD_ASSIGN, mMOD, mNOT_EQUAL, mNUM_INT, mPLUS_ASSIGN, mPLUS, mQUESTION, mRBRACK, mRCURLY, mRPAREN, mSEMI, mSEPARATOR_COMMENT, mSL_ASSIGN, mSL_COMMENT, mSL, mSR_ASSIGN, mSR, mSTAR_ASSIGN, mSTAR, mSTRING_LITERAL, mVOCAB, mWS, nextToken |
Methods inherited from class antlr.CharScanner |
---|
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, LA, mark, match, match, match, matchNot, matchRange, newline, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setTabSize, setText, tab, toLower, traceIn, traceIndent, traceOut, uponEOF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.hunsicker.jalopy.language.Lexer |
---|
getColumn, getFilename, getLine, setColumn, setFilename, setLine |
Methods inherited from interface antlr.TokenStream |
---|
nextToken |
Field Detail |
---|
public static final int JDK_1_3
public static final int JDK_1_4
public boolean parseJavadocComments
public int sourceVersion
public boolean removeJavadocComments
public boolean formatMLComments
public boolean removeSLComments
public boolean removeMLComments
Constructor Detail |
---|
public JavaLexer(java.io.Reader in, CompositeFactory factory)
public JavaLexer(antlr.InputBuffer ib, CompositeFactory factory)
public JavaLexer(antlr.LexerSharedInputState state, CompositeFactory factory)
public JavaLexer(CompositeFactory factory)
setInputBuffer(Reader)
to
set up the input buffer.
Method Detail |
---|
public JavadocParser getJavadocParser()
public Parser getParser()
getParser
in interface Lexer
public void setRemoveMLComments(boolean remove)
remove
- if true
multi-line comments will be removed during
processing.public void setFormatMLComments(boolean format)
format
- if true
multi-line comments will be formatted.public boolean isFormatMLComments()
true
if multi-line comments should be formatted.public boolean isRemoveMLComments()
true
if multi-line comments should be removed during
processing.public void setRemoveSLComments(boolean remove)
remove
- if true
single-line comments will be removed during
processing.public boolean isRemoveSLComments()
true
if single-line comments should be removed during
processing.public void setRemoveJavadocComments(boolean remove)
remove
- if true
Javadoc comments will be removed during
processing.public boolean isRemoveJavadocComments()
true
if Javadoc comments should be removed during
processing.public void setParseJavadocComments(boolean parse)
parse
- if true
Javadoc comments will be parsed during
processing.public boolean isParseJavadocComments()
true
if Javadoc comments will be parsed during
processing.public void setCompatibility(int version)
version
- Java JDK version constant.public int getCompatibility()
public int testLiteralsTable(int ttype)
testLiteralsTable
in class antlr.CharScanner
ttype
- recognized token type.
public int testLiteralsTable(java.lang.String tokenText, int ttype)
testLiteralsTable
in class antlr.CharScanner
tokenText
- recognized token text.ttype
- recognized token text type.
public void panic()
panic
in class antlr.CharScanner
public void panic(java.lang.String message)
panic
in class antlr.CharScanner
public void reportError(antlr.RecognitionException ex)
reportError
in class antlr.CharScanner
ex
- exception which caused the error.public void reportError(java.lang.String message)
reportError
in class antlr.CharScanner
message
- error message.public void reportWarning(java.lang.String message)
reportWarning
in class antlr.CharScanner
message
- warning message.protected antlr.Token makeToken(int t)
makeToken
in class antlr.CharScanner
t
- type of the token.public void setTokenObjectClass(java.lang.String clazz)
setTokenObjectClass
in class antlr.CharScanner
clazz
- a qualified class name.
java.lang.IllegalArgumentException
- if the class is not derived from
ExtendedToken
.public FileFormat getFileFormat()
getFileFormat
in interface Lexer
public void setInputBuffer(antlr.InputBuffer buf)
buf
- buffer.public void setInputBuffer(java.io.Reader in)
setInputBuffer
in interface Lexer
in
- reader to read from.public void reset()
You have to re-initialize the input buffer before you can use the lexer again.
reset
in interface Lexer
setInputBuffer(antlr.InputBuffer)
protected antlr.Token makeJavaDoc(antlr.Token node, java.lang.String newText) throws antlr.TokenStreamIOException
makeJavaDoc
in class InternalJavaLexer
antlr.TokenStreamIOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |