[antlr-interest] Parsing Parts of Java Code

Terence Parr parrt at cs.usfca.edu
Sun Jan 22 11:43:32 PST 2006


Hi.  Investigate filter mode for lexers.

Terence

On Jan 21, 2006, at 6:18 PM, Scott Stanchfield wrote:

> You may be able to just call the statement-list rule, but I haven't  
> looked
> at that grammar in a while.
>
> In general, any public rules in the grammar can be used as a  
> starting point,
> unless the action code in the grammar expects certain state to already
> exist.
>
> Good luck!
> -- Scott 
>
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org
>> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of
>> Matthias Gutheil
>> Sent: Saturday, January 21, 2006 6:17 PM
>> To: antlr-interest at antlr.org
>> Subject: [antlr-interest] Parsing Parts of Java Code
>>
>> Hello,
>>
>> I am using the java1.5 grammer from John Mitchell and Terence
>> Parr and others. I can build the AST and worked on it to add
>> the code line and view comments.
>>
>> Now I need to parse only parts of a java program e.g.
>>
>> stack.push("need");
>> stack.push("help");
>> System.out.println(stack.toString());
>> top();
>>
>> Is that possible with the java1.5 grammer by a trick? :-)
>>
>> Cheers
>> Matthias
>>
>> --
>> Matthias Gutheil, Dipl. Inform.
>> Universität Mannheim
>> Lehrstuhl für Softwaretechnik
>> A5, 6, Gebäudeteil B
>> 68131 Mannheim
>> Germany
>>
>> E-Mail: matthias.gutheil at informatik.uni-mannheim.de
>> Tel: (+49) 621 181 3913
>>
>
>



More information about the antlr-interest mailing list