Download User Control Language (UCL) Reference Manual
Transcript
Dok.-Nr/Doc. No.: COL–RIBRE–STD–0010
Daimler–Benz Aerospace
Ausgabe/Issue:
Überarbtg./Rev.:
Seite/Page:
Raumfahrt-Infrastruktur
4
–
4–4
Datum/Date : 13.03.1998
Datum/Date:
von/of
4–71
4.1.2.4 Numeric Literals
In the UCL source code, numeric literals (constants) may take three possible forms: integer (simple
integer), based integer or real numbers.
4.1.2.4.1 Integers
An integer is simply a sequence of digits (’0’ .. ’9’). The underscore character (’_’) may be used to
logically group digits, it has no effect on the numeric value of the literal. The value of an integer must
be in the range: 0 .. MAX(UNSIGNED_INTEGER). The compiler issues an error message if this
range constraint is violated.
Formal syntax
Simple_Integer = Digits
Digits
= Digit { [ ”_” ] Digit }
Digit
= ”0” | ”1” | ”2” | ”3” | ”4” | ”5” | ”6” | ”7” | ”8” | ”9”
Examples
5, 123, 027, 10_000
4.1.2.4.2 Based Integers
A based integer has the form:
Base “#” Value “#”
where Base is a decimal number indicating the base of the numbering system, it must be in the range
2 .. 16. Some bases are particularly useful: 2 for binary, 8 for octal, 10 for decimal (the default), or 16
for hexadecimal. Value must be a sequence of ”extended digits” (i.e. ’0’ .. ’9’ or the letters ’A’ .. ’F’,
which in hexadecimal notation correspond to the decimal values 10 .. 15, respectively). Further, for a
given base B, each ”extended digit” must be in the range: 0 to B–1.
The compiler generates an error if the value of the specified number is not in the range
0 .. MAX(INTEGER).
Formal syntax
Based_Integer = Digits ”#” Hex_Digit { Hex_Digit } ”#”
Digits
= see 4.1.2.4.1
Hex_Digit
= Digit | ”A” | ”B” | ”C” | ”D” | ”E” | ”F”
Examples of based integers, all having the value 255:
2#1111_1111#
8#377#
16#FF#
10#255#
Daimler–Benz Aerospace AG, D–28199 Bremen – All Rights reserved – Copyright per DIN 34