public abstract class AbstractReportableUnitCompiler extends java.lang.Object implements IReportableUnitCompiler
IReportableUnitCompiler
. Clients should extend and implement compile(CommonTree)
from which you will call report(String, CommonTree)
with any messages. The actual message
and its reporting back to the DefaultCompiler
will be handled based on IReportableUnitCompiler.Level
.
This class is not thread safe.IReportableUnitCompiler.Level
Constructor and Description |
---|
AbstractReportableUnitCompiler() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
compile(org.antlr.runtime.tree.CommonTree node)
do the actual compilation checks.
|
void |
compile(org.antlr.runtime.tree.CommonTree node,
java.util.Collection<java.lang.Exception> info,
java.util.Collection<java.lang.Exception> warnings,
java.util.Collection<java.lang.Exception> errors) |
protected java.util.Collection<java.lang.Exception> |
getCollection(IReportableUnitCompiler.Level level) |
java.util.Collection<java.lang.Integer> |
getRelevantTypes()
return a collection of JACTRBuilder.
|
IReportableUnitCompiler.Level |
getReportLevel() |
void |
postCompile()
noop
|
void |
preCompile()
noop
|
protected java.lang.Exception |
report(java.lang.String message,
org.antlr.runtime.tree.CommonTree node) |
protected CommonTreeException |
report(java.lang.String message,
org.antlr.runtime.tree.CommonTree node,
java.lang.Throwable thrown) |
protected void |
setRelevantTypes(java.lang.Integer... types) |
void |
setReportLevel(IReportableUnitCompiler.Level level) |
protected void setRelevantTypes(java.lang.Integer... types)
public final java.util.Collection<java.lang.Integer> getRelevantTypes()
IUnitCompiler
getRelevantTypes
in interface IUnitCompiler
public IReportableUnitCompiler.Level getReportLevel()
getReportLevel
in interface IReportableUnitCompiler
public void setReportLevel(IReportableUnitCompiler.Level level)
setReportLevel
in interface IReportableUnitCompiler
public final void compile(org.antlr.runtime.tree.CommonTree node, java.util.Collection<java.lang.Exception> info, java.util.Collection<java.lang.Exception> warnings, java.util.Collection<java.lang.Exception> errors)
compile
in interface IUnitCompiler
protected java.lang.Exception report(java.lang.String message, org.antlr.runtime.tree.CommonTree node)
protected CommonTreeException report(java.lang.String message, org.antlr.runtime.tree.CommonTree node, java.lang.Throwable thrown)
protected java.util.Collection<java.lang.Exception> getCollection(IReportableUnitCompiler.Level level)
protected abstract void compile(org.antlr.runtime.tree.CommonTree node)
report(String, CommonTree)
, which will format the appropriate
message and store it in the correct collection.node
- public void postCompile()
postCompile
in interface IUnitCompiler
IUnitCompiler.postCompile()
public void preCompile()
preCompile
in interface IUnitCompiler
IUnitCompiler.preCompile()