I must be searching for the wrong thing because I can't find any examples or documentation on how to add custom errors in grammar actions.
For example, if you have a grammar with a symbol table, and want to report errors when symbols are used before they are defined, what's the method for doing that in the C target? In Java I believe you just throw a RecognitionException, etc. I see there's a macro for creating exceptions: CONSTRUCTEX And I see a similar function for creating exceptions: antlr3ExceptionNew Additionally, in the generated code there are labels for jumping to on HASEXCEPTION(), so I'm guessing there is a mechanism for working with all of that, but I have yet to find it in the documentation or in previous email threads or on the web. What I have found is numerous discussions regarding displayRecognitionError, but I'm not interested in changing *how* the errors are reported (yet). I just want to enforce semantic errors (stuff the grammar itself can't encode, but will require checks like isSymbolDefined in grammar actions, etc.). Thanks! Aaron 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.
