[antlr-interest] Re: Newbie Question about Syntactic Predicates

hawkwall hawkwall at yahoo.com
Fri Nov 7 19:36:38 PST 2003


Jim,

You are right about the oversight, I missed that when I copied in the
post.  I will look at the testLiterals option and play with it. 
Thanks for taking the time to make the example, it seems much easier.
I don't want to do more work than I have to.  


Loring,

Thanks for the hint about left factoring the NUMBER.OF.  There are
lots of places I can do that, and it will help.  You also mentioned
testLiterals, so I will dig more.  From you comment about doing more 
work in the parser, I appreciate your advice.


Thank you both for your answers.  At some point, I plan to add actions
and use Hibernate to populate a database from the parse. I was
thinking it would be cleaner if more of the parsing work was done in
the lexer, because I assume the actions will be fairly complex.  I
have used the perl module Parse::RecDescent in the past to parse files
and build comma seperated text files that were then loaded into the
database.  I spent way to much time debugging the column names and
making sure things were in the right order.  I wish I could say I
understood the internals of P:RD, but in actuality, I just tinkered
until I got an acceptable result.  Already, I have better
understanding of what antlr is doing, the generated code is much
easier to read.  I hope this approach with antlr and hibernate will
work better.  I was kinda shocked to not see regular expressions in
antlr, but I don't think I will miss them. Would an AST serve me
better to populate the database?  I will need to get a better
understanding of AST's if so.  Again, I am grateful for the help.

Mike




 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list