public abstract class AbstractParserContext extends java.lang.Object implements ParserContext
Modifier and Type | Field and Description |
---|---|
protected MetaModelManager |
metaModelManager |
protected org.eclipse.emf.common.util.URI |
uri |
Modifier | Constructor and Description |
---|---|
protected |
AbstractParserContext(MetaModelManager metaModelManager,
org.eclipse.emf.common.util.URI uri) |
Modifier and Type | Method and Description |
---|---|
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.
|
@NonNull protected final MetaModelManager metaModelManager
@NonNull protected final org.eclipse.emf.common.util.URI uri
protected AbstractParserContext(@NonNull MetaModelManager metaModelManager, @Nullable org.eclipse.emf.common.util.URI uri)
@NonNull public BaseResource createBaseResource(@NonNull java.lang.String expression) throws java.io.IOException, ParserException
ParserContext
createBaseResource
in interface ParserContext
java.io.IOException
- if resource loading failsParserException
@Nullable public Type getClassContext()
ParserContext
getClassContext
in interface ParserContext
@NonNull public ExpressionInOCL getExpression(@NonNull BaseResource resource) throws ParserException
ParserContext
getExpression
in interface ParserContext
ParserException
- if parsing fails@NonNull public MetaModelManager getMetaModelManager()
ParserContext
getMetaModelManager
in interface ParserContext
public void initialize(@NonNull Base2PivotConversion conversion, @NonNull ExpressionInOCL expression)
ParserContext
initialize
in interface ParserContext
@NonNull public ExpressionInOCL parse(@NonNull java.lang.String expression) throws ParserException
ParserContext
parse
in interface ParserContext
ParserException
- if parsing fails