// xxx: Wrong! Should use TreeGrammer and not to populate customizer with custom nodes // Should be rewritten but I have no time for this public List<JavaVMOption<?>> parse() { Set<JavaVMOption<?>> result = new HashSet<JavaVMOption<?>>(); try { vmOptions_return options_return = vmOptions(); CommonTree root = options_return.tree; if (root instanceof JavaVMOption<?>) { result.add((JavaVMOption<?>) root); } else if (root != null) { result.addAll(root.getChildren()); } } catch (RecognitionException e) { e.printStackTrace(); } result.addAll(getAllOptions()); return new LinkedList<JavaVMOption<?>>(result); }