[antlr-interest] Re: Antlr grammar to parse Java classfile?

Ric Klaren klaren at cs.utwente.nl
Thu Dec 6 07:32:35 PST 2001


Hi,

On Thu, Dec 06, 2001 at 07:02:10AM -0800, mzukowski at bco.com wrote:
> You are right, semantic predicates are ignored if you are guessing.  That's
> a gotcha that could be taken care of only by extending antlr or extremely
> ugly and unmaintainable syntactic predicates.
> 
> Hopefully for the java classfile format there should be no guessing...but
> this isn't a general solution to the "match n times" problem.

You might work around it with init actions (with devel versions and 2.7.2).
But it's ugly-ish. Init actions inside closures are now inside the loop
(before any lookahead tests etc.) it's even possible to break out of the
closure there (but this is not a documented feature, and I think it should
not be documented, better to implement it inside antlr)

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
 'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
  of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
    goes round the back and ... er ... prods it with his foot. But in a
     technical way,' he added. --- From: Hogfather by Terry Pratchett.


 

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



More information about the antlr-interest mailing list