Yacc shaving

ChrisDolan on 2008-05-01T06:24:14

I've been playing around with the Parrot Compiler Toolkit lately. I started with the superb tutorial that Klaas-Jan Stol wrote. Then I made a bad choice and started a port of a too-complex language (bash).

I quickly got bored with hand-translating bash's parse.y to PGE. So, I set that aside and started writing a parser for Yacc syntax, with the intention of outputting a rough Perl6 grammar and a stubbed out actions.pm file. I love Perl6 regex syntax -- it makes it almost easy to compose a big grammar.

I built the grammar and started on the actions for my Yacc parser. However, when I run it, it just spins and spins. Hmm, I must have some rule that's recursive or too slow. So, I've been adding "{*} #= open" and "{*} #= close" in several places and logging completed steps in the grammar. I guess I need to learn to use Parrot's debugger...