|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.overturetool.vdmj.definitions.Definition
org.overturetool.vdmj.definitions.PerSyncDefinition
public class PerSyncDefinition
| Field Summary | |
|---|---|
Expression |
guard
|
LexNameToken |
opname
|
| Fields inherited from class org.overturetool.vdmj.definitions.Definition |
|---|
accessSpecifier, classDefinition, location, name, nameScope, pass, used |
| Constructor Summary | |
|---|---|
PerSyncDefinition(LexLocation location,
LexNameToken opname,
Expression guard)
|
|
| Method Summary | |
|---|---|
Definition |
findName(LexNameToken sought,
NameScope scope)
Find whether this Definition contains a definition of a name. |
DefinitionList |
getDefinitions()
Return a list of all the definitions created by this definition. |
Expression |
getExpression()
|
Type |
getType()
Return the static type of the definition. |
LexNameList |
getVariableNames()
Return a list of variable names that would be defined by the definition. |
java.lang.String |
kind()
A string with the informal kind of the definition, like "operation". |
java.lang.String |
toString()
|
void |
typeCheck(Environment base,
NameScope scope)
Perform a static type check of this definition. |
| Methods inherited from class org.overturetool.vdmj.definitions.Definition |
|---|
abort, abort, abort, detail, detail2, equals, findExpression, findStatement, findType, getNamedValues, getProofObligations, getSelfDefinition, hashCode, implicitDefinitions, isAccess, isCallableOperation, isFunctionOrOperation, isInstanceVariable, isRuntime, isStatic, isTypeDefinition, isValueDefinition, markUsed, report, setAccessSpecifier, setClassDefinition, typeResolve, unusedCheck, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final LexNameToken opname
public final Expression guard
| Constructor Detail |
|---|
public PerSyncDefinition(LexLocation location,
LexNameToken opname,
Expression guard)
| Method Detail |
|---|
public DefinitionList getDefinitions()
Definition
getDefinitions in class Definitionpublic Type getType()
Definition
Note that for Definitions which define multiple inner definitions (see
Definition.getDefinitions()), this method returns the primary type - eg.
the type of a function, not the types of its pre/post definitions.
getType in class Definitionpublic LexNameList getVariableNames()
Definition
getVariableNames in class Definitionpublic java.lang.String kind()
Definition
kind in class Definitionpublic java.lang.String toString()
toString in class Definition
public Definition findName(LexNameToken sought,
NameScope scope)
DefinitionfindType
method is used for this.
The implementation in the base class compares the name with this.name,
setting the "used" flag if the names match. Subclasses perform a similar
check on any extra definitions they have created.
Definitions which include state fields are sometimes in scope (from
within operation bodies) and sometimes not (in function bodies). So the
scope parameter is used to indicate what sorts of definitions should be
considered in the lookup. The StateDefinition subclass uses this
to decide whether to consider its state definitions as in scope.
findName in class Definitionsought - The name of the definition sought.scope - The sorts of definitions which may be considered.
public void typeCheck(Environment base,
NameScope scope)
Definition
typeCheck in class Definitionbase - Named definitions potentially in scopescope - The types of names in scopepublic Expression getExpression()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||