|Re: [cdt-dev] lpg question|
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.
IBM Eclipse CDT Team
David Sariel ---09/14/2009 04:12:35 AM---Hello,
David Sariel <datosar@xxxxxxxxx>
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
09/14/2009 04:12 AM
[cdt-dev] lpg question