Hello there. I've not been usign ANTLR for a long time so maybe I'm wrong but I think you looked at the lexer. As far as I know, the parser rules always return something. The return type for each method correspondig to a rule in the parser is a inner class of the generated parser. Let's say you declared the rule parserRule in the parser MyParser. The get the result from parsing a file starting from that rule you do something like this: MyParser.parserRule_return result = parser.parserRule();
Hope this helps. Regards On Mon, Mar 15, 2010 at 09:47, Ketan Maheshwari <[email protected]> wrote: > Hello Friends > > While looking at the ways I can use the generated Lexer and Parser classes > of my grammar I stumbled thru this page: > > http://www.antlr.org/wiki/pages/viewpage.action?pageId=789 > > It says that we can use the parser something like this: > > RuleReturnScope result = parser.compilationUnit(); > > But, on my Parser class I do not see any method that really returns result > of this type. > > All my methods for the grammar rules are simply void. panic! > > Am I missing anything here? > > Many thanks! > Ketan > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
