The fucc-parser Reference Manual

Table of Contents

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

The fucc-parser Reference Manual

This is the fucc-parser Reference Manual, version 0.2.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:48:27 2018 GMT+0.


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

1 Introduction

-*- mode: outline; -*-
* What's FUCC

FUCC is FU Compiler Compiler.  FUCC converts LALR(1) or LR(1)
context-free grammar into Common Lisp program that parses input with
actions.

FUCC consists of two parts: generator and parser.  Generator is used
for generating parsing tables.  Parser uses the tables for parsing an
input.  If your grammar is fixed, you need generator for compilation only
and don't need to distribute it.

See files in doc directory, especially doc/FUCC-FAQ.


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

2 Systems

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


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

2.1 fucc-parser

Author

Ivan Boldyrev

Version

0.2.1

Source

fucc-parser.asd (file)

Component

parser (module)


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

3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 fucc-parser/parser

Parent

fucc-parser (system)

Location

parser/

Components

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

4 Files

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


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

4.1 Lisp


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

4.1.1 fucc-parser.asd

Location

fucc-parser.asd

Systems

fucc-parser (system)


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

4.1.2 fucc-parser/parser/fucc-package.lisp

Parent

parser (module)

Location

parser/fucc-package.lisp

Packages

fucc


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

4.1.3 fucc-parser/parser/fucc-decl.lisp

Dependency

fucc-package.lisp (file)

Parent

parser (module)

Location

parser/fucc-decl.lisp

Exported Definitions
Internal Definitions

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

4.1.4 fucc-parser/parser/fucc-util.lisp

Dependencies
Parent

parser (module)

Location

parser/fucc-util.lisp

Internal Definitions

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

4.1.5 fucc-parser/parser/fucc-parser.lisp

Dependencies
Parent

parser (module)

Location

parser/fucc-parser.lisp

Exported Definitions

parser-lr (function)

Internal Definitions

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

4.1.6 fucc-parser/parser/fucc-ll.lisp

Dependency

fucc-package.lisp (file)

Parent

parser (module)

Location

parser/fucc-ll.lisp

Exported Definitions

parser-ll (function)

Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 fucc

Source

fucc-package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

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

6 Definitions

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


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

6.1 Exported definitions


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

6.1.1 Special variables

Special Variable: *next-data*
Package

fucc

Source

fucc-decl.lisp (file)

Special Variable: *next-token*

Data associated with next token returned by lexer; accessible in reduction actions.

Package

fucc

Source

fucc-decl.lisp (file)


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

6.1.2 Functions

Function: parser-ll LEXER LL-DATA
Package

fucc

Source

fucc-ll.lisp (file)

Function: parser-lr LEXER PARSER
Package

fucc

Source

fucc-parser.lisp (file)


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

6.1.3 Conditions

Condition: lr-parse-error-condition ()

LR-specific parser error

Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

parse-error-condition (condition)

Direct methods

error-config (method)

Direct slots
Slot: config

Runtime configuration of parser

Initargs

:config

Readers

error-config (generic function)

Condition: parse-error-condition ()

General parsing error

Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

condition (condition)

Direct subclasses
Direct methods
Direct slots
Slot: token-id

ID of token that caused the error

Initargs

:token-id

Readers

error-token-id (generic function)

Slot: data

Semantic data associated with token

Initargs

:data

Readers

error-data (generic function)


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

6.2 Internal definitions


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

6.2.1 Macros

Macro: ll-final-action LEN ACTION

Final ACTION (form that returns function) where rule length is LEN (unsigned byte)

Package

fucc

Source

fucc-ll.lisp (file)

Macro: ll-middle-action LEN ACTION

Non-final ACTION (form that return function). LEN is unsigned byte that defines number of preceeding tokens.

Package

fucc

Source

fucc-ll.lisp (file)

Macro: rev-apply N FUNC LIST-EXP
Package

fucc

Source

fucc-ll.lisp (file)

Macro: stack-popper N
Package

fucc

Source

fucc-ll.lisp (file)

Macro: with-lr-config (STATE-STACK-VAR TERM-STACK-VAR DATA-STACK-VAR) STACK &body BODY

Components of stack returned by STACK expressions are bound to variables named by symbols in STATE-STACK-VAR, TERM-STACK-VAR and DATA-STACK-VAR. These variables can be used in the BODY.

Package

fucc

Source

fucc-decl.lisp (file)


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

6.2.2 Functions

Function: accept-action-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: action-type ACTION

Action designator (implementation-dependent)

Package

fucc

Source

fucc-decl.lisp (file)

Function: alist-to-hash-table LIST
Package

fucc

Source

fucc-util.lisp (file)

Function: bin-search-goto-table TABLE KEY

Binary search in array of cons pairs: (key . value).
Because of nature of goto-table search is always successfull, so error check are not performed.
Returns value associated with the KEY.

Package

fucc

Source

fucc-util.lisp (file)

Function: copy-accept-action INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: copy-error-action INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: copy-lr-config INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: copy-reduce-action INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: copy-shift-action INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: copy-state INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: error-action-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: ll-rule-actions LL-RULE
Package

fucc

Source

fucc-ll.lisp (file)

Function: ll-rule-nterms LL-RULE
Package

fucc

Source

fucc-ll.lisp (file)

Function: ll-terminal-p ID
Package

fucc

Source

fucc-ll.lisp (file)

Function: longer-p LIST LEN

True, iff LIST is longher than LEN.

Package

fucc

Source

fucc-parser.lisp (file)

Function: lr-config-data-stack INSTANCE
Function: (setf lr-config-data-stack) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: lr-config-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: lr-config-state-stack INSTANCE
Function: (setf lr-config-state-stack) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: lr-config-term-stack INSTANCE
Function: (setf lr-config-term-stack) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-accept-action &key
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-error-action &key
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-lr-config &key (STATE-STACK STATE-STACK) (TERM-STACK TERM-STACK) (DATA-STACK DATA-STACK)
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-reduce-action &key (TERM TERM) (LEN LEN) (FUNCTION FUNCTION)
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-shift-action &key (NEW-STATE NEW-STATE)
Package

fucc

Source

fucc-decl.lisp (file)

Function: make-state &key (ID ID) (TABLE TABLE)
Package

fucc

Source

fucc-decl.lisp (file)

Function: negative->nt NG
Package

fucc

Source

fucc-ll.lisp (file)

Function: nsplit-list LIST N

Return two values: NREVERSEd prefix of LIST of length N and suffix. LIST is destructively modified.

Package

fucc

Source

fucc-parser.lisp (file)

Function: nt->negative ID
Package

fucc

Source

fucc-ll.lisp (file)

Function: parser-lr--reduce! CONFIG ACTION PARSER *NEXT-TOKEN* *NEXT-DATA*
Package

fucc

Source

fucc-parser.lisp (file)

Function: parser-lr--shift! CONFIG ATOM-ID DATA STATE
Package

fucc

Source

fucc-parser.lisp (file)

Function: pop-n-stack DATA-STACK ACTION-STACK N
Package

fucc

Source

fucc-ll.lisp (file)

Function: reduce-action-function INSTANCE
Function: (setf reduce-action-function) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: reduce-action-len INSTANCE
Function: (setf reduce-action-len) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: reduce-action-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: reduce-action-term INSTANCE
Function: (setf reduce-action-term) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: shift-action-new-state INSTANCE
Function: (setf shift-action-new-state) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: shift-action-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: state-id INSTANCE
Function: (setf state-id) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)

Function: state-p OBJECT
Package

fucc

Source

fucc-decl.lisp (file)

Function: state-table INSTANCE
Function: (setf state-table) VALUE INSTANCE
Package

fucc

Source

fucc-decl.lisp (file)


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

6.2.3 Generic functions

Generic Function: error-config CONDITION
Package

fucc

Methods
Method: error-config (CONDITION lr-parse-error-condition)
Source

fucc-decl.lisp (file)

Generic Function: error-data CONDITION
Package

fucc

Methods
Method: error-data (CONDITION parse-error-condition)
Source

fucc-decl.lisp (file)

Generic Function: error-token-id CONDITION
Package

fucc

Methods
Method: error-token-id (CONDITION parse-error-condition)
Source

fucc-decl.lisp (file)

Generic Function: possible-actions CONDITION
Package

fucc

Methods
Method: possible-actions (CONDITION parse-conflict-condition)
Source

fucc-decl.lisp (file)


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

6.2.4 Conditions

Condition: parse-conflict-condition ()

Unresolved conflict in parser

Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

parse-error-condition (condition)

Direct methods

possible-actions (method)

Direct slots
Slot: possible-actions

List of conflicting actions

Initargs

:actions

Initform

(quote nil)

Readers

possible-actions (generic function)


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

6.2.5 Structures

Structure: accept-action ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Structure: error-action ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Structure: lr-config ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: state-stack
Type

list

Initform

(error ")")

Readers

lr-config-state-stack (function)

Writers

(setf lr-config-state-stack) (function)

Slot: term-stack
Type

list

Readers

lr-config-term-stack (function)

Writers

(setf lr-config-term-stack) (function)

Slot: data-stack
Type

list

Readers

lr-config-data-stack (function)

Writers

(setf lr-config-data-stack) (function)

Structure: reduce-action ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: term
Type

fucc::term

Initform

0

Readers

reduce-action-term (function)

Writers

(setf reduce-action-term) (function)

Slot: len
Type

unsigned-byte

Initform

0

Readers

reduce-action-len (function)

Writers

(setf reduce-action-len) (function)

Slot: function
Type

(or fixnum function)

Initform

(function list)

Readers

reduce-action-function (function)

Writers

(setf reduce-action-function) (function)

Structure: shift-action ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: new-state
Initform

(error "")

Readers

shift-action-new-state (function)

Writers

(setf shift-action-new-state) (function)

Structure: state ()
Package

fucc

Source

fucc-decl.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

print-object (method)

Direct slots
Slot: id
Type

unsigned-byte

Initform

0

Readers

state-id (function)

Writers

(setf state-id) (function)

Slot: table
Type

fucc::state-row

Initform

(error "")

Readers

state-table (function)

Writers

(setf state-table) (function)


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

6.2.6 Types

Type: state-row ()
Package

fucc

Source

fucc-decl.lisp (file)

Type: term &optional MAX-TERM
Package

fucc

Source

fucc-decl.lisp (file)


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, fucc-parser.asd: The fucc-parser<dot>asd file
File, Lisp, fucc-parser/parser/fucc-decl.lisp: The fucc-parser/parser/fucc-decl<dot>lisp file
File, Lisp, fucc-parser/parser/fucc-ll.lisp: The fucc-parser/parser/fucc-ll<dot>lisp file
File, Lisp, fucc-parser/parser/fucc-package.lisp: The fucc-parser/parser/fucc-package<dot>lisp file
File, Lisp, fucc-parser/parser/fucc-parser.lisp: The fucc-parser/parser/fucc-parser<dot>lisp file
File, Lisp, fucc-parser/parser/fucc-util.lisp: The fucc-parser/parser/fucc-util<dot>lisp file
fucc-parser.asd: The fucc-parser<dot>asd file
fucc-parser/parser: The fucc-parser/parser module
fucc-parser/parser/fucc-decl.lisp: The fucc-parser/parser/fucc-decl<dot>lisp file
fucc-parser/parser/fucc-ll.lisp: The fucc-parser/parser/fucc-ll<dot>lisp file
fucc-parser/parser/fucc-package.lisp: The fucc-parser/parser/fucc-package<dot>lisp file
fucc-parser/parser/fucc-parser.lisp: The fucc-parser/parser/fucc-parser<dot>lisp file
fucc-parser/parser/fucc-util.lisp: The fucc-parser/parser/fucc-util<dot>lisp file

L
Lisp File, fucc-parser.asd: The fucc-parser<dot>asd file
Lisp File, fucc-parser/parser/fucc-decl.lisp: The fucc-parser/parser/fucc-decl<dot>lisp file
Lisp File, fucc-parser/parser/fucc-ll.lisp: The fucc-parser/parser/fucc-ll<dot>lisp file
Lisp File, fucc-parser/parser/fucc-package.lisp: The fucc-parser/parser/fucc-package<dot>lisp file
Lisp File, fucc-parser/parser/fucc-parser.lisp: The fucc-parser/parser/fucc-parser<dot>lisp file
Lisp File, fucc-parser/parser/fucc-util.lisp: The fucc-parser/parser/fucc-util<dot>lisp file

M
Module, fucc-parser/parser: The fucc-parser/parser module

Jump to:   F   L   M  

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

A.2 Functions

Jump to:   (  
A   B   C   E   F   G   L   M   N   P   R   S   W  
Index Entry  Section

(
(setf lr-config-data-stack): Internal functions
(setf lr-config-state-stack): Internal functions
(setf lr-config-term-stack): Internal functions
(setf reduce-action-function): Internal functions
(setf reduce-action-len): Internal functions
(setf reduce-action-term): Internal functions
(setf shift-action-new-state): Internal functions
(setf state-id): Internal functions
(setf state-table): Internal functions

A
accept-action-p: Internal functions
action-type: Internal functions
alist-to-hash-table: Internal functions

B
bin-search-goto-table: Internal functions

C
copy-accept-action: Internal functions
copy-error-action: Internal functions
copy-lr-config: Internal functions
copy-reduce-action: Internal functions
copy-shift-action: Internal functions
copy-state: Internal functions

E
error-action-p: Internal functions
error-config: Internal generic functions
error-config: Internal generic functions
error-data: Internal generic functions
error-data: Internal generic functions
error-token-id: Internal generic functions
error-token-id: Internal generic functions

F
Function, (setf lr-config-data-stack): Internal functions
Function, (setf lr-config-state-stack): Internal functions
Function, (setf lr-config-term-stack): Internal functions
Function, (setf reduce-action-function): Internal functions
Function, (setf reduce-action-len): Internal functions
Function, (setf reduce-action-term): Internal functions
Function, (setf shift-action-new-state): Internal functions
Function, (setf state-id): Internal functions
Function, (setf state-table): Internal functions
Function, accept-action-p: Internal functions
Function, action-type: Internal functions
Function, alist-to-hash-table: Internal functions
Function, bin-search-goto-table: Internal functions
Function, copy-accept-action: Internal functions
Function, copy-error-action: Internal functions
Function, copy-lr-config: Internal functions
Function, copy-reduce-action: Internal functions
Function, copy-shift-action: Internal functions
Function, copy-state: Internal functions
Function, error-action-p: Internal functions
Function, ll-rule-actions: Internal functions
Function, ll-rule-nterms: Internal functions
Function, ll-terminal-p: Internal functions
Function, longer-p: Internal functions
Function, lr-config-data-stack: Internal functions
Function, lr-config-p: Internal functions
Function, lr-config-state-stack: Internal functions
Function, lr-config-term-stack: Internal functions
Function, make-accept-action: Internal functions
Function, make-error-action: Internal functions
Function, make-lr-config: Internal functions
Function, make-reduce-action: Internal functions
Function, make-shift-action: Internal functions
Function, make-state: Internal functions
Function, negative->nt: Internal functions
Function, nsplit-list: Internal functions
Function, nt->negative: Internal functions
Function, parser-ll: Exported functions
Function, parser-lr: Exported functions
Function, parser-lr--reduce!: Internal functions
Function, parser-lr--shift!: Internal functions
Function, pop-n-stack: Internal functions
Function, reduce-action-function: Internal functions
Function, reduce-action-len: Internal functions
Function, reduce-action-p: Internal functions
Function, reduce-action-term: Internal functions
Function, shift-action-new-state: Internal functions
Function, shift-action-p: Internal functions
Function, state-id: Internal functions
Function, state-p: Internal functions
Function, state-table: Internal functions

G
Generic Function, error-config: Internal generic functions
Generic Function, error-data: Internal generic functions
Generic Function, error-token-id: Internal generic functions
Generic Function, possible-actions: Internal generic functions

L
ll-final-action: Internal macros
ll-middle-action: Internal macros
ll-rule-actions: Internal functions
ll-rule-nterms: Internal functions
ll-terminal-p: Internal functions
longer-p: Internal functions
lr-config-data-stack: Internal functions
lr-config-p: Internal functions
lr-config-state-stack: Internal functions
lr-config-term-stack: Internal functions

M
Macro, ll-final-action: Internal macros
Macro, ll-middle-action: Internal macros
Macro, rev-apply: Internal macros
Macro, stack-popper: Internal macros
Macro, with-lr-config: Internal macros
make-accept-action: Internal functions
make-error-action: Internal functions
make-lr-config: Internal functions
make-reduce-action: Internal functions
make-shift-action: Internal functions
make-state: Internal functions
Method, error-config: Internal generic functions
Method, error-data: Internal generic functions
Method, error-token-id: Internal generic functions
Method, possible-actions: Internal generic functions

N
negative->nt: Internal functions
nsplit-list: Internal functions
nt->negative: Internal functions

P
parser-ll: Exported functions
parser-lr: Exported functions
parser-lr--reduce!: Internal functions
parser-lr--shift!: Internal functions
pop-n-stack: Internal functions
possible-actions: Internal generic functions
possible-actions: Internal generic functions

R
reduce-action-function: Internal functions
reduce-action-len: Internal functions
reduce-action-p: Internal functions
reduce-action-term: Internal functions
rev-apply: Internal macros

S
shift-action-new-state: Internal functions
shift-action-p: Internal functions
stack-popper: Internal macros
state-id: Internal functions
state-p: Internal functions
state-table: Internal functions

W
with-lr-config: Internal macros

Jump to:   (  
A   B   C   E   F   G   L   M   N   P   R   S   W  

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

A.3 Variables

Jump to:   *  
C   D   F   I   L   N   P   S   T  
Index Entry  Section

*
*next-data*: Exported special variables
*next-token*: Exported special variables

C
config: Exported conditions

D
data: Exported conditions
data-stack: Internal structures

F
function: Internal structures

I
id: Internal structures

L
len: Internal structures

N
new-state: Internal structures

P
possible-actions: Internal conditions

S
Slot, config: Exported conditions
Slot, data: Exported conditions
Slot, data-stack: Internal structures
Slot, function: Internal structures
Slot, id: Internal structures
Slot, len: Internal structures
Slot, new-state: Internal structures
Slot, possible-actions: Internal conditions
Slot, state-stack: Internal structures
Slot, table: Internal structures
Slot, term: Internal structures
Slot, term-stack: Internal structures
Slot, token-id: Exported conditions
Special Variable, *next-data*: Exported special variables
Special Variable, *next-token*: Exported special variables
state-stack: Internal structures

T
table: Internal structures
term: Internal structures
term-stack: Internal structures
token-id: Exported conditions

Jump to:   *  
C   D   F   I   L   N   P   S   T  

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

A.4 Data types

Jump to:   A   C   E   F   L   P   R   S   T  
Index Entry  Section

A
accept-action: Internal structures

C
Condition, lr-parse-error-condition: Exported conditions
Condition, parse-conflict-condition: Internal conditions
Condition, parse-error-condition: Exported conditions

E
error-action: Internal structures

F
fucc: The fucc package
fucc-parser: The fucc-parser system

L
lr-config: Internal structures
lr-parse-error-condition: Exported conditions

P
Package, fucc: The fucc package
parse-conflict-condition: Internal conditions
parse-error-condition: Exported conditions

R
reduce-action: Internal structures

S
shift-action: Internal structures
state: Internal structures
state-row: Internal types
Structure, accept-action: Internal structures
Structure, error-action: Internal structures
Structure, lr-config: Internal structures
Structure, reduce-action: Internal structures
Structure, shift-action: Internal structures
Structure, state: Internal structures
System, fucc-parser: The fucc-parser system

T
term: Internal types
Type, state-row: Internal types
Type, term: Internal types

Jump to:   A   C   E   F   L   P   R   S   T