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

Prashant Deva prashant.deva at gmail.com
Fri Mar 24 10:05:59 PST 2006


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));  /*
> 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/20060324/5d9aa180/attachment.html


More information about the antlr-interest mailing list