Ad/2010-08-01 Concrete Syntax for a uml action Language for Foundational uml (Alf) Second Revised Submission



Download 1.74 Mb.
Page13/62
Date28.01.2017
Size1.74 Mb.
#9041
1   ...   9   10   11   12   13   14   15   16   ...   62

8.3Primary Expressions

8.3.1Overview


Primary expressions include the simplest kinds of expressions, from which more complicated kinds are constructed. Parenthesized expressions are also considered primary expressions. The categorization into primary expressions is purely a concept of the concrete syntax, with no additional abstract syntax or mapping specification beyond that given for the various kinds of expressions so categorized.

Syntax

PrimaryExpression(e: Expression)
= NameExpression(e)
| NonNamePrimaryExpression(e)


NonNamePrimaryExpression(e: Expression)
= LiteralExpression(e)
| ThisExpression(e)
| ParenthesizedExpression(e)
| PropertyAccessExpression(e)
| InvocationExpression(e)
| InstanceCreationExpression(e)
| LinkOperationExpression(e)
| ClassExtentExpression(e)
| SequenceConstructionExpression(e)
| SequenceAccessExpression(e)
| SequenceOperationExpression(e)
| SequenceReductionExpression(e)
| SequenceExpansionExpression(e)

Cross References

  1. Literal Expression see Subclause 8.3.2

  2. NameExprssion see Subclause 8.3.3

  3. ThisExpression see Subclause 8.3.4

  4. ParenthesizedExpression see Subclause 8.3.5

  5. PropertyAccessExpression see Subclause 8.3.6

  6. InvocationExpression see Subclause 8.3.7

  7. InstanceCreationExpression see Subclause 8.3.12

  8. LinkOperationExpression see Subclause 8.3.13

  9. ClassExtentExpression see Subclause 8.3.14

  10. SequenceConstructionExpression see Subclause 8.3.15

  11. SequenceAccessExpression see Subclause 8.3.16

  12. SequenceOperationExpression see Subclause 8.3.17

  13. SequenceReductionExpression see Subclause 8.3.18

  14. SequenceExpansionExpression see Subclause 8.3.19

Semantics

See the discussion of semantics for each kind of expression in subsequent subclauses.


8.3.2Literal Expressions


A literal expression comprises a single primitive literal (see Subclause 7.7). (Note that enumeration literals are not denoted using literal expression but, rather, using name expressions—see Subclause 8.3.3.)

Syntax

LiteralExpression(e: LiteralExpression)
= BooleanLiteralExpression(e)
| NaturalLiteralExpression(e)
| UnboundedLiteralExpression(e)
| StringLiteralExpression(e)


BooleanLiteralExpression(e: BooleanLiteralExpression)
= BooleanLiteral(e.image)


NaturalLiteralExpression(e: NaturalLiteralExpression)
= NaturalLiteral(e.image)


UnboundedLiteralExpression(e: UnboundedLiteralExpression)
= UnboundedValueLiteral


StringLiteralExpression(e: StringLiteralExpression)
= StringLiteral(e.image)


Figure 8 4 Abstract Syntax of Literal Expressions



Cross References

  1. BooleanLiteral see Subclause 7.7.1

  2. NaturalLiteral see Subclause 7.7.2

  3. UnboundedValueLiteral see Subclause 7.7.3

  4. StringLiteral see Subclause 7.7.4

  5. Expression see Subclause 8.1

Semantics

A literal expression evaluates to the single primitive value denoted by its primitive literal.

The type of a literal expression is the primitive type corresponding to the kind of primitive literal it comprises. Its multiplicity is always [1..1].

8.3.3Name Expressions


A name expression evaluates to the values denoted by a name.

Syntax

NameExpression(e: NameExpression)
= PotentiallyAmbiguousQualifiedName(e.name)


Figure 8 5 Abstract Syntax for Name Expressions



Cross References

  1. Expression see Subclause 8.1

  2. QualifiedName see Subclause 8.2

  3. PotentiallyAmbiguousQualifiedName see Subclause 8.2

NOTE. See Subclause 8.2 for rules on the disambiguation of a qualified name with the dot notation used as a name expression versus a property access expression.

Semantics

The given name for a name expression must either resolve to an enumeration literal name or to a parameter or local name with an assigned source before the name expression. However, a name with a @parallel annotation as its assigned source may not be used as a name expression (as discussed in Subclause 9.12).

A local name is never qualified.

A parameter name may only be used if the name expression appears within the body of a behavior with parameters (see UML Superstructure, Subclause 13.3.2). The parameter name may be qualified by the name of the behavior or, if the behavior is the method of an operation, by the name of the operation. But this is never required since the names of the parameters of a behavior are always in the current scope of the definition of the behavior.

A name expression is evaluated as follows.


  • Local Name. The values of a local name are those given by its assigned source.

  • Parameter Name. The values of a parameter name are those given by its assigned source. For an in or inout parameter, this will initially be the value assigned to the parameter when the enclosing behavior began execution. However, an inout parameter may be reassigned, in which case its assigned source will change (see Subclause 8.8). An out parameter is always given a value only by explicit assignment (see Subclause 8.8).

  • Enumeration Literal Name. The value of an enumeration literal name is the named enumeration literal.

The type and multiplicity of a name expression are the same as its name, determined as given below.

  • Local Name. Determined by its first assignment (see Subclause 8.8).

  • Parameter Name. As declared for the named parameter.

  • Enumeration Literal. The type is the corresponding enumeration and the multiplicity is [1..1].



Download 1.74 Mb.

Share with your friends:
1   ...   9   10   11   12   13   14   15   16   ...   62




The database is protected by copyright ©ininet.org 2024
send message

    Main page