Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ChrisDolan (2855)

ChrisDolan
  (email not shown publicly)
http://www.chrisdolan.net/

Journal of ChrisDolan (2855)

Thursday May 01, 2008
01:24 AM

Yacc shaving

[ #36296 ]

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...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.