Examples of CommonTree


Examples of org.antlr.runtime.tree.CommonTree

      Tree partspec = ast.getChild(childIndex);
      //sanity check
      if(partspec.getType() == HiveParser.TOK_PARTSPEC) {
        Map<String, String> partSpec = new LinkedHashMap<String, String>();
        for (int i = 0; i < partspec.getChildCount(); ++i) {
          CommonTree partspec_val = (CommonTree) partspec.getChild(i);
          String val = stripQuotes(partspec_val.getChild(1).getText());
          partSpec.put(partspec_val.getChild(0).getText(), val);
        }
        partSpecs.add(partSpec);
      }
    }
    return partSpecs;
View Full Code Here

Examples of org.antlr.runtime.tree.CommonTree

      Tree partSpecTree = ast.getChild(childIndex);
      if (partSpecTree.getType() == HiveParser.TOK_PARTSPEC) {
        PartitionSpec partSpec = new PartitionSpec();

        for (int i = 0; i < partSpecTree.getChildCount(); ++i) {
          CommonTree partSpecSingleKey = (CommonTree) partSpecTree.getChild(i);
          assert (partSpecSingleKey.getType() == HiveParser.TOK_PARTVAL);
          String key = partSpecSingleKey.getChild(0).getText().toLowerCase();
          String operator = partSpecSingleKey.getChild(1).getText();
          String val = partSpecSingleKey.getChild(2).getText();
          partSpec.addPredicate(key, operator, val);
        }

        partSpecList.add(partSpec);
      }
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.antlr.runtime.tree.CommonTree

                charStream = new ANTLRInputStream(inputStream);
            }
            JSONLexer lexer = new JSONLexer(charStream);
            TokenRewriteStream tokens = new TokenRewriteStream(lexer);
            ExtendedJSONParser parser = new ExtendedJSONParser(tokens, input, getErrorHandler());                
            CommonTree commonTree = (CommonTree) parser.message().getTree();
            parseRoot(commonTree);
            if(null != inputStream) {
                inputStream.close();
            }
        } catch(RecognitionException e) {
View Full Code Here

Examples of org.python.antlr.runtime.tree.CommonTree

        }
        AstList body = (AstList) defn.getBody();
        Object firstChildNode = body.get(0);
        String docNode = "";
        if (firstChildNode instanceof Expr) {
            CommonTree firstChild = ((Expr) firstChildNode).getNode();
            docNode = firstChild.toString();
        }
        String doc = "";
        if (docNode.startsWith("'''") && docNode.endsWith("'''")) {
            doc = docNode.substring(3, docNode.length() - 3);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.