[antlr-interest] newbie teething problem(s)

James Wilkinson jimmy at cs.cofc.edu
Wed Jun 29 19:22:16 PDT 2005


I've been working my way through "An Introduction to ANTLR" and had a 
couple of things not work as expected:

1. In the very first example, I don't get the output shown in the 
document. I think that it's because the parser has been told to 
ignore newlines in the grammar. I type in an expression, hit the 
return key, and don't get any output at all. I think it's still 
waiting for EOF and isn't ever going to get it.

No big deal. I can redirect stuff in from a file and get the expected output.

2. When I got to the AST construction section, I made the changes to 
the grammar and the Main program and got a null pointer exception. 
Sure enough, parser.getAST() returns a null pointer. Now I'm totally 
derailed.

Can somebody give me an idea of what to try now?

thanks
-- 
-------------------------------------------------------------
Jimmy Wilkinson            | Professor of Computer Science
jimmy at cs.CofC.edu          | The College of Charleston
(843) 953-8160             | Charleston      SC        29424
http://www.cs.cofc.edu/~jimmy

If there is one word to describe me,
that word would have to be "profectionist".
Any form of incompitence is an athema to me.
Metathesis??? Don't ax me.
Just between you and I, the grammar used by Americans are getting worse.
It just ceases to amaze me how that could be the case, but mostly I 
could care less.


More information about the antlr-interest mailing list