private DRLParser getParser(final String text) { DRLParser parser = new DRLParser(new CommonTokenStream(new DRLLexer(new ANTLRStringStream(text)))); parser.setTreeAdaptor(new DroolsTreeAdaptor()); parser.enableEditorInterface(); return parser; }
@SuppressWarnings("unchecked") public CompletionContext(String backText) { DRLParser parser = getParser(backText); try { parser.compilation_unit(); } catch (Exception ex) { } parserList = parser.getEditorInterface().get(0).getContent(); deriveLocation(); determineDialect(backText); }