Common Lisp Package: FUCC-GENERATOR

README:

FUNCTION

Private

APPLY-ARGUMENT-TRANSFORMS-TO-ACTION (TRANSFORMS ACTION)

Apply TRANSFORMS to ACTION

ATTRIBUTE-FORM-P (FORM)

True if form is any attribute form.

CALCULATE-FIRST (GRAMMAR)

Calculate FIRST for every nterm of grammar.

CALCULATE-RM-INFO (GRAMMAR)

Info about rightmost derivations

COMBINE-FIRST (SET1 SET2)

If (FIRST-SEQ A) is SET1, (FIRST-SEQ B) is SET2, this function returns (FIRST-SEQ (APPEND A B))

COMPLEX-ATTRIBUTE-FORM-P (FORM)

True if form is non-primitive attribute form.

DELETE-UNPRODUCTIVE-NTERM-RULES (GRAMMAR)

Remove rules with unprductive nterms and nterms themself. Return list of unprductive nterms.

DELETE-UNUSED-TERM-RULES (GRAMMAR)

Delete unused terminals and nterminals (i.e. they have no path from initial terminal). Return list of unused terminals/nterminals.

EPSILON-RULE-P (RULE)

Check epsilon-rule.

EXPAND-MIDDLE-ACTIONS-IN-RULE-LR (RULE)

Expand middle actions for LR. Values of middle actions are ignored.

EXPAND-MIDDLE-ACTIONS-LR (RULES)

Expand middle actions for LR in rules.

EXPAND-RULES* (EXPANDER RECURSIVE PREFIX-SET RULES)

Apply EXPANDER to forms starting with atoms in PREFIX-SET to all RULES.

FILTER-RULE (RULE-RIGHT GRAMMAR)

Transform nterm objects into their codes (negative for non-terminals).

GENERATE-TABLES (GRAMMAR ITEMS REDUCE-SET-FUN)

Return two values: action table and goto table.

GET-EPSILON-REDUCTIONS (LRPOINT LAHEAD GRAMMAR)

Epsilon reductions that can happen for the LRPOINT and LAHEAD

GET-NTERM (NAME &KEY IS-TERMINAL)

If NAME is NIL, return NIL. Otherwise look for NAME in environment. If found, return it; otherwise create new object.

INIT-ENV (TERMINALS)

Populate table with TERMINALS. Returns list of term objects and first ID of non-terminals.

ITEMS (GRAMMAR CLOSURE-FUN GOTO-FUN INITIAL-LRPOINT)

Calculate kernel items. Returns list of items.

ITEMS-LR0 (GRAMMAR)

Calculate LR(0) items for the GRAMMAR.

ITEMS-LR1 (GRAMMAR)

Calculate LR(1) items for GRAMMAR.

LIST-CMP (PREDICATE)

Return function that returns true if two lists are equal element by element with PREDICATE.

LRPOINT-LAHEAD (INSTANCE)

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

LRPOINT-POS (INSTANCE)

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

LRPOINT-RULE (INSTANCE)

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

MAKE-LL-TABLE (GRAMMAR)

Generate LL table where each cell may contain list of possible non-terminals. You can later convert nondeterministic tables (where some cell has more than one nonterminal) into deterministic with some precedence rules or just reject such tables.

NTERM-AT-POS (LRPOINT)

Return nterm at position or NIL.

NTERM-BY-NAME (NAME GRAMMAR)

Find NTERM by NAME in given GRAMMAR

NTERMINAL-EPSILON-RULES (NTERMINAL)

List of epsilon rules of the nterminal

OCONS (ELT SET &KEY (ORDERING #'<=))

Insert element into ordered set.

OINTERSECTION (SET1 SET2 &KEY (ORDERING #'<=))

Intersection of two ordered sets: SET1 and SET2. ORDERING is a reflexive ordering.

OSET-ORDERING (ORDERING)

Return function that defines inducted ordering of ordered sets.

OUNION (SET1 SET2 &KEY (ORDERING #'<=))

Union of two ordered sets: SET1 and SET2. ORDERING is a reflexive ordering.

PROCESS-RULE (S-RULE)

Process given rule and return RULE object.

REDUCE-SET-LR0 (ITEM GRAMMAR)

Set rules that can be reduced in given item with LR0 aglorithm.

REDUCE-SET-SLR (ITEM GRAMMAR)

Set rules that can be reduced in given item with LR0 aglorithm.

REDUCTION-LRPOINT-P (LRP)

Check if lrpoint is reduction lrpoint (i.e. point is at right side)

REMOVE-EPSILON-RULES (GRAMMAR)

Remove epsilon rules. Actions are converted appropriately. Return alist NTERMINAL -> EPSILON-ONLY-P where EPSILON-ONLY-P is true iff NTERMINAL expands only to EPSILON or nothing. This function may leave unused nterminals. Use DELETE-UNUSED-NTERM-RULES to remove them

RESOLVE-SIMPLE-CONFLICTS (ACTIONS)

Return set of actions that no other action supersedes.

SEQ-FIRST (SEQ)

FIRST of list of nterms

SPLIT-RULE-FORM (RULE-FORM)

Convert rule form (A -> x -> y) into list ((A x) (A y))

UPDATE-RM-INFO (TARGET-NTERMINAL RULE)

Update RM-INFO for TARGET-NTERMINAL with information from RULE.

Undocumented

ACCEPT-SET-SLR-HELPER (LRPOINT ITEM GRAMMAR)

ADD-EPSILON (ACTIONS &OPTIONAL (VALUE-FORM NIL))

ADD-NTERM (ACTIONS)

ADD-TO-MAXIMAL-ACTIONS (MAX-ACTIONS ACTION)

ADVANCE-LRPOINT (LRPOINT)

CALCULATE-EPSILON-ACTIONS (GRAMMAR)

CALCULATE-FOLLOW (GRAMMAR)

CHAIN-RULE-P (RULE)

CHANNELS (OBJ)

CLOSURE (SET PROCEED EXPAND ORDERING)

CLOSURE-LR0 (SET)

CLOSURE-LR1 (SET)

COMPARE-ACTIONS (ACTION1 ACTION2)

CONVERT-TO-DETERMINISTIC-LL-TABLE (TABLE GRAMMAR)

COPY-LRPOINT (INSTANCE)

DET-LL-TABLE->LIST-LL-PARSER-DATA (TABLE)

DUMP-ACTION-TO-2D (ACTION-TABLE)

DUMP-GOTO-TO-2D (GOTO-TABLE)

DUMP-TO-2D-AND-1D (ACTION-TABLE GOTO-TABLE)

DUMP-TO-2D-TABLES (ACTION-TABLE GOTO-TABLE)

DUMP-VALID-TERMINALS (ACTION-TABLE GRAMMAR)

EPSILON-ACTION (OBJ)

EXPAND-ACTION (RULE)

EXPAND-ACTION--CLASS (FORM RHS REST REV-VAR-LIST REV-INITARG-LIST)

EXPAND-ACTION--DO (FORM REV-VAR-LIST REST)

EXPAND-COMPLEX-FORM-LR (FORM RULE POS)

EXPAND-FORM-LL (FORM RULE POS)

EXPAND-INLINABLE-FORM-LR (FORM RULE POS)

EXPAND-RHS (RHS)

EXPAND-RULES-LL (RULES)

EXPAND-RULES-LR (RULES)

GENERATE-LAHEADS (ITEMS EOF)

GET-UNIQ-ID (FORM)

GOTO-LR0 (SET NTERMINAL)

GOTO-LR1 (SET NTERM)

GOTO-NC (SET NTERMINAL PRED)

IGET (ELEMENT HASHTABLE HASHFUN TEST)

ITABLE-TO-LIST (HT)

ITEM-FIRST (SOMETHING)

ITEM-HASH (ITEM)

ITEM-KERNEL (OBJ)

ITEM= (A B)

ITEMS-LALR (GRAMMAR)

KERNEL (ITEM)

KERNEL-LRPOINT-P (LRPOINT)

LINEARIZE-CONFLICTS (ACTIONS)

LRPOINT-HASH (LRP)

SETFLRPOINT-LAHEAD (NEW-VALUE INSTANCE)

LRPOINT-P (OBJECT)

SETFLRPOINT-POS (NEW-VALUE INSTANCE)

SETFLRPOINT-RULE (NEW-VALUE INSTANCE)

LRPOINT<= (A B)

LRPOINT= (A B)

MAKE-DETERMINISTIC-LL-PARSER-DATA (TABLE GRAMMAR)

MAKE-GRAMMAR (&REST ARGS)

MAKE-ITEM (&REST ARGS)

MAKE-LRPOINT (&KEY ((RULE DUM110) NIL) ((POS DUM111) 0) ((LAHEAD DUM112) NIL))

MAKE-NTERM (&REST ARGS)

MAKE-RULE (&REST ARGS)

NTERM-FIRST (OBJ)

NTERM-FOLLOW (OBJ)

NTERM-USED (OBJ)

NTERM<= (A B)

NTERMINAL-ID (TERMINAL GRAMMAR)

ONE-STEP-CHAIN-RULE-P (RULE STATE TERMINAL-ID ACTION-TABLE GOTO-TABLE)

PARSE-COMPLEX-FORM-LR (FORM RULE POS)

PARSE-GRAMMAR (INITIAL TERMINALS RULES &KEY PREC-INFO (TYPE LR))

PRODUCTIVE (OBJ)

PROP-BOUND-P (OBJ NAME)

REDUCE-ACTION (ACTION STATE TERMINAL ACTION-TABLE GOTO-TABLE)

REDUCE-SET-LALR (ITEM GRAMMAR)

REDUCE-SET-LR1 (ITEM GRAMMAR)

REMOVE-CHAIN-RULES (ACTION-TABLE GOTO-TABLE)

REMOVE-EPSILON (RULE EPSILON-TERMS)

RENUMBER-RULES (GRAMMAR)

REPORT-CONFLICT-AND-RET (TYPE USED-ACTION DISCARDED-ACTION)

RM-INFO (OBJ)

RULE->LL-RULE (RULE GRAMMAR)

SET-CHANNEL-INFO (FROM-ITEM FROM-LRP TO-ITEM TO-LRP)

SET-PRECEDENCE-INFO (GRAMMAR)

SET-SPONTANEOUS-LAHEAD-INFO (LRPOINT ITEM)

SIMPLE-LRPOINT (LRPOINT ITEM)

SPONTANEOUS-LAHEADS (OBJ)

SPREAD-LAHEADS (ITEMS)

MACRO

Private

COMBINE-FIRST-SETS (SET &REST OTHER-SETS)

This macro is similair to COMBINE-FIRST, but it accepts variable number of argument and doesn't evaluate unused expressions

OPUSH (PLACE ELT &OPTIONAL (ORDERING #'<=) &ENVIRONMENT ENV)

Insert new element into ordered set. Note that argument order is different from PUSH.

Undocumented

DEFINE-PROPERTY (NAME)

WITH-NEW-GRAMMAR-ENVIRONMENT (&BODY BODY)

SLOT-ACCESSOR

Private

RULE-ACTION (OBJECT)

Action of the rule that creates rule's result

SETFRULE-ACTION (NEW-VALUE OBJECT)

Action of the rule that creates rule's result

RULE-INIT-ACTION (OBJECT)

Action executed when rule is expanded.

SETFRULE-INIT-ACTION (NEW-VALUE OBJECT)

Action executed when rule is expanded.

RULE-LEFT (OBJECT)

Left-hand size: non-terminal

SETFRULE-LEFT (NEW-VALUE OBJECT)

Left-hand size: non-terminal

RULE-LENGTH (OBJECT)

Cached length of right-hand side

RULE-MIDDLE-ACTIONS (OBJECT)

List of middle actions

SETFRULE-MIDDLE-ACTIONS (NEW-VALUE OBJECT)

List of middle actions

RULE-NTERMINAL (OBJECT)

Left-hand size: non-terminal

SETFRULE-NTERMINAL (NEW-VALUE OBJECT)

Left-hand size: non-terminal

RULE-PRODUCTION (OBJECT)

Right-hand side: list of terms

SETFRULE-PRODUCTION (NEW-VALUE OBJECT)

Right-hand side: list of terms

RULE-RIGHT (OBJECT)

Right-hand side: list of terms

SETFRULE-RIGHT (NEW-VALUE OBJECT)

Right-hand side: list of terms

Undocumented

FIRST-NTERMINAL-ID (OBJECT)

SETFFIRST-NTERMINAL-ID (NEW-VALUE OBJECT)

GRAMMAR-ENVIRONMENT (OBJECT)

SETFGRAMMAR-ENVIRONMENT (NEW-VALUE OBJECT)

GRAMMAR-NTERMINALS (OBJECT)

SETFGRAMMAR-NTERMINALS (NEW-VALUE OBJECT)

GRAMMAR-PREC-INFO (OBJECT)

SETFGRAMMAR-PREC-INFO (NEW-VALUE OBJECT)

GRAMMAR-RULES (OBJECT)

SETFGRAMMAR-RULES (NEW-VALUE OBJECT)

GRAMMAR-TERMINALS (OBJECT)

SETFGRAMMAR-TERMINALS (NEW-VALUE OBJECT)

ITEM-INDEX (OBJECT)

SETFITEM-INDEX (NEW-VALUE OBJECT)

ITEM-MOVES (OBJECT)

SETFITEM-MOVES (NEW-VALUE OBJECT)

ITEM-SET (OBJECT)

NTERM-ID (OBJECT)

SETFNTERM-ID (NEW-VALUE OBJECT)

NTERM-NAME (OBJECT)

SETFNTERM-NAME (NEW-VALUE OBJECT)

NTERM-RULES (OBJECT)

SETFNTERM-RULES (NEW-VALUE OBJECT)

PREC-ASSOC (OBJECT)

SETFPREC-ASSOC (NEW-VALUE OBJECT)

PREC-PRIORITY (OBJECT)

SETFPREC-PRIORITY (NEW-VALUE OBJECT)

RULE-INDEX (OBJECT)

SETFRULE-INDEX (NEW-VALUE OBJECT)

TERMINAL-P (OBJECT)

SETFTERMINAL-P (NEW-VALUE OBJECT)

VARIABLE

Private

+WILDCARD+

Special wildcard terminal for lookahead tracing.

Undocumented

+ATTRIBUTE-FORM+

+COMPLEX-ATTRIBUTE-FORM+

+COMPLEX-FORMS-LL+

+COMPLEX-FORMS-LR+

+INLINEABLE-FORMS-LR+

CLASS

Private

Undocumented

GRAMMAR

ITEM

LRPOINT

NTERM

PREC-MIXIN

PROPERTIES

RULE

CONSTANT

Private

+EOF+

Symbol used as end-of-file terminal.

+START+

Symbol used as initial nonterminal.