org.eclipse.ocl.examples.pivot.context
Interface ParserContext

All Known Implementing Classes:
AbstractParserContext, ClassContext, DiagnosticContext, EClassContext, EInvocationContext, ModelContext, OperationContext, PropertyContext

public interface ParserContext

A ParserContext captures the context in which source text is parsed. A derived context is constructed with the relevant context, then createBaseResource creates a Concrete Syntax resource for a Concrete Syntax expression string. Then parse creates a corresponding Abstract Syntax ExpressionInOCL. initialize is invoked during the parse to install the derived context into the ExpressionInOCL.


Method Summary
 BaseResource createBaseResource(java.lang.String expression)
          Create a Concrete Syntax resource containing the parsed expression.
 Type getClassContext()
          Return the type of the self variable.
 ExpressionInOCL getExpression(BaseResource resource)
          Extract an Abstract Syntax ExpressionInOCL fronm a Concrete Syntax resource.
 MetaModelManager getMetaModelManager()
          Returbn the MetaModelManager in use.
 void initialize(Base2PivotConversion conversion, ExpressionInOCL expression)
          Callback to initialize the ExpressionInOCL with the derived context such as a contextvariable for the self type, parameter and result variables.
 ExpressionInOCL parse(java.lang.String expression)
          Create an Abstract Syntax ExpressionInOCL containing the parsed expression.
 

Method Detail

createBaseResource

BaseResource createBaseResource(java.lang.String expression)
                                throws java.io.IOException
Create a Concrete Syntax resource containing the parsed expression. Semantic errors may be found at the Resource.errors and may be converted to ParseExceptions by invoking PivitUtil.checkResourceErrors.

Throws:
java.io.IOException - if resource loading fails

getClassContext

Type getClassContext()
Return the type of the self variable.


getExpression

ExpressionInOCL getExpression(BaseResource resource)
                              throws ParserException
Extract an Abstract Syntax ExpressionInOCL fronm a Concrete Syntax resource.

Throws:
ParserException - if parsing fails

getMetaModelManager

MetaModelManager getMetaModelManager()
Returbn the MetaModelManager in use.


initialize

void initialize(Base2PivotConversion conversion,
                ExpressionInOCL expression)
Callback to initialize the ExpressionInOCL with the derived context such as a contextvariable for the self type, parameter and result variables.


parse

ExpressionInOCL parse(java.lang.String expression)
                      throws ParserException
Create an Abstract Syntax ExpressionInOCL containing the parsed expression.

Throws:
ParserException - if parsing fails