org.eclipse.ocl.lpg
Interface BasicEnvironment

All Superinterfaces:
Adaptable, Customizable
All Known Subinterfaces:
BasicEnvironment2, Environment.Internal<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
All Known Implementing Classes:
AbstractBasicEnvironment, AbstractEnvironment, EcoreEnvironment, UMLEnvironment

public interface BasicEnvironment
extends Adaptable, Customizable

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, ... errors.
 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

getASTMapping

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.

Parameters:
astNode -
Returns:
cstNode

initASTMapping

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.

Parameters:
astNode -
cstNode -

getFormatter

FormattingHelper getFormatter()
Return the message formatter that may be used to format object-related contributions to problem messages.

Returns:
non-null message formatter

setParser

void setParser(AbstractParser parser)
Define the syntactic parser from which source tokens and text amy be obtained.

Parameters:
parser -

getParser

AbstractParser getParser()
Return the syntactic parser from which source tokens and text amy be obtained.

Returns:
parser

setProblemHandler

ProblemHandler setProblemHandler(ProblemHandler problemHandler)
Define the handler for any problem reports.

Parameters:
problemHandler -
Returns:
the previous problem handler

getProblemHandler

ProblemHandler getProblemHandler()
Obtains a problem handler to service lexer, parser, analyzer, validator, ... errors.

Returns:
the problem handler.

problem

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.

Parameters:
severity - the severity of the problem
phase - the phase in which the problem was encountered
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObject - optional object associated with the problem

analyzerError

void analyzerError(java.lang.String problemMessage,
                   java.lang.String problemContext,
                   java.lang.Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem with a ProblemHandler.errorSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObject - optional object associated with the problem

analyzerError

void analyzerError(java.lang.String problemMessage,
                   java.lang.String problemContext,
                   java.util.List<?> problemObjects)
Convenience method invoking getProblemHandler().analyzerProblem with a ProblemHandler.errorSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObjects - optional sequence of objects associated with the problem

analyzerError

void analyzerError(java.lang.String problemMessage,
                   java.lang.String problemContext,
                   int startOffset,
                   int endOffset)
Convenience method invoking getProblemHandler().analyzerProblem with a ProblemHandler.errorSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
startOffset - character index at the start of the error
endOffset - character index beyond the end of the error

analyzerWarning

void analyzerWarning(java.lang.String problemMessage,
                     java.lang.String problemContext,
                     java.lang.Object problemObject)
Convenience method invoking getProblemHandler().analyzerProblem with a ProblemHandler.warningSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObject - optional object associated with the problem

lexerError

void lexerError(int errorCode,
                int startOffset,
                int endOffset)
Convenience method invoking getProblemHandler().lexerProblem with a ProblemHandler.errorSeverity.

Parameters:
errorCode - the ParserErrorCodes value identifying the error
startOffset - character index at the start of the error
endOffset - character index beyond the end of the error

parserError

void parserError(int errorCode,
                 int leftToken,
                 int rightToken,
                 java.lang.String tokenText)
Convenience method invoking getProblemHandler().parserProblem with a ProblemHandler.errorSeverity.

Parameters:
errorCode - the ParserErrorCodes value identifying the error
leftToken - the lexical token index at the left hand edge of the error
rightToken - the lexical token index at the right hand edge of the error
tokenText - additional text apprropriate to the ParserErrorCodes value.

utilityError

void utilityError(java.lang.String problemMessage,
                  java.lang.String problemContext,
                  java.lang.Object problemObject)
Convenience method invoking getProblemHandler().utilityProblem with a ProblemHandler.errorSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObject - optional object associated with the problem

validatorError

void validatorError(java.lang.String problemMessage,
                    java.lang.String problemContext,
                    java.lang.Object problemObject)
Convenience method invoking getProblemHandler().validatorProblem with a ProblemHandler.errorSeverity.

Parameters:
problemMessage - message describing the problem
problemContext - optional message describing the reporting context
problemObject - optional object associated with the problem

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.