Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ yacc(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lex

yacc

PURPOSE

     Generates a  LR(1) parsing program from  input consisting
     of a context-free grammar specification.

SYNOPSIS
     yacc [ -vdlst ] grammar


DESCRIPTION

     The yacc  command converts a context-free  grammar into a
     set of  tables for  a simple  automaton that  executes an
     LR(1) parsing  algorithm.  The grammar can  be ambiguous;
     specified precedence rules are used to break ambiguities.

     You must compile the output  file, y.tab.c, with a C Lan-
     guage compiler to produce a function yyparse.  This func-
     tion must  be loaded  with the lexical  analyzer function
     yylex,  as well  as main  and yyerror,  an error-handling
     routine  (you  must  provide these  routines).   The  lex
     command is  useful for creating lexical  analyzers usable
     by yacc.

     For more detailed discussion  of yacc and its operations,
     see   AIX   Operating   System  Programming   Tools   and
     Interfaces.

FLAGS

     -d Produces the file y.tab.h.   This contains the #define
        statements  that  associate  the  yacc-assigned  token
        codes with your token names.  This allows source files
        other  than  y.tab.c  to  access the  token  codes  by
        including this header file.
     -l Does not include any #line constructs in y.tab.c.  Use
        this only after the grammar and associated actions are
        fully debugged.
     -s Breaks the yyparse function into several smaller func-
        tions.   Since its  size is  somewhat proportional  to
        that of  the grammar,  it is  possible for  yyparse to
        become  too large  to  compile,  optimize, or  execute
        efficiently.
     -t Compiles  run-time debugging  code.  By  default, this
        code  is  not  included   when  y.tab.c  is  compiled.
        However,  the run-time  debugging  code  is under  the
        control  of  YYDEBUG, a  global  variable  for the  cc
        command preprocessor.  If YYDEBUG has a nonzero value,
        the  C  compiler  (cc) includes  the  debugging  code,
        whether or  not the  -t flag  was used.   Without com-

        piling this code, yyparse will have a faster operating
        speed.
     -v Prepares the  file y.output.   It contains  a readable
        description of the parsing tables and a report on con-
        flicts generated by grammar ambiguities.

FILES

     y.output
     y.tab.c
     y.tab.h             Definitions for token names.
     yacc.tmp,
     yacc.debug          Temporary file.
     yacc.acts           Temporary file.
     /usr/lib/yaccpar    Parser prototype for C programs.

RELATED INFORMATION

     The following command:  "lex."

     The description of yacc  in AIX Operating System Program-
     ming Tools and Interfaces.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026