org.eclipse.ocl.parser
Class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>

java.lang.Object
  extended by org.eclipse.ocl.lpg.AbstractAnalyzer
      extended by org.eclipse.ocl.parser.AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
Direct Known Subclasses:
OCLAnalyzer

public abstract class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
extends AbstractAnalyzer

The AbstractOCLAnalyzer supports semantic analysis of a CST produced by an AbstractOCLParser to create the Essential OCL AST. It is necessary that syntactic parsing and semantic analysis are performed in two steps because LPG is a bottom up parser and cannot provide enough contextual information to create the AST on the first pass. Derived classes should extend the abstract support for EssentialOCL to full support for whatever language in which EssentialOCL is embedded.

Since:
1.2

Field Summary
protected  EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environmentFactory
           
protected  OCLFactory oclFactory
           
protected  UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT> uml
           
 
Constructor Summary
AbstractOCLAnalyzer(AbstractOCLParser parser)
           
 
Method Summary
protected  BooleanLiteralExp<C> booleanLiteralExpCS(BooleanLiteralExpCS booleanLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          BooleanLiteralExpCS
protected  void checkNotReflexive(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String rule, AssociationClassCallExp<C,P> acc)
          Asserts that the specified association class is not a reflexive association.
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> classifierContextDeclCS(ClassifierContextDeclCS classifierContextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
          ClassifierContextDeclCS
protected  CollectionLiteralExp<C> collectionLiteralExpCS(CollectionLiteralExpCS collectionLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          CollectionLiteralExpCS
protected  CollectionLiteralPart<C> collectionLiteralPartCS(CollectionLiteralPartCS collectionLiteralPartCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          CollectionLiteralPartCS
protected  C collectionTypeCS(CollectionTypeCS collectionTypeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          CollectionTypeCS
protected  CollectionKind collectionTypeIdentifierCS(CollectionTypeIdentifierEnum collectionTypeIdentifier)
          CollectionTypeIdentifierCS
protected  void contextDeclCS(ContextDeclCS contextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
          ContextDeclCS
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createClassifierContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, ClassifierContextDeclCS classifierContextDeclCS, C classifier)
           
protected  CT createConstraint()
          Creates an Constraint instance.
protected  InvalidLiteralExp<C> createDummyInvalidLiteralExp()
          Creates a dummy expression of invalid-literal type to be a placeholder for a (sub)expression that could not be parsed.
protected  ExpressionInOCL<C,PM> createExpressionInOCL()
          Creates an ExpressionInOcl instance.
protected  IteratorExp<C,PM> createImplicitCollect(OCLExpression<C> source, FeatureCallExp<C> propertyCall, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CSTNode cstNode)
          Creates an implicit collect iterator expression for a property call on a collection-type source expression.
protected  OCLFactory createOCLFactory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          Creates/obtains the OCLFactory that I use to create OCL AST elements.
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOperationContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OperationContextDeclCS operationContextCS, O operation)
           
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createPackageContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, List<String> packageName)
           
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createPropertyContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, PropertyContextCS propertyContextCS, P property)
           
protected  CT defCS(DefCS defCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          DefCS
protected  OCLExpression<C> enumLiteralExpCS(EnumLiteralExpCS enumLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          EnumLiteralExpCS
static boolean equalName(String name, String elementName)
          Checks whether the names are equal, accounting for possibility of underscore-escaped names.
protected  OperationCallExp<C,O> genOperationCallExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OperationCallExpCS operationCallExpCS, String rule, String operName, OCLExpression<C> source, C ownerType, List<OCLExpression<C>> args)
          Generate an OperationCallExp node.
protected  Variable<C,PM> genVariableDeclaration(CSTNode cstNode, String rule, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String name, C type, OCLExpression<C> initExp, boolean explicitFlag, boolean addToEnvironment, boolean isSelf)
          Generate a VariableDeclaration AST node, and add it to the environment.
protected  C getBagType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
           
protected  C getBoolean()
           
protected  CollectionKind getCollectionKind(C possibleCollectionType)
           
protected  OCLExpression<C> getCollectionSourceExpression(OCLExpressionCS oclExpressionCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          OCLExpressionCS
protected  C getCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CollectionKind kind, C elementType)
           
protected  C getCommonSuperType(CSTNode cstNode, String rule, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type1, C type2)
           
protected  C getElementType(C possibleCollectionType)
           
protected  OCLExpression<C> getLoopBody(OCLExpression<C> expr)
           
 Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getOCLEnvironment()
           
protected  C getOCLType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, Object metaElement)
           
protected  C getOclVoid()
           
protected  C getOperationMessageType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, O operation)
           
protected  C getOrderedSetType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
           
 AbstractOCLParser getParser()
           
protected  C getSequenceType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
           
protected  C getSetType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
           
protected  C getSignalMessageType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C signal)
           
protected  OCLStandardLibrary<C> getStandardLibrary()
           
protected  C getTupleType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, EList<? extends TypedElement<C>> parts)
           
protected  C getTypeType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type)
           
protected  IfExp<C> ifExpCS(IfExpCS ifExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          IfExpCS
protected  void initASTMapping(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, 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.
protected  CT initOrDerValueCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, InitOrDerValueCS initOrDerValueCS)
          InitOrDerValueCS
protected  IntegerLiteralExp<C> integerLiteralExpCS(IntegerLiteralExpCS integerLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          IntegerLiteralExpCS
protected  InvalidLiteralExp<C> invalidLiteralExpCS(InvalidLiteralExpCS invalidLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          InvalidLiteralExpCS
protected  CT invCS(InvCS invCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          InvCS
protected  CT invOrDefCS(InvOrDefCS invOrDefCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          InvOrDefCS
protected  boolean isErrorNode(TypedElement<C> expr)
           Queries whether the specified expression is a placeholder that was created for an expression that failed to parse.
static boolean isEscaped(String name)
          Queries whether the specified name is escaped with an initial underscore ('_') character.
static boolean isIdentifierOrKeyword(int tokenKind)
          Returns true if the token kind is an identifier or keyword, othewise false.
protected  IterateExp<C,PM> iterateExpCS(IterateExpCS iterateExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          IterateExpCS
protected  IteratorExp<C,PM> iteratorExpCS(IteratorExpCS iteratorExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          IteratorExpCS
protected  LetExp<C,PM> letExpCS(LetExpCS letExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          LetExpCS
protected  OCLExpression<C> letExpCSRecursive(LetExpCS letExpCS, int index, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          Constructs the LetExp
protected  OCLExpression<C> literalExpCS(LiteralExpCS literalExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          LiteralExpCS
protected  C lookupAssociationClassReference(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, String name)
           
protected  C lookupClassifier(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<String> className)
           
protected  Variable<C,PM> lookupImplicitSourceForOperation(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<OCLExpression<C>> args, String operationName)
           
protected  O lookupOperation(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, String name, List<? extends TypedElement<C>> args)
           
protected  P lookupProperty(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, String name)
           
protected  C lookupSignal(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, String name, List<? extends TypedElement<C>> args)
           
protected  S lookupState(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C sourceType, List<String> statePath)
           
protected  LoopExp<C,PM> loopExpCS(LoopExpCS loopExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          LoopExpCS
protected  void markAsErrorNode(TypedElement<C> expr)
           Marks the specified (sub)expression as a placeholder for an expression that could not be parsed.
protected  OCLExpression<C> messageExpCS(MessageExpCS messageExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          MessageExpCS
protected  OCLExpression<C> modelPropertyCallExpCS(FeatureCallExpCS modelPropertyCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          ModelPropertyCallExpCS
protected  NullLiteralExp<C> nullLiteralExpCS(NullLiteralExpCS nullLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          NullLiteralExpCS
protected  OCLExpression<C> oclExpressionCS(OCLExpressionCS oclExpressionCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          OCLExpressionCS
protected  OCLExpression<C> operationCallExpCS(OperationCallExpCS operationCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          OperationCallExpCS
protected  void operationContextDeclCS(OperationContextDeclCS operationContextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
          OperationContextDeclCS
protected  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> operationCS(OperationCS operationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          OperationCS
protected  String operationString(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String operName, List<? extends TypedElement<C>> args)
          Constructs the string representation of an operation call.
protected  void packageDeclarationCS(PackageDeclarationCS packageDeclarationCS, List<CT> constraints)
          PackageDeclarationCS
protected  List<Variable<C,PM>> parametersCS(List<VariableCS> parameters, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          ParametersCS
protected  CT prePostOrBodyDeclCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, PrePostOrBodyDeclCS prePostOrBodyDeclCS)
          PrePostOrBodyDeclCS
protected  LiteralExp<C> primitiveLiteralExpCS(PrimitiveLiteralExpCS primitiveLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          PrimitiveLiteralExpCS
protected  C primitiveTypeCS(SimpleTypeEnum simpleType, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          PrimitiveTypeCS
protected  OCLExpression<C> propertyCallExpCS(CallExpCS propertyCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          PropertyCallExpCS
protected  P propertyContextCS(PropertyContextCS propertyContextCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
          PropertyContextCS
protected  List<OCLExpression<C>> qualifiersCS(List<OCLExpressionCS> arguments, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> navigation)
          QualifiersCS
protected  RealLiteralExp<C> realLiteralExpCS(RealLiteralExpCS realLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          RealLiteralExpCS
protected  void setQualifiers(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String rule, NavigationCallExp<C,P> nc, List<OCLExpression<C>> qualifiers)
          Sets the specified navigation call's qualifiers, if they are compatible with the navigated association end or association class.
protected  OCLExpression<C> simpleNameCS(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source)
          SimpleNameCS
protected  StateExp<C,S> stateExpCS(OCLExpression<C> source, StateExpCS stateExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          stateExpCS
protected  StringLiteralExp<C> stringLiteralExpCS(StringLiteralExpCS stringLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          StringLiteralExpCS
protected  TupleLiteralExp<C,P> tupleLiteralExpCS(TupleLiteralExpCS tupleLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          TupleLiteralExpCS
protected  TupleLiteralPart<C,P> tupleLiteralPartCS(VariableCS variableDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          tupleLiteralPartCS
protected  EList<TupleLiteralPart<C,P>> tupleLiteralPartListCS(List<VariableCS> variableDeclarations, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          tupleLiteralPartListCS
protected  C tupleTypeCS(TupleTypeCS tupleTypeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          TupleTypeCS
protected  TypeExp<C> typeCS(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type)
           
protected  C typeCS(TypeCS typeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          TypeCS
static String unescape(String name)
          Obtains the unescaped name (assuming that it is escaped) for another attempt to look it up.
protected  UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExpCS(UnlimitedNaturalLiteralExpCS unlimitedNaturalLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          UnlimitedNaturalLiteralExpCS
protected  Variable<C,PM> variableDeclarationCS(VariableCS variableDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, boolean addToEnvironment)
          VariableDeclarationCS
protected  List<Variable<C,PM>> variableDeclarationListCS(List<VariableCS> variableDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, boolean addToEnvironment)
          VariableDeclarationListCS
protected  OCLExpression<C> variableExpCS(VariableExpCS variableExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
          VariableExpCS
 
Methods inherited from class org.eclipse.ocl.lpg.AbstractAnalyzer
computeInputString, dumpTokens, ERROR, ERROR, ERROR, formatClass, formatEClassName, formatName, formatPath, formatPath, formatQualifiedName, formatString, formatType, getCharOffset, getEnvironment, getFormatter, getLexer, getTraceFlag, initialize, initialize, initPropertyPositions, initStartEndPositions, initTypePositions, makeName, makeString, setCharacterOffset, setFileName, setTab, setTraceFlag, TRACE, TRACE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oclFactory

protected OCLFactory oclFactory

uml

protected UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT> uml

environmentFactory

protected final EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environmentFactory
Constructor Detail

AbstractOCLAnalyzer

public AbstractOCLAnalyzer(AbstractOCLParser parser)
Method Detail

createOCLFactory

protected OCLFactory createOCLFactory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
Creates/obtains the OCLFactory that I use to create OCL AST elements.

Parameters:
env - my OCL environment
Returns:
an appropriate factory

getOCLEnvironment

public Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getOCLEnvironment()

getParser

public AbstractOCLParser getParser()
Overrides:
getParser in class AbstractAnalyzer

getBoolean

protected C getBoolean()

getOclVoid

protected C getOclVoid()

getStandardLibrary

protected OCLStandardLibrary<C> getStandardLibrary()

isIdentifierOrKeyword

public static boolean isIdentifierOrKeyword(int tokenKind)
Returns true if the token kind is an identifier or keyword, othewise false.

Parameters:
tokenKind - the token kind to compare
Returns:
true if the token kind is an identifier or keyword, otherwise false

operationString

protected String operationString(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                 String operName,
                                 List<? extends TypedElement<C>> args)
Constructs the string representation of an operation call.

Parameters:
operName - the operation name
args - the arguments in the operation call
Returns:
the string representation

setQualifiers

protected void setQualifiers(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                             String rule,
                             NavigationCallExp<C,P> nc,
                             List<OCLExpression<C>> qualifiers)
Sets the specified navigation call's qualifiers, if they are compatible with the navigated association end or association class.

Parameters:
rule - the rule name that parsed the qualifiers
nc - the navigation call expression
qualifiers - the qualifiers to set
Throws:
TerminateException

checkNotReflexive

protected void checkNotReflexive(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                 String rule,
                                 AssociationClassCallExp<C,P> acc)
Asserts that the specified association class is not a reflexive association.

Parameters:
env - the current environment
rule - the rule that we are matching
acc - the association class call expression
cstNode - context of the call
Throws:
TerminateException

genVariableDeclaration

protected Variable<C,PM> genVariableDeclaration(CSTNode cstNode,
                                                String rule,
                                                Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                String name,
                                                C type,
                                                OCLExpression<C> initExp,
                                                boolean explicitFlag,
                                                boolean addToEnvironment,
                                                boolean isSelf)
Generate a VariableDeclaration AST node, and add it to the environment. Variable declarations are generated for "self", let expression variables, and iterator and iterate variables, both implicit and explicit. For implicit variables, the name is generated by the Environment.

Throws:
TerminateException

genOperationCallExp

protected OperationCallExp<C,O> genOperationCallExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                    OperationCallExpCS operationCallExpCS,
                                                    String rule,
                                                    String operName,
                                                    OCLExpression<C> source,
                                                    C ownerType,
                                                    List<OCLExpression<C>> args)
Generate an OperationCallExp node. operName is the input name of the operation, which must be matched against the datatype of the operation source.

Parameters:
env - the current environment
operationCallExpCS - the operation call CST node
rule - the name of the concrete syntax rule that we are processing
operName - the operation name
source - the operation's source expression
ownerType - the type that defines the operation, in which we will look it up. This can differ from the type of the source expression in the case of an implicit collect iterator
args - the operation arguments
Throws:
TerminateException

packageDeclarationCS

protected void packageDeclarationCS(PackageDeclarationCS packageDeclarationCS,
                                    List<CT> constraints)
PackageDeclarationCS

Parameters:
packageDeclarationCS - the PackageDeclarationCS CSTNode
constraints - the constraints list to populate
Throws:
TerminateException

contextDeclCS

protected void contextDeclCS(ContextDeclCS contextDeclCS,
                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                             List<CT> constraints)
ContextDeclCS

Parameters:
contextDeclCS - the ContextDeclCS CSTNode
env - the package environment
constraints - the constraints list to populate
Throws:
TerminateException

operationContextDeclCS

protected void operationContextDeclCS(OperationContextDeclCS operationContextDeclCS,
                                      Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                      List<CT> constraints)
OperationContextDeclCS

Parameters:
operationContextDeclCS - the OperationContextDeclCS CSTNode
env - the package environment
constraints - the constraints list to populate
Throws:
TerminateException

operationCS

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> operationCS(OperationCS operationCS,
                                                                     Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OperationCS

Parameters:
operationCS - the OperationCS CSTNode
env - the classifier context environment
Returns:
the operation context environment, or null if the operation could not be resolved
Throws:
TerminateException

createOperationContext

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOperationContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                                                OperationContextDeclCS operationContextCS,
                                                                                O operation)

parametersCS

protected List<Variable<C,PM>> parametersCS(List<VariableCS> parameters,
                                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
ParametersCS

Parameters:
parameters - the list of parameters as VariableDeclarationCS objects
env - the OCL expression
Returns:
a list of VariableDeclarations
Throws:
TerminateException

prePostOrBodyDeclCS

protected CT prePostOrBodyDeclCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                 PrePostOrBodyDeclCS prePostOrBodyDeclCS)
PrePostOrBodyDeclCS

Parameters:
prePostOrBodyDeclCS - the PrePostOrBodyDeclCS CSTNode
env - the OCL environment
operation - the context EOperation
Returns:
the parsed Constraint
Throws:
TerminateException

propertyContextCS

protected P propertyContextCS(PropertyContextCS propertyContextCS,
                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                              List<CT> constraints)
PropertyContextCS

Parameters:
propertyContextCS - the PropertyContextCS CSTNode
env - the package environment
constraints - the constraints list to populate
Returns:
the context property, or null if it could not be resolved

createPropertyContext

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createPropertyContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                                               PropertyContextCS propertyContextCS,
                                                                               P property)

initOrDerValueCS

protected CT initOrDerValueCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                              InitOrDerValueCS initOrDerValueCS)
InitOrDerValueCS

Parameters:
initOrDerValueCS - the InitOrDerValueCS CSTNode
env - the OCL environment
property - the context EStructuralFeature
Returns:
the parsed Constraint
Throws:
TerminateException

classifierContextDeclCS

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> classifierContextDeclCS(ClassifierContextDeclCS classifierContextDeclCS,
                                                                                 Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                                                 List<CT> constraints)
ClassifierContextDeclCS

Parameters:
classifierContextDeclCS - the ClassifierContextDeclCS CSTNode
env - the package environment
constraints - the constraints list to populate
the - classifier context environment, or null of the classifier could not be resolved
Throws:
TerminateException

createClassifierContext

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createClassifierContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                                                 ClassifierContextDeclCS classifierContextDeclCS,
                                                                                 C classifier)

invOrDefCS

protected CT invOrDefCS(InvOrDefCS invOrDefCS,
                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
InvOrDefCS

Parameters:
invOrDefCS - the InvOrDefCS CSTNode
env - the OCL environment
Returns:
the parsed Constraint
Throws:
TerminateException

invCS

protected CT invCS(InvCS invCS,
                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
InvCS

Parameters:
invCS - the InvCS CSTNode
env - the OCL environment
Returns:
the parsed Constraint
Throws:
TerminateException

defCS

protected CT defCS(DefCS defCS,
                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
DefCS

Parameters:
defCS - the DefCS CSTNode
env - the OCL environment
Returns:
the parsed Constraint
Throws:
TerminateException

variableDeclarationCS

protected Variable<C,PM> variableDeclarationCS(VariableCS variableDeclarationCS,
                                               Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                               boolean addToEnvironment)
VariableDeclarationCS

Parameters:
variableDeclarationCS - the VariableDeclarationCS CSTNode
env - the OCL environment
addToEnvironment - boolean whether or not to add the the parsed variable to the environment
Returns:
the parsed VariableDeclaration
Throws:
TerminateException

variableDeclarationListCS

protected List<Variable<C,PM>> variableDeclarationListCS(List<VariableCS> variableDeclarationCS,
                                                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                         boolean addToEnvironment)
VariableDeclarationListCS

Parameters:
variableDeclarationCS - list of VariableDeclarationCSs
env - the OCL environment
addToEnvironment - boolean whether or not to add the the parsed variable to the environment
Returns:
list of VariableDeclarations
Throws:
TerminateException

typeCS

protected C typeCS(TypeCS typeCS,
                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
TypeCS

Parameters:
typeCS - the TypeCS CSTNode
env - the OCL environment
Returns:
an EClassifier representing the type
Throws:
TerminateException

stateExpCS

protected StateExp<C,S> stateExpCS(OCLExpression<C> source,
                                   StateExpCS stateExpCS,
                                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
stateExpCS

Parameters:
source - the source expression of the oclIsInState operation
stateExpCS - the StateExpCS CSTNode
env - the OCL environment
Returns:
a StateExp representing the state
Throws:
TerminateException

collectionTypeCS

protected C collectionTypeCS(CollectionTypeCS collectionTypeCS,
                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
CollectionTypeCS

Parameters:
collectionTypeCS - the CollectionTypeCS CSTNode
env - the OCL environment
Returns:
an EClassifier representing the collection type
Throws:
TerminateException

collectionTypeIdentifierCS

protected CollectionKind collectionTypeIdentifierCS(CollectionTypeIdentifierEnum collectionTypeIdentifier)
CollectionTypeIdentifierCS

Parameters:
collectionTypeIdentifier - the CollectionTypeIdentifierEnum representing the collection type
Returns:
the parsed CollectionType

tupleTypeCS

protected C tupleTypeCS(TupleTypeCS tupleTypeCS,
                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
TupleTypeCS

Parameters:
tupleTypeCS - the TupleTypeCS CSTNode
env - the OCL environment
Returns:
the parsed TupleTypeCS
Throws:
TerminateException

oclExpressionCS

protected OCLExpression<C> oclExpressionCS(OCLExpressionCS oclExpressionCS,
                                           Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OCLExpressionCS

Parameters:
oclExpressionCS - the OCLExpressionCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

variableExpCS

protected OCLExpression<C> variableExpCS(VariableExpCS variableExpCS,
                                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
VariableExpCS

Parameters:
variableExpCS - the VariableExpCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

qualifiersCS

protected List<OCLExpression<C>> qualifiersCS(List<OCLExpressionCS> arguments,
                                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                              OCLExpression<C> navigation)
QualifiersCS

Parameters:
arguments - the OCLExpressionCS arguments list
env - the OCL environment
navigation -
Returns:
the parsed OCLExpressions list
Throws:
TerminateException

ifExpCS

protected IfExp<C> ifExpCS(IfExpCS ifExpCS,
                           Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
IfExpCS

Parameters:
ifExpCS - the IfExpCS CSTNode
env - the OCL environment
Returns:
the parsed IfExpCS
Throws:
TerminateException

letExpCS

protected LetExp<C,PM> letExpCS(LetExpCS letExpCS,
                                Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
LetExpCS

Parameters:
letExpCS - the LetExpCS CSTNode
env - the OCL environment
Returns:
the parsed LetExpCS
Throws:
TerminateException

letExpCSRecursive

protected OCLExpression<C> letExpCSRecursive(LetExpCS letExpCS,
                                             int index,
                                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
Constructs the LetExp

Parameters:
letExpCS - the LetExpCS CSTNode
index - the index of the VariableDeclarationCS to parse
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

simpleNameCS

protected OCLExpression<C> simpleNameCS(SimpleNameCS simpleNameCS,
                                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                        OCLExpression<C> source)
SimpleNameCS

Parameters:
simpleNameCS - the SimpleNameCS CSTNode
env - the OCL environment
source - the source of the SimpleNameCS
Returns:
the parsed OCLExpression
Throws:
TerminateException

createImplicitCollect

protected IteratorExp<C,PM> createImplicitCollect(OCLExpression<C> source,
                                                  FeatureCallExp<C> propertyCall,
                                                  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                  CSTNode cstNode)
Creates an implicit collect iterator expression for a property call on a collection-type source expression.

Parameters:
source - the property call source expression
propertyCall - the property call expression
env - the current environment
Returns:
the collect expression
Throws:
TerminateException

primitiveTypeCS

protected C primitiveTypeCS(SimpleTypeEnum simpleType,
                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
PrimitiveTypeCS

Parameters:
simpleType - the SimpleTypeEnum representing the primitive type
Returns:
an EClassifie representing the primitive type

primitiveLiteralExpCS

protected LiteralExp<C> primitiveLiteralExpCS(PrimitiveLiteralExpCS primitiveLiteralExpCS,
                                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
PrimitiveLiteralExpCS

Parameters:
primitiveLiteralExpCS - the PrimitiveLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed LiteralExp

integerLiteralExpCS

protected IntegerLiteralExp<C> integerLiteralExpCS(IntegerLiteralExpCS integerLiteralExpCS,
                                                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
IntegerLiteralExpCS

Parameters:
integerLiteralExpCS - the IntegerLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed IntegerLiteralExp

unlimitedNaturalLiteralExpCS

protected UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExpCS(UnlimitedNaturalLiteralExpCS unlimitedNaturalLiteralExpCS,
                                                                     Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
UnlimitedNaturalLiteralExpCS

Parameters:
unlimitedNaturalLiteralExpCS - the UnlimitedNaturalLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed UnlimitedNaturalLiteralExp

realLiteralExpCS

protected RealLiteralExp<C> realLiteralExpCS(RealLiteralExpCS realLiteralExpCS,
                                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
RealLiteralExpCS

Parameters:
realLiteralExpCS - the RealLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed RealLiteralExp

stringLiteralExpCS

protected StringLiteralExp<C> stringLiteralExpCS(StringLiteralExpCS stringLiteralExpCS,
                                                 Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
StringLiteralExpCS

Parameters:
stringLiteralExpCS - the StringLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed StringLiteralExp

booleanLiteralExpCS

protected BooleanLiteralExp<C> booleanLiteralExpCS(BooleanLiteralExpCS booleanLiteralExpCS,
                                                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
BooleanLiteralExpCS

Parameters:
booleanLiteralExpCS - the BooleanLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed BooleanLiteralExp

nullLiteralExpCS

protected NullLiteralExp<C> nullLiteralExpCS(NullLiteralExpCS nullLiteralExpCS,
                                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
NullLiteralExpCS

Parameters:
nullLiteralExpCS - the NullLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed NullLiteralExp

invalidLiteralExpCS

protected InvalidLiteralExp<C> invalidLiteralExpCS(InvalidLiteralExpCS invalidLiteralExpCS,
                                                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
InvalidLiteralExpCS

Parameters:
invalidLiteralExpCS - the InvalidLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed InvalidLiteralExp

literalExpCS

protected OCLExpression<C> literalExpCS(LiteralExpCS literalExpCS,
                                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
LiteralExpCS

Parameters:
literalExpCS - the LiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed LiteralExp
Throws:
TerminateException

tupleLiteralExpCS

protected TupleLiteralExp<C,P> tupleLiteralExpCS(TupleLiteralExpCS tupleLiteralExpCS,
                                                 Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
TupleLiteralExpCS

Parameters:
tupleLiteralExpCS - the TupleLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed TupleLiteralExp
Throws:
TerminateException

tupleLiteralPartListCS

protected EList<TupleLiteralPart<C,P>> tupleLiteralPartListCS(List<VariableCS> variableDeclarations,
                                                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
tupleLiteralPartListCS

Parameters:
variableDeclarations - list of VariableDeclarationCSes
env - the OCL environment
Returns:
list of TupleLiteralParts
Throws:
TerminateException

tupleLiteralPartCS

protected TupleLiteralPart<C,P> tupleLiteralPartCS(VariableCS variableDeclarationCS,
                                                   Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
tupleLiteralPartCS

Parameters:
variableDeclarationCS - the VariableDeclarationCS CSTNode
env - the OCL environment
addToEnvironment - boolean whether or not to add the the parsed variable to the environment
Returns:
the parsed VariableDeclaration
Throws:
TerminateException

enumLiteralExpCS

protected OCLExpression<C> enumLiteralExpCS(EnumLiteralExpCS enumLiteralExpCS,
                                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
EnumLiteralExpCS

Parameters:
enumLiteralExpCS - the EnumLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed EnumLiteralExp
Throws:
TerminateException

typeCS

protected TypeExp<C> typeCS(CSTNode cstNode,
                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                            C type)

collectionLiteralExpCS

protected CollectionLiteralExp<C> collectionLiteralExpCS(CollectionLiteralExpCS collectionLiteralExpCS,
                                                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
CollectionLiteralExpCS

Parameters:
collectionLiteralExpCS - the CollectionLiteralExpCS CSTNode
env - the OCL environment
Returns:
the parsed CollectionLiteralExp
Throws:
TerminateException

collectionLiteralPartCS

protected CollectionLiteralPart<C> collectionLiteralPartCS(CollectionLiteralPartCS collectionLiteralPartCS,
                                                           Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
CollectionLiteralPartCS

Parameters:
collectionLiteralPartCS - the CollectionLiteralPartCS CSTNode
env - the OCL environment
Returns:
the parsed CollectionLiteralPart
Throws:
TerminateException

propertyCallExpCS

protected OCLExpression<C> propertyCallExpCS(CallExpCS propertyCallExpCS,
                                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
PropertyCallExpCS

Parameters:
propertyCallExpCS - the PropertyCallExpCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

loopExpCS

protected LoopExp<C,PM> loopExpCS(LoopExpCS loopExpCS,
                                  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
LoopExpCS

Parameters:
loopExpCS - the LoopExpCS CSTNode
env - the OCL environment
Returns:
the parsed LoopExp
Throws:
TerminateException

getCollectionSourceExpression

protected OCLExpression<C> getCollectionSourceExpression(OCLExpressionCS oclExpressionCS,
                                                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OCLExpressionCS

Parameters:
oclExpressionCS - the OCLExpressionCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

iteratorExpCS

protected IteratorExp<C,PM> iteratorExpCS(IteratorExpCS iteratorExpCS,
                                          Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
IteratorExpCS

Parameters:
iteratorExpCS - the IteratorExpCS CSTNode
env - the OCL environment
Returns:
the parsed IteratorExp
Throws:
TerminateException

iterateExpCS

protected IterateExp<C,PM> iterateExpCS(IterateExpCS iterateExpCS,
                                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
IterateExpCS

Parameters:
iterateExpCS - the IterateExpCS CSTNode
env - the OCL environment
Returns:
the parsed IterateExp
Throws:
TerminateException

modelPropertyCallExpCS

protected OCLExpression<C> modelPropertyCallExpCS(FeatureCallExpCS modelPropertyCallExpCS,
                                                  Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
ModelPropertyCallExpCS

Parameters:
modelPropertyCallExpCS - the ModelPropertyCallExpCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

getLoopBody

protected OCLExpression<C> getLoopBody(OCLExpression<C> expr)

operationCallExpCS

protected OCLExpression<C> operationCallExpCS(OperationCallExpCS operationCallExpCS,
                                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OperationCallExpCS

Parameters:
operationCallExpCS - the OperationCallExpCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

messageExpCS

protected OCLExpression<C> messageExpCS(MessageExpCS messageExpCS,
                                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
MessageExpCS

Parameters:
messageExpCS - the MessageExpCS CSTNode
env - the OCL environment
Returns:
the parsed OCLExpression
Throws:
TerminateException

getCommonSuperType

protected C getCommonSuperType(CSTNode cstNode,
                               String rule,
                               Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                               C type1,
                               C type2)

getOCLType

protected C getOCLType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                       Object metaElement)

getSetType

protected C getSetType(CSTNode cstNode,
                       Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                       C elementType)

getOrderedSetType

protected C getOrderedSetType(CSTNode cstNode,
                              Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                              C elementType)

getBagType

protected C getBagType(CSTNode cstNode,
                       Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                       C elementType)

getSequenceType

protected C getSequenceType(CSTNode cstNode,
                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                            C elementType)

getCollectionType

protected C getCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                              CollectionKind kind,
                              C elementType)

getTupleType

protected C getTupleType(CSTNode cstNode,
                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                         EList<? extends TypedElement<C>> parts)

getTypeType

protected C getTypeType(CSTNode cstNode,
                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                        C type)

getOperationMessageType

protected C getOperationMessageType(CSTNode cstNode,
                                    Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                    O operation)

getSignalMessageType

protected C getSignalMessageType(CSTNode cstNode,
                                 Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                 C signal)

getElementType

protected C getElementType(C possibleCollectionType)

getCollectionKind

protected CollectionKind getCollectionKind(C possibleCollectionType)

createDummyInvalidLiteralExp

protected InvalidLiteralExp<C> createDummyInvalidLiteralExp()
Creates a dummy expression of invalid-literal type to be a placeholder for a (sub)expression that could not be parsed. The resulting expression is marked as an error place-holder expression.

Returns:
the dummy invalid-literal expression
See Also:
#markAsErrorNode(OCLExpression)

isErrorNode

protected boolean isErrorNode(TypedElement<C> expr)

Queries whether the specified expression is a placeholder that was created for an expression that failed to parse. An example is the expression returned by createDummyInvalidLiteralExp().

The default implementation simply returns false; subclasses should override if necessary, in conjunction with the markAsErrorNode(TypedElement) method.

Parameters:
expr - a (sub)expression
Returns:
whether the expr is a placeholder for an unparseable (sub)expression
Since:
1.2
See Also:
markAsErrorNode(TypedElement)

markAsErrorNode

protected void markAsErrorNode(TypedElement<C> expr)

Marks the specified (sub)expression as a placeholder for an expression that could not be parsed. A subsequent invocation of the isErrorNode(TypedElement) method should recognize an expression thus marked. Subsequent attempts to mark an expression that is already marked have no effect.

The default implementation does nothing; subclasses should override if necessary, in conjunction with the isErrorPlaceholder method.

Parameters:
expr - an expression that takes the place of a (sub)expression that could not be parsed
Since:
1.2
See Also:
isErrorNode(TypedElement)

createPackageContext

protected Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createPackageContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent,
                                                                              List<String> packageName)
                                                                       throws LookupException
Throws:
LookupException

lookupClassifier

protected C lookupClassifier(CSTNode cstNode,
                             Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                             List<String> className)

lookupImplicitSourceForOperation

protected Variable<C,PM> lookupImplicitSourceForOperation(CSTNode cstNode,
                                                          Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                                          List<OCLExpression<C>> args,
                                                          String operationName)

lookupOperation

protected O lookupOperation(CSTNode cstNode,
                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                            C owner,
                            String name,
                            List<? extends TypedElement<C>> args)

lookupProperty

protected P lookupProperty(CSTNode cstNode,
                           Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                           C owner,
                           String name)

lookupAssociationClassReference

protected C lookupAssociationClassReference(CSTNode cstNode,
                                            Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                                            C owner,
                                            String name)

lookupSignal

protected C lookupSignal(CSTNode cstNode,
                         Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                         C owner,
                         String name,
                         List<? extends TypedElement<C>> args)

lookupState

protected S lookupState(CSTNode cstNode,
                        Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                        C sourceType,
                        List<String> statePath)

createExpressionInOCL

protected ExpressionInOCL<C,PM> createExpressionInOCL()
Creates an ExpressionInOcl instance. Subclasses may override.

Returns:
an new expression-in-OCL

createConstraint

protected CT createConstraint()
Creates an Constraint instance. Subclasses may override.

Returns:
an new constraint

initASTMapping

protected void initASTMapping(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
                              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:
env -
astNode -
cstNode -

isEscaped

public static boolean isEscaped(String name)
Queries whether the specified name is escaped with an initial underscore ('_') character.

Parameters:
name - a name
Returns:
whether it begins with the underscore escape prefix

unescape

public static String unescape(String name)
Obtains the unescaped name (assuming that it is escaped) for another attempt to look it up.

Parameters:
name - an OCL-escaped name
Returns:
the unescaped name

equalName

public static boolean equalName(String name,
                                String elementName)
Checks whether the names are equal, accounting for possibility of underscore-escaped names.

Parameters:
name - a possibly underscore-escaped name
elementName - name of an element in the model
Returns:
whether the element name is equivalent to this name

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