|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.ParserUtility
This class is delegated to my the parser classes and provides a place to encapsulate the utility methods of those classes.
| Field Summary | |
boolean |
allowGeneric
Indicates whether generics syntax should be recognized. |
boolean |
allowMultiJava
Indicates whether multijava syntax should be recognized. |
boolean |
allowRelaxedMultiJava
Indicates whether relaxed multijava syntax should be recognized. |
boolean |
allowUniverseKeywords
WMD Indicates whether universe type modifier syntax should be recognized. |
protected Main |
compiler
|
boolean |
parseJavadocs
Indicates whether javadoc comments should be parsed. |
protected ParsingController |
parsingController
manages parsing of nested language features (like javadoc comments) |
| Constructor Summary | |
ParserUtility(Main compiler,
ParsingController parsingController,
boolean allowGeneric,
boolean allowMultiJava,
boolean allowRelaxedMultiJava,
boolean allowUniverseKeywords,
boolean parseJavadocs)
|
|
| Method Summary | |
PositionedError |
beautifyParserError(antlr.ANTLRException e)
Returns an exception from our exception hierarchy by wrapping the ANTLR excepton. |
TokenReference |
buildTokenReference()
Constructs a token reference (i.e., a source code position marker) for annotating the abstract syntax tree. |
TokenReference |
buildTokenReference(antlr.Token tok)
Constructs a token reference (i.e., a source code position marker) for annotating the abstract syntax tree. |
TokenReference |
buildTokenReference(ParsingController.TokenWrapper wrap)
Constructs a token reference (i.e., a source code position marker) for annotating the abstract syntax tree. |
void |
flushJavadocTokensWithWarning(antlr.Token tok)
Flushes the javadoc token buffer of all javadoc tokens preceding the given token. |
void |
flushJavadocTokensWithWarning(ParsingController.TokenWrapper index)
Flushes the javadoc token buffer of all javadoc tokens preceding the given token. |
Main |
getCompiler()
Returns the compiler that instantiated the parser. |
JavadocComment |
getJavadocComment(antlr.Token tok)
Supplies an AST for the javadoc style comment preceding the given token. |
JavadocComment |
getJavadocComment(ParsingController.TokenWrapper declStart)
Supplies an AST for the javadoc style comment preceding the given token. |
String |
getModifierName(long mod)
Returns the name of the modifier according to the ModifierUtility of the compiler used to
instantiate this. |
String |
getModifierNames(long mods)
Returns the names of the modifiers according to the ModifierUtility of the compiler used to
instantiate this. |
JavaStyleComment[] |
getStatementComment()
Returns the non-Javadoc comments preceding the current lookahead token. |
int |
getUnmatchedTypeLT()
get the value of unmatchedTypeLT, from the ParsingController |
boolean |
modifiersInPreferredOrder(long prevMods,
long mod)
Returns the true if the modifiers are in the preferred order according to the ModifierUtility of the compiler
used to instantiate this. |
void |
reportTrouble(Exception trouble)
Reports that an error has been detected in the lexical analyser. |
void |
setUnmatchedTypeLT(int count)
set the value of unmatchedTypeLT, from the ParsingController |
void |
wrapIfEmptyNonNullWrapper(ParsingController.TokenWrapper wrapper,
antlr.Token tok)
If the given wrapper reference is non-null and the wrapper is empty then wrap the given token in the wrapper. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Main compiler
protected ParsingController parsingController
public final boolean allowMultiJava
public final boolean allowGeneric
public final boolean allowRelaxedMultiJava
public final boolean allowUniverseKeywords
public final boolean parseJavadocs
| Constructor Detail |
public ParserUtility(Main compiler,
ParsingController parsingController,
boolean allowGeneric,
boolean allowMultiJava,
boolean allowRelaxedMultiJava,
boolean allowUniverseKeywords,
boolean parseJavadocs)
| Method Detail |
public final Main getCompiler()
public final TokenReference buildTokenReference()
public final TokenReference buildTokenReference(antlr.Token tok)
tok - A token from which the row and column will be extracted public final TokenReference buildTokenReference(ParsingController.TokenWrapper wrap)
wrap - A wrapped token from which the row and column will be
extracted
requires wrap.unwrap() != null;
public final JavaStyleComment[] getStatementComment()
public final JavadocComment getJavadocComment(ParsingController.TokenWrapper declStart)
throws antlr.TokenStreamException,
antlr.RecognitionException
antlr.TokenStreamException
antlr.RecognitionException
public JavadocComment getJavadocComment(antlr.Token tok)
throws antlr.TokenStreamException,
antlr.RecognitionException
antlr.TokenStreamException
antlr.RecognitionException
public final void flushJavadocTokensWithWarning(ParsingController.TokenWrapper index)
throws antlr.TokenStreamException
antlr.TokenStreamException
public final void flushJavadocTokensWithWarning(antlr.Token tok)
throws antlr.TokenStreamException
antlr.TokenStreamException
public final void wrapIfEmptyNonNullWrapper(ParsingController.TokenWrapper wrapper,
antlr.Token tok)
public final void reportTrouble(Exception trouble)
reportTrouble in interface TroubleReportertrouble - the error to reportpublic final PositionedError beautifyParserError(antlr.ANTLRException e)
public final String getModifierName(long mod)
ModifierUtility of the compiler used to
instantiate this.
org.multijava.util.compiler.ModifierUtility#nameOf(int)public final String getModifierNames(long mods)
ModifierUtility of the compiler used to
instantiate this.
org.multijava.util.compiler.ModifierUtility#asString(int)
public final boolean modifiersInPreferredOrder(long prevMods,
long mod)
ModifierUtility of the compiler
used to instantiate this.
org.multijava.util.compiler.ModifierUtility#inPreferredOrder(int,int)public int getUnmatchedTypeLT()
public void setUnmatchedTypeLT(int count)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||