uk.ac.ucl.cs.emofocl.ocl.parser
Class Environment
java.lang.Object
uk.ac.ucl.cs.emofocl.ocl.parser.Environment
public class Environment
- extends Object
- Author:
- jwskene
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Environment
public Environment(MOFClass context)
Environment
public Environment(Operation context)
Environment
public Environment(Environment parent,
MOFClass context)
getNestedEnvironment
public Environment getNestedEnvironment()
getModel
public EMOFOCLPackage getModel()
lookupVariable
public Reference lookupVariable(String name)
- May return null. Never complains as failure to find a variable may
mean that the name is referring to an implicit attribute or a type
instead.
- Parameters:
name
-
- Returns:
lookupType
public Type lookupType(String name)
throws EnvironmentException
- Throws:
EnvironmentException
lookupType
public Type lookupType(List path)
throws EnvironmentException
- Throws:
EnvironmentException
addVariableReference
public void addVariableReference(String name,
boolean mayBeImplicit,
VariableDeclaration referredElement)
throws EnvironmentException
- Throws:
EnvironmentException
lookupImplicitAttribute
public Property lookupImplicitAttribute(String name)
- May return null. Never complains, because failure to find an
implicit attribute may mean that the name is referring to a type instead.
getImplicitVariable
public Reference getImplicitVariable()
getOCLTypeFromMultiplicityElement
public Type getOCLTypeFromMultiplicityElement(MultiplicityElement element)
getCollectionType
public CollectionType getCollectionType(CollectionKind kind,
Type elementType)
getVoidType
public VoidType getVoidType()
getInvalidType
public InvalidType getInvalidType()
isCollectionType
public boolean isCollectionType(Type type)
getTupleType
public TupleType getTupleType(List elementNames,
List elementTypes)
getBooleanType
public Type getBooleanType()
getIntegerType
public Type getIntegerType()
getRealType
public Type getRealType()
getStringType
public Type getStringType()
getLibraryOperationCallExp
public LibraryOperationCallExp getLibraryOperationCallExp(Type sourceType,
String name,
List arguments)
throws EnvironmentException
- Constructs a library operation call expression, if any known library
operations match the parameters provided. Neither the name of the call
nor the arguments are set on return, so remember to do this.
- Parameters:
sourceType
- name
- arguments
-
- Returns:
-
- Throws:
EnvironmentException