[stringtemplate-interest] [ST4 Beta-4] Cannot intercept error messages from imported groups

Terence Parr parrt at cs.usfca.edu
Thu Feb 10 16:28:27 PST 2011


Hi Udo, can we add an ErrorManager arg to the STGroup* ctors?
Ter
On Feb 7, 2011, at 3:12 AM, Udo Borkowski wrote:

> Hi,
> 
> I am using my own ErrorListener and set it when a new group is created. 
> 
> With Beta-4 it is now possible to notice when an imported group file does not exist.
> 
> However I do not notice when the imported group is buggy. The error message is still written to the standard error listener.
> 
> This is because the error listeners of the imported groups haven't been updated to my error listener. I tried to do so at the same time when setting the listener for the parent group. However I noticed the "imports" are not yet defined after creating the parent group but when the first instance of the parent group is created. 
> 
> Any idea how I can set the error listeners for the imported groups to my error listener?
> 
> 
> One idea: as I am using ONE error listener for ALL groups it would be fine for me just to replace the "standard error listener" globally. E.g.
> 
>> What about making the constant STGroup.DEFAULT_ERR_MGR a static variable/property? This way a different DefaultErrorManager could be defined. The default would be the current "new ErrorManager()". 
> 
> I already suggested this in an earlier post to work around the "missing imported group" issue. But this also seems to be an easy solution for the "cannot intercept error messages from imported groups" issue. I already tried it out and it works fine.
> 
> 
> Udo
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list