Why is addError method on ClassCodeVisitorSupport and not parent CodeVisitorSupport?

View: New views
2 Messages — Rating Filter:   Alert me  

Why is addError method on ClassCodeVisitorSupport and not parent CodeVisitorSupport?

by HamletDRC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Why is addError method on ClassCodeVisitorSupport and not parent
CodeVisitorSupport?

ClassCodeVisitorSupport is a subtype of CodeVisitorSupport.
ClassCodeVisitorSupport defines addError, which is useful to add
errors to the SourceUnit.

Is there any reason this isn't pulled up into CodeVisitorSupport,
beyond that it would then require that class to hold a reference to
SourceUnit?

--
Hamlet D'Arcy
hamletdrc@...

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


--
Hamlet D'Arcy

Re: Why is addError method on ClassCodeVisitorSupport and not parent CodeVisitorSupport?

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hamlet D'Arcy schrieb:

> Why is addError method on ClassCodeVisitorSupport and not parent
> CodeVisitorSupport?
>
> ClassCodeVisitorSupport is a subtype of CodeVisitorSupport.
> ClassCodeVisitorSupport defines addError, which is useful to add
> errors to the SourceUnit.
>
> Is there any reason this isn't pulled up into CodeVisitorSupport,
> beyond that it would then require that class to hold a reference to
> SourceUnit?

the reference to SourceUnit is hold by he abstract method
getSourceUnit(), which every subclass of that visitor has to implement.

Moving getSourceUnit and addError up into CodeVisitorSupport means to
possibly break existing code because getSourceUnit is abstract and
addError requires the SourceUnit.

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email