cl-yacc

API Reference

yacc

A LALR(1) parser generator for Common Lisp

YACC

  • Function MAKE-PRODUCTION (symbol derives &key (action #'list) (action-form nil))
  • Function MAKE-GRAMMAR (&key name (start-symbol (required-argument)) terminals precedence productions)
  • Condition YACC-COMPILE-WARNING  (WARNING)
  • Condition CONFLICT-WARNING  (YACC-COMPILE-WARNING, SIMPLE-WARNING)
  • Condition CONFLICT-SUMMARY-WARNING  (YACC-COMPILE-WARNING)
  • Function 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))
    Returns a parser for the given grammar. If MUFFLE-CONFLICTS is NIL, then a warning will be signaled for all conflicts. If it is T, then no warnings will be signaled. If it is a list of the form (SR SS), then a warning will be signaled unless there are exactly SR shift-reduce conflicts and SS shift-shift conflicts.
  • Condition YACC-RUNTIME-ERROR  (ERROR)
  • Condition YACC-PARSE-ERROR  (YACC-RUNTIME-ERROR)
  • Function 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.
  • Macro 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.
  • Macro 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.