public static void main(String[] args) throws Exception {
    boolean useFrame = false;
    Reader reader = new InputStreamReader(System.in);
    if (args.length > 0 && args[0].startsWith("-f")) {
      useFrame = true;
    }
    for (final String arg : args) {
      if (!arg.startsWith("-")) {
        reader = new StringReader(arg);
        System.out.println("Parsing: \"" + arg + "\"");
        break;
      }
    }
    OQLLexer lexer = new OQLLexer(reader);
    OQLParser parser = new OQLParser(lexer);
    // by default use Unsupported AST class, overridden for supported
    // operators in the grammer proper
    parser.setASTNodeClass("org.apache.geode.cache.query.internal.parse.ASTUnsupported");
    parser.queryProgram();
    AST t = parser.getAST();
    if (useFrame) {
      ASTFrame frame = new ASTFrame("OQL Example", t);
      frame.setVisible(true);
    } else {
      if (t == null) {
        System.out.println("AST is NULL");
      } else {
        System.out.println(t.toStringTree());
      }
    }
  }
Parse a query string. Gets the string from stdin unless cmd line has a string in it that
doesn't start with "-", in which case it parses that string instead. A cmd line arg that starts
with "-f" causes out put to be put into a GUI tree widget thingy; otherwise, the output is a
LISP-like string to stdout
geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/UtilParser.java