...
This can be solved with "in-factoring": "(a|b) c" => "ac|bc". Further analysis of the syntax diagram can point out other simplifications like "(ac|bc) (c)*" => "(a|b) c+". Don't do them aggressively until only the last rule is left - further inlining may solve asymmetries where not all alternatives share the exact same parts.
Sections
- 1.1 Rule Inlining type
- 1.2 Rule Inlining array_type
- 1.3 Rule Inlining unmanaged_type
- 1.4 Rule Inlining non_array_type
- 1.5 Rule Inlining pointer_type
My siblings (including me):
...