org.eclipse.ocl.examples.pivot.context
Class AbstractParserContext

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.context.AbstractParserContext
All Implemented Interfaces:
ParserContext
Direct Known Subclasses:
ClassContext, EClassContext, ModelContext

public abstract class AbstractParserContext
extends java.lang.Object
implements ParserContext


Field Summary
protected  MetaModelManager metaModelManager
           
protected  org.eclipse.emf.common.util.URI uri
           
 
Constructor Summary
protected AbstractParserContext(MetaModelManager metaModelManager, org.eclipse.emf.common.util.URI uri)
           
 
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.
 org.eclipse.emf.common.util.URI getURI()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metaModelManager

protected final MetaModelManager metaModelManager

uri

protected final org.eclipse.emf.common.util.URI uri
Constructor Detail

AbstractParserContext

protected AbstractParserContext(MetaModelManager metaModelManager,
                                org.eclipse.emf.common.util.URI uri)
Method Detail

createBaseResource

public BaseResource createBaseResource(java.lang.String expression)
                                throws java.io.IOException
Description copied from interface: ParserContext
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.

Specified by:
createBaseResource in interface ParserContext
Throws:
java.io.IOException - if resource loading fails

getClassContext

public Type getClassContext()
Description copied from interface: ParserContext
Return the type of the self variable.

Specified by:
getClassContext in interface ParserContext

getExpression

public ExpressionInOCL getExpression(BaseResource resource)
                              throws ParserException
Description copied from interface: ParserContext
Extract an Abstract Syntax ExpressionInOCL fronm a Concrete Syntax resource.

Specified by:
getExpression in interface ParserContext
Throws:
ParserException - if parsing fails

getMetaModelManager

public MetaModelManager getMetaModelManager()
Description copied from interface: ParserContext
Returbn the MetaModelManager in use.

Specified by:
getMetaModelManager in interface ParserContext

getURI

public org.eclipse.emf.common.util.URI getURI()

initialize

public void initialize(Base2PivotConversion conversion,
                       ExpressionInOCL expression)
Description copied from interface: ParserContext
Callback to initialize the ExpressionInOCL with the derived context such as a contextvariable for the self type, parameter and result variables.

Specified by:
initialize in interface ParserContext

parse

public ExpressionInOCL parse(java.lang.String expression)
                      throws ParserException
Description copied from interface: ParserContext
Create an Abstract Syntax ExpressionInOCL containing the parsed expression.

Specified by:
parse in interface ParserContext
Throws:
ParserException - if parsing fails