|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.CharScanner | +--de.hunsicker.jalopy.language.antlr.InternalJavaLexer | +--de.hunsicker.jalopy.language.antlr.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 |
Fields inherited from interface de.hunsicker.jalopy.language.antlr.JavaTokenTypes |
ABSTRACT, ANNOTATION, ANNOTATION_ARRAY_INIT, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, ANNOTATION_MEMBER_VALUE_PAIR, ANNOTATIONS, ARRAY_DECLARATOR, ARRAY_INIT, ASSIGN, AT, BAND, BAND_ASSIGN, BLOCK, BNOT, BOF, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CASE_GROUP, CASESLIST, CHAR_LITERAL, CLASS_DEF, COLON, COMMA, COMMENT, CTOR_CALL, CTOR_DEF, DEC, DIV, DIV_ASSIGN, DOT, ELIST, EMPTY_STAT, ENUM_CONSTANT_DEF, ENUM_DEF, EOF, EQUAL, ESC, EXPONENT, EXPR, EXTENDS_CLAUSE, FINAL, FLOAT_SUFFIX, FOR_CONDITION, FOR_EACH_CLAUSE, FOR_INIT, FOR_ITERATOR, GE, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, IMPORT, INC, INDEX_OP, INSTANCE_INIT, INTERFACE_DEF, JAVADOC_COMMENT, LABELED_STAT, LAND, LBRACK, LCURLY, LE, LITERAL_assert, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_else, LITERAL_enum, LITERAL_extends, LITERAL_false, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_long, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_package, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_threadsafe, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_volatile, LITERAL_while, LNOT, LOR, LPAREN, LT, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJBLOCK, PACKAGE_DEF, PARAMETER_DEF, PARAMETERS, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RBRACK, RCURLY, ROOT, RPAREN, SEMI, SEPARATOR_COMMENT, SL, SL_ASSIGN, SL_COMMENT, SLIST, SPECIAL_COMMENT, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STATIC_IMPORT, STATIC_INIT, STRICTFP, STRING_LITERAL, SUPER_CTOR_CALL, SYNBLOCK, TRIPLE_DOT, TYPE, TYPE_ARGUMENT, TYPE_ARGUMENTS, TYPE_LOWER_BOUNDS, TYPE_PARAMETER, TYPE_PARAMETERS, TYPE_UPPER_BOUNDS, TYPECAST, UNARY_MINUS, UNARY_PLUS, VARIABLE_DEF, VARIABLE_PARAMETER_DEF, VOCAB, WILDCARD_TYPE, WS |
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 de.hunsicker.jalopy.language.antlr.InternalJavaLexer
antlr.TokenStreamIOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |