[antlr-interest] Parsing Parts of Java Code

Matthias Gutheil matthias.gutheil at informatik.uni-mannheim.de
Mon Jan 23 10:29:14 PST 2006


Hi,

am I'm right, that the filter=true option for the lexer doesn't help me 
with this grammer?

http://www.antlr.org/grammar/1090713067533/index.html

And in the Recognizer I can't use the filter flag ( I get an error 
message when using the antlr.Tool).

Matthias

Terence Parr schrieb:
> 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
>>>
>>
>>

-- 
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