## Package org.eclipse.emf.ocl.parser

Definition of the extensible environment API for OCL parsing and evaluation.

See:
Description

Interface Summary
Environment: Deprecated. Use the `Environment` interface, instead.
EnvironmentFactory: Deprecated. Use the `EnvironmentFactory` interface, instead.
EvaluationEnvironment: Deprecated. Use the `EvaluationEnvironment` interface, instead.
PersistentEnvironment: Deprecated. Use the `Environment` interface, instead.
TypeResolver: Deprecated. Use the `TypeResolver` interface with the `Environment`, instead.

Class Summary
AbstractEnvironmentFactory: Deprecated. Use the `AbstractEnvironmentFactory` class, instead.
EcoreEnvironment: Deprecated. Use the `EcoreEnvironment` class, instead.
EcoreEnvironmentFactory: Deprecated. Use the `EcoreEnvironmentFactory` class, instead.
TypeResolverImpl: Deprecated. Use the `AbstractTypeResolver` class, instead, with the `AbstractEnvironment`.

Exception Summary
ParserException: Deprecated. Use the `ParserException` type, instead.
SemanticException: Deprecated. Use the `SemanticException` interface, instead.

## Package org.eclipse.emf.ocl.parser Description

Definition of the extensible environment API for OCL parsing and evaluation.

## Package Specification

This package defines the API for the environments in which OCL expressions are parsed and evaluated.

The `Environment` interface describes the environment in which an OCL expression is parsed. The environment provides two major functions to the parser:

- Name resolution: the parser looks up in its current environment names that it finds in an expression. These include package, classifier, attribute, reference, operation, and variable names. Nested environments define nested scopes, to support shadowing of names (e.g., operation parameters or `let` variables that hide attributes of the context classifier)
- Tracking the context: the environment defines an optional package context, a mandatory classifier context, and (for operation constraints) an operation context. An operation context is implemented as a child environment of a classifier context; this allows for definition of constraints on operations in a different classifier context than the classifier that defines the operation

Environments are created by environment factories. An `EnvironmentFactory` is provided to an `IOCLHelper` to create environments when it needs to, or by clients to create environments for working with the `ExpressionsUtil` utilities. Environment factories are useful for adapting metamodels to Ecore (possibly using the extensions in the `org.eclipse.emf.ocl.uml` package) to use OCL on them. The environments that they create would do the language mapping to look up classifiers etc. as appropriate to the metamodel. A default factory implementation for Ecore is provided and may be extended by clients to support other metamodels.

While the `Environment` class provides a parse-time environment, the `EvaluationEnvironment` keeps track of the current values of variables in the evaluation of an OCL expression. The `AbstractEnvironmentFactory` provides a default implementation suitable for most applications. Factories that customize the parser environments may, however, need to customize the evaluation environment as well to perform transformations on the values that it maintains.

See Also:
  `org.eclipse.emf.ocl.helper`, `ExpressionsUtil`, `EnvironmentFactory`, `Environment`

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