Fundamental Syntax
The assembler language is line based. Additional spacing around expressions is ignored. Also, empty lines and lines that only contain a comment are ignored as well.
Example Listing
Here a short example, illustrating the syntax.
;
; Example Program
;
start: CHAR 'a' ; match the char 'a'
SPLIT %start, %end ; greedy
end: SUCCESS ; match
Language Elements
Syntax |
Name |
Description |
|---|---|---|
; comment |
Comment |
A comment starts with a semicolon character ( |
label: |
Label Target |
A label target must be the first element in a line. Line labels are case-insensitive, and must only consist of letters, digits and underscores. The maximum length is 16 characters. Line labels must be unique for the whole assembly code. Targets can be set inside program, character sequence or character class blocks and referenced from the corresponding operations. |
%label |
Label Reference |
A label reference always starts with the percentage character ( |
123 |
Integer |
Any sequence of digits is interpreted as integer value. It can be used anywhere an integer value is accepted. |
$12af |
Offset |
An offset starts with a dollar sign ( |
“text” |
Text |
Text is enclosed in two double quotes ( |
‘c’ |
Character |
A single character is enclosed in single quotes ( |
&identifier |
Identifier |
An identifier starts with the |
.command |
Assembler Command |
Assembler commands are used to switch data section or write data. About about them in a later section. |
Not
CI
Start
Stop
Assert
|
Modifiers |
Modifiers change the following operation. All these modifiers are case-insensitive. |
None
Jump
Match
NoMatch
Split
Anchor
Capture
Counter
Maximum
Minimum
Success
Failure
Char
Sequence
Category
Class
Any
|
Operation |
Each operation writes an instruction into the program. One or two arguments may follow a operation. Operations are case-insensitive and usually written with uppercase letter to stand out. |