|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BasicEnvironment
A BasicEnvironment
provides input token and output problem support for a text analysis
comprising an AbstractAnalyzer
for semantic analysis,
AbstractParser
for syntactic analysis
(parsing), and an AbstractLexer
for lexical analysis.
Method Summary | |
---|---|
void |
analyzerError(java.lang.String problemMessage,
java.lang.String problemContext,
int startOffset,
int endOffset)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity . |
void |
analyzerError(java.lang.String problemMessage,
java.lang.String problemContext,
java.util.List<?> problemObjects)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity . |
void |
analyzerError(java.lang.String problemMessage,
java.lang.String problemContext,
java.lang.Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity . |
void |
analyzerWarning(java.lang.String problemMessage,
java.lang.String problemContext,
java.lang.Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem
with a ProblemHandler.warningSeverity . |
CSTNode |
getASTMapping(java.lang.Object astNode)
Return the mapping of an astNode to its originating cstNode, so that AST-based analysis may report error messages exploiting the CST context, or to support incremental AST/CST update. |
FormattingHelper |
getFormatter()
Return the message formatter that may be used to format object-related contributions to problem messages. |
AbstractParser |
getParser()
Return the syntactic parser from which source tokens and text amy be obtained. |
ProblemHandler |
getProblemHandler()
Obtains a problem handler to service lexer, parser, analyzer, validator, ... |
void |
initASTMapping(java.lang.Object astNode,
CSTNode cstNode)
Initialize the mapping of an object (typically an astNode) to its originating cstNode, so that AST-based analysis may report error messages exploiting the CST context, or to support incremental AST/CST update. |
void |
lexerError(int errorCode,
int startOffset,
int endOffset)
Convenience method invoking getProblemHandler().lexerProblem
with a ProblemHandler.errorSeverity . |
void |
parserError(int errorCode,
int leftToken,
int rightToken,
java.lang.String tokenText)
Convenience method invoking getProblemHandler().parserProblem
with a ProblemHandler.errorSeverity . |
void |
problem(ProblemHandler.Severity severity,
ProblemHandler.Phase phase,
java.lang.String problemMessage,
java.lang.String problemContext,
java.lang.Object problemObject)
Generically reports a problem about some object. |
void |
setParser(AbstractParser parser)
Define the syntactic parser from which source tokens and text amy be obtained. |
ProblemHandler |
setProblemHandler(ProblemHandler problemHandler)
Define the handler for any problem reports. |
void |
utilityError(java.lang.String problemMessage,
java.lang.String problemContext,
java.lang.Object problemObject)
Convenience method invoking getProblemHandler().utilityProblem
with a ProblemHandler.errorSeverity . |
void |
validatorError(java.lang.String problemMessage,
java.lang.String problemContext,
java.lang.Object problemObject)
Convenience method invoking getProblemHandler().validatorProblem
with a ProblemHandler.errorSeverity . |
Methods inherited from interface org.eclipse.ocl.util.Adaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ocl.options.Customizable |
---|
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption |
Method Detail |
---|
CSTNode getASTMapping(java.lang.Object astNode)
astNode
-
void initASTMapping(java.lang.Object astNode, CSTNode cstNode)
astNode
- cstNode
- FormattingHelper getFormatter()
void setParser(AbstractParser parser)
parser
- AbstractParser getParser()
ProblemHandler setProblemHandler(ProblemHandler problemHandler)
problemHandler
-
ProblemHandler getProblemHandler()
void problem(ProblemHandler.Severity severity, ProblemHandler.Phase phase, java.lang.String problemMessage, java.lang.String problemContext, java.lang.Object problemObject)
severity
- the severity of the problemphase
- the phase in which the problem was encounteredproblemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObject
- optional object associated with the problemvoid analyzerError(java.lang.String problemMessage, java.lang.String problemContext, java.lang.Object problemObject)
getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObject
- optional object associated with the problemvoid analyzerError(java.lang.String problemMessage, java.lang.String problemContext, java.util.List<?> problemObjects)
getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObjects
- optional sequence of objects associated with the problemvoid analyzerError(java.lang.String problemMessage, java.lang.String problemContext, int startOffset, int endOffset)
getProblemHandler().analyzerProblem
with a ProblemHandler.errorSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextstartOffset
- character index at the start of the errorendOffset
- character index beyond the end of the errorvoid analyzerWarning(java.lang.String problemMessage, java.lang.String problemContext, java.lang.Object problemObject)
getProblemHandler().analyzerProblem
with a ProblemHandler.warningSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObject
- optional object associated with the problemvoid lexerError(int errorCode, int startOffset, int endOffset)
getProblemHandler().lexerProblem
with a ProblemHandler.errorSeverity
.
errorCode
- the ParserErrorCodes value identifying the errorstartOffset
- character index at the start of the errorendOffset
- character index beyond the end of the errorvoid parserError(int errorCode, int leftToken, int rightToken, java.lang.String tokenText)
getProblemHandler().parserProblem
with a ProblemHandler.errorSeverity
.
errorCode
- the ParserErrorCodes value identifying the errorleftToken
- the lexical token index at the left hand edge of the errorrightToken
- the lexical token index at the right hand edge of the errortokenText
- additional text apprropriate to the ParserErrorCodes value.void utilityError(java.lang.String problemMessage, java.lang.String problemContext, java.lang.Object problemObject)
getProblemHandler().utilityProblem
with a ProblemHandler.errorSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObject
- optional object associated with the problemvoid validatorError(java.lang.String problemMessage, java.lang.String problemContext, java.lang.Object problemObject)
getProblemHandler().validatorProblem
with a ProblemHandler.errorSeverity
.
problemMessage
- message describing the problemproblemContext
- optional message describing the reporting contextproblemObject
- optional object associated with the problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |