xyacc - SPP modified yacc compiler compiler [IRAF]


xyacc [options] file


-b file_prefix

Specify a file_prefix for output files


Also produce a header file


Don’t generate ’#line’ directives

-P parser

Specify parser file (default boot$xyacc/yaccpar.x)


Flag for version stamping. The -Qy option puts the version stamping information in This allows you to know what version of yacc built the file. The -Qn option (the default) writes no version information.


Compiles runtime debugging code by default.


Prepares the file y.output, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar.


Output version information and exit

-Y dir

Specify location of yaccpar.x (default boot$xyacc).


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

This is a version of yacc that has been modified to produce SPP language parsers. For the most part, it should follow the operation of standard yacc, with the differences noted below.

Input files should follow the yacc convention of ending in .y.



The Yacc input syntax is unmodified, except that the comment convention is now as in SPP, rather than C (i.e., use #, rather than /*..*/). All defines, actions, etc. are of course given in the SPP language.


The Yacc output file is "ytab.x", rather than "". The token defs file "" now contains SPP defines, rather than C #defines. The states file "y.output" is completely unmodified.


The global declarations section %{ .. %} had to be changed somewhat because SPP does not have global variables. The section is now divided into two subsections. The first is for global defines, includes, etc. which go into the header area of the ytab.x file. Then follows a %L, telling Yacc that the local declarations for the parser procedure follow. This second section should contain variable and function declarations required for the user supplied actions (code fragments to be executed when a rule of the grammar is recognized) in the yyparse procedure.


The global declarations section MUST contain the following two defines:

YYMAXDEPTH Depth of the parser stacks; determines the maximum complexity of a language construct which can be parsed. A typical value is 150.

YYOPLEN The length, in struct units, of a token operand value structure. You define the operand structure to be whatever you wish; all the parser needs to know is how big an element is. The lexical analyzer and the actions, both of which are supplied by the user, use the operand structure for communications. Operand structures are always referred to by a Mem pointer.


yacc(1), xpp(1), rpp(1).


This manual page was written by Zed Pobre <zed [AT]>, for the Debian GNU/Linux system (but may be used by others). It includes text from the README file for xyacc in the IRAF sources.