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

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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