error in yacc

S

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
 
I

Ingo Menger

SSG said:
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.
 
F

Flash Gordon

SSG said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top