I am processing my input file through my custom grammar and extracting tokens and returning them in a HashMap
. In ANTLR 3 I was able to parse the file by invoking rule()
method on parser and getting the HashMap
something like parser.record
.
This doesn't seems to work in ANTLR 4. I referred the book and it appears that I have to call parser.init()
to start parsing but I don't see any method in my parser.
I used ANTLRWorks 2 to generate my lexer and parser files. I didn't generate the listener classes.