[antlr-interest] Tutorial Seems to Have Improper Java
Matthew Tedder
teddemc at yahoo.com
Thu Nov 18 15:39:42 PST 2004
Separating them into separate files doesn't seem to
make any difference... The following line gives an
error... it's expecting a '{'
class ExprLexer extends Lexer;
I am learning Java, but I know C++.. I presume Lexer
is defined in antlr.* but I do not understand what is
supposed to be happening here...
Matthew
--- Terence Parr <parrt at cs.usfca.edu> wrote:
>
>
> On Nov 18, 2004, at 1:45 PM, Matthew Tedder wrote:
> > While I code in C/C++ and flex/bison, I am new to
> Java
> > and trying to learn antlr, too. The following
> link is
> > to code I found in an antlr tutorial:
> >
> > http://pastebin.com/121239
> >
> > But it doesn't work.. javac says it's expecting
> '{'
> > after:
> >
> > class ExrLexer extends lever;
> >
> > Can anyone tell me what is wrong here? Once I get
> > just one simple thing working, I think I could be
> > happy playing with it for a while..
>
> Somebody has the main and .g file looking like one.
> Make this a
> separate file:
>
> import antlr.*;
> public class Main {
> public static void main(String[] args) throws
> Exception {
> ExprLexer lexer = new ExprLexer(System.in);
> ExprParser parser = new ExprParser(lexer);
> parser.expr();
> }
> }
>
> Ter
> --
> CS Professor & Grad Director, University of San
> Francisco
> Creator, ANTLR Parser Generator,
> http://www.antlr.org
> Cofounder, http://www.jguru.com
> Cofounder, http://www.knowspam.net enjoy email
> again!
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
> antlr-interest-unsubscribe at yahoogroups.com
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list