The recursive-regex Reference Manual

This is the recursive-regex Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:35:19 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 recursive-regex

Recursive regular expression parsing engine

License

BSD

Version

0.1

Dependencies
  • iterate (system).
  • anaphora (system).
  • cl-interpol (system).
  • cl-ppcre (system).
  • alexandria (system).
  • symbol-munger (system).
Source

recursive-regex.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 recursive-regex/recursive-regex.asd

Source

recursive-regex.asd.

Parent Component

recursive-regex (system).

ASDF Systems

recursive-regex.

Packages

recursive-regex.system.


3.1.2 recursive-regex/rec-regex.lisp

Source

recursive-regex.asd.

Parent Component

recursive-regex (system).

Packages

recursive-regex.

Public Interface
Internals

3.1.3 recursive-regex/rex-reader.lisp

Source

recursive-regex.asd.

Parent Component

recursive-regex (system).

Public Interface

read-rex-file-to-dispatchers (function).

Internals

4 Packages

Packages are listed by definition order.


4.1 recursive-regex

Source

rec-regex.lisp.

Nicknames
  • recex
  • rec-regex
Use List
  • anaphora.
  • common-lisp.
  • common-lisp-user.
  • iterate.
Public Interface
Internals

4.2 recursive-regex.system

Source

recursive-regex.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *case-insensitive*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: *dispatchers*
Package

recursive-regex.

Source

rec-regex.lisp.


5.1.2 Ordinary functions

Function: add-body-matcher (name)

Add a new body matcher that dispatches on name

Package

recursive-regex.

Source

rec-regex.lisp.

Function: add-matched-pair-matcher (name open close &optional escape)

Add a matched pair matcher dispatched on name

Package

recursive-regex.

Source

rec-regex.lisp.

Function: add-named-regex-matcher (name regex)

Add a new dispatcher on name to child regex

Package

recursive-regex.

Source

rec-regex.lisp.

Function: clear-dispatchers ()

removes all the dispatchers

Package

recursive-regex.

Source

rec-regex.lisp.

Function: create-recursive-scanner (regex &optional function-table)

Allows named registers to refer to functions that should be in the place of the named register

Package

recursive-regex.

Source

rec-regex.lisp.

Function: make-default-dispatch-table ()

Creates a default dispatch table with a parens dispatcher that can match pairs of parentheses

Package

recursive-regex.

Source

rec-regex.lisp.

Function: read-rex-file-to-dispatchers (file)

reads a set of definitions in from a rex file, calls add-named-regex-matcher for each production name => regex

Package

recursive-regex.

Source

rex-reader.lisp.

Function: regex-recursive-groups (regex target &key dispatchers tree-results?)

run a recursive regular expression and gather all the results for each of them into a tree

Package

recursive-regex.

Source

rec-regex.lisp.

Function: result-node (name start end &optional target groups kids)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: treeify-regex-results (tree)

Make a lisp tree of the results of the matches from the clos tree

Package

recursive-regex.

Source

rec-regex.lisp.


5.1.3 Generic functions

Generic Reader: end (object)
Package

recursive-regex.

Methods
Reader Method: end ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

end.

Generic Writer: (setf end) (object)
Package

recursive-regex.

Methods
Writer Method: (setf end) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

end.

Generic Reader: full-match (object)
Package

recursive-regex.

Methods
Reader Method: full-match ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

full-match.

Generic Writer: (setf full-match) (object)
Package

recursive-regex.

Methods
Writer Method: (setf full-match) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

full-match.

Generic Reader: groups (object)
Package

recursive-regex.

Methods
Reader Method: groups ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

groups.

Generic Writer: (setf groups) (object)
Package

recursive-regex.

Methods
Writer Method: (setf groups) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

groups.

Generic Reader: kids (object)
Package

recursive-regex.

Methods
Reader Method: kids ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

kids.

Generic Writer: (setf kids) (object)
Package

recursive-regex.

Methods
Writer Method: (setf kids) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

kids.

Generic Reader: name (object)
Package

recursive-regex.

Methods
Reader Method: name ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

name.

Generic Writer: (setf name) (object)
Package

recursive-regex.

Methods
Writer Method: (setf name) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

name.

Generic Reader: start (object)
Package

recursive-regex.

Methods
Reader Method: start ((result-node result-node))

automatically generated reader method

Source

rec-regex.lisp.

Target Slot

start.

Generic Writer: (setf start) (object)
Package

recursive-regex.

Methods
Writer Method: (setf start) ((result-node result-node))

automatically generated writer method

Source

rec-regex.lisp.

Target Slot

start.


5.1.4 Standalone methods

Method: print-object ((o result-node) s)
Source

rec-regex.lisp.


5.1.5 Classes

Class: result-node
Package

recursive-regex.

Source

rec-regex.lisp.

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

name.

Writers

(setf name).

Slot: start
Initargs

:start

Readers

start.

Writers

(setf start).

Slot: end
Initargs

:end

Readers

end.

Writers

(setf end).

Slot: full-match
Initargs

:full-match

Readers

full-match.

Writers

(setf full-match).

Slot: groups
Initargs

:groups

Readers

groups.

Writers

(setf groups).

Slot: kids
Initargs

:kids

Readers

kids.

Writers

(setf kids).


5.2 Internals


5.2.1 Special variables

Special Variable: *body-regex*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: *minimize-results*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: *trace-depth*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: *trace-parse*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: *uncompiled-br*
Package

recursive-regex.

Source

rec-regex.lisp.

Special Variable: +end-of-defs+
Package

recursive-regex.

Source

rex-reader.lisp.

Special Variable: +option+
Package

recursive-regex.

Source

rex-reader.lisp.

Special Variable: +option-case-insensitive+
Package

recursive-regex.

Source

rex-reader.lisp.

Special Variable: +production-split+
Package

recursive-regex.

Source

rex-reader.lisp.


5.2.2 Macros

Macro: def-traced-matcher-lambda ((pos-name name &rest rest-tracing) &body body)
Package

recursive-regex.

Source

rec-regex.lisp.

Macro: trace-log (msg &rest args)
Package

recursive-regex.

Source

rec-regex.lisp.

Macro: tracer (&rest args)
Package

recursive-regex.

Source

rec-regex.lisp.

Macro: with-child-pusher ((place) &body body)

pushes child-matches into the place and continues-matching discards results that have been backtracked passed

Package

recursive-regex.

Source

rec-regex.lisp.


5.2.3 Ordinary functions

Function: %collect-groups-to-tree (name scanner target &optional start end outer-match-start outer-match-end)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: %make-dispatcher (name body-regex function-table)

Whenever we meet a named group, change it to a named dispatcher if we find it in the list we use that matcher, otherwise we use a body matcher.

Package

recursive-regex.

Source

rec-regex.lisp.

Function: %trace-log (msg &rest args)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: %tracer (label name pos match-end &key data level)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: continue-matching (&optional c)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: convert-to-full-match (regex)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: devoid (regex)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: dispatch-fn (name &optional function-table)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: end-of-defs? (line)
Package

recursive-regex.

Source

rex-reader.lisp.

Function: handle-quoted-rules (regex)

quotes in rex productions should be direct string matches (not regex)

Package

recursive-regex.

Source

rex-reader.lisp.

Function: inner-match (data)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: make-body-matcher (&optional name)

Handles matching the body of a named regular expression

Package

recursive-regex.

Source

rec-regex.lisp.

Function: make-displaced-array (array &optional start end)
Package

recursive-regex.

Source

rec-regex.lisp.

Function: make-matched-pair-matcher (name open-char close-char &optional escape)

Will create a regex filter that can match arbitrary pairs of matched characters such as (start (other () some) end)

Package

recursive-regex.

Source

rec-regex.lisp.

Function: make-named-regex-matcher (name named-regex)

Handles matching by delegating to another named regular expression

Package

recursive-regex.

Source

rec-regex.lisp.

Function: option-ci? (line)
Package

recursive-regex.

Source

rex-reader.lisp.

Function: option? (line)
Package

recursive-regex.

Source

rex-reader.lisp.

Function: process-rex-def (name regex defs)
Package

recursive-regex.

Source

rex-reader.lisp.

Function: replace-all (string part replacement &key test stream)

Returns a new string in which all the occurences of the part
is replaced with replacement. [FROM http://cl-cookbook.sourceforge.net/strings.html#manip]

Package

recursive-regex.

Source

rex-reader.lisp.

Function: replace-expansions (defs new-regex)

If we encounter {name} style definitions in the right hand side replace them with their text (regex fragment) value

Package

recursive-regex.

Source

rex-reader.lisp.

Function: trimmed-readline (stream &optional eof-error-p eof-value recursive-p)

read a line and trim it, if it is empty return nil instead of empty string

Package

recursive-regex.

Source

rex-reader.lisp.

Function: unescaped-quote-pos (s start)

find the index of an unescaped quote

Package

recursive-regex.

Source

rex-reader.lisp.


5.2.4 Generic functions

Generic Reader: data (condition)
Generic Writer: (setf data) (condition)
Package

recursive-regex.

Methods
Reader Method: data ((condition inner-match))
Writer Method: (setf data) ((condition inner-match))
Source

rec-regex.lisp.

Target Slot

data.


5.2.5 Conditions

Condition: inner-match
Package

recursive-regex.

Source

rec-regex.lisp.

Direct superclasses

condition.

Direct methods
Direct slots
Slot: data
Initform

(quote nil)

Initargs

:data

Readers

data.

Writers

(setf data).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   D   E   F   G   H   I   K   M   N   O   P   R   S   T   U   W  
Index Entry  Section

%
%collect-groups-to-tree: Private ordinary functions
%make-dispatcher: Private ordinary functions
%trace-log: Private ordinary functions
%tracer: Private ordinary functions

(
(setf data): Private generic functions
(setf data): Private generic functions
(setf end): Public generic functions
(setf end): Public generic functions
(setf full-match): Public generic functions
(setf full-match): Public generic functions
(setf groups): Public generic functions
(setf groups): Public generic functions
(setf kids): Public generic functions
(setf kids): Public generic functions
(setf name): Public generic functions
(setf name): Public generic functions
(setf start): Public generic functions
(setf start): Public generic functions

A
add-body-matcher: Public ordinary functions
add-matched-pair-matcher: Public ordinary functions
add-named-regex-matcher: Public ordinary functions

C
clear-dispatchers: Public ordinary functions
continue-matching: Private ordinary functions
convert-to-full-match: Private ordinary functions
create-recursive-scanner: Public ordinary functions

D
data: Private generic functions
data: Private generic functions
def-traced-matcher-lambda: Private macros
devoid: Private ordinary functions
dispatch-fn: Private ordinary functions

E
end: Public generic functions
end: Public generic functions
end-of-defs?: Private ordinary functions

F
full-match: Public generic functions
full-match: Public generic functions
Function, %collect-groups-to-tree: Private ordinary functions
Function, %make-dispatcher: Private ordinary functions
Function, %trace-log: Private ordinary functions
Function, %tracer: Private ordinary functions
Function, add-body-matcher: Public ordinary functions
Function, add-matched-pair-matcher: Public ordinary functions
Function, add-named-regex-matcher: Public ordinary functions
Function, clear-dispatchers: Public ordinary functions
Function, continue-matching: Private ordinary functions
Function, convert-to-full-match: Private ordinary functions
Function, create-recursive-scanner: Public ordinary functions
Function, devoid: Private ordinary functions
Function, dispatch-fn: Private ordinary functions
Function, end-of-defs?: Private ordinary functions
Function, handle-quoted-rules: Private ordinary functions
Function, inner-match: Private ordinary functions
Function, make-body-matcher: Private ordinary functions
Function, make-default-dispatch-table: Public ordinary functions
Function, make-displaced-array: Private ordinary functions
Function, make-matched-pair-matcher: Private ordinary functions
Function, make-named-regex-matcher: Private ordinary functions
Function, option-ci?: Private ordinary functions
Function, option?: Private ordinary functions
Function, process-rex-def: Private ordinary functions
Function, read-rex-file-to-dispatchers: Public ordinary functions
Function, regex-recursive-groups: Public ordinary functions
Function, replace-all: Private ordinary functions
Function, replace-expansions: Private ordinary functions
Function, result-node: Public ordinary functions
Function, treeify-regex-results: Public ordinary functions
Function, trimmed-readline: Private ordinary functions
Function, unescaped-quote-pos: Private ordinary functions

G
Generic Function, (setf data): Private generic functions
Generic Function, (setf end): Public generic functions
Generic Function, (setf full-match): Public generic functions
Generic Function, (setf groups): Public generic functions
Generic Function, (setf kids): Public generic functions
Generic Function, (setf name): Public generic functions
Generic Function, (setf start): Public generic functions
Generic Function, data: Private generic functions
Generic Function, end: Public generic functions
Generic Function, full-match: Public generic functions
Generic Function, groups: Public generic functions
Generic Function, kids: Public generic functions
Generic Function, name: Public generic functions
Generic Function, start: Public generic functions
groups: Public generic functions
groups: Public generic functions

H
handle-quoted-rules: Private ordinary functions

I
inner-match: Private ordinary functions

K
kids: Public generic functions
kids: Public generic functions

M
Macro, def-traced-matcher-lambda: Private macros
Macro, trace-log: Private macros
Macro, tracer: Private macros
Macro, with-child-pusher: Private macros
make-body-matcher: Private ordinary functions
make-default-dispatch-table: Public ordinary functions
make-displaced-array: Private ordinary functions
make-matched-pair-matcher: Private ordinary functions
make-named-regex-matcher: Private ordinary functions
Method, (setf data): Private generic functions
Method, (setf end): Public generic functions
Method, (setf full-match): Public generic functions
Method, (setf groups): Public generic functions
Method, (setf kids): Public generic functions
Method, (setf name): Public generic functions
Method, (setf start): Public generic functions
Method, data: Private generic functions
Method, end: Public generic functions
Method, full-match: Public generic functions
Method, groups: Public generic functions
Method, kids: Public generic functions
Method, name: Public generic functions
Method, print-object: Public standalone methods
Method, start: Public generic functions

N
name: Public generic functions
name: Public generic functions

O
option-ci?: Private ordinary functions
option?: Private ordinary functions

P
print-object: Public standalone methods
process-rex-def: Private ordinary functions

R
read-rex-file-to-dispatchers: Public ordinary functions
regex-recursive-groups: Public ordinary functions
replace-all: Private ordinary functions
replace-expansions: Private ordinary functions
result-node: Public ordinary functions

S
start: Public generic functions
start: Public generic functions

T
trace-log: Private macros
tracer: Private macros
treeify-regex-results: Public ordinary functions
trimmed-readline: Private ordinary functions

U
unescaped-quote-pos: Private ordinary functions

W
with-child-pusher: Private macros


A.3 Variables

Jump to:   *   +  
D   E   F   G   K   N   S  
Index Entry  Section

*
*body-regex*: Private special variables
*case-insensitive*: Public special variables
*dispatchers*: Public special variables
*minimize-results*: Private special variables
*trace-depth*: Private special variables
*trace-parse*: Private special variables
*uncompiled-br*: Private special variables

+
+end-of-defs+: Private special variables
+option+: Private special variables
+option-case-insensitive+: Private special variables
+production-split+: Private special variables

D
data: Private conditions

E
end: Public classes

F
full-match: Public classes

G
groups: Public classes

K
kids: Public classes

N
name: Public classes

S
Slot, data: Private conditions
Slot, end: Public classes
Slot, full-match: Public classes
Slot, groups: Public classes
Slot, kids: Public classes
Slot, name: Public classes
Slot, start: Public classes
Special Variable, *body-regex*: Private special variables
Special Variable, *case-insensitive*: Public special variables
Special Variable, *dispatchers*: Public special variables
Special Variable, *minimize-results*: Private special variables
Special Variable, *trace-depth*: Private special variables
Special Variable, *trace-parse*: Private special variables
Special Variable, *uncompiled-br*: Private special variables
Special Variable, +end-of-defs+: Private special variables
Special Variable, +option+: Private special variables
Special Variable, +option-case-insensitive+: Private special variables
Special Variable, +production-split+: Private special variables
start: Public classes