Marwan Ajraoui wrote: > Hi there; > > I did define a customized node, extending a commonTree, defined an > adaptor extending a CommonTreeAdaptor, for my semantic analysis. > Nevertheless, I'm getting a classCastException, when the parser find > the first sintax error. > > The reason is that it can not cast CommonErrorNode to my customized > node, since both extend CommonTree. > > I'm interested on reporting all parser errores no just the first one. > What is the better aproach, dealing with this expcetion so it doesn't > stop the execution?
Override the errorNode method in your custom TreeAdaptor to return an instance of your node class. <http://www.antlr.org/api/Java/classorg_1_1antlr_1_1runtime_1_1tree_1_1_base_tree_adaptor.html#6794aa45ca9774822f1be82a3856e8f8> -- David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com 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 -~----------~----~----~----~------~----~------~--~---
