[antlr-interest] Compiler Issue (Eclipse 3.1.2 / Antlr Studio 1.1)

Dominik Holenstein dholenstein at gmail.com
Fri Mar 24 22:22:52 PST 2006


Oliver, Jeff, Prashant,

I thank you very much for answering my question!

The error was caused by a wrong classpath. Further, I installed Antlr Studio
in the same Eclipse environment where I installed the free Antlr plugin. I
removed the free plugin and corrected the classpath and the variables.
Everything is working fine now and I can continue to learn Java and Antlr.

All the best,
Dominik



On 3/24/06, Prashant Deva <prashant.deva at gmail.com> wrote:
>
> Did you 'Enable ANTLR Studio' on the project first?
>
>
> On 3/24/06, Dominik Holenstein <dholenstein at gmail.com> wrote:
> >
> >  Hello,
> >
> > I am very new to Eclipse, Java and ANTLR. So my question is a very basic
> > one but after looking for a solution for several hours I want to ask you
> > whether you can help me:
> >
> > This is my grammar file:
> >
> >
> > header {
> > }
> > class XMLParser extends Parser;
> >
> > startMark
> >   : name:NAME
> >   {System.out.println("Name: "+name.getText());} ;
> >
> >
> > class XMLLexer extends Lexer;
> > NAME: ('a'..'z'|'A'..'Z'|'0'..'9')+ NEWLINE;
> > NEWLINE
> >     :   '\r' '\n'   // DOS   ;
> >
> > And this is my Main.java file:
> >
> > import java.io.*;
> >
> > class Main {
> >  public static void main(String[] args) {
> >   try {
> >         XMLLexer lexer = new XMLLexer(new DataInputStream( System.in<http://system.in/>));
> > /* Problem see below
> >         XMLParser parser = new
> > XMLParser(lexer);                                      /* Problem see below
> >         parser.startMark();
> >   }
> >
> >   catch(Exception e) {
> >    System.err.println("exception: "+e);
> >   }
> >  }
> > }
> >
> > This is the system I am working with:
> > - Windows XP
> > - Eclipse 3.1.2
> > - ANTLR Studio 1.1
> >
> > When I want to run the application (Run -> Run as -> Java Application) I
> > get this very nice messages in the console view of Eclipse:
> >
> > Exception in thread "main" java.lang.Error: Unresolved compilation
> > problems:
> >  XMLLexer cannot be resolved to a type
> >  XMLLexer cannot be resolved to a type
> >  XMLParser cannot be resolved to a type
> >  XMLParser cannot be resolved to a type
> >
> >  at Main.main(Main.java:7)
> >
> >
> >
> > Where do I have to look at to solve this issue?
> > - java or antlr code files?
> > - classpath and variables settings?
> > - other project settings?
> > - other ideas?
> >
> > I know it is a  very basic question but I appreciate any help very much.
> >
> > My plans are to develop a simple XML parser first just for learning
> > purposed.
> >
> > Kind regards,
> >
> > Dominik
> > Zurich, Switzerland
> >
> >
> >
>
>
>
> --
> Prashant Deva
> Creator, ANTLR Studio
> Founder, Placid Systems, www.placidsystems.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060325/76fe53d0/attachment.html


More information about the antlr-interest mailing list