package lambdapi
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=66d7d29f7a0d10493b8178c4c3aeb247971e24fab3eba1c54887e1b9a82fe005
sha512=69ecf2406e4c7225ab7f8ebe11624db5d2ab989c8f30f5b6e5d426fd8ef9102f142a2840af16fb9103bb712ebcf7d314635f8b413a05df66e7b7a38548867032
doc/lambdapi.parsing/Parsing/LpLexer/index.html
Module Parsing.LpLexerSource
Lexer for Lambdapi syntax. Uses Sedlex, a Utf8 friendly lexer. Some helper functions to check if a string conflicts with the syntax are also provided.
type token = | EOF| ABORT| ADMIT| ADMITTED| APPLY| AS| ASSERT| ASSERTNOT| ASSOCIATIVE| ASSUME| BEGIN| BUILTIN| COMMUTATIVE| COMPUTE| CONSTANT| DEBUG| END| FAIL| FLAG| GENERALIZE| HAVE| IN| INDUCTION| INDUCTIVE| INFIX| INJECTIVE| LET| NOTATION| OPAQUE| OPEN| PREFIX| PRINT| PRIVATE| PROOFTERM| PROTECTED| PROVER| PROVER_TIMEOUT| QUANTIFIER| REFINE| REFLEXIVITY| REQUIRE| REWRITE| RULE| SEQUENTIAL| SIMPLIFY| SOLVE| SYMBOL| SYMMETRY| TYPE_QUERY| TYPE_TERM| UNIF_RULE| VERBOSE| WHY3| WITH| ASSOC of Pratter.associativity| DEBUG_FLAGS of bool * string| INT of int| FLOAT of float| STRINGLIT of string| SWITCH of bool| ARROW| ASSIGN| BACKQUOTE| COMMA| COLON| DOT| EQUIV| HOOK_ARROW| LAMBDA| L_CU_BRACKET| L_PAREN| L_SQ_BRACKET| PI| R_CU_BRACKET| R_PAREN| R_SQ_BRACKET| SEMICOLON| TURNSTILE| UNDERSCORE| VBAR| UID of string| UID_EXPL of string| UID_META of Syntax.meta_ident| UID_PATT of string| QID of Common.Path.t| QID_EXPL of Common.Path.t
Tokens.
Identifiers.
There are two kinds of identifiers: regular identifiers and escaped identifiers of the form "{|...|}".
Modulo those surrounding brackets, escaped identifiers allow to use as identifiers keywords or filenames that are not regular identifiers.
An escaped identifier denoting a filename or directory is unescaped before accessing to it. Hence, the module "{|a b|}" refers to the file "a b".
Identifiers need to be normalized so that an escaped identifier, once unescaped, is not regular. To this end, every identifier of the form "{|s|}" with s regular, is understood as "s" (function remove_useless_escape below).
Finally, identifiers must not be empty, so that we can use the empty string for the path of ghost signatures.
escape s converts a string s into an escaped identifier if it is not regular. We do not check whether s contains "|}". FIXME?
remove_useless_escape s replaces escaped regular identifiers by their unescape form.