yacc man page on Plan9

Man page or keyword search:  
man Server   549 pages
apropos Keyword Search (all sections)
Output format
Plan9 logo
[printable version]

YACC(1)								       YACC(1)

       yacc - yet another compiler-compiler

       yacc [ option ...  ] grammar

       Yacc converts a context-free grammar and translation code into a set of
       tables for an LR(1) parser and translator.  The grammar may be  ambigu‐
       ous; specified precedence rules are used to break ambiguities.

       The output file, y.tab.c, must be compiled by the C compiler to produce
       a program This program must be loaded with a lexical analyzer function,
       yylex(void)  (often  generated  by  lex(1)), with a main(int argc, char
       *argv[]) program, and with an error handling routine, yyerror(char*).

       The options are

       -o output  Direct output to the specified file instead of y.tab.c.

       -Dn	  Create file y.debug,	containing  diagnostic	messages.   To
		  incorporate them in the parser, compile it with preprocessor
		  symbol yydebug defined.  The	amount	of  diagnostic	output
		  from	the  parser  is	 regulated  by	value  n.  The value 0
		  reports errors; 1 reports reductions; higher values  (up  to
		  4) include more information about state transitions.

       -v	  Create  file y.output, containing a description of the pars‐
		  ing tables and of conflicts arising from ambiguities in  the

       -d	  Create  file y.tab.h, containing #define statements that as‐
		  sociate  yacc-assigned  `token  codes'  with	 user-declared
		  `token  names'.   Include  it	 in  source  files  other than
		  y.tab.c to give access to the token codes.

       -s stem	  Change the  prefix  of  the  file  names  y.tab.c,  y.tab.h,
		  y.debug, and y.output to stem.

       -S	  Write a parser that uses Stdio instead of the print routines
		  in libc.

       The specification of yacc itself is essentially the same	 as  the  UNIX
       version	described  in  the references mentioned below.	Besides the -D
       option, the main relevant differences are:

	      The interface  to	 the  C	 environment  is  by  default  through
	      <libc.h> rather than <stdio.h>; the -S option reverses this.

	      The parser accepts UTF input text (see utf(6)), which has a cou‐
	      ple of effects.  First, the return value of  yylex()  no	longer
	      fits in a short; second, the starting value for non-terminals is
	      now 0xE000 rather than 257.

	      The generated parser can be recursive: actions can call yyparse,
	      for  example  to	implement  a  sort of #include statement in an

	      Finally, some undocumented inner workings	 of  the  parser  have
	      been changed, which may affect programs that know too much about
	      its structure.





	      temporary file

	      temporary file

	      parser prototype

	      parser prototype using stdio


       S. C. Johnson and R. Sethi, ``Yacc: A parser generator'', Unix Research
       System Programmer's Manual, Tenth Edition, Volume 2
       B.  W.  Kernighan and Rob Pike, The UNIX Programming Environment, Pren‐
       tice Hall, 1984

       The parser may not have full information when it writes to  y.debug  so
       that the names of the tokens returned by may be missing.

                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server Plan9

List of man pages available for Plan9

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net