By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

error in yacc

P: n/a
SSG
Hai All!

I am new to lex and yacc..

I compile one yacc program , but it tells errors...

10 Rules never reduced..

how to debug the code.. just i am giving my yacc sample code...

%%
design_unit
: context_clause
library_unit
;

library_unit
: primary_unit
| secondary_unit
| error
;

I am not doing any actions..

Thanx

Dec 8 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

SSG schrieb:
10 Rules never reduced..


This is not the appropriate group for this topic. Maybe you want to try
comp.programming or comp.compilers.

This said, try the -v option of yacc. It'll give you a file y.output
and at the end of that file, it tells you, which rules will never be
reduced. Depending on how you are developing your grammar, the message
may or may not indicate an error.

Dec 8 '05 #2

P: n/a
SSG wrote:
Hai All!

I am new to lex and yacc..


<snip>

Aren't you lucky. However, none of lex, yacc, flex, bison or any of the
other similar tools are part of C, so this is not the correct group to
ask about them.

Yes, they produce C code, but so do lots of other things, this does NOT
make them on topic.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Dec 8 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.