AntlrVSIX
AntlrVSIX copied to clipboard
New transform: "hoist do-nothin's"
Leaving a note to myself on the "hoist do-nothin's". If a rule contains an empty alternative, hoist the empty alternative to an EBNF "?" operator. There may be a chain, in which case the hoist can go way up the production chain.
a -> 'a' b ;
b -> 'b' | ;
=>
a -> 'a' b? ;
b -> 'b' ;