The parser.common-rules Reference Manual

This is the parser.common-rules Reference Manual, version 0.4.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:31:25 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 parser.common-rules

Provides common parsing rules that are useful in many grammars.

Maintainer

Jan Moringen <>

Author

Jan Moringen <>

License

MIT

Version

0.4.0

Dependencies
  • alexandria (system).
  • split-sequence (system).
  • let-plus (system)., at least version "0.2"
  • esrap (system)., at least version "0.16"
Source

parser.common-rules.asd.

Child Component

src (module).


3 Modules

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


3.1 parser.common-rules/src

Source

parser.common-rules.asd.

Parent Component

parser.common-rules (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 parser.common-rules/parser.common-rules.asd

Source

parser.common-rules.asd.

Parent Component

parser.common-rules (system).

ASDF Systems

parser.common-rules.


4.1.2 parser.common-rules/src/package.lisp

Source

parser.common-rules.asd.

Parent Component

src (module).

Packages

parser.common-rules.


4.1.3 parser.common-rules/src/rules-anchors.lisp

Dependency

package.lisp (file).

Source

parser.common-rules.asd.

Parent Component

src (module).


4.1.4 parser.common-rules/src/rules-whitespace.lisp

Dependency

rules-anchors.lisp (file).

Source

parser.common-rules.asd.

Parent Component

src (module).


4.1.5 parser.common-rules/src/rules-comments.lisp

Dependency

rules-whitespace.lisp (file).

Source

parser.common-rules.asd.

Parent Component

src (module).

Internals

trim-common-prefix (generic function).


4.1.6 parser.common-rules/src/rules-literals.lisp

Dependency

rules-comments.lisp (file).

Source

parser.common-rules.asd.

Parent Component

src (module).

Internals

4.1.7 parser.common-rules/src/macros-tokenization.lisp

Dependency

rules-literals.lisp (file).

Source

parser.common-rules.asd.

Parent Component

src (module).

Public Interface

defrule/s (macro).

Internals

skippable-rule-for-name (function).


5 Packages

Packages are listed by definition order.


5.1 parser.common-rules

This package contains parsing rules and macros for common parsing tasks that are hopefully useful in many grammars.

Source

package.lisp.

Use List
  • alexandria.
  • common-lisp.
  • esrap.
  • let-plus.
Public Interface

defrule/s (macro).

Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Macros

Macro: defrule/s (name-and-options expression &body options)

Like ‘esrap:defule’ but define additional rules named NAME/s and NAME/?s which respectively require/allow EXPRESSION to be followed by skippable input (e.g. whitespace).

NAME-AND-OPTIONS can be either just a rule name or a list of the form

(NAME &key
SKIPPABLE-EXPRESSION S?
SKIPPABLE?-EXPRESSION ?S?
DEFINER)

where SKIPPABLE-EXPRESSION and SKIPPABLE?-EXPRESSION name the rules used to parse skippable input in the NAME/s and NAME/?s variants. Default to ‘skippable’ and ‘skippable?’ respectively.

S? and ?S? control which of the NAME/S and NAME/?S rules should be generated. Default is generating both.

DEFINER is the name of the macro used to define the "main" rule. Defaults to ‘esrap:defrule’.

Package

parser.common-rules.

Source

macros-tokenization.lisp.


6.2 Internals


6.2.1 Ordinary functions

Function: %parse-integer (radix text position end)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: <=-0-255 (number)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: binary-digit-char? (character)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: decimal-digit-char? (character)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: hexadecimal-digit-char? (character)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: in-double-float-range (number)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: in-single-float-range (number)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: octal-digit-char? (character)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: parse-binary-integer (text position end)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: parse-decimal-integer (text position end)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: parse-hexadecimal-integer (text position end)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: parse-octal-integer (text position end)
Package

parser.common-rules.

Source

rules-literals.lisp.

Function: skippable-rule-for-name (skippable-name name)
Package

parser.common-rules.

Source

macros-tokenization.lisp.


6.2.2 Generic functions

Generic Function: trim-common-prefix (thing &key prefix-characters)
Package

parser.common-rules.

Source

rules-comments.lisp.

Methods
Method: trim-common-prefix ((thing cons) &key prefix-characters)
Method: trim-common-prefix ((thing string) &key prefix-characters)

Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   <  
B   D   F   G   H   I   M   O   P   S   T  
Index Entry  Section

%
%parse-integer: Private ordinary functions

<
<=-0-255: Private ordinary functions

B
binary-digit-char?: Private ordinary functions

D
decimal-digit-char?: Private ordinary functions
defrule/s: Public macros

F
Function, %parse-integer: Private ordinary functions
Function, <=-0-255: Private ordinary functions
Function, binary-digit-char?: Private ordinary functions
Function, decimal-digit-char?: Private ordinary functions
Function, hexadecimal-digit-char?: Private ordinary functions
Function, in-double-float-range: Private ordinary functions
Function, in-single-float-range: Private ordinary functions
Function, octal-digit-char?: Private ordinary functions
Function, parse-binary-integer: Private ordinary functions
Function, parse-decimal-integer: Private ordinary functions
Function, parse-hexadecimal-integer: Private ordinary functions
Function, parse-octal-integer: Private ordinary functions
Function, skippable-rule-for-name: Private ordinary functions

G
Generic Function, trim-common-prefix: Private generic functions

H
hexadecimal-digit-char?: Private ordinary functions

I
in-double-float-range: Private ordinary functions
in-single-float-range: Private ordinary functions

M
Macro, defrule/s: Public macros
Method, trim-common-prefix: Private generic functions
Method, trim-common-prefix: Private generic functions

O
octal-digit-char?: Private ordinary functions

P
parse-binary-integer: Private ordinary functions
parse-decimal-integer: Private ordinary functions
parse-hexadecimal-integer: Private ordinary functions
parse-octal-integer: Private ordinary functions

S
skippable-rule-for-name: Private ordinary functions

T
trim-common-prefix: Private generic functions
trim-common-prefix: Private generic functions
trim-common-prefix: Private generic functions


A.3 Variables


A.4 Data types

Jump to:   F   M   P   R   S  
Index Entry  Section

F
File, macros-tokenization.lisp: The parser․common-rules/src/macros-tokenization․lisp file
File, package.lisp: The parser․common-rules/src/package․lisp file
File, parser.common-rules.asd: The parser․common-rules/parser․common-rules․asd file
File, rules-anchors.lisp: The parser․common-rules/src/rules-anchors․lisp file
File, rules-comments.lisp: The parser․common-rules/src/rules-comments․lisp file
File, rules-literals.lisp: The parser․common-rules/src/rules-literals․lisp file
File, rules-whitespace.lisp: The parser․common-rules/src/rules-whitespace․lisp file

M
macros-tokenization.lisp: The parser․common-rules/src/macros-tokenization․lisp file
Module, src: The parser․common-rules/src module

P
Package, parser.common-rules: The parser․common-rules package
package.lisp: The parser․common-rules/src/package․lisp file
parser.common-rules: The parser․common-rules system
parser.common-rules: The parser․common-rules package
parser.common-rules.asd: The parser․common-rules/parser․common-rules․asd file

R
rules-anchors.lisp: The parser․common-rules/src/rules-anchors․lisp file
rules-comments.lisp: The parser․common-rules/src/rules-comments․lisp file
rules-literals.lisp: The parser․common-rules/src/rules-literals․lisp file
rules-whitespace.lisp: The parser․common-rules/src/rules-whitespace․lisp file

S
src: The parser․common-rules/src module
System, parser.common-rules: The parser․common-rules system