A type of element that contains a portion of the primary data in the e-NON stream
Data elements hold the primary information carried in the e-NON stream.
A subtype is an element type that is specified by a prefix and a sub-prefix
Some element types are divided into related subtypes. A subtype introduces a level of hierarchy to the data elements. Only one layer of subtype is supported.
The use of subtypes expands the range of available prefixes at the cost of occasionally requiring 2 prefix bytes for an element.
When an element type declares subtypes, then that element type must always appear with a subtype.
The array
element is an example of an element-type that uses subtypes. The array type is introduced by the array prefix ‘(‘ follwed by the sub-prefix that identifies the type of the array, such as double
or int
.
The metadata element is another example of subtypes.
Each element has a distinct type, which determines how the element content is interpreted.
Element types fall into categories of similar behavior:
- Data Elements
- Scalar Elements
A scalar element is one that contains no other elements.- Constant Values
Constant-value elements require only the prefix to determine the value. These 6 elements are:
null, false, true, positive infinity, negative infinity, NaN
- Nano-int
The nano-int is a special case that lies somewhere between Constant Value and Fixed-size. The nano-int needs only the prefix, but there are 128 prefix values dedicated to the nano-int which determine its value. The value, therefore, is not constant. - Fixed-size
The fixed-size elements are those which always require the same number of bytes to hold the value:
byte, short, int, long, float, double, char(8-bit), time(long)
- Variable-size
A variable-size element might take any length, and requires a size to be specified in the stream:
char(utf8)
,string
,number
,byte[](BLOB)
†,array
†,time(string)
- Constant Values
- Container Elements
Container elements contain other elements within. The two types of container arelist
andmap
.
- Scalar Elements
- Metadata Elements
These elements do not contain data themselves, but provide information that may assist or alter the interpretation of data elements. - Control Elements
These elements influence the behavior and/or state of the e-NON processor.
A unit of data beginning with a prefix byte followed by zero or more bytes of information
An element is the basic unit of information in the e-NON stream. The key distinguishing feature of the element is the prefix. All elements require a prefix.
The element type is identified by the prefix. The information following the prefix is interpreted according to the element type.
An element must always appear in its entirety. It is illegal for the e-NON stream to end anywhere other than an element boundary.
A single-byte value that introduces an element.
A prefix is the first byte of every element in the e-NON stream.
Except for the nano-int element, the prefix maps 1-to-1 with an element type.
The byte values of prefixes are grouped into ranges:
range | prefix type | description |
0x00 |
not a prefix | The special prefix 0 is reserved for element types that do not have a prefix. An element without a prefix can’t apepar in the e-NON stream. Therefore a prefix of 0 is only used for data structures internal to the e-NON processor. |
0x01..0x19 |
control prefix | Control prefixes introduce non-data elements such as metadata. |
0x20..0x7F |
data element prefix | This range is used to prefix the data elements. These are (mostly) the printable ASCII characters. |
0x80..0xFF |
nano-int value | This range represents the 128 nano-int values. |
A single-byte value that follows certain prefixes to indicate an element subtype.
A sub-prefix is the second byte of certain elements in the e-NON stream. When an element type is defined to have subtypes, then the prefix must be followed by a sub-prefix. The sub-prefix determines the element subtype.
Unlike the prefix, the sub-prefix values are not divided into ranges. However, the sub-prefix value 0x00 is reserved to represent not a sub-prefix.