LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Lex & YACC (https://www.linuxquestions.org/questions/programming-9/lex-and-yacc-234977/)

coolfrog 09-24-2004 11:22 PM

Lex & YACC
 
Hi,
Could any one give me a link to a comprehensive tutorial on lex and yacc. I'm having problems understanding about YYSTYPE , yylval etc. and how to link lex and yacc files so on.

vharishankar 09-25-2004 02:55 AM

Try this page. Download the pdf file.
http://www.epaperpress.com/lexandyacc/

coolfrog 09-25-2004 03:04 AM

Thanx. That was of some help.

alexrait1 09-25-2004 07:00 AM

yylval is a global variable of type YYSTYPE.
since all the grammar variables use it for storing/passing their symantic values, it should be declared as a union (or a struct).
typedef YYSTYPE some_struct_or_union;
the problem with structs, is that they soon get bloated if you have a lot of variables...


All times are GMT -5. The time now is 05:23 AM.