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 ]

Allison (3003)

Allison
  (email not shown publicly)

Human (I think).

Journal of Allison (3003)

Thursday January 12, 2006
04:33 PM

Punie commas

[ #28333 ]
Last journal post I mentioned I was in the process of deciding which way to transform the tree structure for comma lists. Between options A, B, and C, I chose option D: modify the parser grammar. I actually implemented option B, but the result was somewhat tortured (a "code smell"), and it looked like A and C would be equally tortured. Interestingly, the way you write the parser grammar can make it easier or harder to transform the resulting parse tree. In this case, following the old yacc pattern (cexpr rule within a cexpr rule) made for a nasty transformation, while changing it to a simple repetition allowed the transformation to fall out in fairly few lines of code. I'm happy. :)
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.