private List<INode> list(INode... nodes) {
List<INode> ret = new ArrayList<INode>();
for (int i = 0; i < nodes.length; i++) {
INode node = nodes[i];
if (node instanceof INodeList)
ret.addAll(list(node.accept(this, null).toArray(new INode[] {})));
else if (node instanceof NodeOptional)
ret.addAll(list(node.accept(this, null).toArray(new INode[] {})));
else if (node instanceof NodeChoice)
ret.addAll(list(((NodeChoice) node).choice));
else if (node != null)