On 9/7/11 7:36 PM, "Jim Idle" <j...@temporal-wave.com> wrote:
Hi Jim, > You remember that this is all open source, freely given right? Of course I do :-) And I have read sources of ANTLR 3.4, be sure. Btw, my congratulations and respect. Very high quality code. > Generally, > don't try and mix C++ things in with the C. Exceptions are almost > certainly not want you want for error reporting while parsing anyway. > As I said earlier, copy the existing routine and adapt it. It does as many > things as it can to show you how to access the information. I can't > provide a universal error message handler as there is no way to know what > information your particular parser will have available or how you want the > messages to look and so on. All your customer error handler need do is > call a C++ object that you provide and that object can collect the errors > so that you can print them out at the end etc. The source code is right > there and well commented :) Ahhaa, I hope I have to hear you ... I will try say it now by own words to double check. * so we must implement own dsiplayError() -- this is clear. * we must NOT throw here any C++ exception. Instead, we must just build some Err String and put it e.g. Into our own Stack of such error strings * then we do AST = parser->entryRule() MyNodes = treePareser->entryRule() Zero exceptions here Then we just do if( errCount > 0 ) { stop job somehow report errors to user for example point ZZZ: throw myException( ErrStack->getErrors() ;) } Sounds right? Thank you, Jim for points. ----------------- Well, only one more question come to mind. :-) I have read that ANTLR3-C self build LIST OF exception objects. Is this true? If yes, then may be this is not needed? I mean override displayError() method? >> All your customer error handler need do is >> call a C++ object that you provide and that object can collect the errors >> so that you can print them out at the end etc. And we can "convert" that list into exception at point ZZZ in the above example? -- Best regards, Ruslan Zasukhin VP Engineering and New Technology Paradigma Software, Inc Valentina - Joining Worlds of Information http://www.paradigmasoft.com [I feel the need: the need for speed] 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.