This is the dso-lex Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:00:45 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
dso-lex
cl-ppcre
(system).
dso-util
(system).
lex.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
dso-lex/lex.lisp
dso-lex
(system).
deflexer
(macro).
lex-all
(function).
make-lexer
(function).
anchor-and-mode
(function).
break-defs
(function).
combine
(function).
greedy-lexer-form
(function).
lexer-form
(function).
wrap
(function).
Packages are listed by definition order.
dso-lex
Allows the definition of lexers. See DEFLEXER.
cl-ppcre
.
common-lisp
.
dso-util
.
deflexer
(macro).
lex-all
(function).
make-lexer
(function).
anchor-and-mode
(function).
break-defs
(function).
combine
(function).
greedy-lexer-form
(function).
lexer-form
(function).
wrap
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines a lexer, called as a function of the given NAME, and returning
the matched token-class, image, and image-length as values. The body
consists of token-class definitions, each being a list of a regular
expression, the name of the class, and an optional filter.
Unless PRIORITY-ONLY is true, the longest match will win, and
rule-priority will only be used to break ties. Otherwise, the first
match wins.
Example:
(deflexer lexer ()
("[0-9]+" number parse-integer)
("[a-zA-Z]" letter))
(lexer "2pi" 1)
Returns a lexer function. The DEFS consists of token-class definitions, each being a list of a regular expression, the name of the class, and an optional filter. The returned function takes as arguments an input sequence and an optional start position, and returning the matched token-class, image, and image-length as values.
Unless PRIORITY-ONLY is true, the longest match will win, and
rule-priority will only be used to break ties. Otherwise, the first
match wins.
Example:
(let ((lexer (make-lexer ’(("[0-9]+" number parse-integer)
("[a-zA-Z]" letter)))))
(funcall lexer "2pi" 1))
Jump to: | A B C D F G L M W |
---|
Jump to: | A B C D F G L M W |
---|
Jump to: | D F L P S |
---|
Jump to: | D F L P S |
---|