You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inherited attribute inh::Integer occurs on Foo;
inherited attribute syn::Integer occurs on Foo;
aspect default production
top::Foo ::=
{ top.syn = top.inh; }
If there are no other equations for syn, this will flag the default equation as exceeding the flow type of syn. As a workaround, one can explicitly specify flowtype syn {inh} on Foo;.
The text was updated successfully, but these errors were encountered:
krame505
changed the title
Dependencies from flow type inference aren't included in flow type inference
Dependencies from default productions aren't included in flow type inference
Nov 17, 2023
Note that this isn't quite true - if there are non-forwarding productions that lack an equation for syn, then the dependencies of the default equation for syn will still have an effect. But if all non-forwarding productions have an equation, the flow type for syn will not be inferred to contain inh. This is an unusual situation with regular nonterminals (unless some non-forwarding prods still need to be written that will make use of the default equation), but for closed nonterminals this is a more egregious issue as one would frequently write new non-forwarding productions for the nonterminal in extensions, where the default would apply.
The fix here is to include default production flow graphs in the flow type inference process.
For example
If there are no other equations for syn, this will flag the default equation as exceeding the flow type of
syn
. As a workaround, one can explicitly specifyflowtype syn {inh} on Foo;
.The text was updated successfully, but these errors were encountered: