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

Martin Probst mail at martin-probst.com
Fri Mar 30 00:08:32 PDT 2007


> Right--my version of println was intended as a
> conceptual example.  Actually, I would tend more to
> use a qualifiedId (construct a text string that
> includes all of "System.out.println" as a
> reconstructed symbol; or maybe use subtables for class
> members and tables of classes) and symbol table lookup
> for generic method translation.

Actually, you would need to resolve "System" to "java.lang.System" to  
find out it's really something that resembles printf. Of course it  
would be really bad coding style to have another class with the same  
name as something in java.lang, but e.g. with List (AWT vs. java.util  
vs Swing vs ANTLR's List) it's quite common.

This whole syntax directed approach doesn't really seem very  
feasible, I fear.

Regards,
Martin


More information about the antlr-interest mailing list