yacc(1) General Commands Manual yacc(1)Name
yacc - yet another compiler-compiler
Syntax
yacc [-vd] grammar
Description
The command converts a context-free grammar into a set of tables for a simple automaton which executes an left recursive parsing algorithm.
The grammar may be ambiguous; specified precedence rules are used to break ambiguities.
The output file, must be compiled by the C compiler to produce a program yyparse. This program must be loaded with the lexical analyzer
program, yylex, as well as main and yyerror, an error handling routine. These routines must be supplied by the user; is useful for creat-
ing lexical analyzers usable by
Options-d Writes all define statements to file. This allows source files other than to access the token codes.
-v Writes description of parsing tables and report of grammatical conflicts to file.
Diagnostics
The number of reduce-reduce and shift-reduce conflicts is reported on the standard output; a more detailed report is found in the Simi-
larly, if some rules are not reachable from the start symbol, this is also reported.
Restrictions
Because file names are fixed, at most one process can be active in a given directory at a time.
Files
y.output
y.tab.c
y.tab.h defines for token names
yacc.tmp, yacc.acts temporary files
See Alsolex(1)
"YACC - Yet Another Compiler Compiler" ULTRIX Supplementary Documents Vol. II:Programmer
yacc(1)
Check Out this Related Man Page
YACC(1) General Commands Manual YACC(1)NAME
yacc - yet another compiler-compiler
SYNOPSIS
yacc [ -vd ] grammar
DESCRIPTION
Yacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR(1) parsing algorithm. The grammar
may be ambiguous; 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 yyparse. This program must be loaded with the lexical
analyzer program, yylex, as well as main and yyerror, an error handling routine. These routines must be supplied by the user; Lex(1) is
useful for creating lexical analyzers usable by yacc.
If the -v flag is given, the file y.output is prepared, which contains a description of the parsing tables and a report on conflicts gener-
ated by ambiguities in the grammar.
If the -d flag is used, the file y.tab.h is generated with the define statements that associate the yacc-assigned `token codes' with the
user-declared `token names'. This allows source files other than y.tab.c to access the token codes.
FILES
y.output
y.tab.c
y.tab.h defines for token names
yacc.tmp, yacc.acts temporary files
/usr/lib/yaccpar parser prototype for C programs
/lib/liby.a library with default `main' and `yyerror'
SEE ALSO lex(1)
LR Parsing by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974.
YACC - Yet Another Compiler Compiler by S. C. Johnson.
DIAGNOSTICS
The number of reduce-reduce and shift-reduce conflicts is reported on the standard output; a more detailed report is found in the y.output
file. Similarly, if some rules are not reachable from the start symbol, this is also reported.
BUGS
Because file names are fixed, at most one yacc process can be active in a given directory at a time.
YACC(1)
my yacc output file y.tab.c is not compiling using cc y.tab.c -ly command
.possibily option flag -ly is not correct.i m using red hat linux 9.please give solutions. (4 Replies)
Does anyone use the following Cobol compiler:
RM/COBOL-85 Compiler - Version 5.15.00 for SCO Unix 386.
I am looking for a file that might be part of the distribution named "osmain.o"
Thanks. (0 Replies)
To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first?
The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's...
Eventhough i... (12 Replies)
How to specify the token length in a yacc file?
sample input format
<field1,data type ans,fixed length 6> followed by <field2,data type ans,fixed length 3>
Example i/p and o/p
Sample Input: "ab* d2 9o"
O/p : "Field1 Field2 "
yacc/bison grammar:
record :... (1 Reply)
Hi everyone!
This is my very first post, sorry if I'm not posting in the right category.
I'm trying to match a newline "/n" using lex/yacc.
For example,
print(9,'\n',8)
should print
9
8
now do I write a regular expression to match exactly " '\n' "
Thanks! (1 Reply)
Hi guys,
I'm struggling with a simple but at the same time complicated problem related to yacc :wall: Maybe someone can help me with this :confused:
I'm working on a big project and it's hard for me to show the problem exactly on my code, but I will give a model of it.
Before I had this kind... (2 Replies)
Hello
I have a questions and m stuck on it.
Theoritcally the phases of compiler.
1. Lexical analyis -- genrates tokes
NOW MY QUESTION IS: where i can see these token if i make a simple C program.
Please guys tell me step to see it. and other phases too.
your help will be appreciated... (1 Reply)
Hi Frds,
I am new to unix forums. With lot of hope, i'm posting this thread. I want to understand GCC functionality(from commandline parsing to Assembly code generatio). i have relavant source code with me. But i felt little bit difficulty in understanding / reading each line of code. Is... (5 Replies)