AntlrVSIX icon indicating copy to clipboard operation
AntlrVSIX copied to clipboard

New transform: "hoist do-nothin's"

Open kaby76 opened this issue 4 years ago • 0 comments

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' ;

kaby76 avatar May 22 '20 11:05 kaby76