|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.lpg.AbstractProblemHandler
public abstract class AbstractProblemHandler
Partial implementation of the ProblemHandler
API, useful for
subclasses to selectively override behaviour.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.ocl.lpg.ProblemHandler |
---|
ProblemHandler.Phase, ProblemHandler.Severity |
Field Summary |
---|
Fields inherited from interface org.eclipse.ocl.lpg.ProblemHandler |
---|
ERROR_MESSAGES |
Fields inherited from interface lpg.runtime.ParseErrorCodes |
---|
BEFORE_CODE, DELETION_CODE, EOF_CODE, ERROR_CODE, ERROR_RULE_ERROR_CODE, ERROR_RULE_WARNING_CODE, errorMsgText, INSERTION_CODE, INVALID_CODE, INVALID_TOKEN_CODE, LEX_ERROR_CODE, MERGE_CODE, MISPLACED_CODE, NO_MESSAGE_CODE, SCOPE_CODE, SECONDARY_CODE, SUBSTITUTION_CODE |
Constructor Summary | |
---|---|
protected |
AbstractProblemHandler(AbstractParser parser)
Initializes me with the parser that can supply line number locations for problems. |
Method Summary | |
---|---|
protected void |
addProblem(java.lang.String message)
The default implementation just prints the message using System.out.println . |
void |
analyzerProblem(ProblemHandler.Severity problemSeverity,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Convenience method typically invoking handleProblem
with a analyzerProblem processing phase. |
void |
beginParse()
This default implementation does nothing. |
void |
beginValidation()
This default implementation does nothing. |
void |
endParse()
This default implementation does nothing. |
void |
endValidation()
This default implementation does nothing. |
void |
flush(org.eclipse.emf.common.util.Monitor monitor)
Flush all problems to their recipient. |
int |
getErrorReportLineOffset()
Queries the line offset for reporting errors. |
AbstractParser |
getParser()
Queries the parser from which I obtain source tokens and text. |
void |
handleProblem(ProblemHandler.Severity problemSeverity,
ProblemHandler.Phase processingPhase,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Implements the interface, invoking addProblem with a line comprising
processingPhase-problemSeverity in processingContext; lineNumber : problemMessage . |
void |
lexerProblem(ProblemHandler.Severity problemSeverity,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Convenience method typically invoking handleProblem
with a lexerProblem processing phase. |
void |
parserProblem(ProblemHandler.Severity problemSeverity,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Convenience method typically invoking handleProblem
with a parserProblem processing phase. |
void |
setErrorReportLineOffset(int offset)
Sets the line offset for reporting errors. |
void |
setParser(AbstractParser parser)
Define the syntactic parser from which source tokens and text may be obtained. |
void |
utilityProblem(ProblemHandler.Severity problemSeverity,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Convenience method typically invoking handleProblem
with a utilityProblem processing phase. |
void |
validatorProblem(ProblemHandler.Severity problemSeverity,
java.lang.String problemMessage,
java.lang.String processingContext,
int startOffset,
int endOffset)
Convenience method typically invoking handleProblem
with a validatorProblem processing phase. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractProblemHandler(AbstractParser parser)
parser
- my parserMethod Detail |
---|
protected void addProblem(java.lang.String message)
System.out.println
.
message
- the problem descriptionpublic void analyzerProblem(ProblemHandler.Severity problemSeverity, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
ProblemHandler
handleProblem
with a analyzerProblem
processing phase.
analyzerProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severityproblemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void beginParse()
beginParse
in interface ProblemHandler
public void endParse()
endParse
in interface ProblemHandler
public void beginValidation()
beginValidation
in interface ProblemHandler
public void endValidation()
endValidation
in interface ProblemHandler
public void flush(org.eclipse.emf.common.util.Monitor monitor)
ProblemHandler
flush
in interface ProblemHandler
monitor
- an optional EMF monitor for reporting progress. May be
null
if not needed by the callerpublic void setParser(AbstractParser parser)
ProblemHandler
setParser
in interface ProblemHandler
public AbstractParser getParser()
ProblemHandler
getParser
in interface ProblemHandler
public void handleProblem(ProblemHandler.Severity problemSeverity, ProblemHandler.Phase processingPhase, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
addProblem
with a line comprising
processingPhase-problemSeverity in processingContext; lineNumber : problemMessage
.
handleProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severity (e.g. errorSeverity
)processingPhase
- optional text describing the processing phase (e.g. analyzerProblem
)problemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void lexerProblem(ProblemHandler.Severity problemSeverity, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
ProblemHandler
handleProblem
with a lexerProblem
processing phase.
lexerProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severityproblemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void parserProblem(ProblemHandler.Severity problemSeverity, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
ProblemHandler
handleProblem
with a parserProblem
processing phase.
parserProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severityproblemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void utilityProblem(ProblemHandler.Severity problemSeverity, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
ProblemHandler
handleProblem
with a utilityProblem
processing phase.
utilityProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severityproblemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void validatorProblem(ProblemHandler.Severity problemSeverity, java.lang.String problemMessage, java.lang.String processingContext, int startOffset, int endOffset)
ProblemHandler
handleProblem
with a validatorProblem
processing phase.
validatorProblem
in interface ProblemHandler
problemSeverity
- text describing the problem severityproblemMessage
- message describing the problemprocessingContext
- optional message describing the reporting context (e.g. "PathNameCS"
)startOffset
- (inclusive) index of first source character influencing the problem, -ve if unknownendOffset
- (exclusive) index of last source character influencing the problem, -ve if unknownpublic void setErrorReportLineOffset(int offset)
ProblemHandler
setErrorReportLineOffset
in interface ProblemHandler
public int getErrorReportLineOffset()
ProblemHandler
getErrorReportLineOffset
in interface ProblemHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |