| ... | ... | @@ -30,18 +30,17 @@ if 'const' is specified then that is an assertion the contents of memory there w |
|
|
|
initialized data is trickier, a possible syntax is
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
|
|
|
|
foreign space [bigendian|littleendian] [const] <n> :: Ptr <type> = constant
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
where constant may be one of
|
|
|
|
|
|
|
|
a value: 3
|
|
|
|
- a value: 3
|
|
|
|
|
|
|
|
an initialized list: [ 0, 1, 2, ...]
|
|
|
|
- an initialized list: \[ 0, 1, 2, …\]
|
|
|
|
|
|
|
|
a "string" to be output as utf8, utf16 or ucs4 unicode code points depending on what type of pointer it is assigned to.
|
|
|
|
|
|
|
|
```
|
|
|
|
- a "string" to be output as utf8, utf16 or ucs4 unicode code points depending on what type of pointer it is assigned to.
|
|
|
|
|
|
|
|
|
|
|
|
if the data is initialized as a string, \<n\> will always refer to a number of characters regardless of encoding and the string will be null terminated (unless an explicit \<n\> chops off the trailing space)
|
| ... | ... | @@ -68,11 +67,11 @@ another possibility is the definition of 'manifestly constant' data. which is de |
|
|
|
```wiki
|
|
|
|
name :: built-in-type
|
|
|
|
name = <constant>
|
|
|
|
```
|
|
|
|
|
|
|
|
or sizeof a builtin
|
|
|
|
- or sizeof a builtin
|
|
|
|
|
|
|
|
or 'foo <op> bar' where foo and bar are manifestly constant and op is a basic operation.
|
|
|
|
```
|
|
|
|
- or 'foo \<op\> bar' where foo and bar are manifestly constant and op is a basic operation.
|
|
|
|
|
|
|
|
|
|
|
|
then allow such manifestly constant values for n and allow types whose sizeof is manifestly constant to be used in foreign space declarations.
|
| ... | ... | |