Here an extension wants to compute some synthesized attributes on the dispatch production (application here) and avoid writing the same equations in implementation productions. As previously discussed offline, it isn't feasible to allow synthesized equations on an implementation production to be omitted and implicitly defaulted to copy from the forward parent. However perhaps one should be able to write those copy equations explicitly. These equations should typically never be accessed, however one may also wish to make use of a synthesized equation in the dispatching production in a different attribute equation in an implementation production. The above approach requires re-decoration of children and re-computation of attributes; sharing isn't permitted in an extension context like this, as the application production does not itself implement the Application signature. Some other production may also have forwarded to functionInvocation, so this may not always give the desired result.
The fix is just to make the forward parent accessible, like how one can explicitly access e.g. forward.typerep. I'm not sure what the syntax for this should be - forwardParent, backward?
In the process of refactoring Silver as a part of #751, I have noticed a recurring pattern:
Here an extension wants to compute some synthesized attributes on the dispatch production (
application
here) and avoid writing the same equations in implementation productions. As previously discussed offline, it isn't feasible to allow synthesized equations on an implementation production to be omitted and implicitly defaulted to copy from the forward parent. However perhaps one should be able to write those copy equations explicitly. These equations should typically never be accessed, however one may also wish to make use of a synthesized equation in the dispatching production in a different attribute equation in an implementation production. The above approach requires re-decoration of children and re-computation of attributes; sharing isn't permitted in an extension context like this, as theapplication
production does not itself implement theApplication
signature. Some other production may also have forwarded tofunctionInvocation
, so this may not always give the desired result.The fix is just to make the forward parent accessible, like how one can explicitly access e.g.
forward.typerep
. I'm not sure what the syntax for this should be -forwardParent
,backward
?