[antlr-interest] How to parse java source code ?

Johannes Luber jaluber at gmx.de
Mon Sep 22 05:02:32 PDT 2008


Murali schrieb:
>  I need the parser which can give the import list, fuction list, variable names and types, etc., 
> 
> Is antlr satisfies the same?

There is an example grammar which parses Java source code.
> 
> Can u send me the usage of antlr to getting import list, function list, commented lines and variable names and types from giving java code as input list

You have to change the grammar in such a way that you store the required
information. After a successful parsing, you merely have to read it out.
I'm not sure from your description if you actually need a full symbol
table or a lesser structure is sufficient. Just write down which
information you need, how you can store it and look where in the grammar
it is located.

Johannes
> 
> 
> 
> -- 
> With Lov,
> Murali.
> 
> 
> ------------------------------------------------------------------------
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 



More information about the antlr-interest mailing list