[antlr-interest] Parse trace?

West Jay - Toronto-MROC - external JWest at mroc.com
Thu May 14 11:07:43 PDT 2009


Hi all,

I've been expanding the Oracle PL/SQL grammar (from the ANTLR downloads section) for the past while and have had lots of success.

options {
            language=CSharp2;
            k=*;
            backtrack=true;
            memoize=true;
            output=AST;
}

Right now I've got it parsing lots of programs into exactly the AST I want (liking those tree rewrite rules), but there are definitely still many programs that don't parse the way I expect/require.

How can I determine which path was taken through the grammar to parse the input?

I'm not sure how the grammar is producing some of this output, but if I knew the path it was taking I'd at least have some understanding of the problem and likely then be able to figure out a way to fix it.

So far, the only option I've seen is annotating my grammar with trace statements that'll execute during parsing.  Ick.  Is there not a better way?

I'm pretty sure there must be, and I'm just not seeing it.

Suggestions?

Thanks,
J

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090514/fea97b3f/attachment.html 


More information about the antlr-interest mailing list