module PrologGenlex: sig
.. end
A lexical analyzer for ISO-Prolog syntax.
This module is similar to the Genlex module of the OCaml standard
library, but uses ISO-Prolog instead of OCaml syntax.
Current Restrictions:
- Input should be ISO-Prolog which uses ISO-Latin-1 encoding.
- Characters are classified as capitalized and small according to the
ISO-Latin-1 encoding.
- No operator support. Input must be produced by Prolog's
write_canonical predicate.
- Both /* */ and % comments are allowed. /* */ comments may not be
nested.
- Prolog strings are not supported.
- Integers and floats are currently read in using their OCaml print
representation (which may be the same as Prolog's).
- The following escape codes are supported within quoted atoms:
\n, \r, \t, and \DDD, where DDD is the decimal ASCII code of
a character.
type
prolog_token =
| |
PunctuationPrologToken of string |
| |
VarPrologToken of string |
| |
ConstPrologToken of string |
| |
IntPrologToken of int |
| |
FloatPrologToken of float |
The type of tokens.
val prolog_lexer : char Stream.t -> prolog_token Stream.t
The lexer function.