ANTLR generating empty conditions
问题 I'm trying to learn to use ANTLR, but I cannot figure out what's wrong with my code in this case. I hope this will be really easy for anyone with some experience with it. This is the grammar (really short). grammar SmallTest; @header { package parseTest; import java.util.ArrayList; } prog returns [ArrayList<ArrayList<String>> all] :(stat { if ($all == null) $all = new ArrayList<ArrayList<String>>(); $all.add($stat.res); } )+ ; stat returns [ArrayList<String> res] :(element { if ($res == null)