Expand description
The OftLisp reader.
Note that this is typically known as a parser, but Lisp tradition is to refer to the parser for the language as “the reader”, especially when it does not perform advanced processing (e.g. macro expansion) automatically.
The grammar of OftLisp is:
value = { comment }, byteString
| { comment }, string
| { comment }, symbolish
| { comment }, "(", { value }, ")"
| { comment }, "(", value, { value }, "\u{2022}", value ")"
| { comment }, "[", { value }, "]"
| { comment }, readerMacro, { comment }, value;
comment = ";", { ? all characters ? - "\n" }, "\n";
byteString = "b", '"', { stringChar }, '"'
string = '"', { stringChar }, '"'
symbolish = symbolChar, { symbolChar }
stringChar = ? all characters ? - ( "\\" | '"' )
| "\\", escape;
escape = "a" | "b" | "e" | "n" | "r" | "t" | '"'
| "x", hex, hex
| "u", hex, hex, hex, hex
| "U", hex, hex, hex, hex, hex, hex, hex, hex;
hex = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
| "a" | "b" | "c" | "d" | "e" | "f"
| "A" | "B" | "C" | "D" | "E" | "F";
symbolChar = ? an ASCII letter ?
| ? an ASCII digit ?
| "+" | "-" | "." | "/" | "$" | "?" | "*" | "#" | "=" | "<"
| ">" | "_";
readerMacro = "'" | "`" | ",@" | ",";
Modules§
Structs§
- Read
Error - An error that occurs while reading.
- Source
Location - The location of an error (or of anything else).
Enums§
- Accept
Set - A set of acceptable characters.
- Read
Error Kind - The kind of the error.