Common Lisp Package: LISPBUILDER-YACC

README:

FUNCTION

Public

MAKE-PARSER (GRAMMAR &KEY (DISCARD-MEMOS T) (MUFFLE-CONFLICTS NIL) (PRINT-DERIVES-EPSILON NIL) (PRINT-FIRST-TERMINALS NIL) (PRINT-STATES NIL) (PRINT-GOTO-GRAPH NIL) (PRINT-LOOKAHEADS NIL))

Combines COMPUTE-ALL-LOOKAHEADS and COMPUTE-PARSING-TABLES. MUFFLE-WARNINGS is one of NIL, T, :SOME or a list of the form (sr rr).

PARSE-WITH-LEXER (LEXER PARSER)

Parse the stream of symbols provided by LEXER using PARSER. LEXER is a function of no arguments returning a symbol and a semantic value, and should return (VALUES NIL NIL) when the end of input is reached. Handle YACC-PARSE-ERROR to provide custom error reporting.

Undocumented

MAKE-GRAMMAR (&KEY NAME (START-SYMBOL (REQUIRED-ARGUMENT)) TERMINALS PRECEDENCE PRODUCTIONS)

MAKE-PRODUCTION (SYMBOL DERIVES &KEY (ACTION #'LIST) (ACTION-FORM NIL))

Private

COMBINE-FIRST (F1 S GRAMMAR)

FIRST(s1.s) where f1=FIRST(s1).

COMPUTE-ALL-LOOKAHEADS (KERNELS GRAMMAR)

Compute the LR(1) lookaheads for all the collections in KERNELS.

COMPUTE-GOTO (KERNEL SYMBOL GRAMMAR)

Compute the kernel of goto(KERNEL, SYMBOL)

COMPUTE-KERNELS (GRAMMAR)

Compute the set collections of LR(0) items for GRAMMAR.

COMPUTE-LOOKAHEADS (KERNEL GRAMMAR &OPTIONAL PROPAGATE-ONLY)

Compute the LR(1) lookaheads for all items in KERNEL. If PROPAGATE-ONLY is true, ignore spontaneous generation.

COMPUTE-PARSING-TABLES (KERNELS GRAMMAR &KEY MUFFLE-CONFLICTS)

Compute the parsing tables for grammar GRAMMAR and transitions KERNELS. PRECEDENCE is as in FIND-PRECEDENCE. MUFFLE-WARNINGS is one of NIL, T, :SOME or a list of the form (sr rr).

DERIVES-EPSILON (SYMBOL GRAMMAR &OPTIONAL SEEN)

True if symbol derives epsilon.

DERIVES-EPSILON* (SYMBOL GRAMMAR &OPTIONAL SEEN)

Unmemoised version of DERIVES-EPSILON.

DERIVES-FIRST (C GRAMMAR &OPTIONAL SEEN)

The list of symbols A such that C rm->* A.eta for some eta.

DERIVES-FIRST-TERMINAL (C GRAMMAR &OPTIONAL SEEN)

The list of terminals a such that C rm->* a.eta, last non-epsilon.

FIND-PRECEDENCE (OP PRECEDENCE)

Return the tail of PRECEDENCE starting with the element containing OP. PRECEDENCE is a list of elements of the form (KEYWORD . (op...)).

FIND-SINGLE-TERMINAL (S GRAMMAR)

Return the only terminal in S, or NIL if none or multiple.

FIRST-TERMINALS (S GRAMMAR)

FIRST(s) without epsilon.

GOTO-SYMBOL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GOTO-TARGET (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-%SYMBOLS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-DERIVES-EPSILON (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-DERIVES-FIRST (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-DERIVES-FIRST-TERMINAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-PRECEDENCE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-PRODUCTIONS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GRAMMAR-SYMBOLS (GRAMMAR)

The set of symbols (both terminal and nonterminal) of GRAMMAR.

GRAMMAR-TERMINALS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

HANDLE-CONFLICT (A1 A2 GRAMMAR ACTION-PRODUCTIONS ID S &OPTIONAL MUFFLE-CONFLICTS)

Decide what to do with a conflict between A1 and A2 in state ID on symbol S. Returns three actions: the chosen action, the number of new sr and rr.

ITEM-EQUAL-P (I1 I2)

Equality predicate for LR(0) items.

ITEM-LOOKAHEAD (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ITEM-LOOKAHEADS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ITEM-LR1-EQUAL-P (I1 I2)

Equality predicate for LR(1) items.

ITEM-LR1-HASH-VALUE (ITEM)

Returns an object suitable for keying associations of LR1-items.

ITEM-POSITION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ITEM-PRODUCTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ITEM-SET-EQUAL-P (C1 C2)

Equality predicate for sorted sets of LR(0) items.

ITEM< (I1 I2)

Total strict order on LR(0) items.

ITEMS-CLOSURE (ITEMS GRAMMAR)

Compute the closure of a set of LR(1) items.

KERNEL-GOTOS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KERNEL-ID (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

KERNEL-ITEM (KERNEL)

The item in a singleton set of items.

KERNEL-ITEMS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LR1-ADD (ITEM COLLECTION)

Add ITEM to COLLECTION.

LR1-ADD-COLLECTION (ITEMS COLLECTION)

Add all the elements of ITEMS to COLLECTION.

LR1-FIND (ITEM COLLECTION)

Find an LR(1) item equal to ITEM in COLLECTION, or NIL.

MAP-LR1-COLLECTION (F COLLECTION)

Apply F to all elements of COLLECTION.

MEMQ (ITEM LIST)

MEMBER :TEST #'EQ

NUMBER-KERNELS (KERNELS)

Set a unique ID for all kernels in KERNELS.

PARSER-ACTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PARSER-GOTO (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PARSER-STATES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION-ACTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION-ACTION-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION-DERIVES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION-EQUAL-P (P1 P2)

Equality predicate for productions within a single grammar

PRODUCTION-ID (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION-SYMBOL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PRODUCTION< (P1 P2)

Total order on productions within a single grammar

REDUCE-ACTION-ACTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REDUCE-ACTION-ACTION-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REDUCE-ACTION-LENGTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REDUCE-ACTION-SYMBOL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RELATIVE-FIRST (S A GRAMMAR &OPTIONAL SEEN)

Union of FIRST(eta) for all the eta s.t. S rm->* Aeta.

RELATIVE-FIRST-SEQUENCE (S A GRAMMAR &OPTIONAL SEEN)

Sequence version of RELATIVE-FIRST.

SEQUENCE-DERIVES-EPSILON (SEQUENCE GRAMMAR)

Sequence version of DERIVES-EPSILON*.

SEQUENCE-DERIVES-FIRST (SEQUENCE GRAMMAR &OPTIONAL SEEN)

Sequence version of DERIVES-FIRST.

SEQUENCE-DERIVES-FIRST-TERMINAL (SEQUENCE GRAMMAR &OPTIONAL SEEN)

Sequence version of DERIVES-FIRST-TERMINAL.

SEQUENCE-FIRST (S GRAMMAR)

FIRST(s).

SEQUENCE-FIRST-TERMINALS (S GRAMMAR)

Sequence version of FIRST-TERMINALS.

SHIFT-ACTION-STATE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

%COPY-ITEM (INSTANCE)

%MAKE-GRAMMAR (&KEY ((NAME DUM135) NIL) ((TERMINALS DUM136) 'NIL) ((PRECEDENCE DUM137) 'NIL) ((PRODUCTIONS DUM138) 'NIL) ((%SYMBOLS DUM139) UNDEFINED) ((DERIVES-EPSILON DUM140) 'NIL) ((DERIVES-FIRST DUM141) 'NIL) ((DERIVES-FIRST-TERMINAL DUM142) 'NIL))

%MAKE-KERNEL (ITEMS)

%MAKE-PARSER (STATES GOTO ACTION)

ACCEPT-ACTION-P (OBJECT)

ACTION-EQUAL-P (A1 A2)

ACTION-P (OBJECT)

CLEAR-LR1-COLLECTION (COLLECTION)

COPY-ACCEPT-ACTION (INSTANCE)

COPY-ACTION (INSTANCE)

COPY-ERROR-ACTION (INSTANCE)

COPY-GOTO (INSTANCE)

COPY-GRAMMAR (INSTANCE)

COPY-KERNEL (INSTANCE)

COPY-LR0-ITEM (INSTANCE)

COPY-LR1-ITEM (INSTANCE)

COPY-PARSER (INSTANCE)

COPY-PRODUCTION (INSTANCE)

COPY-REDUCE-ACTION (INSTANCE)

COPY-SHIFT-ACTION (INSTANCE)

ERROR-ACTION-P (OBJECT)

FIND-GOTO (KERNEL SYMBOL)

GOTO-EQUAL-P (G1 G2)

GOTO-P (OBJECT)

SETFGOTO-SYMBOL (NEW-VALUE INSTANCE)

SETFGOTO-TARGET (NEW-VALUE INSTANCE)

SETFGRAMMAR-%SYMBOLS (NEW-VALUE INSTANCE)

SETFGRAMMAR-DERIVES-EPSILON (NEW-VALUE INSTANCE)

SETFGRAMMAR-DERIVES-FIRST (NEW-VALUE INSTANCE)

SETFGRAMMAR-DERIVES-FIRST-TERMINAL (NEW-VALUE INSTANCE)

GRAMMAR-DISCARD-MEMOS (GRAMMAR)

GRAMMAR-EPSILON-PRODUCTIONS (GRAMMAR)

SETFGRAMMAR-NAME (NEW-VALUE INSTANCE)

GRAMMAR-P (OBJECT)

SETFGRAMMAR-PRECEDENCE (NEW-VALUE INSTANCE)

SETFGRAMMAR-PRODUCTIONS (NEW-VALUE INSTANCE)

SETFGRAMMAR-TERMINALS (NEW-VALUE INSTANCE)

ITEM-ACTION (ITEM)

ITEM-ACTION-FORM (ITEM)

ITEM-DERIVES (ITEM)

ITEM-DOT-LEFT (ITEM)

ITEM-DOT-RIGHT (ITEM &OPTIONAL (N 0))

ITEM-DOT-RIGHT-P (ITEM)

ITEM-DOT-SYMBOL (ITEM)

SETFITEM-LOOKAHEAD (NEW-VALUE INSTANCE)

SETFITEM-LOOKAHEADS (NEW-VALUE INSTANCE)

ITEM-P (OBJECT)

SETFITEM-POSITION (NEW-VALUE INSTANCE)

SETFITEM-PRODUCTION (NEW-VALUE INSTANCE)

ITEM-SHIFT (ITEM &OPTIONAL (N 1))

ITEM-SYMBOL (ITEM)

SETFKERNEL-GOTOS (NEW-VALUE INSTANCE)

SETFKERNEL-ID (NEW-VALUE INSTANCE)

SETFKERNEL-ITEMS (NEW-VALUE INSTANCE)

KERNEL-P (OBJECT)

LR0-ITEM-P (OBJECT)

LR1-COLLECTION-EMPTY-P (COLLECTION)

LR1-ITEM-P (OBJECT)

LR1-ITEM-SHIFT (ITEM &OPTIONAL (N 1))

MAKE-ACCEPT-ACTION (&KEY)

MAKE-ERROR-ACTION (&KEY)

MAKE-GOTO (SYMBOL TARGET)

MAKE-HASH-TABLE-FROM-LR1-LIST (L)

MAKE-ITEM (PRODUCTION POSITION)

MAKE-KERNEL (ITEMS &OPTIONAL KERNELS)

MAKE-LR1-COLLECTION (&OPTIONAL SAME-KIND-AS)

MAKE-LR1-ITEM (PRODUCTION POSITION LOOKAHEAD)

MAKE-REDUCE-ACTION (SYMBOL LENGTH &KEY (ACTION #'LIST) (ACTION-FORM NIL))

MAKE-SHIFT-ACTION (STATE)

PARSE-GRAMMAR (FORMS)

PARSE-PRODUCTION (FORM)

SETFPARSER-ACTION (NEW-VALUE INSTANCE)

SETFPARSER-GOTO (NEW-VALUE INSTANCE)

PARSER-P (OBJECT)

SETFPARSER-STATES (NEW-VALUE INSTANCE)

SETFPRODUCTION-ACTION (NEW-VALUE INSTANCE)

SETFPRODUCTION-ACTION-FORM (NEW-VALUE INSTANCE)

SETFPRODUCTION-DERIVES (NEW-VALUE INSTANCE)

SETFPRODUCTION-ID (NEW-VALUE INSTANCE)

PRODUCTION-P (OBJECT)

SETFPRODUCTION-SYMBOL (NEW-VALUE INSTANCE)

SETFREDUCE-ACTION-ACTION (NEW-VALUE INSTANCE)

SETFREDUCE-ACTION-ACTION-FORM (NEW-VALUE INSTANCE)

SETFREDUCE-ACTION-LENGTH (NEW-VALUE INSTANCE)

REDUCE-ACTION-P (OBJECT)

SETFREDUCE-ACTION-SYMBOL (NEW-VALUE INSTANCE)

REQUIRED-ARGUMENT

SHIFT-ACTION-P (OBJECT)

SETFSHIFT-ACTION-STATE (NEW-VALUE INSTANCE)

TERMINAL-P (SYMBOL GRAMMAR)

MACRO

Public

DEFINE-GRAMMAR (NAME &BODY BODY)

DEFINE-GRAMMAR NAME OPTION... PRODUCTION... PRODUCTION ::= (SYMBOL RHS...) RHS ::= SYMBOL | (SYMBOL... [ACTION]) Defines the special variable NAME to be a grammar. Options are as in MAKE-GRAMMAR.

DEFINE-PARSER (NAME &BODY BODY)

DEFINE-GRAMMAR NAME OPTION... PRODUCTION... PRODUCTION ::= (SYMBOL RHS...) RHS ::= SYMBOL | (SYMBOL... [ACTION]) Defines the special variable NAME to be a parser. Options are as in MAKE-GRAMMAR and MAKE-PARSER.

GENERIC-FUNCTION

Public

Undocumented

YACC-PARSE-ERROR-EXPECTED-TERMINALS (CONDITION)

YACC-PARSE-ERROR-TERMINAL (CONDITION)

YACC-PARSE-ERROR-VALUE (CONDITION)

Private

Undocumented

CONFLICT-SUMMARY-WARNING-REDUCE-REDUCE (CONDITION)

CONFLICT-SUMMARY-WARNING-SHIFT-REDUCE (CONDITION)

CONFLICT-WARNING-KIND (CONDITION)

CONFLICT-WARNING-STATE (CONDITION)

CONFLICT-WARNING-TERMINAL (CONDITION)

VARIABLE

Private

*ITEMS-CLOSURE-HASH-THRESHOLD*

The number of elements when items-closure switches to using a hashtable.

CLASS

Private

Undocumented

ACCEPT-ACTION

ACTION

ERROR-ACTION

GOTO

GRAMMAR

ITEM

KERNEL

LR0-ITEM

LR1-ITEM

PARSER

PRODUCTION

REDUCE-ACTION

SHIFT-ACTION

CONDITION

Public

Undocumented

YACC-PARSE-ERROR

Private

Undocumented

CONFLICT-SUMMARY-WARNING

CONFLICT-WARNING