Module CLexer
type starts_quotation=|NoQuotation|QuotationWhen one registers a keyword she can declare it starts a quotation. In particular using QUOTATION("name:") in a grammar rule declares "name:" as a keyword and the token QUOTATION is matched whenever the keyword is followed by an identifier or a parenthesized text. Eg
constr:x string:
....ltac:(....) ltac:....The delimiter is made of 1 or more occurrences of the same parenthesis, eg ((.....)) or
[[[....]]]. The idea being that if the text happens to contain the closing delimiter, one can make the delimiter longer and avoid confusion (no escaping). Egstring:
[ .. ']' ..]Nesting the delimiter is allowed, eg ((..((...))..)) is OK.
Keywords don't need to end in ':'
val add_keyword : ?quotation:starts_quotation -> string -> unitThis should be functional but it is not due to the interface
val remove_keyword : string -> unitval is_keyword : string -> boolval keywords : unit -> CString.Set.t
val set_keyword_state : keyword_state -> unitval get_keyword_state : unit -> keyword_stateval check_ident : string -> unitval is_ident : string -> boolval check_keyword : string -> unitval terminal : string -> string Tok.pWhen string is not an ident, returns a keyword.
val terminal_number : string -> NumTok.Unsigned.t Tok.pPrecondition: the input is a number (c.f.
NumTok.t)
module Error : sig ... end