Bug in Racc?

J

jonT

Hi all,

The following was reported to Minero Aoki (Racc developer) a while ago;
he hasn't replied so I assume he's busy. Thus I'm putting it out to the
Ruby community, any ideas would be appreciated. Appologies for the
lengthy code segment, I wasn't able to find what exactly was wrong -
the interaction appears very subtle!
____________________________________________________________________________

I'm emailing you to report a potential bug in Racc. Again, I'm aware
that it is alpha s/w but I do like to help developers create stable
software :).

Do the following:
: j@moose:528:0$; wget
http://www.tippell.com/files/public/autocomplete_parser.y
: j@moose:529:0$; racc -o autocomplete_parser.rb autocomplete_parser.y
&& ruby1.9 autocomplete_parser.rb

You should get output along the lines:
10 shift/reduce conflicts
166 reduce/reduce conflicts
2 useless rules
005

Now uncomment line 16 and comment out lines 17-20. Repeat and you'll
get the output:
10 shift/reduce conflicts
170 reduce/reduce conflicts
2 useless rules
/usr/local/lib/site_ruby/1.9/racc/parser.rb:350:in `on_error':
(Racc::parseError)
parse error on value "t4" (IDENT) from
/usr/local/lib/site_ruby/1.9/racc/parser.rb:99:in `do_parse'
from autocomplete_parser.y:121:in `parse'
from autocomplete_parser.rb:1246:in `run'
from autocomplete_parser.rb:1248

A similar result can be seen on lines 35-39.

Next return to the original file and uncomment lines 67-79 and comment
lines 82-108. Run and you'll get the same error message as before.

Note though that (again from the original), commenting out lines
133-134 provides the correct result:
10 shift/reduce conflicts
166 reduce/reduce conflicts
2 useless rules
012


I'm no yacc expert but the guys in the lab have confirmed that my code
looks correct - and racc compiles it fine. Moreover a parse error at
runtime rather than at compile time would lead me to believe that my
code is correct.

Unfortunately I'm also fairly new to Ruby and I don't read Japanese -
which puts me at quite a poor position to write fixes.

Can you confirm that this is a bug in Racc?

Cheers,

Jon
 

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

Similar Threads

Racc 2
bug in flog ? 1
Error reporting in Racc 0
problems with racc: $end token 13
Errors with rdtool in 1.8 0
Bug in Decimal?? 8
[ANN] ruby_parser 2.0.0 Released 8
shift/reduce conflicts in the YACC grammar of C99 4

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top