MCPcopy Create free account
hub / github.com/apache/pig / parse

Method parse

test/org/apache/pig/parser/ParserTestingUtils.java:41–52  ·  view source on GitHub ↗
(String query)

Source from the content-addressed store, hash-verified

39 }
40
41 public static Tree parse(String query) throws IOException, RecognitionException, ParsingFailureException {
42 CommonTokenStream tokens = tokenize( query );
43 QueryParser parser = QueryParserUtils.createParser( tokens );
44 QueryParser.query_return result = parser.query();
45 Tree ast = (Tree)result.getTree();
46 TreePrinter.printTree( (CommonTree)ast, 0 );
47
48 if( 0 < parser.getNumberOfSyntaxErrors() )
49 throw new ParsingFailureException( QueryParser.class );
50
51 return ast;
52 }
53
54 public static Tree validateAst(String query)
55 throws RecognitionException, ParsingFailureException, IOException {

Callers 1

validateAstMethod · 0.95

Calls 3

tokenizeMethod · 0.95
createParserMethod · 0.95
printTreeMethod · 0.95

Tested by

no test coverage detected