home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / doc / bison.man < prev    next >
Text File  |  1993-06-13  |  6KB  |  199 lines

  1.  
  2.  
  3.  
  4. BISON(1)                                                 BISON(1)
  5.  
  6.  
  7. NAME
  8.        bison - GNU Project parser generator (yacc replacement)
  9.  
  10. SYNOPSIS
  11.        bison  [  -b file-prefix ] [ --file-prefix=file-prefix ] [
  12.        -d ] [ --defines ] [ -l ] [ --no-lines ] [ -o outfile ]  [
  13.        --output-file=outfile   ]   [   -p   prefix  ]  [  --name-
  14.        prefix=prefix ] [ -t ] [ --debug ] [ -v ] [ --verbose ]  [
  15.        -V  ]  [  --version  ] [ -y ] [ --yacc ] [ --fixed-output-
  16.        files ] file
  17.  
  18. DESCRIPTION
  19.        Bison is a parser generator in the style of  yacc(1).   It
  20.        should  be  upwardly  compatible with input files designed
  21.        for yacc.
  22.  
  23.        Input files should follow the yacc convention of ending in
  24.        .y.   Unlike  yacc,  the generated files do not have fixed
  25.        names, but instead use the prefix of the input file.   For
  26.        instance,  a  grammar description file named parse.y would
  27.        produce the generated parser in a file named  parse.tab.c,
  28.        instead of yacc's y.tab.c.
  29.  
  30.        This description of the options that can be given to bison
  31.        is adapted from the node Invocation in  the  bison.texinfo
  32.        manual, which should be taken as authoritative.
  33.  
  34.        Bison  supports both traditional single-letter options and
  35.        mnemonic long option names.  Long option names  are  indi-
  36.        cated  with  --  instead  of  -.  Abbreviations for option
  37.        names are allowed as long as they are unique.  When a long
  38.        option  takes an argument, like --file-prefix, connect the
  39.        option name and the argument with =.
  40.  
  41.    OPTIONS
  42.        -b file-prefix
  43.        --file-prefix=file-prefix
  44.               Specify a prefix to use for all bison  output  file
  45.               names.   The  names are chosen as if the input file
  46.               were named file-prefix.c.
  47.  
  48.        -d
  49.        --defines
  50.               Write an extra output file containing macro defini-
  51.               tions for the token type names defined in the gram-
  52.               mar and the semantic value type YYSTYPE, as well as
  53.               a few extern variable declarations.
  54.  
  55.               If the parser output file is named name.c then this
  56.               file is named name.h.
  57.  
  58.               This output file is essential if you  wish  to  put
  59.               the  definition of yylex in a separate source file,
  60.               because yylex needs to be able to  refer  to  token
  61.  
  62.  
  63.  
  64.                               local                             1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BISON(1)                                                 BISON(1)
  71.  
  72.  
  73.               type codes and the variable yylval.
  74.  
  75.        -l
  76.        --no-lines
  77.               Don't  put  any  #line preprocessor commands in the
  78.               parser file.  Ordinarily bison  puts  them  in  the
  79.               parser  file  so  that the C compiler and debuggers
  80.               will associate errors with your  source  file,  the
  81.               grammar file.  This option causes them to associate
  82.               errors with the parser file, treating it  an  inde-
  83.               pendent source file in its own right.
  84.  
  85.        -o outfile
  86.        --output-file=outfile
  87.               Specify the name outfile for the parser file.
  88.  
  89.               The  other output files' names are constructed from
  90.               outfile as described under the -v and -d  switches.
  91.  
  92.        -p prefix
  93.        --name-prefix=prefix
  94.               Rename  the  external symbols used in the parser so
  95.               that they start with prefix  instead  of  yy.   The
  96.               precise  list of symbols renamed is yyparse, yylex,
  97.               yyerror, yylval, yychar, and yydebug.
  98.  
  99.               For example, if you use  -p  c,  the  names  become
  100.               cparse, clex, and so on.
  101.  
  102.        -t
  103.        --debug
  104.               Output  a  definition of the macro YYDEBUG into the
  105.               parser file, so that the debugging  facilities  are
  106.               compiled.
  107.  
  108.        -v
  109.        --verbose
  110.               Write  an  extra  output  file  containing  verbose
  111.               descriptions of the parser states and what is  done
  112.               for each type of look-ahead token in that state.
  113.  
  114.               This  file  also  describes all the conflicts, both
  115.               those resolved by operator precedence and the unre-
  116.               solved ones.
  117.  
  118.               The  file's  name  is made by removing .tab.c or .c
  119.               from the parser output file name, and adding  .out-
  120.               put instead.
  121.  
  122.               Therefore,  if  the  input  file is foo.y, then the
  123.               parser file is called foo.tab.c by default.   As  a
  124.               consequence,  the  verbose  output  file  is called
  125.               foo.output.
  126.  
  127.  
  128.  
  129.  
  130.                               local                             2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. BISON(1)                                                 BISON(1)
  137.  
  138.  
  139.        -V
  140.        --version
  141.               Print the version number of bison.
  142.  
  143.        -y
  144.        --yacc
  145.        --fixed-output-files
  146.               Equivalent to -o y.tab.c; the parser output file is
  147.               called  y.tab.c,  and  the other outputs are called
  148.               y.output and y.tab.h.  The purpose of  this  switch
  149.               is  to imitate yacc's output file name conventions.
  150.               Thus, the following shell script can substitute for
  151.               yacc:
  152.  
  153.               bison -y $*
  154.  
  155.  
  156.        The  long-named options can be introduced with `+' as well
  157.        as `--', for compatibility with previous releases.   Even-
  158.        tually  support  for  `+'  will  be removed, because it is
  159.        incompatible with the POSIX.2 standard.
  160.  
  161. FILES
  162.        /usr/local/lib/bison.simple   simple parser
  163.        /usr/local/lib/bison.hairy    complicated parser
  164.  
  165. SEE ALSO
  166.        yacc(1)
  167.        The  Bison  Reference  Manual,  included   as   the   file
  168.        bison.texinfo in the bison source distribution.
  169.  
  170. DIAGNOSTICS
  171.        Self explanatory.
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                               local                             3
  197.  
  198.  
  199.