Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
  @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);
  }