The parse Reference Manual

This is the parse Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:15:01 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 parse

Parsing package for Common Lisp.

Author

Jeffrey Massung

License

Apache 2.0

Version

1.0

Source

parse.asd.

Child Component

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

Source

parse.asd.

Parent Component

parse (system).

ASDF Systems

parse.

Packages

parse-asd.


3.1.2 parse/parse.lisp

Source

parse.asd.

Parent Component

parse (system).

Packages

parse.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 parse-asd

Source

parse.asd.

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

4.2 parse

Source

parse.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: .do (p &rest ps)

Chained together >> combinators.

Package

parse.

Source

parse.lisp.

Macro: .let ((var p) &body body)

Macro for >>= to make it more readable.

Package

parse.

Source

parse.lisp.

Macro: .let* ((binding &rest bindings) &body body)

Macro for making multiple .let bindings more readable.

Package

parse.

Source

parse.lisp.

Macro: .or (p &rest ps)

Chained together or combinators.

Package

parse.

Source

parse.lisp.

Macro: .prog1 (form &body rest)

Macro to execute Lisp expressions, returning the first result.

Package

parse.

Source

parse.lisp.

Macro: .progn (&body rest)

Macro to execute Lisp expressions, returning the last result.

Package

parse.

Source

parse.lisp.

Macro: define-parser (name &body ps)

Create a parse combinator.

Package

parse.

Source

parse.lisp.


5.1.2 Ordinary functions

Function: .all (p &rest ps)

Parse each combinator in order and return all as a list.

Package

parse.

Source

parse.lisp.

Function: .any ()

Succeeds if not at the end of the token stream.

Package

parse.

Source

parse.lisp.

Function: .between (open-guard close-guard p)

Capture a combinator between guards.

Package

parse.

Source

parse.lisp.

Function: .either (p1 p2)

Attempt to parse p1, if that fails, try p2.

Package

parse.

Source

parse.lisp.

Function: .eof ()

Succeeds if at the end of the token stream.

Package

parse.

Source

parse.lisp.

Function: .fail (datum &rest arguments)

Ensures that the parse combinator fails.

Package

parse.

Source

parse.lisp.

Function: .get ()

Always succeeds, returns the current parse state data.

Package

parse.

Source

parse.lisp.

Function: .ignore (p)

Parse p, ignore the result.

Package

parse.

Source

parse.lisp.

Function: .is (class &key test)

Checks if the current token is of a given class.

Package

parse.

Source

parse.lisp.

Function: .many (p)

Try and parse a combinator zero or more times.

Package

parse.

Source

parse.lisp.

Function: .many-until (p end)

Parse zero or more combinators until an end combinator is reached.

Package

parse.

Source

parse.lisp.

Function: .many1 (p)

Try and parse a combinator one or more times.

Package

parse.

Source

parse.lisp.

Function: .maybe (p)

Try and parse p, ignore it if there.

Package

parse.

Source

parse.lisp.

Function: .modify (f)

Always succeeds, applys f with the parse state data.

Package

parse.

Source

parse.lisp.

Function: .opt (x p)

Optionally match a parse combinator or return x.

Package

parse.

Source

parse.lisp.

Function: .pop ()

Always succeeds, assumes data is a list an pops it.

Package

parse.

Source

parse.lisp.

Function: .push (x)

Always succeeds, assumes data is a list and pushes x onto it.

Package

parse.

Source

parse.lisp.

Function: .put (x)

Always succeeds, puts data into the parse state.

Package

parse.

Source

parse.lisp.

Function: .ret (x)

Convert X into a monadic value.

Package

parse.

Source

parse.lisp.

Function: .sep-by (p sep)

Zero or more occurances of p separated by sep.

Package

parse.

Source

parse.lisp.

Function: .sep-by1 (p sep)

One or more occurances of p separated by sep.

Package

parse.

Source

parse.lisp.

Function: .skip-many (p)

Optionally skip a parse combinator zero or more times.

Package

parse.

Source

parse.lisp.

Function: .skip-many1 (p)

Try and parse a combinator one or more times, ignore it.

Package

parse.

Source

parse.lisp.

Function: >> (p m)

Monadic bind, ignore intermediate result.

Package

parse.

Source

parse.lisp.

Function: >>= (p f)

Monadic bind combinator.

Package

parse.

Source

parse.lisp.

Function: parse (p next-token &key initial-state errorp error-value)

Create a parse-state and pass it through a parse combinator.

Package

parse.

Source

parse.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: copy-parse-state (instance)
Package

parse.

Source

parse.lisp.

Function: make-parse-state (&key read-token tokens token-last data)
Package

parse.

Source

parse.lisp.

Reader: parse-state-data (instance)
Writer: (setf parse-state-data) (instance)
Package

parse.

Source

parse.lisp.

Target Slot

data.

Function: parse-state-next-token (st)

Returns the next token in the token list as a cons pair.

Package

parse.

Source

parse.lisp.

Function: parse-state-p (object)
Package

parse.

Source

parse.lisp.

Reader: parse-state-read-token (instance)
Writer: (setf parse-state-read-token) (instance)
Package

parse.

Source

parse.lisp.

Target Slot

read-token.

Function: parse-state-token-class (st)

Returns the class of the current token.

Package

parse.

Source

parse.lisp.

Reader: parse-state-token-last (instance)
Writer: (setf parse-state-token-last) (instance)
Package

parse.

Source

parse.lisp.

Target Slot

token-last.

Function: parse-state-token-value (st)

Returns the value of the current token.

Package

parse.

Source

parse.lisp.

Reader: parse-state-tokens (instance)
Writer: (setf parse-state-tokens) (instance)
Package

parse.

Source

parse.lisp.

Target Slot

tokens.

Function: satisfy (st pred)

Read the next token if necesary, test class, return value.

Package

parse.

Source

parse.lisp.


5.2.2 Structures

Structure: parse-state
Package

parse.

Source

parse.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: read-token
Readers

parse-state-read-token.

Writers

(setf parse-state-read-token).

Slot: tokens
Readers

parse-state-tokens.

Writers

(setf parse-state-tokens).

Slot: token-last
Readers

parse-state-token-last.

Writers

(setf parse-state-token-last).

Slot: data
Readers

parse-state-data.

Writers

(setf parse-state-data).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (   .   >  
C   D   F   M   P   S  
Index Entry  Section

(
(setf parse-state-data): Private ordinary functions
(setf parse-state-read-token): Private ordinary functions
(setf parse-state-token-last): Private ordinary functions
(setf parse-state-tokens): Private ordinary functions

.
.all: Public ordinary functions
.any: Public ordinary functions
.between: Public ordinary functions
.do: Public macros
.either: Public ordinary functions
.eof: Public ordinary functions
.fail: Public ordinary functions
.get: Public ordinary functions
.ignore: Public ordinary functions
.is: Public ordinary functions
.let: Public macros
.let*: Public macros
.many: Public ordinary functions
.many-until: Public ordinary functions
.many1: Public ordinary functions
.maybe: Public ordinary functions
.modify: Public ordinary functions
.opt: Public ordinary functions
.or: Public macros
.pop: Public ordinary functions
.prog1: Public macros
.progn: Public macros
.push: Public ordinary functions
.put: Public ordinary functions
.ret: Public ordinary functions
.sep-by: Public ordinary functions
.sep-by1: Public ordinary functions
.skip-many: Public ordinary functions
.skip-many1: Public ordinary functions

>
>>: Public ordinary functions
>>=: Public ordinary functions

C
copy-parse-state: Private ordinary functions

D
define-parser: Public macros

F
Function, (setf parse-state-data): Private ordinary functions
Function, (setf parse-state-read-token): Private ordinary functions
Function, (setf parse-state-token-last): Private ordinary functions
Function, (setf parse-state-tokens): Private ordinary functions
Function, .all: Public ordinary functions
Function, .any: Public ordinary functions
Function, .between: Public ordinary functions
Function, .either: Public ordinary functions
Function, .eof: Public ordinary functions
Function, .fail: Public ordinary functions
Function, .get: Public ordinary functions
Function, .ignore: Public ordinary functions
Function, .is: Public ordinary functions
Function, .many: Public ordinary functions
Function, .many-until: Public ordinary functions
Function, .many1: Public ordinary functions
Function, .maybe: Public ordinary functions
Function, .modify: Public ordinary functions
Function, .opt: Public ordinary functions
Function, .pop: Public ordinary functions
Function, .push: Public ordinary functions
Function, .put: Public ordinary functions
Function, .ret: Public ordinary functions
Function, .sep-by: Public ordinary functions
Function, .sep-by1: Public ordinary functions
Function, .skip-many: Public ordinary functions
Function, .skip-many1: Public ordinary functions
Function, >>: Public ordinary functions
Function, >>=: Public ordinary functions
Function, copy-parse-state: Private ordinary functions
Function, make-parse-state: Private ordinary functions
Function, parse: Public ordinary functions
Function, parse-state-data: Private ordinary functions
Function, parse-state-next-token: Private ordinary functions
Function, parse-state-p: Private ordinary functions
Function, parse-state-read-token: Private ordinary functions
Function, parse-state-token-class: Private ordinary functions
Function, parse-state-token-last: Private ordinary functions
Function, parse-state-token-value: Private ordinary functions
Function, parse-state-tokens: Private ordinary functions
Function, satisfy: Private ordinary functions

M
Macro, .do: Public macros
Macro, .let: Public macros
Macro, .let*: Public macros
Macro, .or: Public macros
Macro, .prog1: Public macros
Macro, .progn: Public macros
Macro, define-parser: Public macros
make-parse-state: Private ordinary functions

P
parse: Public ordinary functions
parse-state-data: Private ordinary functions
parse-state-next-token: Private ordinary functions
parse-state-p: Private ordinary functions
parse-state-read-token: Private ordinary functions
parse-state-token-class: Private ordinary functions
parse-state-token-last: Private ordinary functions
parse-state-token-value: Private ordinary functions
parse-state-tokens: Private ordinary functions

S
satisfy: Private ordinary functions