ModSlaveSim help v3.07 - 5.1. Lexical Structure
Download manual: HTML
ModSlaveSim contains 4 classes of tokens: identifiers, constants, operators and keywords.
token:
identifier
keyword
constant
operator
Whitespace (space, newlines, tabs) is ignored except in its role as a separator of tokens.
-
identifier :
integer_constant
An identifier is a
followed by a sequence of digits.In ModSlaveSim an identifier is used to refer to a register. An expression may contain a reference to any register, including itself. An alternative way to refer to itself is by using the form
.To identify a specific register, the register address is used as the sequence of digits after the Map Addresses). Identifiers can therefore occur in the range $0 to $2147483647.
. The minimum value for an address is 0 and the maximum value 'model address' is 2147483647 (seeA warning message appears when an expression contains a reference to a register that has not yet been entered (declared). It is possible to continue and enter the register later.
-
keyword : | | | |
Keywords are all case-sensitive. Pre-defined Variables).
and are ModSlaveSim variables (see section -
constant :
integer_constant
floating_constant
integer_constant : integer
integer : digit digit*
digit : | | | | | | | | |
An integer_constant is a digit followed by zero or more digits.
floating_constant :
integer period
integer period? exponent
integer? period integer exponent?
period :
exponent :
sign? integer
sign? integer
sign :
A floating_constant must have either a period [ ] or an exponent e.g. [ ], but may have both. It must also have an integer component either for the whole number part, or the fraction part, or both. The following are all valid examples::
67. 67.0 67.89 0.89 .89 6e-3 67.e+4 67.89e-2 0.89e1 .89e-4
For all constants, a sequence of digits is taken to be in decimal radix.
-
operator :
unary_sign
| |
binary_sign
|
bitwise_or
| | | | |
An operator specifies an operation to be performed that returns a value. The object that the operator acts upon is the operand.
The
operator shall always occur in a pair.