Chapter 3 The Application Description Language

3.7 Expressions

You construct expressions from variables (see Section 3.6, "Variable Definitions" page 18), constants (see Section 3.4, "Base Type Constants" page 15), operators, and delimiters. The ADL operator set is a near subset of the C++ operator set with a few additions and is described in the figures below.

3.7.1 Delimiters

Delimiters in the ADL primarily group together related tokens. For example, you use parentheses to change precedence within an expression. ADL delimiters have a higher precedence than operators, thereby allowing them to control the order of evaluation.
ADL Delimiters
DelimiterPairPurposeSample Usage
( )To change order of computation in expressions(1+2) * 3
{}To form a list from expressions{'A, 'World, 2*3}
[], [), (], ()To form an interval from pairs of numbers

 

5 : (4,6)

 

In some cases delimiters create a new semantic item out of the elements they enclose. The interval delimiters serve this purpose by making an interval from two numbers. However, intervals are more than two numbers paired together. They possess "open" or "closed" attributes at each endpoint and support a test for membership in the interval.

3.7.2 Operators

When the same operator occurs in both the ADL and in C++, it has the same semantics, precedence, and associativity. The following points deserve special notice:


[5] Any implies any base or compound data type. The equal and not equal operators can also be applied to arrays (Section 3.9, "Complex Data Types" page 25), but not to objects.
3.7.1 - Delimiters
3.7.2 - Operators

AM2 Documentation - 19 NOV 1996

Generated with Harlequin WebMaker