Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-25-2004, 12:22 AM   #1
Registered: Sep 2004
Location: India
Distribution: Slackware 10.0
Posts: 77

Rep: Reputation: 15
Lex & YACC

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.
Old 09-25-2004, 03:55 AM   #2
Senior Member
Registered: Dec 2003
Posts: 3,161
Blog Entries: 4

Rep: Reputation: 135Reputation: 135
Try this page. Download the pdf file.
Old 09-25-2004, 04:04 AM   #3
Registered: Sep 2004
Location: India
Distribution: Slackware 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Thanx. That was of some help.
Old 09-25-2004, 08:00 AM   #4
Registered: Jul 2003
Location: Israel
Distribution: slackware current kernel 2.6.9
Posts: 70

Rep: Reputation: 15
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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LEX and YACC with C gr33ndata Programming 4 11-18-2007 06:12 PM
lex & yacc installation sharathg786 Ubuntu 3 10-12-2005 02:21 AM
how to work on lex & yacc? sharathg786 Ubuntu 2 09-13-2005 05:52 AM
Lex & yacc programming in windows. hemanexp Linux - Software 1 01-09-2004 06:41 AM
Lex & yacc Programming in linux. hemanexp Linux - Software 2 01-07-2004 12:09 PM

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration