[antlr-interest] how to construct an AST ?

venkat medhaj hvmedhaj at gmail.com
Wed Feb 17 11:07:58 PST 2010


Hi,
      I was trying to run see how the Java grammar works but unfortunately,
it was throwing some errors. I downloaded the .g file for the java 1.6 by
YANG JIANG and when I tried saving that on eclipse, I get the following
error. Can someone please tell me whats going on and how to fix that ?
Basically, I want to take a Java file and run that against the grammar and
see the AST. Thats my goal and firstly, I want to get the grammar running
correctly. Although I follwed the tutorial, I wasnt able to figure out what
was the issue with this partiucalr grammar. Also, if anyone could shed some
light as to what are the glitches that I may encounter while experimenting
on this, that would be great.  I would appreciate it if scott could shed
some light on this. Thanks a lot scott. Your videos have been truly helpful.


Multiple markers at this line

- (209): Multiple token rules can match input such as "'!'": BANG, BANGEQ

As a result, token(s) BANGEQ were disabled for that input

- (208): The following token definitions can never be matched because prior
tokens match the same input: INTLITERAL,DOUBLELITERAL,LINE_..........

-V




On Mon, Jan 25, 2010 at 11:47 PM, venkat medhaj <hvmedhaj at gmail.com> wrote:

> Hi, I am a newbie to ANTLR and I am learning to use Antlr lately. I want to
> generate an AST for the .g file i.e the grammar file available, the target
> language being Java 1.6.
> Can anyone please tell me how to proceed ? I find it a bit confusing.
>
> Thnks,
> -V
>


More information about the antlr-interest mailing list