Tabnine Logo
CompiledFEELSupport$SyntaxErrorListener
Code IndexAdd Tabnine to your IDE (free)

How to use
CompiledFEELSupport$SyntaxErrorListener
in
org.kie.dmn.feel.codegen.feel11

Best Java code snippets using org.kie.dmn.feel.codegen.feel11.CompiledFEELSupport$SyntaxErrorListener (Showing top 5 results out of 315)

origin: org.kie/kie-dmn-feel

private List<Boolean> parseCompileEvaluate(String feelLiteralExpression, Object l) {
  Object left = EvalHelper.coerceNumber(l);
  FEELEventListenersManager mgr = new FEELEventListenersManager();
  CompiledFEELSupport.SyntaxErrorListener listener = new CompiledFEELSupport.SyntaxErrorListener();
  mgr.addListener(listener);
  EvaluationContext emptyContext = CodegenTestUtil.newEmptyEvaluationContext(mgr);
  CompiledFEELUnaryTests compiledUnaryTests = parse(feelLiteralExpression, mgr, listener);
  LOG.debug("{}", compiledUnaryTests);
  List<Boolean> result = compiledUnaryTests.getUnaryTests()
      .stream()
      .map(ut -> ut.apply(emptyContext, left))
      .collect(Collectors.toList());
  if (listener.isError()) {
    LOG.debug("{}", listener.event());
    return Collections.emptyList();
  }
  LOG.debug("{}", result);
  return result;
}
origin: org.kie/kie-dmn-feel

private DirectCompilerResult getCompilerResult() {
  if (compiledExpression == null) {
    if (errorListener.isError()) {
      compiledExpression =
          DirectCompilerResult.of(
              CompiledFEELSupport.compiledErrorExpression(
                  errorListener.event().getMessage()),
              BuiltInType.UNKNOWN);
    } else {
      try {
        compiledExpression = ast.accept(new ASTCompilerVisitor());
      } catch (FEELCompilationError e) {
        compiledExpression = DirectCompilerResult.of(
            CompiledFEELSupport.compiledErrorExpression(e.getMessage()),
            BuiltInType.UNKNOWN);
      }
    }
  }
  return compiledExpression;
}
origin: org.kie/kie-dmn-feel

private CompiledFEELUnaryTests parse(String input, Map<String, Type> inputTypes, FEELEventListenersManager mgr, CompiledFEELSupport.SyntaxErrorListener listener) {
  FEEL_1_1Parser parser = FEELParser.parse(mgr, input, inputTypes, Collections.emptyMap(), Collections.emptyList(), Collections.emptyList());
  ParseTree tree = parser.unaryTestsRoot();
  DirectCompilerResult directResult;
  if (listener.isError()) {
    directResult = CompiledFEELSupport.compiledErrorUnaryTest(listener.event().getMessage());
  } else {
    ASTBuilderVisitor v = new ASTBuilderVisitor(inputTypes);
    BaseNode node = v.visit(tree);
    BaseNode transformed = node.accept(new ASTUnaryTestTransform()).node();
    directResult = transformed.accept(new ASTCompilerVisitor());
  }
  Expression expr = directResult.getExpression();
  CompiledFEELUnaryTests cu = new CompilerBytecodeLoader().makeFromJPUnaryTestsExpression(input, expr, directResult.getFieldDeclarations());
  return cu;
}

origin: org.kie/kie-dmn-feel

private DirectCompilerResult getCompilerResult() {
  if (compiledExpression == null) {
    if (errorListener.isError()) {
      compiledExpression = CompiledFEELSupport.compiledErrorUnaryTest(
          errorListener.event().getMessage());
    } else {
      try {
        compiledExpression = ast.accept(new ASTCompilerVisitor());
      } catch (FEELCompilationError e) {
        compiledExpression = CompiledFEELSupport.compiledErrorUnaryTest(e.getMessage());
      }
    }
  }
  return compiledExpression;
}
origin: org.kie/kie-dmn-feel

public UnaryTestInterpretedExecutableExpression getInterpreted() {
  if (errorListener.isError()) {
    return UnaryTestInterpretedExecutableExpression.EMPTY;
  } else {
    return new UnaryTestInterpretedExecutableExpression(new CompiledExpressionImpl(ast));
  }
}
org.kie.dmn.feel.codegen.feel11CompiledFEELSupport$SyntaxErrorListener

Most used methods

  • event
  • isError
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now