A Token is a pattern-matching symbol that is present in the assembly stream. A Token is not a literal and it has no assembly or disassembly.
A Token has a pattern property that defines a regex for the symbols that it
should match, and a default property that gives the rendering for the
Token in a disassembled stream if no other rendering is available.
The four examples given below are for forms of COMMA, SPACE, UInteger, and EMPTY.
COMMA and SPACE are delimiters that occur in the assembly stream between assembly symbols.
UInteger matches any positive integer, starting from 0 and rising to infinity.
The parent Rule can explicitly write the appropriate value in disassembly.
The EMPTY token states that an empty string is present. Some instances of Choice
use this as the final option in a set of valid sets of symbols (if there is behavior that occurs when no
value is present), whereas others end with a null.
| Properties | Type | Description |
|---|---|---|
| _meta | Meta |
Metadata
See
Meta
for more information.
|
| _type |
|
|
| default |
oneOf [
string
null
]
|
The default rendering for this Token in assembly strings. SPACE matches any number of whitespace characters but always renders as one.
oneOf string
oneOf null
|
| pattern◊ |
|
The regex pattern matching this Token. SPACE matches any number of whitespace characters but always renders as one. |
|
||
|
||
{
"_type": "Instruction.Rules.Token",
"pattern": ",\\s+",
"default": ", "
}
{
"_type": "Instruction.Rules.Token",
"pattern": "\\s+",
"default": " "
}
{
"_type": "Instruction.Rules.Token",
"pattern": "[1-9][0-9]*"
}
{
"_type": "Instruction.Rules.Token",
"pattern": "",
"default": ""
}
{
"info": [
[
"A $(~Instruction.Rules.Token) is a pattern-matching symbol that is present in the assembly stream.",
"A Token is not a literal and it has no assembly or disassembly."
],
[
"A $(~Instruction.Rules.Token) has a `pattern` property that defines a regex for the symbols that it",
"should match, and a `default` property that gives the rendering for the",
"$(~Instruction.Rules.Token) in a disassembled stream if no other rendering is available."
],
"The four examples given below are for forms of `COMMA`, `SPACE`, `UInteger`, and `EMPTY`.",
"`COMMA` and `SPACE` are delimiters that occur in the assembly stream between assembly symbols.",
[
"`UInteger` matches any positive integer, starting from 0 and rising to infinity.",
"The parent $(~Instruction.Rules.Rule) can explicitly write the appropriate value in disassembly."
],
[
"The `EMPTY` token states that an empty string is present. Some instances of $(~Instruction.Rules.Choice)",
"use this as the final option in a set of valid sets of symbols (if there is behavior that occurs when no",
"value is present), whereas others end with a null."
]
],
"type": "object",
"examples": [
{
"_type": "Instruction.Rules.Token",
"pattern": ",\\s+",
"default": ", "
},
{
"_type": "Instruction.Rules.Token",
"pattern": "\\s+",
"default": " "
},
{
"_type": "Instruction.Rules.Token",
"pattern": "[1-9][0-9]*"
},
{
"_type": "Instruction.Rules.Token",
"pattern": "",
"default": ""
}
],
"properties": {
"_meta": {
"$ref": "../../Meta.json",
"info": [
"Metadata"
]
},
"_type": {
"enum": [
"Instruction.Rules.Token"
]
},
"default": {
"info": [
[
"The default rendering for this $(~Instruction.Rules.Token) in assembly strings.",
"SPACE matches any number of whitespace characters but always renders as one."
]
],
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"pattern": {
"info": [
[
"The regex pattern matching this $(~Instruction.Rules.Token).",
"SPACE matches any number of whitespace characters but always renders as one."
]
],
"type": "string"
}
},
"required": [
"pattern"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Instruction.Rules.Token"
}