The monkeylib-text-languages Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The monkeylib-text-languages Reference Manual

This is the monkeylib-text-languages Reference Manual, version 1.0, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:20:13 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

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


Previous: , Up: Systems   [Contents][Index]

1.1 monkeylib-text-languages

Author

Peter Seibel <peter@gigamonkeys.com>

License

BSD

Description

Compiler for text-based languages.

Version

1.0

Dependencies
Source

monkeylib-text-languages.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

2 Files

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


Previous: , Up: Files   [Contents][Index]

2.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.1 monkeylib-text-languages.asd

Location

monkeylib-text-languages.asd

Systems

monkeylib-text-languages (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.2 monkeylib-text-languages/packages.lisp

Parent

monkeylib-text-languages (system)

Location

packages.lisp

Packages

monkeylib-text-languages


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.3 monkeylib-text-languages/language.lisp

Dependency

packages.lisp (file)

Parent

monkeylib-text-languages (system)

Location

language.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

2.1.4 monkeylib-text-languages/file-compiler.lisp

Dependencies
Parent

monkeylib-text-languages (system)

Location

file-compiler.lisp

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

3 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

3.1 monkeylib-text-languages

Source

packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

4.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.1 Macros

Macro: define-language NAME PARENT
Package

monkeylib-text-languages

Source

language.lisp (file)

Macro: define-language-macro NAME
Package

monkeylib-text-languages

Source

language.lisp (file)

Macro: define-macro NAME MACRO-SYMBOL (&rest PARAMETERS) &body BODY
Package

monkeylib-text-languages

Source

language.lisp (file)

Macro: define-special-operator NAME SPECIAL-OPERATOR-SYMBOL (LANGUAGE PROCESSOR &rest OTHER-PARAMETERS) &body BODY
Package

monkeylib-text-languages

Source

language.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.2 Functions

Function: case-preserving-readtable ()
Package

monkeylib-text-languages

Source

language.lisp (file)

Function: compile-special-op-body PROCESSOR BODY

Code generator generator.

Package

monkeylib-text-languages

Source

language.lisp (file)

Function: emit LANGUAGE BODY ENVIRONMENT
Package

monkeylib-text-languages

Source

language.lisp (file)

Function: emit-for-language LANGUAGE-CLASS SEXP
Package

monkeylib-text-languages

Source

language.lisp (file)

Function: fully-expand-macro-form LANGUAGE FORM ENVIRONMENT
Package

monkeylib-text-languages

Source

language.lisp (file)

Function: parse-&environment PARAMETERS

Parse out an optional &environment parameter and return the parameter list without it and the name of the parameter.

Package

monkeylib-text-languages

Source

language.lisp (file)

Function: process LANGUAGE PROCESSOR FORM ENVIRONMENT

Process FORM as an expression in LANGUAGE. The ENVIRONMENT is provided to special forms and to the basic evaluation rule implemented by a method on PROCESS-SEXP.

Package

monkeylib-text-languages

Source

language.lisp (file)

Function: self-evaluating-p FORM
Package

monkeylib-text-languages

Source

language.lisp (file)

Function: sexp->ops LANGUAGE BODY ENVIRONMENT
Package

monkeylib-text-languages

Source

language.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.3 Generic functions

Generic Function: comment LANGUAGE TEXT

Return text as a comment.

Package

monkeylib-text-languages

Source

language.lisp (file)

Generic Function: embeddable-value-form LANGUAGE FORM ENVIRONMENT

Return a form that will evaluate to a string that can be embedded in the generated output.

Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: embeddable-value-form LANGUAGE FORM ENVIRONMENT

Reasonable default. Languages that need to escape certain characters will need their own specializations of this method.

Generic Function: expand-macro-form LANGUAGE FORM ENVIRONMENT
Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: expand-macro-form LANGUAGE FORM ENVIRONMENT
Generic Function: identifier LANGUAGE FORM

Extract a symbol that identifies the form.

Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: identifier LANGUAGE FORM
Method: identifier LANGUAGE (FORM cons)

Reasonable default for languages with a Lispy syntax.

Generic Function: input-package OBJECT
Generic Function: (setf input-package) NEW-VALUE OBJECT
Package

monkeylib-text-languages

Methods
Method: input-package (LANGUAGE language)
Method: (setf input-package) NEW-VALUE (LANGUAGE language)

package we should use to read the input file.

Source

language.lisp (file)

Generic Function: input-readtable OBJECT
Generic Function: (setf input-readtable) NEW-VALUE OBJECT
Package

monkeylib-text-languages

Methods
Method: input-readtable (LANGUAGE language)
Method: (setf input-readtable) NEW-VALUE (LANGUAGE language)

readtable we should use to read the input files in this language.

Source

language.lisp (file)

Generic Function: macro-form-p LANGUAGE FORM

Is the given form a macro form in language. The
default method probably does what you want–it extracts the form’s identifier and looks for a macro-symbol on its plist.

Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: macro-form-p LANGUAGE (FORM cons)
Method: macro-form-p LANGUAGE FORM
Generic Function: macro-symbols OBJECT
Generic Function: (setf macro-symbols) NEW-VALUE OBJECT
Package

monkeylib-text-languages

Methods
Method: macro-symbols (LANGUAGE language)
Method: (setf macro-symbols) NEW-VALUE (LANGUAGE language)

symbols added to a symbol’s plist to indicate it
has been defined as a macro in LANGUAGE. These will typically be pushed onto this list in an :after method on initialize-instance so they are ordered the same as the class precedence list.

Source

language.lisp (file)

Generic Function: output-file-type OBJECT
Generic Function: (setf output-file-type) NEW-VALUE OBJECT
Package

monkeylib-text-languages

Methods
Method: output-file-type (LANGUAGE language)
Method: (setf output-file-type) NEW-VALUE (LANGUAGE language)

file suffix for generated files.

Source

language.lisp (file)

Generic Function: process-sexp LANGUAGE PROCESSOR FORM ENVIRONMENT

The basic evaluation rule for the language,
after special operators and macro forms have been handled.

Package

monkeylib-text-languages

Source

language.lisp (file)

Generic Function: process-special-form LANGUAGE PROCESSOR FORM ENVIRONMENT
Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: process-special-form LANGUAGE PROCESSOR FORM ENVIRONMENT
Generic Function: sexp-form-p LANGUAGE FORM

Is the given form a meaningful non-special, non-macro form in language.

Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: sexp-form-p LANGUAGE FORM

Suitable default for languages in which all forms that are not special or macros have some meaning. Languages that allow embedded code and embedded values will need their own specialization of this method.

Generic Function: special-form-p LANGUAGE FORM

Is the given form a special form in language. The
default method probably does what you want–it extracts the form’s identifier and looks for a special-operator-symbol on its plist.

Package

monkeylib-text-languages

Source

language.lisp (file)

Methods
Method: special-form-p LANGUAGE (FORM cons)
Method: special-form-p LANGUAGE FORM
Generic Function: special-operator-symbols OBJECT
Generic Function: (setf special-operator-symbols) NEW-VALUE OBJECT
Package

monkeylib-text-languages

Methods
Method: special-operator-symbols (LANGUAGE language)
Method: (setf special-operator-symbols) NEW-VALUE (LANGUAGE language)

symbols added to a symbol’s plist to indicate it
has been defined as a macro in LANGUAGE. These will typically be pushed onto this list in an :after method on initialize-instance so they are ordered the same as the class precedence list.

Source

language.lisp (file)

Generic Function: top-level-environment LANGUAGE

Environment for evaluating top-level forms.

Package

monkeylib-text-languages

Source

language.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.4 Conditions

Condition: foo-syntax-error ()
Package

monkeylib-text-languages

Source

language.lisp (file)

Direct superclasses

condition (condition)

Direct methods
  • print-object (method)
  • cause-of (method)
  • cause-of (method)
  • form-of (method)
  • form-of (method)
Direct slots
Slot: form
Initargs

:form

Readers

form-of (generic function)

Writers

(setf form-of) (generic function)

Slot: cause
Initargs

:cause

Initform

(quote nil)

Readers

cause-of (generic function)

Writers

(setf cause-of) (generic function)


Previous: , Up: Exported definitions   [Contents][Index]

4.1.5 Classes

Class: language ()
Package

monkeylib-text-languages

Source

language.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: special-operator-symbols

symbols added to a symbol’s plist to indicate it
has been defined as a macro in LANGUAGE. These will typically be pushed onto this list in an :after method on initialize-instance so they are ordered the same as the class precedence list.

Readers

special-operator-symbols (generic function)

Writers

(setf special-operator-symbols) (generic function)

Slot: macro-symbols

symbols added to a symbol’s plist to indicate it
has been defined as a macro in LANGUAGE. These will typically be pushed onto this list in an :after method on initialize-instance so they are ordered the same as the class precedence list.

Readers

macro-symbols (generic function)

Writers

(setf macro-symbols) (generic function)

Slot: input-readtable

readtable we should use to read the input files in this language.

Initargs

:input-readtable

Readers

input-readtable (generic function)

Writers

(setf input-readtable) (generic function)

Slot: input-package

package we should use to read the input file.

Initargs

:input-package

Readers

input-package (generic function)

Writers

(setf input-package) (generic function)

Slot: output-file-type

file suffix for generated files.

Initargs

:output-file-type

Readers

output-file-type (generic function)

Writers

(setf output-file-type) (generic function)


Previous: , Up: Definitions   [Contents][Index]

4.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.1 Functions

Function: find-in-plist IDENTIFIER SYMBOLS

Find the first value on an identifier’s plist given a list of symbols. This is used to implement inheritance of special forms

Package

monkeylib-text-languages

Source

language.lisp (file)

Function: generate LANGUAGE INPUT &optional OUTPUT

Input can be a sexp, a string, or a stream. Output can be an output stream, a string, a pathname, NIL, or T. The latter two are interpreted as they are by CL:FORMAT, NIL generates a string, T send to *STANDARD-OUTPUT*.

Package

monkeylib-text-languages

Source

file-compiler.lisp (file)

Function: normalize-macro-lambda-list PARAMETERS NAMEVAR

Create a destructuring-lambda list that can parse a whole macro form, including an optional &whole parameter and a parameter to eat up the macro name.

Package

monkeylib-text-languages

Source

language.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

4.2.2 Generic functions

Generic Function: cause-of CONDITION
Generic Function: (setf cause-of) NEW-VALUE CONDITION
Package

monkeylib-text-languages

Methods
Method: cause-of (CONDITION foo-syntax-error)
Method: (setf cause-of) NEW-VALUE (CONDITION foo-syntax-error)
Source

language.lisp (file)

Generic Function: finish STREAM

Close the output stream or return the result as necessary.

Package

monkeylib-text-languages

Source

file-compiler.lisp (file)

Methods
Method: finish (STREAM string-stream)
Method: finish (STREAM file-stream)
Method: finish (STREAM stream)
Generic Function: form-of CONDITION
Generic Function: (setf form-of) NEW-VALUE CONDITION
Package

monkeylib-text-languages

Methods
Method: form-of (CONDITION foo-syntax-error)
Method: (setf form-of) NEW-VALUE (CONDITION foo-syntax-error)
Source

language.lisp (file)

Generic Function: input-to-sexp LANGUAGE INPUT

Convert input to a sexp.

Package

monkeylib-text-languages

Source

file-compiler.lisp (file)

Methods
Method: input-to-sexp LANGUAGE (INPUT cons)
Method: input-to-sexp LANGUAGE (INPUT string)
Method: input-to-sexp LANGUAGE (INPUT pathname)
Method: input-to-sexp LANGUAGE (INPUT stream)
Generic Function: output-to-stream OUTPUT

Convert output to a stream.

Package

monkeylib-text-languages

Source

file-compiler.lisp (file)

Methods
Method: output-to-stream (OUTPUT stream)
Method: output-to-stream (OUTPUT string)
Method: output-to-stream (OUTPUT pathname)
Method: output-to-stream (OUTPUT (eql nil))
Method: output-to-stream (OUTPUT (eql t))

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

F
File, Lisp, monkeylib-text-languages.asd: The monkeylib-text-languages<dot>asd file
File, Lisp, monkeylib-text-languages/file-compiler.lisp: The monkeylib-text-languages/file-compiler<dot>lisp file
File, Lisp, monkeylib-text-languages/language.lisp: The monkeylib-text-languages/language<dot>lisp file
File, Lisp, monkeylib-text-languages/packages.lisp: The monkeylib-text-languages/packages<dot>lisp file

L
Lisp File, monkeylib-text-languages.asd: The monkeylib-text-languages<dot>asd file
Lisp File, monkeylib-text-languages/file-compiler.lisp: The monkeylib-text-languages/file-compiler<dot>lisp file
Lisp File, monkeylib-text-languages/language.lisp: The monkeylib-text-languages/language<dot>lisp file
Lisp File, monkeylib-text-languages/packages.lisp: The monkeylib-text-languages/packages<dot>lisp file

M
monkeylib-text-languages.asd: The monkeylib-text-languages<dot>asd file
monkeylib-text-languages/file-compiler.lisp: The monkeylib-text-languages/file-compiler<dot>lisp file
monkeylib-text-languages/language.lisp: The monkeylib-text-languages/language<dot>lisp file
monkeylib-text-languages/packages.lisp: The monkeylib-text-languages/packages<dot>lisp file

Jump to:   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

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

(
(setf cause-of): Internal generic functions
(setf cause-of): Internal generic functions
(setf form-of): Internal generic functions
(setf form-of): Internal generic functions
(setf input-package): Exported generic functions
(setf input-package): Exported generic functions
(setf input-readtable): Exported generic functions
(setf input-readtable): Exported generic functions
(setf macro-symbols): Exported generic functions
(setf macro-symbols): Exported generic functions
(setf output-file-type): Exported generic functions
(setf output-file-type): Exported generic functions
(setf special-operator-symbols): Exported generic functions
(setf special-operator-symbols): Exported generic functions

C
case-preserving-readtable: Exported functions
cause-of: Internal generic functions
cause-of: Internal generic functions
comment: Exported generic functions
compile-special-op-body: Exported functions

D
define-language: Exported macros
define-language-macro: Exported macros
define-macro: Exported macros
define-special-operator: Exported macros

E
embeddable-value-form: Exported generic functions
embeddable-value-form: Exported generic functions
emit: Exported functions
emit-for-language: Exported functions
expand-macro-form: Exported generic functions
expand-macro-form: Exported generic functions

F
find-in-plist: Internal functions
finish: Internal generic functions
finish: Internal generic functions
finish: Internal generic functions
finish: Internal generic functions
form-of: Internal generic functions
form-of: Internal generic functions
fully-expand-macro-form: Exported functions
Function, case-preserving-readtable: Exported functions
Function, compile-special-op-body: Exported functions
Function, emit: Exported functions
Function, emit-for-language: Exported functions
Function, find-in-plist: Internal functions
Function, fully-expand-macro-form: Exported functions
Function, generate: Internal functions
Function, normalize-macro-lambda-list: Internal functions
Function, parse-&environment: Exported functions
Function, process: Exported functions
Function, self-evaluating-p: Exported functions
Function, sexp->ops: Exported functions

G
generate: Internal functions
Generic Function, (setf cause-of): Internal generic functions
Generic Function, (setf form-of): Internal generic functions
Generic Function, (setf input-package): Exported generic functions
Generic Function, (setf input-readtable): Exported generic functions
Generic Function, (setf macro-symbols): Exported generic functions
Generic Function, (setf output-file-type): Exported generic functions
Generic Function, (setf special-operator-symbols): Exported generic functions
Generic Function, cause-of: Internal generic functions
Generic Function, comment: Exported generic functions
Generic Function, embeddable-value-form: Exported generic functions
Generic Function, expand-macro-form: Exported generic functions
Generic Function, finish: Internal generic functions
Generic Function, form-of: Internal generic functions
Generic Function, identifier: Exported generic functions
Generic Function, input-package: Exported generic functions
Generic Function, input-readtable: Exported generic functions
Generic Function, input-to-sexp: Internal generic functions
Generic Function, macro-form-p: Exported generic functions
Generic Function, macro-symbols: Exported generic functions
Generic Function, output-file-type: Exported generic functions
Generic Function, output-to-stream: Internal generic functions
Generic Function, process-sexp: Exported generic functions
Generic Function, process-special-form: Exported generic functions
Generic Function, sexp-form-p: Exported generic functions
Generic Function, special-form-p: Exported generic functions
Generic Function, special-operator-symbols: Exported generic functions
Generic Function, top-level-environment: Exported generic functions

I
identifier: Exported generic functions
identifier: Exported generic functions
identifier: Exported generic functions
input-package: Exported generic functions
input-package: Exported generic functions
input-readtable: Exported generic functions
input-readtable: Exported generic functions
input-to-sexp: Internal generic functions
input-to-sexp: Internal generic functions
input-to-sexp: Internal generic functions
input-to-sexp: Internal generic functions
input-to-sexp: Internal generic functions

M
Macro, define-language: Exported macros
Macro, define-language-macro: Exported macros
Macro, define-macro: Exported macros
Macro, define-special-operator: Exported macros
macro-form-p: Exported generic functions
macro-form-p: Exported generic functions
macro-form-p: Exported generic functions
macro-symbols: Exported generic functions
macro-symbols: Exported generic functions
Method, (setf cause-of): Internal generic functions
Method, (setf form-of): Internal generic functions
Method, (setf input-package): Exported generic functions
Method, (setf input-readtable): Exported generic functions
Method, (setf macro-symbols): Exported generic functions
Method, (setf output-file-type): Exported generic functions
Method, (setf special-operator-symbols): Exported generic functions
Method, cause-of: Internal generic functions
Method, embeddable-value-form: Exported generic functions
Method, expand-macro-form: Exported generic functions
Method, finish: Internal generic functions
Method, finish: Internal generic functions
Method, finish: Internal generic functions
Method, form-of: Internal generic functions
Method, identifier: Exported generic functions
Method, identifier: Exported generic functions
Method, input-package: Exported generic functions
Method, input-readtable: Exported generic functions
Method, input-to-sexp: Internal generic functions
Method, input-to-sexp: Internal generic functions
Method, input-to-sexp: Internal generic functions
Method, input-to-sexp: Internal generic functions
Method, macro-form-p: Exported generic functions
Method, macro-form-p: Exported generic functions
Method, macro-symbols: Exported generic functions
Method, output-file-type: Exported generic functions
Method, output-to-stream: Internal generic functions
Method, output-to-stream: Internal generic functions
Method, output-to-stream: Internal generic functions
Method, output-to-stream: Internal generic functions
Method, output-to-stream: Internal generic functions
Method, process-special-form: Exported generic functions
Method, sexp-form-p: Exported generic functions
Method, special-form-p: Exported generic functions
Method, special-form-p: Exported generic functions
Method, special-operator-symbols: Exported generic functions

N
normalize-macro-lambda-list: Internal functions

O
output-file-type: Exported generic functions
output-file-type: Exported generic functions
output-to-stream: Internal generic functions
output-to-stream: Internal generic functions
output-to-stream: Internal generic functions
output-to-stream: Internal generic functions
output-to-stream: Internal generic functions
output-to-stream: Internal generic functions

P
parse-&environment: Exported functions
process: Exported functions
process-sexp: Exported generic functions
process-special-form: Exported generic functions
process-special-form: Exported generic functions

S
self-evaluating-p: Exported functions
sexp->ops: Exported functions
sexp-form-p: Exported generic functions
sexp-form-p: Exported generic functions
special-form-p: Exported generic functions
special-form-p: Exported generic functions
special-form-p: Exported generic functions
special-operator-symbols: Exported generic functions
special-operator-symbols: Exported generic functions

T
top-level-environment: Exported generic functions

Jump to:   (  
C   D   E   F   G   I   M   N   O   P   S   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   C   F   I   M   O   S  
Index Entry  Section

C
cause: Exported conditions

F
form: Exported conditions

I
input-package: Exported classes
input-readtable: Exported classes

M
macro-symbols: Exported classes

O
output-file-type: Exported classes

S
Slot, cause: Exported conditions
Slot, form: Exported conditions
Slot, input-package: Exported classes
Slot, input-readtable: Exported classes
Slot, macro-symbols: Exported classes
Slot, output-file-type: Exported classes
Slot, special-operator-symbols: Exported classes
special-operator-symbols: Exported classes

Jump to:   C   F   I   M   O   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   L   M   P   S  
Index Entry  Section

C
Class, language: Exported classes
Condition, foo-syntax-error: Exported conditions

F
foo-syntax-error: Exported conditions

L
language: Exported classes

M
monkeylib-text-languages: The monkeylib-text-languages system
monkeylib-text-languages: The monkeylib-text-languages package

P
Package, monkeylib-text-languages: The monkeylib-text-languages package

S
System, monkeylib-text-languages: The monkeylib-text-languages system

Jump to:   C   F   L   M   P   S