| Re: [cdt-dev] lpg question |
Hi David,
I take it what you're trying to do is have LPG print out which reductions are actually happening during a parse so that you can debug your parser.
As far as I know there is no way to automatically get LPG to do that for you, so you need to do it yourself. You'll notice that the information you need is at the top of the *.l files. So to make it work I wrote a little script that reads the *.l files and generates a Java class that contains a giant String array where the index is the rule number and the element is the rule. Then I added a couple lines of code to the top of the ruleAction() method in the generated parser that uses the array to print out the rules that are being fired.
Mike Kucera
Software Developer
IBM Eclipse CDT Team
mkucera@xxxxxxxxxx
David Sariel ---09/14/2009 04:12:35 AM---Hello,
From: | David Sariel <datosar@xxxxxxxxx> |
To: | "CDT General developers list." <cdt-dev@xxxxxxxxxxx> |
Date: | 09/14/2009 04:12 AM |
Subject: | [cdt-dev] lpg question |