Class ParserUtils

java.lang.Object
org.elasticsearch.xpack.esql.parser.ParserUtils

public final class ParserUtils extends Object
  • Field Details

  • Method Details

    • visit

      public static Object visit(Function<org.antlr.v4.runtime.tree.ParseTree,Object> visitor, org.antlr.v4.runtime.tree.ParseTree tree)
    • visitList

      public static <T> List<T> visitList(org.antlr.v4.runtime.tree.ParseTreeVisitor<?> visitor, List<? extends org.antlr.v4.runtime.ParserRuleContext> contexts, Class<T> clazz)
    • typedParsing

      public static <T> T typedParsing(org.antlr.v4.runtime.tree.ParseTreeVisitor<?> visitor, org.antlr.v4.runtime.tree.ParseTree ctx, Class<T> type)
    • source

      public static Source source(org.antlr.v4.runtime.tree.ParseTree ctx)
    • source

      public static Source source(org.antlr.v4.runtime.tree.TerminalNode terminalNode)
    • source

      public static Source source(org.antlr.v4.runtime.ParserRuleContext parserRuleContext)
    • source

      public static Source source(org.antlr.v4.runtime.Token token)
    • source

      public static Source source(org.antlr.v4.runtime.ParserRuleContext begin, org.antlr.v4.runtime.ParserRuleContext end)
    • source

      public static Source source(org.antlr.v4.runtime.tree.TerminalNode begin, org.antlr.v4.runtime.ParserRuleContext end)
    • source

      public static Source source(org.antlr.v4.runtime.Token start, org.antlr.v4.runtime.Token stop)
    • text

      public static String text(org.antlr.v4.runtime.tree.ParseTree node)
      Retrieves the raw text of the node (without interpreting it as a string literal).
    • nameOrPosition

      public static String nameOrPosition(org.antlr.v4.runtime.Token token)
      Extract the name or the position of an ES|QL parameter.
    • promqlNameOrPosition

      public static String promqlNameOrPosition(org.antlr.v4.runtime.Token token)
      Extract the name or the position of a PromQL parameter. Kept separate from nameOrPosition(org.antlr.v4.runtime.Token) since the two lexers assign independent token type IDs that can collide after grammar changes.
    • unquoteIdString

      public static String unquoteIdString(String quotedString)
    • quoteIdString

      public static String quoteIdString(String unquotedString)
    • buildStats

      public static ParserUtils.Stats buildStats(Source source, List<Expression> groupings, List<NamedExpression> aggregates)