Character Set | ||||
---|---|---|---|---|
let | Byte | :: | '\00' .. '\ff'
| |
let | Control | :: | '\00' .. '\1f' | '\7f' | '\ff'
| |
Basic elements of tokens | ||||
let | Printable | :: | ||
ign | Space | :: | " "
| |
ign | Line | :: | "\n" | "\r\n" | "\r"
| |
ign | Page | :: | "\p"
| |
ign | Etx | :: | "\1a" { Byte }
| |
Definitions and simple tokens | ||||
let | Letter | :: | 'A' .. 'Z' | 'a' .. 'z' | |
let | HexDigit | :: | '0' .. '9' | Letter | |
let | Digit | :: | '0' .. '9' | |
let | Normal | :: | ||
let | Quote | :: | '\'\"\`\\' | |
tok | Parenthesis | :: | '()[]{}'
| |
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 | :: |
| |
tok | Nat | :: | Digit +
| |
tok | Opr | :: | ( Special - ';=<>' ) + | '=<>'
| |
tok | Set | :: | '\'' { LitChar } '\''
| |
tok | Seq | :: | '\"' { LitChar } '\"'
| |
Macro tokens | ||||
let | White | :: | ||
let | Name | :: | ( Letter | "_" ) { Letter | Digit | "_" } | |
let | MPar | :: | ( Printable - ( White | ',' | ')' | '=' ) ) { Printable - ( White | ',' | ')' | '=' ) } | |
tok | MacInc | :: | "#include" White { White } ( Printable - White ) { Printable - White }
| |
tok | MacDel | :: | "#undefine" White { White } Name
| |
tok | MacDfn | :: | "#macro" White { White } Name { White } [ "(" { White } MPar { { White } "," { White } MPar } { White } ")" { White } ] [ "=" ( { Byte } - ( { Byte } ( "#macro" | "#end" ) { Byte } ) ) "#end" ]
| |
tok | MacSep | :: | '\'' ( Byte - '\'' ) [ '-' ]
| |
tok | MacCond | :: | ( ( "#ifdef" | "#ifndef" ) White { White } Name ) | "#else" | "#end"
|
start | Source | :: | Language [ Nat ] Ide [ Regular Grammar { QlxDfn } ] [ Context Free Grammar { Dfn } { Context State . Token : reduce Ide . Ide { reduce Ide . Ide } } ] | |
let | QlxCat | :: | com | ind | let | tok | lan | ign
| |
let | QlxGrp | :: |
| |
let | Exp | :: |
| |
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ||||
| | ( Exp ) | |||
| | ||||
| | ||||
| | ||||
| | ||||
| | Exp + | |||
| | ||||
| | Exp * | |||
| | [ Exp ] | |||
| | { Exp } | |||
let | Limit | :: |
| |
let | QlxDfn | :: | tok < Ide >
| |
| | QlxCat [ [ ica ] ] [ : Ide : ] Ide [ QlxGrp ] = Exp | |||
| | InGroup Ide | |||
| | ExGroup Ide [ tok ] | |||
| | ||||
| | ExGroup Ide | |||
let | Cat | :: | let | start | xtop
| |
let | Lay | :: | ! | ? | :
| |
let | Mbr | :: |
| |
| | ||||
| | ( { Seq } Mbr { Seq } ... { Seq } ) | |||
| | ||||
| | [ { Seq } Mbr { Seq } ... { Seq } ] | |||
| | [ other ] | |||
| | ||||
let | Dfn | :: | Cat [ [ err ] ] Ide { Lay Ide : { Mbr } }
| |
let | State | :: |
| |
let | Token | :: |
|