Each rule defining such a class of character sequences has the following structure: <Class Type> <Class Identifier> :: <Regular Expression>
We distinguish four types of classes:
A regular expression spezifies
the character sequences belonging to the class. Such a description usually
consists of the following elements and operators:
Character Set | ||||
---|---|---|---|---|
let | Byte | :: | '\00' .. '\ff' | all extended ascii |
let | Control | :: | ( '\00' .. '\1f' | '\7f' ) | '\ff' | control DEL space-like extended ascii |
Basic elements of tokens | ||||
let | Printable | :: | ||
ign | Space | :: | " " | ASCII - Space |
ign | Line | :: | "\n" | "\r\n" | UNIX / CPM / DOS |
ign | Page | :: | "\p" | weak separation convention |
ign | Etx | :: | "\1a" { Byte } | CPM / older DOS Versions |
Definitions and simple tokens | ||||
let | Letter | :: | 'A' .. 'Z' | 'a' .. 'z' | |
let | HexDigit | :: | '0' .. '9' | 'a' .. 'f' | |
let | Digit | :: | '0' .. '9' | |
let | Normal | :: | ||
let | Quote | :: | '\'\"\`\\' | |
tok | Parenthesis | :: | '()[]{}' | one character tokens |
let | Special | :: | ( ( Printable - Normal ) - Parenthesis ) - Quote | |
single byte literals or literals, encoded in us-ascii, ISO 8859-1 Latin-1 or ucs4 hex values | ||||
let | LitChar | :: | ( Printable - Quote ) | ( '\\' ( ( ( Quote | 'prnt' ) | ( HexDigit HexDigit ) ) | ( ( ( ( ( ( ( ( 'xX' HexDigit ) HexDigit ) HexDigit ) HexDigit ) HexDigit ) HexDigit ) HexDigit ) HexDigit ) ) ) | |
Comments et al | ||||
com | Comment | :: | ';' { Printable } | |
Complex tokens | ||||
tok | Ide | :: | Identifier | |
tok | Nat | :: | Digit + | Natural |
tok | Opr | :: | ( Special - ';' ) + | Operator |
tok | Set | :: | ( '\'' { LitChar } ) '\'' | CharacterSet |
tok | Seq | :: | ( '\"' { LitChar } ) '\"' | CharacterSequence (String) |
Macro tokens | ||||
let | White | :: | ||
let | Name | :: | ||
let | MPar | :: | ( Printable - ( ( ( White | ',' ) | ')' ) | '=' ) ) { Printable - ( ( ( White | ',' ) | ')' ) | '=' ) } | |
tok | MacInc | :: | ( ( ( "#include" White ) { White } ) ( Printable - White ) ) { Printable - White } | Include |
tok | MacDfn | :: | ( ( ( ( ( "#macro" White ) { White } ) Name ) { White } ) [ ( ( ( ( ( "(" { White } ) MPar ) { ( ( { White } "," ) { White } ) MPar } ) { White } ) ")" ) { White } ] ) [ ( "=" ( { Byte } - ( ( { Byte } ( "#macro" | "#end" ) ) { Byte } ) ) ) "#end" ] | Macro definition |
tok | MacSep | :: | ( '\'' ( Byte - '\'' ) ) [ '-' ] | End of parameter |
tok | MacCond | :: | ( ( ( ( ( "#ifdef" | "#ifndef" ) White ) { White } ) Name ) | "#else" ) | "#end" | Conditionals |
Each rule
is structured as follows: <Rule Type: start or let>
<Rule Identifier> :: <EBNF-konform Expression>
An EBNF-konform expression defines a part
of the language syntax. It consists of a set of alternative productions i.e.
partial expressions, separated by the character '|'.
A production can be spezified with the help of the following elements and operators:
start | Source | :: | Language Ide Regular Grammar { QlxCat [ [ ica ] ] Ide = Exp } [ Context Free Grammar { Cat [ [ err ] ] Ide { Lay Ide : { Mbr } } } ] | |
let | QlxCat | :: | tok | let | lan | com | ign | QlxCategory |
let | Exp | :: | Expression prio 0 | |
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ( Exp ) | |||
| | ||||
| | [ Exp ] | |||
| | { Exp } | |||
| | Exp + | |||
let | Cat | :: | xtop | start | let | Category |
let | Lay | :: | ! | ? | : | Layouting: PrettyPrinter Hint |
let | Mbr | :: | Member |