|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.lpg.AbstractAnalyzer org.eclipse.ocl.parser.AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
public abstract class AbstractOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
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.
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 |
---|
protected OCLFactory oclFactory
protected UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT> uml
protected final EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environmentFactory
Constructor Detail |
---|
public AbstractOCLAnalyzer(AbstractOCLParser parser)
Method Detail |
---|
protected OCLFactory createOCLFactory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OCLFactory
that I use to create OCL AST
elements.
env
- my OCL environment
public Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getOCLEnvironment()
public AbstractOCLParser getParser()
getParser
in class AbstractAnalyzer
protected C getBoolean()
protected C getOclVoid()
protected OCLStandardLibrary<C> getStandardLibrary()
public static boolean isIdentifierOrKeyword(int tokenKind)
tokenKind
- the token kind to compare
protected String operationString(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String operName, List<? extends TypedElement<C>> args)
operName
- the operation nameargs
- the arguments in the operation call
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)
rule
- the rule name that parsed the qualifiersnc
- the navigation call expressionqualifiers
- the qualifiers to set
TerminateException
protected void checkNotReflexive(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, String rule, AssociationClassCallExp<C,P> acc)
env
- the current environmentrule
- the rule that we are matchingacc
- the association class call expressioncstNode
- context of the call
TerminateException
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)
TerminateException
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)
env
- the current environmentoperationCallExpCS
- the operation call CST noderule
- the name of the concrete syntax rule that we are processingoperName
- the operation namesource
- the operation's source expressionownerType
- 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 iteratorargs
- the operation arguments
TerminateException
protected void packageDeclarationCS(PackageDeclarationCS packageDeclarationCS, List<CT> constraints)
packageDeclarationCS
- the PackageDeclarationCS
CSTNode
constraints
- the constraints list to populate
TerminateException
protected void contextDeclCS(ContextDeclCS contextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
contextDeclCS
- the ContextDeclCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populate
TerminateException
protected void operationContextDeclCS(OperationContextDeclCS operationContextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
operationContextDeclCS
- the OperationContextDeclCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populate
TerminateException
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
- the OperationCS
CSTNode
env
- the classifier context environment
null
if the
operation could not be resolved
TerminateException
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 List<Variable<C,PM>> parametersCS(List<VariableCS> parameters, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
parameters
- the list of parameters as VariableDeclarationCS
objectsenv
- the OCL expression
VariableDeclaration
s
TerminateException
protected CT prePostOrBodyDeclCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, PrePostOrBodyDeclCS prePostOrBodyDeclCS)
prePostOrBodyDeclCS
- the PrePostOrBodyDeclCS
CSTNode
env
- the OCL environmentoperation
- the context EOperation
Constraint
TerminateException
protected P propertyContextCS(PropertyContextCS propertyContextCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, List<CT> constraints)
propertyContextCS
- the PropertyContextCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populate
null
if it could not be
resolvedprotected 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 initOrDerValueCS(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, InitOrDerValueCS initOrDerValueCS)
initOrDerValueCS
- the InitOrDerValueCS
CSTNode
env
- the OCL environmentproperty
- the context EStructuralFeature
Constraint
TerminateException
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
- the ClassifierContextDeclCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populatethe
- classifier context environment, or null
of the
classifier could not be resolved
TerminateException
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 invOrDefCS(InvOrDefCS invOrDefCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
invOrDefCS
- the InvOrDefCS
CSTNode
env
- the OCL environment
Constraint
TerminateException
protected CT invCS(InvCS invCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
invCS
- the InvCS
CSTNode
env
- the OCL environment
Constraint
TerminateException
protected CT defCS(DefCS defCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
defCS
- the DefCS
CSTNode
env
- the OCL environment
Constraint
TerminateException
protected Variable<C,PM> variableDeclarationCS(VariableCS variableDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, boolean addToEnvironment)
variableDeclarationCS
- the VariableDeclarationCS
CSTNode
env
- the OCL environmentaddToEnvironment
- boolean whether or not to add the
the parsed variable to the environment
VariableDeclaration
TerminateException
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)
variableDeclarationCS
- list of VariableDeclarationCS
senv
- the OCL environmentaddToEnvironment
- boolean whether or not to add the
the parsed variable to the environment
VariableDeclaration
s
TerminateException
protected C typeCS(TypeCS typeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
typeCS
- the TypeCS
CSTNode
env
- the OCL environment
EClassifier
representing the type
TerminateException
protected StateExp<C,S> stateExpCS(OCLExpression<C> source, StateExpCS stateExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
source
- the source expression of the oclIsInState operationstateExpCS
- the StateExpCS
CSTNode
env
- the OCL environment
StateExp
representing the state
TerminateException
protected C collectionTypeCS(CollectionTypeCS collectionTypeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
collectionTypeCS
- the CollectionTypeCS
CSTNode
env
- the OCL environment
EClassifier
representing the collection type
TerminateException
protected CollectionKind collectionTypeIdentifierCS(CollectionTypeIdentifierEnum collectionTypeIdentifier)
collectionTypeIdentifier
- the CollectionTypeIdentifierEnum
representing
the collection type
CollectionType
protected C tupleTypeCS(TupleTypeCS tupleTypeCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
tupleTypeCS
- the TupleTypeCS
CSTNode
env
- the OCL environment
TupleTypeCS
TerminateException
protected OCLExpression<C> oclExpressionCS(OCLExpressionCS oclExpressionCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
oclExpressionCS
- the OCLExpressionCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
protected OCLExpression<C> variableExpCS(VariableExpCS variableExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
variableExpCS
- the VariableExpCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
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)
arguments
- the OCLExpressionCS
arguments listenv
- the OCL environmentnavigation
-
OCLExpression
s list
TerminateException
protected IfExp<C> ifExpCS(IfExpCS ifExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
ifExpCS
- the IfExpCS
CSTNode
env
- the OCL environment
IfExpCS
TerminateException
protected LetExp<C,PM> letExpCS(LetExpCS letExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
letExpCS
- the LetExpCS
CSTNode
env
- the OCL environment
LetExpCS
TerminateException
protected OCLExpression<C> letExpCSRecursive(LetExpCS letExpCS, int index, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
letExpCS
- the LetExpCS
CSTNode
index
- the index of the VariableDeclarationCS to parseenv
- the OCL environment
OCLExpression
TerminateException
protected OCLExpression<C> simpleNameCS(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source)
simpleNameCS
- the SimpleNameCS
CSTNode
env
- the OCL environmentsource
- the source of the SimpleNameCS
OCLExpression
TerminateException
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)
collect
iterator expression for a
property call on a collection-type source expression.
source
- the property call source expressionpropertyCall
- the property call expressionenv
- the current environment
TerminateException
protected C primitiveTypeCS(SimpleTypeEnum simpleType, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
simpleType
- the SimpleTypeEnum
representing the primitive type
EClassifie
representing the primitive typeprotected LiteralExp<C> primitiveLiteralExpCS(PrimitiveLiteralExpCS primitiveLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
primitiveLiteralExpCS
- the PrimitiveLiteralExpCS
CSTNode
env
- the OCL environment
LiteralExp
protected IntegerLiteralExp<C> integerLiteralExpCS(IntegerLiteralExpCS integerLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
integerLiteralExpCS
- the IntegerLiteralExpCS
CSTNode
env
- the OCL environment
IntegerLiteralExp
protected UnlimitedNaturalLiteralExp<C> unlimitedNaturalLiteralExpCS(UnlimitedNaturalLiteralExpCS unlimitedNaturalLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
unlimitedNaturalLiteralExpCS
- the UnlimitedNaturalLiteralExpCS
CSTNode
env
- the OCL environment
UnlimitedNaturalLiteralExp
protected RealLiteralExp<C> realLiteralExpCS(RealLiteralExpCS realLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
realLiteralExpCS
- the RealLiteralExpCS
CSTNode
env
- the OCL environment
RealLiteralExp
protected StringLiteralExp<C> stringLiteralExpCS(StringLiteralExpCS stringLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
stringLiteralExpCS
- the StringLiteralExpCS
CSTNode
env
- the OCL environment
StringLiteralExp
protected BooleanLiteralExp<C> booleanLiteralExpCS(BooleanLiteralExpCS booleanLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
booleanLiteralExpCS
- the BooleanLiteralExpCS
CSTNode
env
- the OCL environment
BooleanLiteralExp
protected NullLiteralExp<C> nullLiteralExpCS(NullLiteralExpCS nullLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
nullLiteralExpCS
- the NullLiteralExpCS
CSTNode
env
- the OCL environment
NullLiteralExp
protected InvalidLiteralExp<C> invalidLiteralExpCS(InvalidLiteralExpCS invalidLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
invalidLiteralExpCS
- the InvalidLiteralExpCS
CSTNode
env
- the OCL environment
InvalidLiteralExp
protected OCLExpression<C> literalExpCS(LiteralExpCS literalExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
literalExpCS
- the LiteralExpCS
CSTNode
env
- the OCL environment
LiteralExp
TerminateException
protected TupleLiteralExp<C,P> tupleLiteralExpCS(TupleLiteralExpCS tupleLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
tupleLiteralExpCS
- the TupleLiteralExpCS
CSTNode
env
- the OCL environment
TupleLiteralExp
TerminateException
protected EList<TupleLiteralPart<C,P>> tupleLiteralPartListCS(List<VariableCS> variableDeclarations, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
variableDeclarations
- list of VariableDeclarationCS
esenv
- the OCL environment
TupleLiteralPart
s
TerminateException
protected TupleLiteralPart<C,P> tupleLiteralPartCS(VariableCS variableDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
variableDeclarationCS
- the VariableDeclarationCS
CSTNode
env
- the OCL environmentaddToEnvironment
- boolean whether or not to add the
the parsed variable to the environment
VariableDeclaration
TerminateException
protected OCLExpression<C> enumLiteralExpCS(EnumLiteralExpCS enumLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
enumLiteralExpCS
- the EnumLiteralExpCS
CSTNode
env
- the OCL environment
EnumLiteralExp
TerminateException
protected TypeExp<C> typeCS(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type)
protected CollectionLiteralExp<C> collectionLiteralExpCS(CollectionLiteralExpCS collectionLiteralExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
collectionLiteralExpCS
- the CollectionLiteralExpCS
CSTNode
env
- the OCL environment
CollectionLiteralExp
TerminateException
protected CollectionLiteralPart<C> collectionLiteralPartCS(CollectionLiteralPartCS collectionLiteralPartCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
collectionLiteralPartCS
- the CollectionLiteralPartCS
CSTNode
env
- the OCL environment
CollectionLiteralPart
TerminateException
protected OCLExpression<C> propertyCallExpCS(CallExpCS propertyCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
propertyCallExpCS
- the PropertyCallExpCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
protected LoopExp<C,PM> loopExpCS(LoopExpCS loopExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
loopExpCS
- the LoopExpCS
CSTNode
env
- the OCL environment
LoopExp
TerminateException
protected OCLExpression<C> getCollectionSourceExpression(OCLExpressionCS oclExpressionCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
oclExpressionCS
- the OCLExpressionCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
protected IteratorExp<C,PM> iteratorExpCS(IteratorExpCS iteratorExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
iteratorExpCS
- the IteratorExpCS
CSTNode
env
- the OCL environment
IteratorExp
TerminateException
protected IterateExp<C,PM> iterateExpCS(IterateExpCS iterateExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
iterateExpCS
- the IterateExpCS
CSTNode
env
- the OCL environment
IterateExp
TerminateException
protected OCLExpression<C> modelPropertyCallExpCS(FeatureCallExpCS modelPropertyCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
modelPropertyCallExpCS
- the ModelPropertyCallExpCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
protected OCLExpression<C> getLoopBody(OCLExpression<C> expr)
protected OCLExpression<C> operationCallExpCS(OperationCallExpCS operationCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
operationCallExpCS
- the OperationCallExpCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
protected OCLExpression<C> messageExpCS(MessageExpCS messageExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
messageExpCS
- the MessageExpCS
CSTNode
env
- the OCL environment
OCLExpression
TerminateException
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 getOCLType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, Object metaElement)
protected C getSetType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
protected C getOrderedSetType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
protected C getBagType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
protected C getSequenceType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C elementType)
protected C getCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CollectionKind kind, C elementType)
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 C getOperationMessageType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, O operation)
protected C getSignalMessageType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C signal)
protected C getElementType(C possibleCollectionType)
protected CollectionKind getCollectionKind(C possibleCollectionType)
protected InvalidLiteralExp<C> createDummyInvalidLiteralExp()
#markAsErrorNode(OCLExpression)
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.
expr
- a (sub)expression
markAsErrorNode(TypedElement)
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.
expr
- an expression that takes the place of a (sub)expression that
could not be parsedisErrorNode(TypedElement)
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
LookupException
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 lookupAssociationClassReference(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 ExpressionInOCL<C,PM> createExpressionInOCL()
protected CT createConstraint()
protected void initASTMapping(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, Object astNode, CSTNode cstNode)
env
- astNode
- cstNode
- public static boolean isEscaped(String name)
'_'
) character.
name
- a name
public static String unescape(String name)
name
- an OCL-escaped name
public static boolean equalName(String name, String elementName)
name
- a possibly underscore-escaped nameelementName
- name of an element in the model
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |