|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 java.util.List<OCLExpression<C>> |
argumentsCS(OperationCallExpCS operationCallExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
|
protected OCLExpression<C> |
arrowOperationCallExpCS(OperationCallExpCS operationCallExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OperationCallExpCS for an -> |
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,
java.lang.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,
java.util.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,
java.util.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()
Deprecated. Use the createDummyInvalidLiteralExp(Environment, CSTNode)
method, instead |
protected InvalidLiteralExp<C> |
createDummyInvalidLiteralExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CSTNode cstNode)
Creates a dummy expression of invalid-literal type to be a placeholder for a (sub)expression that could not be parsed. |
protected C |
createDummyInvalidType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CSTNode cstNode,
java.lang.String message)
Return the type used to terminate the AST reference from cstNode that failed to be resolved due to message. |
protected java.lang.Object |
createDummyPackage(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
PackageDeclarationCS packageDeclarationCS)
Return the package used to terminate the AST reference from an implicit PackageDeclarationCS. |
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 OCLExpression<C> |
createImplicitSource(OperationCallExpCS operationCallExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.util.List<OCLExpression<C>> args)
|
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,
java.util.List<java.lang.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)
|
static |
createSequenceOfNames(PathNameCS pathNameCS,
SimpleNameCS simpleNameCS)
|
protected VariableExp<C,PM> |
createVariableExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CSTNode cst,
Variable<C,PM> var)
Creates a variable expression with the variable that it references. |
protected CT |
defCS(DefCS defCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
DefCS |
protected void |
documentCS(OCLDocumentCS documentCS,
java.util.List<CT> constraints)
Analyzes a top-level document CS. |
static boolean |
equalName(java.lang.String name,
java.lang.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,
java.lang.String rule,
java.lang.String operName,
OCLExpression<C> source,
C ownerType,
java.util.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. |
protected Variable<C,PM> |
genVariableDeclaration(CSTNode cstNode,
java.lang.String rule,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.lang.String name,
C type,
OCLExpression<C> initExp,
boolean explicitFlag,
boolean addToEnvironment,
boolean isSelf)
Generate a VariableDeclaration AST node, and add it to the environment. |
AbstractOCLParser |
getAbstractParser()
Obtains the parser that I use to transform the OCL text into the Concrete Syntax Model. |
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(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CollectionKind kind,
C elementType)
Obtains the current environment's representation of the collection type of the specified kind on the given element type. |
protected C |
getCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
CollectionKind kind,
C elementType)
Deprecated. Since 1.3, use the getCollectionType(CSTNode, Environment, CollectionKind, Object)
method, instead. |
protected C |
getCommonSuperType(CSTNode cstNode,
java.lang.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,
java.lang.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()
Obtains my parser. |
protected C |
getPropertyType(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
P property)
Obtains the type, in the current environment, of the specified property. |
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,
|
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,
java.lang.Object astNode,
CSTNode cstNode)
Initialize the symmetric 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 void |
initASTMapping(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.lang.Object fromAstNode,
CSTNode cstNode,
java.lang.Object toAstNode)
Initialize the asymmetric mapping of an object (typically an astNode) to its originating cstNode, and of a cstNode to its consequent object (typically an astNode) 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 |
isAtPre(FeatureCallExpCS callExp)
Queries whether the specified call expression is adorned with @pre. |
protected boolean |
isAtPre(VariableExpCS callExp)
Queries whether the specified variable expression is adorned with @pre. |
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(java.lang.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, otherwise 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 OCLExpression<C> |
letExp(LetExpCS letExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
LetExpCS |
protected LetExp<C,PM> |
letExpCS(LetExpCS letExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
Deprecated. Since 1.3, use letExp(LetExpCS, Environment) ,
instead. |
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,
java.lang.String name)
|
protected C |
lookupClassifier(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.util.List<java.lang.String> className)
|
protected Variable<C,PM> |
lookupImplicitSourceForOperation(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.util.List<OCLExpression<C>> args,
java.lang.String operationName)
|
protected O |
lookupOperation(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
java.lang.String name,
java.util.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,
java.lang.String name)
|
protected C |
lookupSignal(CSTNode cstNode,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
C owner,
java.lang.String name,
java.util.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,
java.util.List<java.lang.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> |
oclIsInStateOperationCallExpCS(OperationCallExpCS operationCallExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
OperationCallExpCS for oclIsInState |
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,
java.util.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 java.lang.String |
operationString(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.lang.String operName,
java.util.List<? extends TypedElement<C>> args)
Constructs the string representation of an operation call. |
protected void |
packageDeclarationCS(PackageDeclarationCS packageDeclarationCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.util.List<CT> constraints)
Analyzes a package declaration in the context of the environment created for an OCLDocumentCS . |
protected void |
packageDeclarationCS(PackageDeclarationCS packageDeclarationCS,
java.util.List<CT> constraints)
Parses a top-level package declaration that is not nested in an OCLDocumentCS . |
protected java.util.List<Variable<C,PM>> |
parametersCS(java.util.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,
java.util.List<CT> constraints)
PropertyContextCS |
protected java.util.List<OCLExpression<C>> |
qualifiersCS(java.util.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 |
resolveIteratorOperation(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
Ovverridden by subclasses to assign the AST Operation target for an iterator reference from the CST. |
protected void |
setQualifiers(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
java.lang.String rule,
NavigationCallExp<C,P> nc,
java.util.List<OCLExpression<C>> qualifiers)
Sets the specified navigation call's qualifiers, if they are compatible with the navigated association end or association class. |
protected AssociationClassCallExp<C,P> |
simpleAssociationClassName(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source,
C owner,
java.lang.String simpleName)
Attempts to parse a simpleNameCS as an association-class call expression. |
protected OCLExpression<C> |
simpleNameCS(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source)
Parses a simpleNameCS token. |
protected PropertyCallExp<C,P> |
simplePropertyName(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source,
C owner,
java.lang.String simpleName)
Attempts to parse a simpleNameCS as a property call expression. |
protected TypeExp<C> |
simpleTypeName(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source,
C classifier,
java.lang.String simpleName)
Attempts to parse a simpleNameCS as a type expression. |
protected OCLExpression<C> |
simpleUndefinedName(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source,
java.lang.String simpleName)
The error case for simpleNameCS, which is called when the name cannot be resolved to any suitable expression. |
protected VariableExp<C,PM> |
simpleVariableName(SimpleNameCS simpleNameCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
OCLExpression<C> source,
java.lang.String simpleName)
Attempts to parse a simpleNameCS as a variable expression. |
protected StateExp<C,S> |
stateExpCS(OCLExpression<C> source,
CSTNode stateExpCS,
stateExpCS |
protected OCLExpression<C> |
staticOperationCallExpCS(OperationCallExpCS operationCallExpCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
|
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 |
tupleLiteralPartListCS(java.util.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)
EnumLiteralExpCS |
protected C |
typeCS(TypeCS typeCS,
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
TypeCS |
static java.lang.String |
unescape(java.lang.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 java.util.List<Variable<C,PM>> |
variableDeclarationListCS(java.util.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, reset, reset, 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 getAbstractParser()
AbstractAnalyzer
getAbstractParser
in class AbstractAnalyzer
public AbstractOCLParser getParser()
AbstractAnalyzer
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 java.lang.String operationString(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.lang.String operName, java.util.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, java.lang.String rule, NavigationCallExp<C,P> nc, java.util.List<OCLExpression<C>> qualifiers)
rule
- the rule name that parsed the qualifiersnc
- the navigation call expressionqualifiers
- the qualifiers to setprotected void checkNotReflexive(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.lang.String rule, AssociationClassCallExp<C,P> acc)
env
- the current environmentrule
- the rule that we are matchingacc
- the association class call expressioncstNode
- context of the callprotected Variable<C,PM> genVariableDeclaration(CSTNode cstNode, java.lang.String rule, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.lang.String name, C type, OCLExpression<C> initExp, boolean explicitFlag, boolean addToEnvironment, boolean isSelf)
protected OperationCallExp<C,O> genOperationCallExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OperationCallExpCS operationCallExpCS, java.lang.String rule, java.lang.String operName, OCLExpression<C> source, C ownerType, java.util.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 argumentsprotected void documentCS(OCLDocumentCS documentCS, java.util.List<CT> constraints)
documentCS
- the documentconstraints
- the constraints list to populateprotected void packageDeclarationCS(PackageDeclarationCS packageDeclarationCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<CT> constraints)
OCLDocumentCS
.
packageDeclarationCS
- the package declaration to analyzeenv
- the OCL document environment in which to analyze itconstraints
- the constraints list to populateprotected void packageDeclarationCS(PackageDeclarationCS packageDeclarationCS, java.util.List<CT> constraints)
OCLDocumentCS
.
packageDeclarationCS
- the package declarationconstraints
- the constraints list to populateprotected void contextDeclCS(ContextDeclCS contextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<CT> constraints)
contextDeclCS
- the ContextDeclCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populateprotected void operationContextDeclCS(OperationContextDeclCS operationContextDeclCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<CT> constraints)
operationContextDeclCS
- the OperationContextDeclCS
CSTNode
env
- the package environmentconstraints
- the constraints list to populateprotected 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 resolvedprotected 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 java.util.List<Variable<C,PM>> parametersCS(java.util.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
sprotected 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
protected P propertyContextCS(PropertyContextCS propertyContextCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.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
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, java.util.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 resolvedprotected 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
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
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
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
protected java.util.List<Variable<C,PM>> variableDeclarationListCS(java.util.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
sprotected 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 typeprotected StateExp<C,S> stateExpCS(OCLExpression<C> source, CSTNode stateExpCS,statePath, 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 stateprotected 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 typeprotected 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
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
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
protected boolean isAtPre(FeatureCallExpCS callExp)
callExp
- a call expression
protected boolean isAtPre(VariableExpCS callExp)
variableExp
- a variable expression
protected VariableExp<C,PM> createVariableExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CSTNode cst, Variable<C,PM> var)
env
- the current parsing environmentcst
- the concrete syntax that produces the variable expressionvar
- the referred variable
protected java.util.List<OCLExpression<C>> qualifiersCS(java.util.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 listprotected 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
@Deprecated protected LetExp<C,PM> letExpCS(LetExpCS letExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
letExp(LetExpCS, Environment)
,
instead.
letExpCS
- the LetExpCS
CSTNode
env
- the OCL environment
LetExpCS
protected OCLExpression<C> letExp(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
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
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
simpleAssociationClassName(SimpleNameCS, Environment,
OCLExpression, Object, String)
,
simplePropertyName(SimpleNameCS, Environment, OCLExpression,
Object, String)
,
simpleTypeName(SimpleNameCS, Environment, OCLExpression, Object,
String)
,
simpleVariableName(SimpleNameCS, Environment, OCLExpression,
String)
,
simpleUndefinedName(SimpleNameCS, Environment, OCLExpression,
String)
protected AssociationClassCallExp<C,P> simpleAssociationClassName(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source, C owner, java.lang.String simpleName)
simpleNameCS
- the simple nameenv
- the current environmentsource
- the navigation source expression, or null
if the
source is implicitowner
- the owner of the association-class end to be navigated, or
null
if the source is implicitsimpleName
- the simple name, as a string
null
if the
simple name does not resolve to a related association classsimpleNameCS(SimpleNameCS, Environment, OCLExpression)
protected PropertyCallExp<C,P> simplePropertyName(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source, C owner, java.lang.String simpleName)
simpleNameCS
- the simple nameenv
- the current environmentsource
- the navigation source expression, or null
if the
source is implicitowner
- the owner of the property to be navigated, or
null
if the source is implicitsimpleName
- the simple name, as a string
null
if the simple name
does not resolve to an available propertysimpleNameCS(SimpleNameCS, Environment, OCLExpression)
protected TypeExp<C> simpleTypeName(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source, C classifier, java.lang.String simpleName)
source
is provided, if any. In such cases, it is usually
inappropriate to attempt to resolve the simple name as a type expression.
Also, the referenced classifier
may already be determined to
be a member of the OCL Standard Library.
simpleNameCS
- the simple nameenv
- the current environmentsource
- the navigation source expression, if any, in which case this
would not be a type expression in OCLclassifier
- the referenced classifier, if it is already known to be one of
the OCL Standard Library typessimpleName
- the simple name, as a string
null
if the simple
name does not resolve to an accessible typesimpleNameCS(SimpleNameCS, Environment, OCLExpression)
protected VariableExp<C,PM> simpleVariableName(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source, java.lang.String simpleName)
source
, if any, is provided for completeness and
generality. If there is a navigation source, then it is not usually
appropriate to attempt to resolve the simple name as a variable.
simpleNameCS
- the simple nameenv
- the current environmentsource
- the navigation source expression, if any, in which case this
would not be a variable expression in OCLsimpleName
- the simple name, as a string
null
if the simple name
does not resolve to an accessible variablesimpleNameCS(SimpleNameCS, Environment, OCLExpression)
protected OCLExpression<C> simpleUndefinedName(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, OCLExpression<C> source, java.lang.String simpleName)
simpleNameCS
- the simple nameenv
- the current environmentsource
- the navigation source expression, or null
if the
source is implicitsimpleName
- the simple name, as a string
simpleNameCS(SimpleNameCS, Environment, OCLExpression)
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
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
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
protectedtupleLiteralPartListCS(java.util.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
sprotected 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
protected TypeExp<C> typeCS(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C type)
enumLiteralExpCS
- the EnumLiteralExpCS
CSTNode
env
- the OCL environment
EnumLiteralExp
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
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
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
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
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
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
protected void resolveIteratorOperation(SimpleNameCS simpleNameCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
simpleNameCS
- the iterator nameenv
- the current OCL environmentprotected 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
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
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
protected OCLExpression<C> createImplicitSource(OperationCallExpCS operationCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<OCLExpression<C>> args)
protected OCLExpression<C> arrowOperationCallExpCS(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
protected OCLExpression<C> oclIsInStateOperationCallExpCS(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
protected OCLExpression<C> staticOperationCallExpCS(OperationCallExpCS operationCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
protected java.util.List<OCLExpression<C>> argumentsCS(OperationCallExpCS operationCallExpCS, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
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
protected C getCommonSuperType(CSTNode cstNode, java.lang.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, java.lang.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(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CollectionKind kind, C elementType)
cstNode
- the concrete syntax of a collection-type referenceenv
- the current environmentkind
- the collection kind to retrieveelementType
- the collection type's element type
@Deprecated protected C getCollectionType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CollectionKind kind, C elementType)
getCollectionType(CSTNode, Environment, CollectionKind, Object)
method, instead.
env
- the current environmentkind
- the collection kind to retrieveelementType
- the collection type's element type
protected C getTupleType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,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 getPropertyType(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, P property)
cstNode
- a property-call or property-context concrete syntaxenv
- the current OCL parsing environmentowner
- the contextual classifier of the property referenceproperty
- the referenced property
protected C getElementType(C possibleCollectionType)
protected CollectionKind getCollectionKind(C possibleCollectionType)
@Deprecated protected InvalidLiteralExp<C> createDummyInvalidLiteralExp()
createDummyInvalidLiteralExp(Environment, CSTNode)
method, instead
#markAsErrorNode(OCLExpression)
protected InvalidLiteralExp<C> createDummyInvalidLiteralExp(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CSTNode cstNode)
env
- the contextual parsing environmentcstNode
- the concrete-syntax node that could not be analyzed
#markAsErrorNode(OCLExpression)
,
createDummyInvalidLiteralExp()
protected C createDummyInvalidType(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, CSTNode cstNode, java.lang.String message)
env
- the current OCL parsing environmentcstNode
- a concrete syntax node that could not be resolvedmessage
- the reason for the failure to resolve. Subclasses may choose
to log this message in some way
protected java.lang.Object createDummyPackage(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, PackageDeclarationCS packageDeclarationCS)
null
. Subclasses may override to create a more interesting
package.
env
- the current OCL parsing environmentpackageDeclarationCS
- the concrete syntax of the package declaration
null
if non is requiredprotected 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, java.util.List<java.lang.String> packageName) throws LookupException
LookupException
protected C lookupClassifier(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<java.lang.String> className)
protected Variable<C,PM> lookupImplicitSourceForOperation(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.util.List<OCLExpression<C>> args, java.lang.String operationName)
protected O lookupOperation(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, java.lang.String name, java.util.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, java.lang.String name)
protected C lookupAssociationClassReference(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, java.lang.String name)
protected C lookupSignal(CSTNode cstNode, Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, C owner, java.lang.String name, java.util.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, java.util.List<java.lang.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, java.lang.Object astNode, CSTNode cstNode)
env
- the current OCL parsing environmentastNode
- the abstract syntax nodecstNode
- the concrete syntax node that generated itprotected void initASTMapping(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, java.lang.Object fromAstNode, CSTNode cstNode, java.lang.Object toAstNode)
env
- the current OCL parsing environmentfromAstNode
- the source of an AST-to-CST mappingcstNode
- the target of the AST-to-CST mapping and the source of a
CST-to-AST mappingtoAstNode
- the target of the CST-to-AST mappingpublic staticcreateSequenceOfNames(PathNameCS pathNameCS, SimpleNameCS simpleNameCS)
public static boolean isEscaped(java.lang.String name)
'_'
) character.
name
- a name
public static java.lang.String unescape(java.lang.String name)
name
- an OCL-escaped name
public static boolean equalName(java.lang.String name, java.lang.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 |