1YACC(1)                     General Commands Manual                    YACC(1)
2
3
4

NAME

6       yacc - yet another compiler-compiler
7

SYNOPSIS

9       yacc [ -vd ] grammar
10

DESCRIPTION

12       Yacc  converts a context-free grammar into a set of tables for a simple
13       automaton which executes an LR(1) parsing algorithm.  The  grammar  may
14       be ambiguous; specified precedence rules are used to break ambiguities.
15
16       The output file, y.tab.c, must be compiled by the C compiler to produce
17       a program yyparse.  This program must be loaded with the  lexical  ana‐
18       lyzer  program,  yylex,  as well as main and yyerror, an error handling
19       routine.  These routines must be supplied by the user; Lex(1) is useful
20       for creating lexical analyzers usable by yacc.
21
22       If  the -v flag is given, the file y.output is prepared, which contains
23       a description of the parsing tables and a report on conflicts generated
24       by ambiguities in the grammar.
25
26       If  the  -d flag is used, the file y.tab.h is generated with the define
27       statements that associate the  yacc-assigned  `token  codes'  with  the
28       user-declared  `token  names'.   This  allows  source  files other than
29       y.tab.c to access the token codes.
30

FILES

32       y.output
33       y.tab.c
34       y.tab.h             defines for token names
35       yacc.tmp, yacc.acts temporary files
36       /usr/lib/yaccpar    parser prototype for C programs
37       /lib/liby.a         library with default `main' and `yyerror'
38

SEE ALSO

40       lex(1)
41       LR Parsing by A. V. Aho and S. C.  Johnson,  Computing  Surveys,  June,
42       1974.
43       YACC - Yet Another Compiler Compiler by S. C. Johnson.
44

DIAGNOSTICS

46       The  number  of reduce-reduce and shift-reduce conflicts is reported on
47       the standard output; a more detailed report is found  in  the  y.output
48       file.   Similarly,  if some rules are not reachable from the start sym‐
49       bol, this is also reported.
50

BUGS

52       Because file names are fixed, at most one yacc process can be active in
53       a given directory at a time.
54
55
56
57                                                                       YACC(1)
Impressum