Latest LQ Deal: Latest LQ Deals
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-24-2004, 11:22 PM   #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, 02:55 AM   #2
Senior Member
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Try this page. Download the pdf file.
Old 09-25-2004, 03: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, 07: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 05:12 PM
lex & yacc installation sharathg786 Ubuntu 3 10-12-2005 01:21 AM
how to work on lex & yacc? sharathg786 Ubuntu 2 09-13-2005 04:52 AM
Lex & yacc programming in windows. hemanexp Linux - Software 1 01-09-2004 05:41 AM
Lex & yacc Programming in linux. hemanexp Linux - Software 2 01-07-2004 11:09 AM > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration