Common Lisp Package: COM.INFORMATIMAGO.COMMON-LISP.LISP-SEXP.SOURCE-FORM

This package exports functions to parse and manipulate Common Lisp sources as lisp forms (such as in macros). Copyright Pascal J. Bourguignon 2003 - 2012 This package is provided under the GNU General Public License. See the source file for details.

README:

FUNCTION

Public

EXTRACT-BODY (BODY)

RETURN: The list of body forms. NOTE: This parses the body as a lambda body. It's better to use PARSE-BODY directly.

EXTRACT-DECLARATIONS (BODY &OPTIONAL (ALLOW-DOCSTRING T))

RETURN: The list of declaration forms. NOTE: This parses the body as a lambda body. It's better to use PARSE-BODY directly.

EXTRACT-DOCUMENTATION (BODY)

RETURN: The documentation string found in BODY, or NIL if none is present. CLHS: 3.4.11 Syntactic Interaction of Documentation Strings and Declarations In a number of situations, a documentation string can appear amidst a series of declare expressions prior to a series of forms. In that case, if a string S appears where a documentation string is permissible and is not followed by either a declare expression or a form then S is taken to be a form; otherwise, S is taken as a documentation string. The consequences are unspecified if more than one such documentation string is present. NOTE: This parses the body as a lambda body. It's better to use PARSE-BODY directly.

PARSE-BODY (WHERE BODY)

WHERE: (member :lambda :locally :progn) specifies where the body is found, that is whether it may contains docstrings and declarations, or just declarations, or none. BODY: A list of forms. RETURN: Three values: a docstring or nil, a list of declarations, a list of forms.

PARSE-LAMBDA-LIST (LAMBDA-LIST &OPTIONAL (KIND ORDINARY))

DO: Parse a lambda-list of the specified kind. KIND: (MEMBER :ORDINARY :BOA :SPECIALIZED :MODIFY-MACRO :GENERIC :MACRO :TYPE :DESTRUCTURING :SETF :METHOD-COMBINATION) RETURN: A lambda-list instance. NOTE: In the case of :macro, :destructuring lambda lists, some parameter lists may further contain destructuring-lambda-list instances instead of lambda-list-parameter instances.

Undocumented

DECLARATIONS-HASH-TABLE (DECLARATIONS)

EXTRACT-METHOD-BODY (METHOD-STUFF)

EXTRACT-METHOD-DDL (METHOD-STUFF)

EXTRACT-METHOD-DECLARATIONS (METHOD-STUFF)

EXTRACT-METHOD-DOCUMENTATION (METHOD-STUFF)

EXTRACT-METHOD-LAMBDA-LIST (METHOD-STUFF)

EXTRACT-METHOD-QUALIFIERS (METHOD-STUFF)

Private

BODYVAR (SELF CURRENT)

RETURN: (values parameter following)

PARSE-VAR (SELF CURRENT SLOT LAMBDA-LIST-KEYWORD CLASS)

RETURN: (values parameter following)

Undocumented

DECLARATIONP (FORM)

DESTRUCTURING-REST (SELF CURRENT)

ENVVAR (SELF CURRENT)

MACRO-REST (SELF CURRENT)

PARSE-REST (SELF CURRENT SYNTAX)

RESTVAR (SELF CURRENT)

TEST/PARSE-BODY

WHOLEVAR (SELF CURRENT)

MACRO

Private

Undocumented

DEFINE-DEFAULT-GENERIC (NAME CLASS DEFAULT-VALUE)

GENERIC-FUNCTION

Public

LAMBDA-LIST-PARAMETERS (LAMBDA-LIST)

An ordered list of the parameters or destructuring-lambda-list instances.

LAMBDA-LIST-REST-P (SELF)

RETURN: Whether &REST or &BODY parameters are present.

PARAMETER-SPECIFIER (PARAMETER)

Return a parameter specifier sexp, which can be used to build a lambda list.

Undocumented

ENSURE-PARAMETER-KEYWORD (SELF)

LAMBDA-LIST-ALLOWED-KEYWORDS (LAMBDA-LIST)

LAMBDA-LIST-AUXILIARY-PARAMETERS-P (SELF)

LAMBDA-LIST-BODY-PARAMETER-P (SELF)

LAMBDA-LIST-ENVIRONMENT-PARAMETER-P (SELF)

LAMBDA-LIST-KIND (LAMBDA-LIST)

LAMBDA-LIST-MANDATORY-PARAMETER-COUNT (SELF)

LAMBDA-LIST-MANDATORY-PARAMETERS-P (SELF)

LAMBDA-LIST-OPTIONAL-PARAMETER-COUNT (SELF)

LAMBDA-LIST-OPTIONAL-PARAMETERS-P (SELF)

LAMBDA-LIST-REST-PARAMETER-P (SELF)

LAMBDA-LIST-WHOLE-PARAMETER-P (SELF)

MAKE-ARGUMENT-LIST (SELF)

MAKE-ARGUMENT-LIST-FORM (LAMBDA-LIST)

MAKE-HELP (SELF)

MAKE-LAMBDA-LIST (SELF)

PARAMETER-INDICATOR-P (SELF)

PARAMETER-INITFORM-P (SELF)

PARAMETER-KEYWORD-P (SELF)

PARAMETER-LABEL (PARAMETER)

PARAMETER-LAMBDA-LIST-KEYWORD (PARAMETER)

PARAMETER-SPECIALIZER-P (SELF)

PARSE-ORIGINAL-LAMBDA-LIST (SELF)

Private

Undocumented

AUXVARS (SELF CURRENT)

GKEYVARS (SELF CURRENT)

GOPTVARS (SELF CURRENT)

KEYVARS (SELF CURRENT)

LAMBDA-LIST-KEYWORD-PARAMETERS-P (SELF)

LAMBDA-LIST-SYNTAX (SELF)

OPTVARS (SELF CURRENT)

PARAMETER-HELP-LABEL (SELF)

PARAMETER-NAME-P (SELF)

PARSE-KEYVARS (SELF CURRENT CLASS)

PARSE-OPTVARS (SELF CURRENT SLOT LAMBDA-LIST-KEYWORD CLASS)

PARSE-PARAMETER (SELF FORM)

PARSE-PARAMETER-NAME (SELF FORM)

PARSE-REQVARS (SELF CURRENT CLASS)

PREQVARS (SELF CURRENT)

REQVARS (SELF CURRENT)

SREQVARS (SELF CURRENT)

SLOT-ACCESSOR

Public

LAMBDA-LIST-ALLOW-OTHER-KEYS-P (SELF)

Whether &ALLOW-OTHER-KEYS is present.

SETFLAMBDA-LIST-ALLOW-OTHER-KEYS-P (NEW-VALUE OBJECT)

Whether &ALLOW-OTHER-KEYS is present.

LAMBDA-LIST-KEY-P (SELF)

Whether &KEY is present.

SETFLAMBDA-LIST-KEY-P (NEW-VALUE OBJECT)

Whether &KEY is present.

PARAMETER-INDICATOR (SELF)

NIL, or the name of the indicator parameter.

SETFPARAMETER-INDICATOR (NEW-VALUE OBJECT)

NIL, or the name of the indicator parameter.

PARAMETER-INITFORM (SELF)

The initial form for the parameter.

SETFPARAMETER-INITFORM (NEW-VALUE OBJECT)

The initial form for the parameter.

PARAMETER-KEYWORD (SELF)

NIL, or the keyword specified for the parameter.

SETFPARAMETER-KEYWORD (NEW-VALUE OBJECT)

NIL, or the keyword specified for the parameter.

PARAMETER-NAME (OBJECT)

The name of the parameter.

SETFPARAMETER-NAME (NEW-VALUE OBJECT)

The name of the parameter.

PARAMETER-SPECIALIZER (SELF)

A specializer can be either NIL (no specializer),p a symbol denoting a class, or a cons (eql object) denoting an EQL specializer.

SETFPARAMETER-SPECIALIZER (NEW-VALUE OBJECT)

A specializer can be either NIL (no specializer),p a symbol denoting a class, or a cons (eql object) denoting an EQL specializer.

Undocumented

LAMBDA-LIST-AUXILIARY-PARAMETERS (SELF)

SETFLAMBDA-LIST-AUXILIARY-PARAMETERS (NEW-VALUE OBJECT)

LAMBDA-LIST-BODY-PARAMETER (SELF)

SETFLAMBDA-LIST-BODY-PARAMETER (NEW-VALUE OBJECT)

LAMBDA-LIST-ENVIRONMENT-PARAMETER (SELF)

SETFLAMBDA-LIST-ENVIRONMENT-PARAMETER (NEW-VALUE OBJECT)

LAMBDA-LIST-KEYWORD-PARAMETERS (SELF)

SETFLAMBDA-LIST-KEYWORD-PARAMETERS (NEW-VALUE OBJECT)

LAMBDA-LIST-MANDATORY-PARAMETERS (OBJECT)

SETFLAMBDA-LIST-MANDATORY-PARAMETERS (NEW-VALUE OBJECT)

LAMBDA-LIST-OPTIONAL-PARAMETERS (OBJECT)

SETFLAMBDA-LIST-OPTIONAL-PARAMETERS (NEW-VALUE OBJECT)

LAMBDA-LIST-REST-PARAMETER (OBJECT)

SETFLAMBDA-LIST-REST-PARAMETER (NEW-VALUE OBJECT)

LAMBDA-LIST-WHOLE-PARAMETER (SELF)

SETFLAMBDA-LIST-WHOLE-PARAMETER (NEW-VALUE OBJECT)

ORIGINAL-LAMBDA-LIST (OBJECT)

SETFORIGINAL-LAMBDA-LIST (NEW-VALUE OBJECT)

CLASS

Public

AUXILIARY-PARAMETER

An auxiliary parameter.

BODY-PARAMETER

A &BODY parameter.

ENVIRONMENT-PARAMETER

An &ENVIRONMENT parameter.

GENERIC-KEYWORD-PARAMETER

A generic keyword parameter.

GENERIC-OPTIONAL-PARAMETER

An optional parameter in generic lambda-lists.

KEYWORD-PARAMETER

A keyword parameter.

LAMBDA-LIST

An abstract lambda-list.

OPTIONAL-PARAMETER

An optional parameter. Note that while auxiliary-parameter and optional-parameter have the same initform attribute, an optional-parameter is a different kind from an auxiliary-parameter, semantically.

PARAMETER

A generic parameter.

REST-PARAMETER

A &REST parameter.

SPECIALIZED-PARAMETER

A specialized parameter.

WHOLE-PARAMETER

A &WHOLE parameter.

Undocumented

BOA-LAMBDA-LIST

DESTRUCTURING-LAMBDA-LIST

GENERIC-LAMBDA-LIST

MACRO-LAMBDA-LIST

METHOD-COMBINATION-LAMBDA-LIST

MODIFY-MACRO-LAMBDA-LIST

ORDINARY-LAMBDA-LIST

SETF-LAMBDA-LIST

SPECIALIZED-LAMBDA-LIST

TYPE-LAMBDA-LIST

Private

OR-LL

This class and its subclasses are mixin declaring formally the attributes for the various lambda-list classes. Semantically, some constraints may be different from one lambda-list to the other.

PARAMETER-WITH-INITFORM

A mixin for a parameter that may have an initform.

PARAMETER-WITH-KEYWORD

A mixin for keyword parameters.

Undocumented

ORAK-LL

ORAKA-LL

ORAKAW-LL

ORAKAWB-LL

ORAKAWBE-LL

ORAKE-LL

CONDITION

Private

Undocumented

SIMPLE-PROGRAM-ERROR