Difference between revisions of "XCSG:Variable"
From AtlasWiki
(→Language mappings) |
(changed "memoryBarrier" tag to "happensBefore" tag) |
||
Line 20: | Line 20: | ||
{{XCSGTag | {{XCSGTag | ||
− | | name = | + | | name = happensBefore |
| description = Indicates that reading from the variable creates a "happens before" relationship to any code (in any thread) that previously wrote to the variable. | | description = Indicates that reading from the variable creates a "happens before" relationship to any code (in any thread) that previously wrote to the variable. | ||
| references = [http://docs.oracle.com/javase/specs/jls/se5.0/html/classes.html#8.3.1.4 JLS, SE 5.0: volatile fields] | | references = [http://docs.oracle.com/javase/specs/jls/se5.0/html/classes.html#8.3.1.4 JLS, SE 5.0: volatile fields] |
Revision as of 11:44, 2 July 2014
A Variable in XCSG is a named assignable entity.
The semantics of Variable are those common to all its subtypes.
Specifications
Metaclass | Variable |
---|---|
Extends | Node |
Description | A named assignable entity that represents a portion of the system’s state. |
Direct Subkinds | CallInput, Field, ProgramVariable, StackVariable |
---|
All Superkinds | Node, ModelElement |
---|
Specified In Edges | |||
---|---|---|---|
In Edge | Predecessor | Multiplicity | Description |
DataFlow (Edge) | DataFlow (Node) | ✱ | Connects DataFlow nodes to one another and to Variables, linking the origin of data to locations that it is modified or consumed. |
Specified Out Edges | |||
---|---|---|---|
Out Edge | Successor | Multiplicity | Description |
DataFlow (Edge) | DataFlow (Node) | ✱ | Connects DataFlow nodes to one another and to Variables, linking the origin of data to locations that it is modified or consumed. |
DefinedAs | TypeAlias | 0..1 | Connects a Variable or DataFlow node which received its Type via a TypeAlias (such as a C/C++ typedef) to that TypeAlias. |
InstanceVariableWritten | InstanceVariableAssignment | ✱ | Connects a value (DataFlow (Node) or Variable) representing an object instance to an InstanceVariableAssignment representing a write to a field of that object. |
TypeOf | Type | 1 | Links a Variable or DataFlow node to its Type |
Known Possible In Edges | ||||
---|---|---|---|---|
In Edge | Predecessor | Multiplicity | Description | |
HasVariable | Namespace | 1 | Links a Classifier or Package to one of its Variables. | |
InterproceduralDataFlow | Assignment | ✱ | Represents data flows between Functions, or involving Variables visible to multiple Functions.
| |
Inherited From | In Edge | Predecessor | Multiplicity | Description |
Node | Contains | Node | 1 | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |
Known Possible Out Edges | ||||
---|---|---|---|---|
Out Edge | Successor | Multiplicity | Description | |
InterproceduralDataFlow | DataFlow (Node) | ✱ | Represents data flows between Functions, or involving Variables visible to multiple Functions.
| |
Inherited From | Out Edge | Successor | Multiplicity | Description |
Node | Contains | Node | ✱ | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |
Tag | immutable |
---|---|
Description | Present if the variable cannot be changed after initialization. |
Tag | volatile |
---|---|
Description | Present if the code indicates the variable requires special treatment because the variable's value can be changed externally, e.g. by hardware. |
Tag | happensBefore |
---|---|
Description | Indicates that reading from the variable creates a "happens before" relationship to any code (in any thread) that previously wrote to the variable. |
Enumeration | Visibility |
---|---|
Description | The visibility of a Type, Variable, or Function in its Namespace. |
Language mappings
The volatile
tag maps exactly to the volatile
keyword in C and C++. Note that other languages, notably Java (since 1.5), use the same keyword, but additionally require a memory barrier or "happens before" relationship between writes to the variable and later reads; for such variables, both the volatile
and memoryBarrier
tags should be present.
Individual language mappings are provided for each subtype of Variable (Attribute, AssociationEnd, ArrayElement, Parameter, and LocalVariable).