NET/MASTER Network Control Language (NCL) Reference Manual
Lexical Elements of NCL
Compiler Operation
106126 Tandem Computers Incorporated 8–5
Symbols are not variables. The value of a symbol is the symbol itself, whereas the
value of a variable can change.
Uppercase alphabetic characters in the symbol remain as uppercase characters.
Lowercase characters are not converted to uppercase except when the language
requires it: for example, when the letters represent a label.
Symbols include numbers as a subset. If a symbol is in a context that permits it to be a
number, it must begin with a digit (0 through 9) or a period (.), and it must follow the
syntax:
[ 0–9 … ] [ . ] [ 0–9 … ] [ e [ + | - ] [ 0–9 … ]]
If a symbol is in a context that permits it to be a number, but one or more of these
conditions fail, the compiler regards the symbol as an unquoted string. Moreover, if
the context requires it to be numeric, the compiler raises an error.
A number can also include a plus sign (+) or minus sign (-), indicating the sign of the
exponent (indicated by the letter e). Only a symbol that is a number can use these
characters, and this is the only position in a number in which a plus sign or minus sign
can occur. A plus sign or a minus sign before a number is regarded as a unary
operator and not as part of the number itself.
For example, the sequence of characters 123.7e+2 (in which the plus sign is a unary
operator) is a single symbol (and, therefore, a single lexical element), but the sequence
of characters 123.45e-x6 is not a single symbol—it is three lexical elements: 123.45e, -,
and x6. This is the case because the x after the minus sign cannot be used in that
position.
Note An exponent is always the power to which 10 is raised. For example, 7e2 represents 7 multiplied by 100
(10 raised to the power of 2); the result is 700.
Quoted Strings A quoted string is a lexical element that begins with a single quote (‘) or double quote
(“) and ends with a quote of the same type. The compiler operates as if the last
character of the quoted string is a quote of the same type, and it uses the closing quote
to delimit the lexical element. A compilation error occurs if the quotes are not of the
same type.
A quoted string can cross source line boundaries without requiring a line
continuation character (,). (Trailing blanks are stripped from a line during
compilation, but leading blanks on the next line are part of the quoted string. For
more information, see “Terminating and Continuing a Statement” later in this section.)
A quoted string must end before the end of the current source file.