The parseltongue Reference Manual

This is the parseltongue Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:18:46 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 parseltongue

Parseltongue

Maintainer

Vincent Toups

Author

Vincent Toups

License

LGPL

Long Description

A monadic parser combinator library with Haskell do-like notation.

Version

0.0.1

Dependency

lisp-unit (system).

Source

parseltongue.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 parseltongue/parseltongue.asd

Source

parseltongue.asd.

Parent Component

parseltongue (system).

ASDF Systems

parseltongue.


3.1.2 parseltongue/package.lisp

Source

parseltongue.asd.

Parent Component

parseltongue (system).

Packages

parseltongue.


3.1.3 parseltongue/parseltongue.lisp

Dependency

package.lisp (file).

Source

parseltongue.asd.

Parent Component

parseltongue (system).

Public Interface
Internals

3.1.4 parseltongue/tests.lisp

Dependency

parseltongue.lisp (file).

Source

parseltongue.asd.

Parent Component

parseltongue (system).


4 Packages

Packages are listed by definition order.


4.1 parseltongue

Source

package.lisp.

Use List
  • common-lisp.
  • lisp-unit.
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 Special variables

Special Variable: =item

A parser

Package

parseltongue.

Source

parseltongue.lisp.

Special Variable: =rest

A parser

Package

parseltongue.

Source

parseltongue.lisp.


5.1.2 Macros

Macro: defparser (name/args maybe-doc &rest body)
Package

parseltongue.

Source

parseltongue.lisp.

Macro: parser (&rest forms)
Package

parseltongue.

Source

parseltongue.lisp.


5.1.3 Ordinary functions

Function: =>and (&rest ps)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>eq (to)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>equal (to)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>items (n)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>items->string (n)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>maybe (=p)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>maybe-alternative (=p alt)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>one-plus-more (=p)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>or (&rest ps)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>reduce-concat (=p)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>satisfies (fun)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>string (s)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>zero-plus-more (p)

Produce a parser which parses P zero or more times and monadically returns the results in a list.

Package

parseltongue.

Source

parseltongue.lisp.

Function: =item (input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =rest (input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: parse/first-result (=p input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: parser-bind (=p =>p)
Package

parseltongue.

Source

parseltongue.lisp.

Function: parser-pair (value input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: parser-return (&rest items)
Package

parseltongue.

Source

parseltongue.lisp.


5.1.4 Generic functions

Generic Function: empty? (list)
Package

parseltongue.

Methods
Method: empty? ((string string))
Source

parseltongue.lisp.

Method: empty? ((list list))
Source

parseltongue.lisp.

Generic Function: next (list)
Package

parseltongue.

Methods
Method: next ((string string))
Source

parseltongue.lisp.

Method: next ((list list))
Source

parseltongue.lisp.

Generic Function: rest-of (list)
Package

parseltongue.

Methods
Method: rest-of ((string string))
Source

parseltongue.lisp.

Method: rest-of ((list list))
Source

parseltongue.lisp.


5.1.5 Structures

Structure: parser-pair
Package

parseltongue.

Source

parseltongue.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: value
Readers

parser-pair-value.

Writers

(setf parser-pair-value).

Slot: input
Readers

parser-pair-input.

Writers

(setf parser-pair-input).


5.2 Internals


5.2.1 Special variables

Special Variable: =nil

A parser

Package

parseltongue.

Source

parseltongue.lisp.


5.2.2 Macros

Macro: defun/var (name arg-list &rest body)
Package

parseltongue.

Source

parseltongue.lisp.

Macro: named-let (name bindings &rest body)
Package

parseltongue.

Source

parseltongue.lisp.

Macro: parser-helper (&rest forms)
Package

parseltongue.

Source

parseltongue.lisp.


5.2.3 Ordinary functions

Function: => (&rest items)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>and2 (=p1 =p2)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>list (=p)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =>or2 (=p1 =p2)
Package

parseltongue.

Source

parseltongue.lisp.

Function: =nil (input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: alist (a key)

Return the value at KEY or NIL.

Package

parseltongue.

Source

parseltongue.lisp.

Function: alist-cons (a key val)

CONS VAL onto the LIST held at KEY in the ALIST A.

Package

parseltongue.

Source

parseltongue.lisp.

Function: bind-form? (form)
Package

parseltongue.

Source

parseltongue.lisp.

Function: copy-parser-pair (instance)
Package

parseltongue.

Source

parseltongue.lisp.

Function: make-parser-pair (&key value input)
Package

parseltongue.

Source

parseltongue.lisp.

Function: mapcar/deal (fun lst)

Map FUN over LST. FUN returns a list of two items, the first of which is a key the second of which is a value. The VALUES are accumulated at the KEYS in an ALIST which is returned.

Package

parseltongue.

Source

parseltongue.lisp.

Reader: parser-pair-input (instance)
Writer: (setf parser-pair-input) (instance)
Package

parseltongue.

Source

parseltongue.lisp.

Target Slot

input.

Function: parser-pair-p (object)
Package

parseltongue.

Source

parseltongue.lisp.

Reader: parser-pair-value (instance)
Writer: (setf parser-pair-value) (instance)
Package

parseltongue.

Source

parseltongue.lisp.

Target Slot

value.

Function: parser-plus (&rest ps)
Package

parseltongue.

Source

parseltongue.lisp.

Function: reverse-alist-keys (a)

Reverse the lists held at each key in A.

Package

parseltongue.

Source

parseltongue.lisp.

Function: strcat (&rest s)
Package

parseltongue.

Source

parseltongue.lisp.

Function: zero-plus-more-step (substate parser)

Apply PARSER to the CDR of substate. If it succeeds, cons the result onto the list in the CAR of substate and indicate CONTINUE for MAPCAR/DEAL. If PARSER on CDR of substate FAILS, then reverse the CAR of SUBSTATE and return this value consed with the last INPUT state.

Package

parseltongue.

Source

parseltongue.lisp.


5.2.4 Generic functions

Generic Function: empty-of (list)
Package

parseltongue.

Methods
Method: empty-of ((string string))
Source

parseltongue.lisp.

Method: empty-of ((list list))
Source

parseltongue.lisp.

Generic Function: prefix (o string)
Package

parseltongue.

Methods
Method: prefix (o (list list))
Source

parseltongue.lisp.

Method: prefix (o (string string))
Source

parseltongue.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (   =  
A   B   C   D   E   F   G   M   N   P   R   S   Z  
Index Entry  Section

(
(setf parser-pair-input): Private ordinary functions
(setf parser-pair-value): Private ordinary functions

=
=>: Private ordinary functions
=>and: Public ordinary functions
=>and2: Private ordinary functions
=>eq: Public ordinary functions
=>equal: Public ordinary functions
=>items: Public ordinary functions
=>items->string: Public ordinary functions
=>list: Private ordinary functions
=>maybe: Public ordinary functions
=>maybe-alternative: Public ordinary functions
=>one-plus-more: Public ordinary functions
=>or: Public ordinary functions
=>or2: Private ordinary functions
=>reduce-concat: Public ordinary functions
=>satisfies: Public ordinary functions
=>string: Public ordinary functions
=>zero-plus-more: Public ordinary functions
=item: Public ordinary functions
=nil: Private ordinary functions
=rest: Public ordinary functions

A
alist: Private ordinary functions
alist-cons: Private ordinary functions

B
bind-form?: Private ordinary functions

C
copy-parser-pair: Private ordinary functions

D
defparser: Public macros
defun/var: Private macros

E
empty-of: Private generic functions
empty-of: Private generic functions
empty-of: Private generic functions
empty?: Public generic functions
empty?: Public generic functions
empty?: Public generic functions

F
Function, (setf parser-pair-input): Private ordinary functions
Function, (setf parser-pair-value): Private ordinary functions
Function, =>: Private ordinary functions
Function, =>and: Public ordinary functions
Function, =>and2: Private ordinary functions
Function, =>eq: Public ordinary functions
Function, =>equal: Public ordinary functions
Function, =>items: Public ordinary functions
Function, =>items->string: Public ordinary functions
Function, =>list: Private ordinary functions
Function, =>maybe: Public ordinary functions
Function, =>maybe-alternative: Public ordinary functions
Function, =>one-plus-more: Public ordinary functions
Function, =>or: Public ordinary functions
Function, =>or2: Private ordinary functions
Function, =>reduce-concat: Public ordinary functions
Function, =>satisfies: Public ordinary functions
Function, =>string: Public ordinary functions
Function, =>zero-plus-more: Public ordinary functions
Function, =item: Public ordinary functions
Function, =nil: Private ordinary functions
Function, =rest: Public ordinary functions
Function, alist: Private ordinary functions
Function, alist-cons: Private ordinary functions
Function, bind-form?: Private ordinary functions
Function, copy-parser-pair: Private ordinary functions
Function, make-parser-pair: Private ordinary functions
Function, mapcar/deal: Private ordinary functions
Function, parse/first-result: Public ordinary functions
Function, parser-bind: Public ordinary functions
Function, parser-pair: Public ordinary functions
Function, parser-pair-input: Private ordinary functions
Function, parser-pair-p: Private ordinary functions
Function, parser-pair-value: Private ordinary functions
Function, parser-plus: Private ordinary functions
Function, parser-return: Public ordinary functions
Function, reverse-alist-keys: Private ordinary functions
Function, strcat: Private ordinary functions
Function, zero-plus-more-step: Private ordinary functions

G
Generic Function, empty-of: Private generic functions
Generic Function, empty?: Public generic functions
Generic Function, next: Public generic functions
Generic Function, prefix: Private generic functions
Generic Function, rest-of: Public generic functions

M
Macro, defparser: Public macros
Macro, defun/var: Private macros
Macro, named-let: Private macros
Macro, parser: Public macros
Macro, parser-helper: Private macros
make-parser-pair: Private ordinary functions
mapcar/deal: Private ordinary functions
Method, empty-of: Private generic functions
Method, empty-of: Private generic functions
Method, empty?: Public generic functions
Method, empty?: Public generic functions
Method, next: Public generic functions
Method, next: Public generic functions
Method, prefix: Private generic functions
Method, prefix: Private generic functions
Method, rest-of: Public generic functions
Method, rest-of: Public generic functions

N
named-let: Private macros
next: Public generic functions
next: Public generic functions
next: Public generic functions

P
parse/first-result: Public ordinary functions
parser: Public macros
parser-bind: Public ordinary functions
parser-helper: Private macros
parser-pair: Public ordinary functions
parser-pair-input: Private ordinary functions
parser-pair-p: Private ordinary functions
parser-pair-value: Private ordinary functions
parser-plus: Private ordinary functions
parser-return: Public ordinary functions
prefix: Private generic functions
prefix: Private generic functions
prefix: Private generic functions

R
rest-of: Public generic functions
rest-of: Public generic functions
rest-of: Public generic functions
reverse-alist-keys: Private ordinary functions

S
strcat: Private ordinary functions

Z
zero-plus-more-step: Private ordinary functions