Next: , Previous: analyze-declaration-specifier, Up: API


build-declaration-specifier

Syntax

— Generic Function: build-declaration-specifier declaration-identifier affected-variables context

⇒ result-specifier

Method signatures

— Method: build-declaration-specifier (id (eql 'declaration)) vars context
— Method: build-declaration-specifier (id (eql 'dynamic-extent)) vars context
— Method: build-declaration-specifier (id (eql 'ftype)) vars context
— Method: build-declaration-specifier (id (eql 'ignore)) vars context
— Method: build-declaration-specifier (id (eql 'ignorable)) vars context
— Method: build-declaration-specifier (id (eql 'inline)) vars context
— Method: build-declaration-specifier (id (eql 'notinline)) vars context
— Method: build-declaration-specifier (id (eql 'optimize)) vars context
— Method: build-declaration-specifier (id (eql 'special)) vars context
— Method: build-declaration-specifier (id (eql 'type)) vars context
— Method: build-declaration-specifier id vars context

Arguments and Values

declaration-identifier
A declaration identifier.
affected-variables
A list of normalized binding names affected by the declaration specifier under construction.
context
An object.
result-specifier
A declaration specifier.

Description

The generic function build-declaration-specifier is used by build-declarations to reconstruct a declaration specifier from the parts returned by analyze-declaration-specifier.

It is hence the counterpart of analyze-declaration-specifier: whereas that one disassembles a declaration specifier into parts, build-declaration-specifier assembles the parts back into a declaration specifier.

Examples

  PARSE-DECLARATIONS> (build-declaration-specifier 'optimize nil '((speed 0) debug))
  => (OPTIMIZE (SPEED 0) DEBUG)
  PARSE-DECLARATIONS> (build-declaration-specifier 'type '(x y z) 'fixnum)
  => (TYPE FIXNUM X Y Z)
  PARSE-DECLARATIONS> (build-declaration-specifier 'inline '(#'f #'g #'h) nil)
  => (INLINE F G H)

Exceptional Situations

None.

See Also

analyze-declaration-specifier
build-declarations

Notes

build-declaration-specifier can be thought of as being (almost) the inverse function of analyze-declaration-specifier. That is for an arbitrary declaration specifier in *SPEC*, the following code should axiomatically result in a declaration specifier that is equivalent to *SPEC* when interpreted by the Common Lisp implementation:

  (multiple-value-call #'build-declaration-specifier
    (analyze-declaration-specifier (first *spec*) (rest *spec*) nil))

However, the result may in fact not be EQUAL to the original specifier, as analyze-declaration-specifier can perform arbitrary normalization:

  PARSE-DECLARATIONS> (let ((spec '((string 512) variable)))
                        (multiple-value-call #'build-declaration-specifier
                          (analyze-declaration-specifier (first spec) (rest spec) nil)))
  => (TYPE (STRING 512) VARIABLE)