[antlr-interest] ANTLR3 Capturing System.out.println

Kailey Joanette kaileyjo at bigbluebubble.com
Thu Mar 29 06:37:07 PDT 2007


So. I'm sticking to a syntactic translation for now, until I find that I
definitely need semantic.

 

I have a question though. how would I go about capturing things like
System.out.println() and System.currentTimeMillis()?  I tried putting a
matching block in 'statement' rule of the Java 1.5 grammar that would match
'System''.''out''.''println''(' outputExpression ')' but that ended up
creating problems with other system calls. Because now when it reaches say
System.currentTimeMillis I says there is no viable alternative when it
reaches "System". which I don't understand because my rule doesn't deal with
that so it should just default to the same rules it has always used.

 

Is there a better way to capture things like this and get the desired
output?

 

Kailey

 

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


More information about the antlr-interest mailing list