org.apache.pig.tools.grunt
Class GruntParser

java.lang.Object
  extended by org.apache.pig.tools.pigscript.parser.PigScriptParser
      extended by org.apache.pig.tools.grunt.GruntParser
All Implemented Interfaces:
org.apache.pig.tools.pigscript.parser.PigScriptParserConstants

public class GruntParser
extends org.apache.pig.tools.pigscript.parser.PigScriptParser


Nested Class Summary
static class GruntParser.StreamPrinter
          StreamPrinter.
 
Field Summary
 
Fields inherited from class org.apache.pig.tools.pigscript.parser.PigScriptParser
jj_nt, mConsoleReader, mInteractive, token, token_source
 
Fields inherited from interface org.apache.pig.tools.pigscript.parser.PigScriptParserConstants
ALIASES, AS, BAG_CONSTANT, BRIEF, CAT, CD, COPY, COPYFROMLOCAL, COPYTOLOCAL, DEFAULT, DESCRIBE, DIGIT, DOT, DUMP, EOF, EOL, EXEC, EXPLAIN, FLOAT, FS, FSSPECIALCHAR, GENERATE, HELP, IDENTIFIER, ILLUSTRATE, IN_BLOCK, IN_COMMAND, IN_DOUBLE_QUOTED_STRING, IN_STRING, INTEGER, KILL, LETTER, LS, MKDIR, MOVE, MULTI_LINE_COMMENT, NUMBER, OUT, PARAM, PARAM_FILE, PATH, PIG, PIG_END, PIG_START, PWD, QUIT, QUOTE, QUOTEDSTRING, REGISTER, REMOVE, REMOVEFORCE, RUN, SCHEMA_DEFINITION, SCRIPT, SCRIPT_DONE, SEMICOLON, SET, SH, SINGLE_LINE_COMMENT, SPECIALCHAR, tokenImage, USING
 
Constructor Summary
GruntParser(InputStream stream)
           
GruntParser(InputStream stream, String encoding)
           
GruntParser(org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager tm)
           
GruntParser(Reader stream)
           
 
Method Summary
protected  void explainCurrentBatch()
           
protected  void explainCurrentBatch(boolean dontPrintOutput)
           
 boolean isDone()
           
 int[] parseStopOnError()
           
 int[] parseStopOnError(boolean sameBatch)
          Parses Pig commands in either interactive mode or batch mode.
protected  void printAliases()
           
protected  void printHelp()
           
protected  void processCat(String path)
           
protected  void processCD(String path)
           
protected  void processCopy(String src, String dst)
           
protected  void processCopyFromLocal(String src, String dst)
           
protected  void processCopyToLocal(String src, String dst)
           
protected  void processDescribe(String alias)
           
protected  void processDump(String alias)
           
protected  void processExplain(String alias, String script, boolean isVerbose, String format, String target, List<String> params, List<String> files)
           
protected  void processExplain(String alias, String script, boolean isVerbose, String format, String target, List<String> params, List<String> files, boolean dontPrintOutput)
           
protected  void processFsCommand(String[] cmdTokens)
           
protected  void processIllustrate(String alias)
           
protected  void processKill(String jobid)
           
protected  void processLS(String path)
           
protected  void processMkdir(String dir)
           
protected  void processMove(String src, String dst)
           
protected  void processPig(String cmd)
           
protected  void processPWD()
           
protected  void processRegister(String jar)
           
protected  void processRegister(String path, String scriptingLang, String namespace)
           
protected  void processRemove(String path, String options)
           
protected  void processScript(String script, boolean batch, List<String> params, List<String> files)
           
protected  void processSet(String key, String value)
           
protected  void processShCommand(String[] cmdTokens)
           
 void prompt()
           
protected  void quit()
           
 void setLoadOnly(boolean loadOnly)
           
 void setParams(PigServer pigServer)
           
 
Methods inherited from class org.apache.pig.tools.pigscript.parser.PigScriptParser
disable_tracing, enable_tracing, Explain, generateParseException, GetKey, getLineNumber, getNextToken, GetPath, GetReserved, getToken, GetValue, parse, ReInit, ReInit, ReInit, ReInit, Script, setConsoleReader, setInteractive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GruntParser

public GruntParser(Reader stream)

GruntParser

public GruntParser(InputStream stream,
                   String encoding)

GruntParser

public GruntParser(InputStream stream)

GruntParser

public GruntParser(org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager tm)
Method Detail

parseStopOnError

public int[] parseStopOnError()
                       throws IOException,
                              org.apache.pig.tools.pigscript.parser.ParseException
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

parseStopOnError

public int[] parseStopOnError(boolean sameBatch)
                       throws IOException,
                              org.apache.pig.tools.pigscript.parser.ParseException
Parses Pig commands in either interactive mode or batch mode. In interactive mode, executes the plan right away whenever a STORE command is encountered.

Throws:
IOException, - ParseException
IOException
org.apache.pig.tools.pigscript.parser.ParseException

setLoadOnly

public void setLoadOnly(boolean loadOnly)

setParams

public void setParams(PigServer pigServer)

prompt

public void prompt()
Specified by:
prompt in class org.apache.pig.tools.pigscript.parser.PigScriptParser

quit

protected void quit()
Specified by:
quit in class org.apache.pig.tools.pigscript.parser.PigScriptParser

isDone

public boolean isDone()

processDescribe

protected void processDescribe(String alias)
                        throws IOException
Specified by:
processDescribe in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processExplain

protected void processExplain(String alias,
                              String script,
                              boolean isVerbose,
                              String format,
                              String target,
                              List<String> params,
                              List<String> files)
                       throws IOException,
                              org.apache.pig.tools.pigscript.parser.ParseException
Specified by:
processExplain in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

processExplain

protected void processExplain(String alias,
                              String script,
                              boolean isVerbose,
                              String format,
                              String target,
                              List<String> params,
                              List<String> files,
                              boolean dontPrintOutput)
                       throws IOException,
                              org.apache.pig.tools.pigscript.parser.ParseException
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

explainCurrentBatch

protected void explainCurrentBatch()
                            throws IOException
Throws:
IOException

explainCurrentBatch

protected void explainCurrentBatch(boolean dontPrintOutput)
                            throws IOException
Throws:
IOException

printAliases

protected void printAliases()
                     throws IOException
Specified by:
printAliases in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processRegister

protected void processRegister(String jar)
                        throws IOException
Specified by:
processRegister in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processRegister

protected void processRegister(String path,
                               String scriptingLang,
                               String namespace)
                        throws IOException,
                               org.apache.pig.tools.pigscript.parser.ParseException
Specified by:
processRegister in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

processScript

protected void processScript(String script,
                             boolean batch,
                             List<String> params,
                             List<String> files)
                      throws IOException,
                             org.apache.pig.tools.pigscript.parser.ParseException
Specified by:
processScript in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

processSet

protected void processSet(String key,
                          String value)
                   throws IOException,
                          org.apache.pig.tools.pigscript.parser.ParseException
Specified by:
processSet in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException
org.apache.pig.tools.pigscript.parser.ParseException

processCat

protected void processCat(String path)
                   throws IOException
Specified by:
processCat in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processCD

protected void processCD(String path)
                  throws IOException
Specified by:
processCD in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processDump

protected void processDump(String alias)
                    throws IOException
Specified by:
processDump in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processIllustrate

protected void processIllustrate(String alias)
                          throws IOException
Specified by:
processIllustrate in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processKill

protected void processKill(String jobid)
                    throws IOException
Specified by:
processKill in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processLS

protected void processLS(String path)
                  throws IOException
Specified by:
processLS in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processPWD

protected void processPWD()
                   throws IOException
Specified by:
processPWD in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

printHelp

protected void printHelp()
Specified by:
printHelp in class org.apache.pig.tools.pigscript.parser.PigScriptParser

processMove

protected void processMove(String src,
                           String dst)
                    throws IOException
Specified by:
processMove in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processCopy

protected void processCopy(String src,
                           String dst)
                    throws IOException
Specified by:
processCopy in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processCopyToLocal

protected void processCopyToLocal(String src,
                                  String dst)
                           throws IOException
Specified by:
processCopyToLocal in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processCopyFromLocal

protected void processCopyFromLocal(String src,
                                    String dst)
                             throws IOException
Specified by:
processCopyFromLocal in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processMkdir

protected void processMkdir(String dir)
                     throws IOException
Specified by:
processMkdir in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processPig

protected void processPig(String cmd)
                   throws IOException
Specified by:
processPig in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processRemove

protected void processRemove(String path,
                             String options)
                      throws IOException
Specified by:
processRemove in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processFsCommand

protected void processFsCommand(String[] cmdTokens)
                         throws IOException
Specified by:
processFsCommand in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException

processShCommand

protected void processShCommand(String[] cmdTokens)
                         throws IOException
Specified by:
processShCommand in class org.apache.pig.tools.pigscript.parser.PigScriptParser
Throws:
IOException


Copyright © ${year} The Apache Software Foundation