The cl-bnf Reference Manual

This is the cl-bnf Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:46:08 2024 GMT+0.

Table of Contents


1 Systems

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


1.1 cl-bnf

A simple BNF parser.

Author

Bruno Dias <>

License

MIT

Source

cl-bnf.asd.

Child Component

src (module).


2 Modules

Modules are listed depth-first from the system components tree.


2.1 cl-bnf/src

Source

cl-bnf.asd.

Parent Component

cl-bnf (system).

Child Component

bnf.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 cl-bnf/cl-bnf.asd

Source

cl-bnf.asd.

Parent Component

cl-bnf (system).

ASDF Systems

cl-bnf.


3.1.2 cl-bnf/src/bnf.lisp

Source

cl-bnf.asd.

Parent Component

src (module).

Packages

cl-bnf.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-bnf

Source

bnf.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Macros

Macro: define-grammar (spec &rest rules)

Generates the parser with SPEC and all the RULES.

Package

cl-bnf.

Source

bnf.lisp.

Macro: define-rule (label rule &key call tag apply)

Generate a function LABEL to parse RULE. Later, you can apply a TRANSFORMATION which can be a function or a keytword.

Package

cl-bnf.

Source

bnf.lisp.


5.1.2 Ordinary functions

Function: parse (rules source)

Parse according to the RULES on SOURCE.

Package

cl-bnf.

Source

bnf.lisp.


5.2 Internals


5.2.1 Macros

Macro: one (stream pred)

Get a single char from the STREAM and test against PRED.

Package

cl-bnf.

Source

bnf.lisp.

Macro: single-char (stream char)

Get a single char from the STREAM and test against CHAR.

Package

cl-bnf.

Source

bnf.lisp.


5.2.2 Ordinary functions

Function: and-match (stream expression)

And pattern to be run on STREAM with EXPRESSION.

Package

cl-bnf.

Source

bnf.lisp.

Function: back-char (ts)

Move backward one char on TS.

Package

cl-bnf.

Source

bnf.lisp.

Function: copy-text-stream (instance)
Package

cl-bnf.

Source

bnf.lisp.

Function: eval-pattern-or-function (item source)

Evaluate a patter or function for ITEM an use SOURCE.

Package

cl-bnf.

Source

bnf.lisp.

Function: expand-and-rule (items)

Take many or RULES and normalize the tree.

Package

cl-bnf.

Source

bnf.lisp.

Function: expand-item (item)

If ITEM is simple type, transforms it into the correct structure.

Package

cl-bnf.

Source

bnf.lisp.

Function: ispair (x)
Package

cl-bnf.

Source

bnf.lisp.

Function: make-text-stream (&key cursor text line column length)
Package

cl-bnf.

Source

bnf.lisp.

Function: many-matches (stream expression)

Many pattern to be run on STREAM with EXPRESSION.

Package

cl-bnf.

Source

bnf.lisp.

Function: map-rules (fn rules)

Apply FN on each expression in RULES.

Package

cl-bnf.

Source

bnf.lisp.

Function: maybe-match (stream expression)

Maybe pattern to be run on STREAM with EXPRESSION.

Package

cl-bnf.

Source

bnf.lisp.

Function: next-char (ts &key eof-char)

Look ahead the next char.

Package

cl-bnf.

Source

bnf.lisp.

Function: or-match (stream expression)

Or pattern to be run on STREAM with EXPRESSION.

Package

cl-bnf.

Source

bnf.lisp.

Function: split-seq-on (item seq)

Split on ITEM on SEQ.

Package

cl-bnf.

Source

bnf.lisp.

Function: string-match (stream str)

String pattern to be run on STREAM with STRING.

Package

cl-bnf.

Source

bnf.lisp.

Reader: text-stream-column (instance)
Writer: (setf text-stream-column) (instance)
Package

cl-bnf.

Source

bnf.lisp.

Target Slot

column.

Reader: text-stream-cursor (instance)
Writer: (setf text-stream-cursor) (instance)
Package

cl-bnf.

Source

bnf.lisp.

Target Slot

cursor.

Reader: text-stream-length (instance)
Writer: (setf text-stream-length) (instance)
Package

cl-bnf.

Source

bnf.lisp.

Target Slot

length.

Reader: text-stream-line (instance)
Writer: (setf text-stream-line) (instance)
Package

cl-bnf.

Source

bnf.lisp.

Target Slot

line.

Function: text-stream-p (object)
Package

cl-bnf.

Source

bnf.lisp.

Reader: text-stream-text (instance)
Writer: (setf text-stream-text) (instance)
Package

cl-bnf.

Source

bnf.lisp.

Target Slot

text.


5.2.3 Structures

Structure: text-stream
Package

cl-bnf.

Source

bnf.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: cursor
Readers

text-stream-cursor.

Writers

(setf text-stream-cursor).

Slot: text
Readers

text-stream-text.

Writers

(setf text-stream-text).

Slot: line
Readers

text-stream-line.

Writers

(setf text-stream-line).

Slot: column
Readers

text-stream-column.

Writers

(setf text-stream-column).

Slot: length
Package

common-lisp.

Readers

text-stream-length.

Writers

(setf text-stream-length).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   B   C   D   E   F   I   M   N   O   P   S   T  
Index Entry  Section

(
(setf text-stream-column): Private ordinary functions
(setf text-stream-cursor): Private ordinary functions
(setf text-stream-length): Private ordinary functions
(setf text-stream-line): Private ordinary functions
(setf text-stream-text): Private ordinary functions

A
and-match: Private ordinary functions

B
back-char: Private ordinary functions

C
copy-text-stream: Private ordinary functions

D
define-grammar: Public macros
define-rule: Public macros

E
eval-pattern-or-function: Private ordinary functions
expand-and-rule: Private ordinary functions
expand-item: Private ordinary functions

F
Function, (setf text-stream-column): Private ordinary functions
Function, (setf text-stream-cursor): Private ordinary functions
Function, (setf text-stream-length): Private ordinary functions
Function, (setf text-stream-line): Private ordinary functions
Function, (setf text-stream-text): Private ordinary functions
Function, and-match: Private ordinary functions
Function, back-char: Private ordinary functions
Function, copy-text-stream: Private ordinary functions
Function, eval-pattern-or-function: Private ordinary functions
Function, expand-and-rule: Private ordinary functions
Function, expand-item: Private ordinary functions
Function, ispair: Private ordinary functions
Function, make-text-stream: Private ordinary functions
Function, many-matches: Private ordinary functions
Function, map-rules: Private ordinary functions
Function, maybe-match: Private ordinary functions
Function, next-char: Private ordinary functions
Function, or-match: Private ordinary functions
Function, parse: Public ordinary functions
Function, split-seq-on: Private ordinary functions
Function, string-match: Private ordinary functions
Function, text-stream-column: Private ordinary functions
Function, text-stream-cursor: Private ordinary functions
Function, text-stream-length: Private ordinary functions
Function, text-stream-line: Private ordinary functions
Function, text-stream-p: Private ordinary functions
Function, text-stream-text: Private ordinary functions

I
ispair: Private ordinary functions

M
Macro, define-grammar: Public macros
Macro, define-rule: Public macros
Macro, one: Private macros
Macro, single-char: Private macros
make-text-stream: Private ordinary functions
many-matches: Private ordinary functions
map-rules: Private ordinary functions
maybe-match: Private ordinary functions

N
next-char: Private ordinary functions

O
one: Private macros
or-match: Private ordinary functions

P
parse: Public ordinary functions

S
single-char: Private macros
split-seq-on: Private ordinary functions
string-match: Private ordinary functions

T
text-stream-column: Private ordinary functions
text-stream-cursor: Private ordinary functions
text-stream-length: Private ordinary functions
text-stream-line: Private ordinary functions
text-stream-p: Private ordinary functions
text-stream-text: Private ordinary functions