Initial import into git.
[galago.git] / java / pig-galago / pig-galago.patch
blobd1eb51151afe03cea69355225ed1579b92eaaddf
1 diff -Naur pig-original/src/.svn/README.txt pig-galago/src/.svn/README.txt
2 --- pig-original/src/.svn/README.txt 2007-04-05 11:24:35.000000000 -0400
3 +++ pig-galago/src/.svn/README.txt 1969-12-31 19:00:00.000000000 -0500
4 @@ -1,2 +0,0 @@
5 -This is a Subversion working copy administrative directory.
6 -Visit http://subversion.tigris.org/ for more information.
7 diff -Naur pig-original/src/.svn/entries pig-galago/src/.svn/entries
8 --- pig-original/src/.svn/entries 2007-04-05 11:24:35.000000000 -0400
9 +++ pig-galago/src/.svn/entries 1969-12-31 19:00:00.000000000 -0500
10 @@ -1,17 +0,0 @@
11 -<?xml version="1.0" encoding="utf-8"?>
12 -<wc-entries
13 - xmlns="svn:">
14 -<entry
15 - committed-rev="1619"
16 - name=""
17 - committed-date="2007-04-05T15:23:39.957315Z"
18 - url="svn+ssh://research6/pig/trunk/pig/src.oss/src"
19 - last-author="breed"
20 - kind="dir"
21 - uuid="07b68ec7-261b-0410-92da-dbfe1b73ca74"
22 - repos="svn+ssh://research6"
23 - revision="1619"/>
24 -<entry
25 - name="com"
26 - kind="dir"/>
27 -</wc-entries>
28 diff -Naur pig-original/src/.svn/format pig-galago/src/.svn/format
29 --- pig-original/src/.svn/format 2007-04-05 11:24:35.000000000 -0400
30 +++ pig-galago/src/.svn/format 1969-12-31 19:00:00.000000000 -0500
31 @@ -1 +0,0 @@
33 diff -Naur pig-original/src/com/yahoo/pig/EvalFunc.java pig-galago/src/com/yahoo/pig/EvalFunc.java
34 --- pig-original/src/com/yahoo/pig/EvalFunc.java 2007-04-05 11:24:35.000000000 -0400
35 +++ pig-galago/src/com/yahoo/pig/EvalFunc.java 2007-08-31 09:54:55.000000000 -0400
36 @@ -25,10 +25,7 @@
37 // report that progress is being made (otherwise hadoop times out after 600 seconds working on one outer tuple)
38 protected void progress() {
39 if (PigMapReduce.reporter != null) {
40 - try {
41 - PigMapReduce.reporter.progress();
42 - } catch (IOException ignored) {
43 - }
44 + PigMapReduce.reporter.progress();
48 diff -Naur pig-original/src/com/yahoo/pig/PigServer.java pig-galago/src/com/yahoo/pig/PigServer.java
49 --- pig-original/src/com/yahoo/pig/PigServer.java 2007-04-05 11:24:35.000000000 -0400
50 +++ pig-galago/src/com/yahoo/pig/PigServer.java 2007-09-05 08:28:08.000000000 -0400
51 @@ -4,6 +4,7 @@
53 package com.yahoo.pig;
55 +import com.yahoo.pig.impl.galago.POGalago;
56 import java.io.IOException;
57 import java.io.InputStream;
58 import java.util.HashMap;
59 @@ -55,7 +56,11 @@
60 /**
61 * Use the Experimental Hadoop framework; not available yet.
63 - PIG
64 + PIG,
65 + /**
66 + * Use the Galago TupleFlow framework
67 + */
68 + GALAGO;
71 private static ExecType parseExecType(String str) throws IOException {
72 @@ -66,6 +71,7 @@
73 if (normStr.equals("mapred")) return ExecType.MAPREDUCE;
74 if (normStr.equals("pig")) return ExecType.PIG;
75 if (normStr.equals("pigbody")) return ExecType.PIG;
76 + if (normStr.equals("galago")) return ExecType.GALAGO;
78 throw new IOException("Unrecognized exec type: " + str);
80 @@ -314,8 +320,14 @@
81 IntermedResult readFrom = (IntermedResult) queryResults.get(id);
83 if (!readFrom.executed()) {
84 + if (pigContext.getExecType() == ExecType.GALAGO) {
85 + LogicalOperator root = readFrom.lp.root();
86 + LogicalOperator store = new LOStore( pigContext, root, filename, func, false );
87 + LogicalPlan lp = new LogicalPlan( store, pigContext );
88 + readFrom = new IntermedResult( lp );
89 + }
90 readFrom.compile(queryResults);
91 - if (pigContext.getExecType() != ExecType.LOCAL) {
92 + if (pigContext.getExecType() == ExecType.MAPREDUCE) {
93 POMapreduce pom = (POMapreduce)readFrom.pp.root;
94 if (func == null) {
95 pom.outputFile = filename;
96 diff -Naur pig-original/src/com/yahoo/pig/builtin/LOWER.java pig-galago/src/com/yahoo/pig/builtin/LOWER.java
97 --- pig-original/src/com/yahoo/pig/builtin/LOWER.java 1969-12-31 19:00:00.000000000 -0500
98 +++ pig-galago/src/com/yahoo/pig/builtin/LOWER.java 2007-09-06 13:22:47.000000000 -0400
99 @@ -0,0 +1,38 @@
101 + * LOWER
103 + * September 6, 2007 -- Trevor Strohman
105 + * BSD License (http://www.galagosearch.org/license)
106 + */
108 +package com.yahoo.pig.builtin;
110 +import com.yahoo.pig.BagEvalFunc;
111 +import com.yahoo.pig.data.DataCollector;
112 +import com.yahoo.pig.data.Tuple;
113 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaField;
114 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaItem;
115 +import com.yahoo.pig.impl.logicalLayer.schema.SchemaItemList;
116 +import java.io.IOException;
118 +/**
120 + * @author trevor
121 + */
122 +public class LOWER extends BagEvalFunc {
123 + @Override
124 + public void exec(Tuple input, DataCollector output) throws IOException {
125 + String str = input.getAtomField(0).strval();
126 + Tuple t = new Tuple(1);
127 + t.setField(0, str.toLowerCase());
128 + output.add(t);
131 + @Override
132 + public SchemaItem outputSchema() {
133 + SchemaItemList schema = new SchemaItemList();
134 + schema.add(new SchemaField("lower"));
135 + return schema;
138 diff -Naur pig-original/src/com/yahoo/pig/data/Tuple.java pig-galago/src/com/yahoo/pig/data/Tuple.java
139 --- pig-original/src/com/yahoo/pig/data/Tuple.java 2007-04-05 11:24:35.000000000 -0400
140 +++ pig-galago/src/com/yahoo/pig/data/Tuple.java 2007-09-04 15:38:01.000000000 -0400
141 @@ -314,8 +314,7 @@
142 public void readFields(DataInput in) throws IOException {
143 // nuke the old contents of the tuple
144 fields = new ArrayList<Datum>();
145 - byte[] b = new byte[1];
146 - in.readFully(b); // Skip the 'TUPLE'
147 + in.readByte(); // Skip the 'TUPLE'
148 readTuple(this, in);
151 @@ -327,10 +326,9 @@
153 private static void readTuple(Tuple ret, DataInput in) throws IOException {
154 int size = decodeInt(in);
155 - byte[] b = new byte[1];
156 for (int i = 0, n = size; i < n; i++) {
157 - in.readFully(b);
158 - switch (b[0]) {
159 + byte b = in.readByte();
160 + switch (b) {
161 case Tuple.TUPLE:
162 ret.fields.add(readTuple(in));
163 break;
164 diff -Naur pig-original/src/com/yahoo/pig/impl/eval/EvalItemList.java pig-galago/src/com/yahoo/pig/impl/eval/EvalItemList.java
165 --- pig-original/src/com/yahoo/pig/impl/eval/EvalItemList.java 2007-04-05 11:24:35.000000000 -0400
166 +++ pig-galago/src/com/yahoo/pig/impl/eval/EvalItemList.java 2007-09-06 13:22:37.000000000 -0400
167 @@ -289,7 +289,7 @@
168 //Since potentially can return without filling output, mark output as stale
169 //the exec method of CrossProductItem will mark output as not stale
170 output.markStale(true);
171 - while (pendingCrossProducts.peek().isReady()){
172 + while (pendingCrossProducts.size() > 0 && pendingCrossProducts.peek().isReady()){
173 pendingCrossProducts.remove().exec();
176 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/Driver.java pig-galago/src/com/yahoo/pig/impl/galago/Driver.java
177 --- pig-original/src/com/yahoo/pig/impl/galago/Driver.java 1969-12-31 19:00:00.000000000 -0500
178 +++ pig-galago/src/com/yahoo/pig/impl/galago/Driver.java 2007-09-11 14:52:10.000000000 -0400
179 @@ -0,0 +1,53 @@
181 + * Driver
183 + * September 5, 2007 -- Trevor Strohman
185 + * BSD License (http://www.galagosearch.org/license)
186 + */
188 +package com.yahoo.pig.impl.galago;
190 +import com.yahoo.pig.PigServer;
191 +import com.yahoo.pig.PigServer.ExecType;
192 +import java.io.BufferedReader;
193 +import java.io.FileInputStream;
194 +import java.io.FileNotFoundException;
195 +import java.io.FileReader;
196 +import java.io.IOException;
198 +/**
200 + * @author trevor
201 + */
202 +public class Driver {
203 + public static void main( String[] args ) throws FileNotFoundException, IOException, Exception {
204 + PigServer server = new PigServer( ExecType.GALAGO );
205 + BufferedReader reader = new BufferedReader( new FileReader( args[0] ) );
206 + String line;
208 + if( args.length != 3 ) {
209 + System.err.println( "usage: pigScriptName outputVariable outputFilename" );
210 + return;
213 + while( (line = reader.readLine()) != null ) {
214 + // skip comments
215 + if( line.startsWith( "#" ) ) {
216 + continue;
219 + try {
220 + server.registerQuery( line );
221 + } catch( Exception e ) {
222 + throw new Exception( "Problem in query line: " + line, e );
225 + reader.close();
227 + String outName = args[1];
228 + String outputFilename = args[2];
230 + server.store( outName, outputFilename );
233 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/EvalTuples.java pig-galago/src/com/yahoo/pig/impl/galago/EvalTuples.java
234 --- pig-original/src/com/yahoo/pig/impl/galago/EvalTuples.java 1969-12-31 19:00:00.000000000 -0500
235 +++ pig-galago/src/com/yahoo/pig/impl/galago/EvalTuples.java 2007-09-11 14:52:10.000000000 -0400
236 @@ -0,0 +1,54 @@
238 + * EvalTuples
240 + * September 1, 2007 -- Trevor Strohman
242 + * BSD License (http://www.galagosearch.org/license)
243 + */
245 +package com.yahoo.pig.impl.galago;
247 +import com.yahoo.pig.PigServer.ExecType;
248 +import com.yahoo.pig.data.DataCollector;
249 +import com.yahoo.pig.impl.PigContext;
250 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
251 +import galago.tupleflow.InputClass;
252 +import galago.tupleflow.OutputClass;
253 +import galago.tupleflow.StandardStep;
254 +import galago.tupleflow.TupleFlowParameters;
255 +import galago.tupleflow.execution.Verified;
256 +import java.io.IOException;
258 +/**
260 + * @author trevor
261 + */
263 +@Verified
264 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
265 +@OutputClass(className="com.yahoo.pig.impl.galago.Tuple")
266 +public class EvalTuples extends StandardStep<Tuple, Tuple> {
267 + PigContext context = new PigContext( ExecType.GALAGO ); // probably not the right option
268 + EvalSpecPipe evalSpecPipe;
269 + DataCollector collector;
271 + public EvalTuples( TupleFlowParameters parameters ) throws IOException {
272 + evalSpecPipe = new EvalSpecPipe( context, parameters.getXML().get( "spec" ) );
273 + collector = evalSpecPipe.collector( new EvalCollector() );
276 + private class EvalCollector extends DataCollector {
277 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
278 + if( t == null )
279 + return;
281 + Tuple next = new Tuple();
282 + next.copyFrom(t);
283 + processor.process( next );
287 + public void process( Tuple t ) throws IOException {
288 + collector.add(t);
291 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java pig-galago/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java
292 --- pig-original/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java 1969-12-31 19:00:00.000000000 -0500
293 +++ pig-galago/src/com/yahoo/pig/impl/galago/GalagoPlanCompiler.java 2007-09-11 14:52:10.000000000 -0400
294 @@ -0,0 +1,317 @@
296 + * GalagoPlanCompiler
298 + * September 1, 2007 -- Trevor Strohman
300 + * BSD License (http://www.galagosearch.org/license)
301 + */
303 +package com.yahoo.pig.impl.galago;
305 +import com.yahoo.pig.impl.PigContext;
306 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
307 +import com.yahoo.pig.impl.logicalLayer.LOCogroup;
308 +import com.yahoo.pig.impl.logicalLayer.LOEval;
309 +import com.yahoo.pig.impl.logicalLayer.LOLoad;
310 +import com.yahoo.pig.impl.logicalLayer.LORead;
311 +import com.yahoo.pig.impl.logicalLayer.LOStore;
312 +import com.yahoo.pig.impl.logicalLayer.LOUnion;
313 +import com.yahoo.pig.impl.logicalLayer.LogicalOperator;
314 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
315 +import com.yahoo.pig.impl.physicalLayer.PhysicalOperator;
316 +import com.yahoo.pig.impl.physicalLayer.PlanCompiler;
317 +import galago.tupleflow.Parameters;
318 +import galago.tupleflow.execution.Job;
319 +import galago.tupleflow.execution.JobConstructor.Connection;
320 +import galago.tupleflow.execution.JobConstructor.ConnectionAssignmentType;
321 +import galago.tupleflow.execution.JobConstructor.ConnectionEndPoint;
322 +import galago.tupleflow.execution.JobConstructor.ConnectionPointType;
323 +import galago.tupleflow.execution.JobConstructor.InputStep;
324 +import galago.tupleflow.execution.JobConstructor.OutputStep;
325 +import galago.tupleflow.execution.JobConstructor.Stage;
326 +import galago.tupleflow.execution.JobConstructor.StageConnectionPoint;
327 +import galago.tupleflow.execution.Step;
328 +import galago.tupleflow.Parameters.Value;
329 +import java.io.IOException;
330 +import java.util.ArrayList;
331 +import java.util.HashMap;
332 +import java.util.Map;
334 +/**
336 + * @author trevor
337 + */
338 +public class GalagoPlanCompiler extends PlanCompiler {
339 + PigContext pigContext;
340 + int stageCounter = 0;
341 + Job job = new Job();
342 + HashMap<String, String> outputToStage = new HashMap<String, String>();
343 + HashMap<String, Connection> connections = new HashMap<String, Connection>();
345 + public GalagoPlanCompiler( PigContext pigContext ) {
346 + super(pigContext);
348 + if( System.getProperty( "hashCount" ) != null )
349 + job.properties.put( "hashCount", System.getProperty("hashCount") );
352 + private Stage buildStage( String stageType ) {
353 + Stage s = new Stage();
354 + s.name = stageType + stageCounter;
355 + stageCounter++;
356 + job.stages.add(s);
357 + return s;
360 + private StageConnectionPoint buildPoint( ConnectionPointType type, String name ) {
361 + return new StageConnectionPoint( type,
362 + name,
363 + "com.yahoo.pig.impl.galago.Tuple",
364 + new String[0],
365 + null );
368 + private StageConnectionPoint buildOutput( String name ) {
369 + return buildPoint( ConnectionPointType.Output, name );
372 + private StageConnectionPoint buildInput( String name ) {
373 + return buildPoint( ConnectionPointType.Input, name );
374 + }
376 + private void storeOutputLookup( String aliasName, String stageName ) {
377 + outputToStage.put( aliasName, stageName );
380 + public void addLoadStage( LOLoad load ) {
381 + Stage splitStage = buildStage( "split" + load.alias );
382 + String splitAlias = load.alias + "$split";
384 + Parameters splitParameters = new Parameters();
385 + splitParameters.add( "filename", load.filename );
387 + Step splitGeneratorStep = new Step( null, "com.yahoo.pig.impl.galago.MakeReadSplits", splitParameters );
388 + splitStage.steps.add( splitGeneratorStep );
389 + splitStage.steps.add( new OutputStep( null, splitAlias ) );
390 + splitStage.connections.put( splitAlias, buildOutput( splitAlias ) );
391 + storeOutputLookup( splitAlias, splitStage.name );
393 + Stage loadStage = buildStage( "load" + load.alias );
395 + Parameters loadParameters = new Parameters();
396 + loadParameters.add( "function", load.lf.toString() );
398 + Step inputStep = new InputStep( null, splitAlias );
399 + Step loadStep = new Step( null, "com.yahoo.pig.impl.galago.ReadTuples", loadParameters );
400 + Step storeStep = new OutputStep( null, load.alias );
402 + loadStage.steps.add( inputStep );
403 + loadStage.steps.add(loadStep);
404 + loadStage.steps.add(storeStep);
405 + loadStage.connections.put( splitAlias, buildInput( splitAlias ) );
406 + loadStage.connections.put( load.alias, buildOutput( load.alias ) );
408 + storeOutputLookup( load.alias, loadStage.name );
409 + createHashedConnection( loadStage, splitAlias );
412 + private void addEvalStage(LOEval eval) {
413 + assert eval.inputs.length == 1;
414 + LogicalOperator input = eval.inputs[0];
415 + Stage evalStage = buildStage( "eval" + input.alias );
417 + Parameters evalParameters = new Parameters();
418 + evalParameters.add( "spec", eval.spec.toString() );
420 + Step inputStep = new InputStep( null, input.alias );
421 + Step evalStep = new Step( null, "com.yahoo.pig.impl.galago.EvalTuples", evalParameters );
422 + Step outputStep = new OutputStep( null, eval.alias );
424 + evalStage.steps.add( inputStep );
425 + evalStage.steps.add( evalStep );
426 + evalStage.steps.add( outputStep );
428 + evalStage.connections.put( input.alias, buildInput( input.alias ) );
429 + evalStage.connections.put( eval.alias, buildOutput( eval.alias ) );
431 + createEachConnection( evalStage, input.alias );
432 + storeOutputLookup( eval.alias, evalStage.name );
433 + connectNowhere( evalStage, eval.alias );
436 + private ConnectionEndPoint createConnectionInput( String source ) {
437 + assert outputToStage.containsKey( source );
438 + return new ConnectionEndPoint( null, outputToStage.get( source ), source, ConnectionPointType.Input );
441 + private ConnectionEndPoint createConnectionOutput( Stage destination, String source, String[] hash ) {
442 + ConnectionAssignmentType type = (hash != null ? ConnectionAssignmentType.Each : ConnectionAssignmentType.Combined);
443 + return createConnectionOutput( destination, source, hash, type );
446 + private ConnectionEndPoint createConnectionOutput( Stage destination, String source, String[] hash, ConnectionAssignmentType type ) {
447 + return new ConnectionEndPoint( null, destination.name, source, type, ConnectionPointType.Output );
450 + private void createEachConnection( Stage destination, String source ) {
451 + createConnection( destination, source, new String[0], null, ConnectionAssignmentType.Each );
454 + private void createCombinedConnection( Stage destination, String source ) {
455 + createConnection( destination, source, new String[0], null, ConnectionAssignmentType.Combined );
458 + private void createHashedConnection( Stage destination, String source ) {
459 + createConnection( destination, source, new String[0], new String[] { "+0" }, ConnectionAssignmentType.Each );
462 + private void createConnection( Stage destination, String source, String[] order, String[] hash, ConnectionAssignmentType type ) {
463 + assert outputToStage.containsKey( source ) : destination.name + " " + source;
465 + if( !connections.containsKey(source) ) {
466 + Connection c = new Connection( null, "com.yahoo.pig.impl.galago.Tuple", order, hash, -1 );
467 + c.inputs.add( createConnectionInput( source ) );
468 + connections.put( source, c );
471 + Connection connection = connections.get( source );
472 + connection.outputs.add( createConnectionOutput( destination, source, hash, type ) );
473 + job.connections.add( connection );
476 + private void connectNowhere( Stage outputStage, String outputPoint ) {
477 + // BUGBUG: should remove this method
478 + /*
479 + Connection connection = new Connection( null, "com.yahoo.pig.impl.galago.Tuple", new String[0], null, -1 );
480 + connection.inputs.add( new ConnectionEndPoint( null, outputStage.name, outputPoint, ConnectionPointType.Input ) );
481 + job.connections.add( connection );
482 + */
485 + private void addStoreStage(LOStore store) {
486 + Stage s = buildStage( "store" + store.alias );
487 + String inputName = store.inputs[0].alias;
488 + Parameters parameters = new Parameters();
490 + parameters.add( "filename", store.filename );
491 + parameters.add( "function", store.sf );
492 + Step inputStep = new InputStep( inputName );
493 + Step storeStep = new Step( null, "com.yahoo.pig.impl.galago.StoreTuples", parameters );
495 + s.steps.add( inputStep );
496 + s.steps.add( storeStep );
497 + s.connections.put( inputName, buildInput( inputName ) );
499 + createCombinedConnection( s, inputName );
502 + private void addGroupStage(LOCogroup group) {
503 + ArrayList<String> outputNames = new ArrayList();
505 + // Create one Map stage for each input to the COGROUP operator.
506 + // A COGROUP looks like:
507 + // COGROUP a by x, b by y, c by z
508 + // This COGROUP ends up being 3 different map stages, one for each input,
509 + // which performs the hashing, etc.
510 + // Then, there's a final Reduce stage that aligns all the similar tuples
511 + // and outputs the final tuple set.
513 + Parameters reduceParameters = new Parameters();
514 + ArrayList<Value> inputParamList = new ArrayList<Value>();
516 + for( int i=0; i<group.inputs.length; i++ ) {
517 + LogicalOperator input = group.inputs[i];
518 + GroupBySpec spec = group.specs[i];
520 + Stage inputStage = buildStage( "input" + input.alias );
521 + String outputName = "map$" + stageCounter + "$" + input.alias + "$" + group.alias;
522 + outputNames.add( outputName );
524 + inputStage.connections.put( input.alias, buildInput( input.alias ) );
525 + inputStage.connections.put( outputName, buildOutput( outputName ) );
526 + storeOutputLookup( outputName, inputStage.name );
528 + Parameters inputParameters = new Parameters();
529 + inputParameters.add( "group", spec.toString() );
531 + Step inputStep = new InputStep( null, input.alias );
532 + Step mapStep = new Step( null, "com.yahoo.pig.impl.galago.MapTuples", inputParameters );
533 + Step outputStep = new OutputStep( null, outputName );
535 + inputStage.steps.add( inputStep );
536 + inputStage.steps.add( mapStep );
537 + inputStage.steps.add( outputStep );
539 + createEachConnection( inputStage, input.alias );
541 + Value root = new Value();
542 + root.add( "name", outputName );
543 + root.add( "group", spec.toString() );
544 + inputParamList.add( root );
547 + Stage reduceStage = buildStage( "reduce" + group.alias );
548 + reduceParameters.add( "input", inputParamList );
549 + reduceParameters.add( "eval", "" );
551 + Step reduceStep = new Step( null, "com.yahoo.pig.impl.galago.JoinTuples", reduceParameters );
552 + Step outputStep = new OutputStep( null, group.alias );
554 + reduceStage.steps.add(reduceStep);
555 + reduceStage.steps.add(outputStep);
557 + // Connect the Map stages to the Reduce stage
558 + for( String outputName : outputNames ) {
559 + // This is the connection spec in the reduce stage
560 + reduceStage.connections.put( outputName, buildInput( outputName ) );
561 + // This builds the connection at the job level
562 + createHashedConnection( reduceStage, outputName );
565 + reduceStage.connections.put( group.alias, buildOutput( group.alias ) );
567 + storeOutputLookup( group.alias, reduceStage.name );
568 + connectNowhere( reduceStage, group.alias );
571 + private void addUnionStage(LOUnion lOUnion) {
572 + throw new UnsupportedOperationException("Not yet implemented");
575 + private void addReadStage( LORead read, Map queryResults ) throws IOException {
576 + IntermedResult intermediate = read.readFrom;
578 + if( !intermediate.compiled() ) {
579 + compile( intermediate.lp.root(), queryResults );
580 + intermediate.setCompiled( true );
584 + public PhysicalOperator compile(LogicalOperator lo, Map queryResults) throws IOException {
585 + // each compile stage just creates something in the job
586 + // that we can reference later.
587 + for( LogicalOperator input : lo.inputs )
588 + compile( input, queryResults );
590 + if (lo instanceof LOLoad) {
591 + addLoadStage( (LOLoad)lo );
592 + } else if(lo instanceof LORead) {
593 + LORead read = (LORead) lo;
594 + addReadStage( read, queryResults );
595 + } else if(lo instanceof LOStore) {
596 + LOStore store = (LOStore) lo;
597 + addStoreStage( store );
598 + } else if(lo instanceof LOEval) {
599 + LOEval eval = (LOEval)lo;
600 + addEvalStage( eval );
601 + } else if(lo instanceof LOCogroup) {
602 + addGroupStage( (LOCogroup)lo );
603 + } else if(lo instanceof LOUnion) {
604 + addUnionStage( (LOUnion)lo );
605 + } else {
606 + throw new IOException( "unknown logical operator type " + lo.getClass().getName() );
609 + return new POGalago( job );
612 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/JoinTuples.java pig-galago/src/com/yahoo/pig/impl/galago/JoinTuples.java
613 --- pig-original/src/com/yahoo/pig/impl/galago/JoinTuples.java 1969-12-31 19:00:00.000000000 -0500
614 +++ pig-galago/src/com/yahoo/pig/impl/galago/JoinTuples.java 2007-09-11 14:52:10.000000000 -0400
615 @@ -0,0 +1,173 @@
617 + * JoinTuples
619 + * September 3, 2007 -- Trevor Strohman
621 + * BSD License (http://www.galagosearch.org/license)
622 + */
624 +package com.yahoo.pig.impl.galago;
626 +import com.yahoo.pig.PigServer.ExecType;
627 +import com.yahoo.pig.data.BagFactory;
628 +import com.yahoo.pig.data.DataBag;
629 +import com.yahoo.pig.data.DataCollector;
630 +import com.yahoo.pig.data.Datum;
631 +import com.yahoo.pig.impl.PigContext;
632 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
633 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
634 +import galago.tupleflow.ExNihiloSource;
635 +import galago.tupleflow.IncompatibleProcessorException;
636 +import galago.tupleflow.Linkage;
637 +import galago.tupleflow.OutputClass;
638 +import galago.tupleflow.Parameters.Value;
639 +import galago.tupleflow.Processor;
640 +import galago.tupleflow.Step;
641 +import galago.tupleflow.TupleFlowParameters;
642 +import galago.tupleflow.TypeReader;
643 +import galago.tupleflow.execution.Verified;
644 +import java.io.IOException;
645 +import java.util.ArrayList;
646 +import java.util.List;
647 +import java.io.File;
649 +/**
651 + * @author trevor
652 + */
653 +@Verified
654 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
655 +public class JoinTuples implements ExNihiloSource<Tuple> {
657 + TypeReader[] readers;
658 + public Processor<Tuple> processor;
659 + PigContext context;
660 + DataCollector evalPipe;
661 + ArrayList<Input> inputs = new ArrayList<Input>();
663 + public class Input {
665 + public String name;
666 + public GroupBySpec group;
667 + public TypeReader<Tuple> reader;
668 + public Tuple top;
669 + public DataBag bag;
670 + public boolean isInner;
672 + public void read() throws IOException {
673 + top = reader.read();
677 + @SuppressWarnings("unchecked")
678 + public JoinTuples(TupleFlowParameters parameters) throws IOException {
679 + context = new PigContext(ExecType.GALAGO);
680 + // BUGBUG: probably need to freeze-dry the context
681 + String evalSpec = parameters.getXML().get("eval", "");
683 + List<Value> inputs = parameters.getXML().list("input");
684 + for (int i = 0; i < inputs.size(); i++) {
685 + Input input = new Input();
686 + input.name = inputs.get(i).get("name");
687 + String groupSpec = inputs.get(i).get("group");
688 + input.group = new GroupBySpec(context, groupSpec);
689 + input.isInner = input.group.isInner;
690 + input.top = null;
691 + input.bag = BagFactory.getInstance().getNewBag();
692 + input.reader = parameters.getTypeReader(input.name);
693 + this.inputs.add(input);
696 + evalPipe = (new EvalSpecPipe(context, evalSpec)).collector(new JoinCollector());
699 + public class JoinCollector extends DataCollector {
701 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
702 + if (t == null) {
703 + return;
705 + Tuple g = new Tuple();
706 + g.copyFrom(t);
707 + processor.process(g);
711 + public boolean isDone() {
712 + for (Input input : inputs) {
713 + if (input.top != null) {
714 + return false;
718 + return true;
721 + private void initializeTemporaryDirectory() {
722 + String temporary = System.getProperty( "java.io.tmpdir" );
723 + BagFactory.init( new File(temporary) );
726 + public void run() throws IOException {
727 + for (Input input : inputs) {
728 + input.read();
731 + initializeTemporaryDirectory();
733 + while (!isDone()) {
734 + // find the smallest tuple
735 + Datum groupName = null;
737 + for (Input input : inputs) {
738 + if (input.top != null) {
739 + Datum first = input.top.getField(0);
741 + if (groupName == null) {
742 + groupName = first;
743 + } else if (groupName.compareTo(first) < 0) {
744 + groupName = first;
749 + Tuple result = new Tuple(1 + inputs.size());
750 + result.setField(0, groupName);
752 + // now, add to the tuple
753 + for (int i = 0; i < inputs.size(); i++) {
754 + Input input = inputs.get(i);
755 + DataBag bag = BagFactory.getInstance().getNewBag();
757 + while (input.top != null && input.top.getField(0).equals(groupName)) {
758 + bag.add((com.yahoo.pig.data.Tuple) input.top.getField(1));
759 + input.read();
762 + input.bag = bag;
763 + result.setField(i + 1, bag);
766 + boolean usableTuple = true;
768 + for (int i = 0; i < inputs.size(); i++) {
769 + Input input = inputs.get(i);
771 + if (input.isInner && input.bag.isEmpty()) {
772 + usableTuple = false;
776 + if (usableTuple) {
777 + evalPipe.add(result);
778 + evalPipe.add(null);
782 + processor.close();
785 + public void setProcessor(Step step) throws IncompatibleProcessorException {
786 + Linkage.link(this, step);
789 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/MakeReadSplits.java pig-galago/src/com/yahoo/pig/impl/galago/MakeReadSplits.java
790 --- pig-original/src/com/yahoo/pig/impl/galago/MakeReadSplits.java 1969-12-31 19:00:00.000000000 -0500
791 +++ pig-galago/src/com/yahoo/pig/impl/galago/MakeReadSplits.java 2007-09-10 18:24:07.000000000 -0400
792 @@ -0,0 +1,73 @@
794 + * MakeReadSplits
796 + * September 7, 2007 -- Trevor Strohman
798 + * BSD License (http://www.galagosearch.org/license)
799 + */
801 +package com.yahoo.pig.impl.galago;
803 +import galago.tupleflow.ExNihiloSource;
804 +import galago.tupleflow.IncompatibleProcessorException;
805 +import galago.tupleflow.Linkage;
806 +import galago.tupleflow.OutputClass;
807 +import galago.tupleflow.Processor;
808 +import galago.tupleflow.Step;
809 +import galago.tupleflow.TupleFlowParameters;
810 +import galago.tupleflow.execution.Verified;
811 +import java.io.File;
812 +import java.util.List;
813 +import java.io.IOException;
815 +/**
817 + * @author trevor
818 + */
819 +@Verified
820 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
821 +public class MakeReadSplits implements ExNihiloSource<Tuple> {
823 + public Processor<Tuple> processor;
824 + public List<String> filenames;
825 + public long increment;
827 + /** Creates a new instance of MakeReadSplits */
828 + public MakeReadSplits(TupleFlowParameters parameters) {
829 + filenames = parameters.getXML().stringList("filename");
830 + increment = parameters.getXML().get("splitLength", 10 * 1024 * 1024);
833 + public void run() throws IOException {
834 + for (String filename : filenames) {
835 + if (filename.endsWith(".gz")) {
836 + // compressed files can't be split
837 + Tuple t = new Tuple(4);
838 + t.setField(0, filename + "-" + 0 + "-" + Long.MAX_VALUE);
839 + t.setField(1, filename);
840 + t.setField(2, 0);
841 + t.setField(3, Long.MAX_VALUE);
842 + } else {
843 + long fileLength = new File(filename).length();
845 + for (long start = 0; start < fileLength; start += increment) {
846 + long end = Math.min(fileLength, start + increment);
848 + Tuple t = new Tuple(4);
849 + t.setField(0, filename + "-" + start + "-" + end);
850 + t.setField(1, filename);
851 + t.setField(2, start);
852 + t.setField(3, end);
854 + processor.process(t);
859 + processor.close();
862 + public void setProcessor(Step next) throws IncompatibleProcessorException {
863 + Linkage.link(this, next);
866 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/MapTuples.java pig-galago/src/com/yahoo/pig/impl/galago/MapTuples.java
867 --- pig-original/src/com/yahoo/pig/impl/galago/MapTuples.java 1969-12-31 19:00:00.000000000 -0500
868 +++ pig-galago/src/com/yahoo/pig/impl/galago/MapTuples.java 2007-09-11 14:52:10.000000000 -0400
869 @@ -0,0 +1,69 @@
871 + * MapTuples
873 + * September 3, 2007 -- Trevor Strohman
875 + * BSD License (http://www.galagosearch.org/license)
876 + */
878 +package com.yahoo.pig.impl.galago;
880 +import com.yahoo.pig.PigServer.ExecType;
881 +import com.yahoo.pig.data.DataCollector;
882 +import com.yahoo.pig.data.Datum;
883 +import com.yahoo.pig.impl.PigContext;
884 +import com.yahoo.pig.impl.eval.EvalSpecPipe;
885 +import com.yahoo.pig.impl.eval.groupby.GroupBySpec;
886 +import galago.tupleflow.InputClass;
887 +import galago.tupleflow.OutputClass;
888 +import galago.tupleflow.StandardStep;
889 +import galago.tupleflow.TupleFlowParameters;
890 +import galago.tupleflow.execution.Verified;
891 +import java.io.IOException;
893 +/**
895 + * @author trevor
896 + */
898 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
899 +@OutputClass(className="com.yahoo.pig.impl.galago.Tuple")
900 +@Verified
901 +public class MapTuples extends StandardStep<Tuple, Tuple> {
902 + GroupBySpec group;
903 + EvalSpecPipe evalPipeSpec;
904 + DataCollector collector;
905 + PigContext context = new PigContext( ExecType.GALAGO );
907 + private class MapCollector extends DataCollector {
908 + public void add(com.yahoo.pig.data.Tuple t) throws IOException {
909 + if( t == null )
910 + return;
912 + Datum[] multGroups = group.eval(t);
914 + for( int i=0; i<multGroups.length; i++ ) {
915 + Datum key = multGroups[i];
916 + Tuple result = new Tuple();
918 + result.appendField(key);
919 + result.appendTuple(new Tuple(t));
920 + processor.process(result);
925 + public MapTuples( TupleFlowParameters parameters ) throws IOException {
926 + group = new GroupBySpec( context, parameters.getXML().get("group") );
927 + collector = new MapCollector();
930 + public void process(Tuple object) throws IOException {
931 + collector.add(object);
934 + public void close() throws IOException {
935 + collector.add(null);
936 + super.close();
939 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/POGalago.java pig-galago/src/com/yahoo/pig/impl/galago/POGalago.java
940 --- pig-original/src/com/yahoo/pig/impl/galago/POGalago.java 1969-12-31 19:00:00.000000000 -0500
941 +++ pig-galago/src/com/yahoo/pig/impl/galago/POGalago.java 2007-09-11 14:52:10.000000000 -0400
942 @@ -0,0 +1,89 @@
944 + * POGalago
946 + * September 1, 2007 -- Trevor Strohman
948 + * BSD License (http://www.galagosearch.org/license)
949 + */
951 +package com.yahoo.pig.impl.galago;
953 +import com.yahoo.pig.impl.physicalLayer.PhysicalOperator;
954 +import com.yahoo.pig.data.Tuple;
955 +import galago.tupleflow.Order;
956 +import galago.tupleflow.TypeReader;
957 +import galago.tupleflow.execution.ErrorStore;
958 +import galago.tupleflow.execution.Job;
959 +import galago.tupleflow.execution.JobExecutionContext;
960 +import galago.tupleflow.execution.LocalStageExecutor;
961 +import galago.tupleflow.execution.StageExecutor;
962 +import galago.tupleflow.execution.StageExecutorFactory;
963 +import java.io.IOException;
965 +/**
967 + * @author trevor
968 + */
969 +public class POGalago extends PhysicalOperator {
970 + Job job;
971 + JobExecutionContext context;
972 + String[] orderSpec;
973 + String dataSourceName;
974 + TypeReader<com.yahoo.pig.impl.galago.Tuple> tupleReader;
976 + String outputFilename;
977 + String outputFunction;
979 + /** Creates a new instance of POGalago */
980 + public POGalago( Job job, String dataSourceName, String[] orderSpec ) {
981 + this.job = job;
982 + this.dataSourceName = dataSourceName;
983 + this.orderSpec = orderSpec;
986 + public POGalago( Job job ) {
987 + this.job = job;
990 + public Tuple getNext() throws IOException {
991 + if( tupleReader != null )
992 + return tupleReader.read();
993 + return null;
996 + @Override
997 + public boolean open(boolean continueFromLast) throws IOException {
998 + if( !super.open(continueFromLast) )
999 + return false;
1001 + String temporaryStorage = System.getProperty( "gwd" );
1003 + if( temporaryStorage == null )
1004 + temporaryStorage = "/tmp/pig-galago";
1006 + String executorType = System.getProperty( "executorType" );
1008 + ErrorStore errorStore = new ErrorStore();
1009 + StageExecutor executor = StageExecutorFactory.newInstance( executorType );
1011 + job = JobExecutionContext.optimize(job);
1012 + System.out.println(job);
1013 + context = new JobExecutionContext( job, temporaryStorage, errorStore );
1014 + context.prepare();
1016 + try {
1017 + context.run( executor );
1018 + } catch( Exception e ) {
1019 + throw (IOException) new IOException( "Problems executing the Galago job." ).initCause(e);
1022 + executor.shutdown();
1023 + System.err.println( errorStore.toString() );
1024 + return true;
1027 + public void setOutput( String filename, String function ) {
1028 + outputFilename = filename;
1029 + outputFunction = function;
1032 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/ReadTuples.java pig-galago/src/com/yahoo/pig/impl/galago/ReadTuples.java
1033 --- pig-original/src/com/yahoo/pig/impl/galago/ReadTuples.java 1969-12-31 19:00:00.000000000 -0500
1034 +++ pig-galago/src/com/yahoo/pig/impl/galago/ReadTuples.java 2007-09-11 14:52:10.000000000 -0400
1035 @@ -0,0 +1,79 @@
1037 + * ReadTuples
1039 + * September 3, 2007 -- Trevor Strohman
1041 + * BSD License (http://www.galagosearch.org/license)
1042 + */
1044 +package com.yahoo.pig.impl.galago;
1046 +import com.yahoo.pig.PigServer.ExecType;
1047 +import com.yahoo.pig.StorageFunc;
1048 +import com.yahoo.pig.data.DataAtom;
1049 +import com.yahoo.pig.impl.PigContext;
1050 +import com.yahoo.pig.impl.io.FileLocalizer;
1051 +import galago.tupleflow.InputClass;
1052 +import galago.tupleflow.OutputClass;
1053 +import galago.tupleflow.StandardStep;
1054 +import galago.tupleflow.TupleFlowParameters;
1055 +import galago.tupleflow.execution.ErrorHandler;
1056 +import java.io.File;
1057 +import java.io.IOException;
1058 +import java.io.InputStream;
1059 +import java.lang.reflect.InvocationTargetException;
1060 +import java.util.zip.GZIPInputStream;
1062 +/**
1064 + * @author trevor
1065 + */
1067 +@InputClass(className = "com.yahoo.pig.impl.galago.Tuple")
1068 +@OutputClass(className = "com.yahoo.pig.impl.galago.Tuple")
1069 +public class ReadTuples extends StandardStep<Tuple, Tuple> {
1071 + String funcSpec;
1073 + /** Creates a new instance of ReadTuples */
1074 + public ReadTuples(TupleFlowParameters parameters) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
1075 + funcSpec = parameters.getXML().get("function");
1078 + public void process(Tuple t) throws IOException {
1079 + String filename = ((DataAtom) t.getField(1)).strval();
1080 + long offset = ((DataAtom) t.getField(2)).numval().longValue();
1081 + long end = ((DataAtom) t.getField(3)).numval().longValue();
1082 + StorageFunc function = null;
1084 + try {
1085 + function = (StorageFunc) PigContext.instantiateArgFunc(funcSpec);
1086 + } catch (Exception e) {
1087 + throw (IOException) new IOException( "Couldn't instantiate storage function" ).initCause(e);
1090 + InputStream stream = FileLocalizer.open(ExecType.LOCAL, filename);
1092 + if (filename.endsWith(".gz")) {
1093 + stream = new GZIPInputStream(stream);
1096 + stream.skip(offset);
1097 + function.bindTo(stream, offset, end);
1098 + com.yahoo.pig.data.Tuple tuple;
1100 + while ((tuple = function.getNext()) != null) {
1101 + Tuple wrapped = new Tuple();
1102 + wrapped.copyFrom(tuple);
1103 + processor.process(wrapped);
1106 + stream.close();
1109 + public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
1110 + if (!parameters.getXML().containsKey("function")) {
1111 + handler.addError("'function' is a required parameter of ReadTuples.");
1115 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/StoreTuples.java pig-galago/src/com/yahoo/pig/impl/galago/StoreTuples.java
1116 --- pig-original/src/com/yahoo/pig/impl/galago/StoreTuples.java 1969-12-31 19:00:00.000000000 -0500
1117 +++ pig-galago/src/com/yahoo/pig/impl/galago/StoreTuples.java 2007-09-11 14:52:10.000000000 -0400
1118 @@ -0,0 +1,50 @@
1120 + * StoreTuples
1122 + * September 5, 2007 -- Trevor Strohman
1124 + * BSD License (http://www.galagosearch.org/license)
1125 + */
1127 +package com.yahoo.pig.impl.galago;
1129 +import com.yahoo.pig.StorageFunc;
1130 +import com.yahoo.pig.impl.PigContext;
1131 +import galago.tupleflow.InputClass;
1132 +import galago.tupleflow.Processor;
1133 +import galago.tupleflow.TupleFlowParameters;
1134 +import galago.tupleflow.execution.Verified;
1135 +import java.io.BufferedWriter;
1136 +import java.io.FileWriter;
1137 +import java.io.IOException;
1138 +import java.lang.reflect.InvocationTargetException;
1140 +/**
1142 + * @author trevor
1143 + */
1144 +@Verified
1145 +@InputClass(className="com.yahoo.pig.impl.galago.Tuple")
1146 +public class StoreTuples implements Processor<Tuple> {
1147 + BufferedWriter writer;
1148 + StorageFunc function;
1150 + /** Creates a new instance of StoreTuples */
1151 + public StoreTuples( TupleFlowParameters parameters ) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
1152 + String filename = parameters.getXML().get( "filename" );
1153 + String funcSpec = parameters.getXML().get( "function" );
1155 + function = (StorageFunc) PigContext.instantiateArgFunc(funcSpec);
1156 + writer = new BufferedWriter( new FileWriter( filename ) );
1159 + public void process( Tuple tuple ) throws IOException {
1160 + String result = tuple.toDelimitedString( "\t" );
1161 + writer.append( result );
1162 + writer.append( "\n" );
1165 + public void close() throws IOException {
1166 + writer.close();
1169 diff -Naur pig-original/src/com/yahoo/pig/impl/galago/Tuple.java pig-galago/src/com/yahoo/pig/impl/galago/Tuple.java
1170 --- pig-original/src/com/yahoo/pig/impl/galago/Tuple.java 1969-12-31 19:00:00.000000000 -0500
1171 +++ pig-galago/src/com/yahoo/pig/impl/galago/Tuple.java 2007-09-11 14:52:10.000000000 -0400
1172 @@ -0,0 +1,225 @@
1174 + * Tuple
1176 + * September 1, 2007 -- Trevor Strohman
1178 + * BSD License (http://www.galagosearch.org/license)
1179 + */
1181 +package com.yahoo.pig.impl.galago;
1183 +import galago.tupleflow.ArrayInput;
1184 +import galago.tupleflow.ArrayOutput;
1185 +import galago.tupleflow.ExNihiloSource;
1186 +import galago.tupleflow.IncompatibleProcessorException;
1187 +import galago.tupleflow.Linkage;
1188 +import galago.tupleflow.Order;
1189 +import galago.tupleflow.Processor;
1190 +import galago.tupleflow.ReaderSource;
1191 +import galago.tupleflow.Step;
1192 +import galago.tupleflow.Type;
1193 +import galago.tupleflow.TypeReader;
1194 +import java.io.EOFException;
1195 +import java.io.IOException;
1196 +import java.util.Collection;
1197 +import java.util.Comparator;
1198 +import java.util.PriorityQueue;
1200 +/**
1202 + * @author trevor
1203 + */
1204 +public class Tuple extends com.yahoo.pig.data.Tuple
1205 + implements Type<Tuple> {
1206 + public Tuple() {
1207 + super();
1210 + public Tuple(int fieldCount) {
1211 + super(fieldCount);
1214 + public Tuple(com.yahoo.pig.data.Tuple t) {
1215 + super(t);
1218 + public Order<Tuple> getOrder(String... fields) {
1219 + return new TupleOrder( fields );
1222 + public static class TupleOrder implements Order<Tuple> {
1223 + public TupleOrder( String[] orderSpec ) {
1226 + public Class<Tuple> getOrderedClass() {
1227 + return Tuple.class;
1230 + public int hash(Tuple tuple) {
1231 + return tuple.fields.get(0).hashCode();
1234 + public Comparator<Tuple> lessThan() {
1235 + return new Comparator<Tuple>() {
1236 + public int compare( Tuple one, Tuple two ) {
1237 + return one.compareTo(two);
1239 + };
1242 + public Comparator<Tuple> greaterThan() {
1243 + return new Comparator<Tuple>() {
1244 + public int compare( Tuple one, Tuple two ) {
1245 + return -one.compareTo(two);
1247 + };
1250 + public ReaderSource<Tuple> orderedCombiner( final Collection<TypeReader<Tuple>> readers, final boolean closeOnExit) {
1251 + return new TupleOrderedCombiner( readers, closeOnExit );
1254 + public static class TupleOrderedCombiner implements ReaderSource<Tuple> {
1255 + public Processor<Tuple> processor;
1256 + public Collection<TypeReader<Tuple>> readers;
1257 + public PriorityQueue<ReaderIterator> iterators;
1258 + public boolean closeOnExit;
1259 + public boolean uninitialized;
1261 + public TupleOrderedCombiner( Collection<TypeReader<Tuple>> readers, boolean closeOnExit ) {
1262 + this.readers = readers;
1263 + this.closeOnExit = closeOnExit;
1264 + this.iterators = new PriorityQueue<ReaderIterator>();
1265 + this.uninitialized = true;
1268 + public static class ReaderIterator implements Comparable<ReaderIterator> {
1269 + public Tuple top;
1270 + public TypeReader<Tuple> reader;
1272 + public ReaderIterator( TypeReader<Tuple> reader ) throws IOException {
1273 + this.reader = reader;
1274 + read();
1277 + public boolean isDone() {
1278 + return top == null;
1281 + public Tuple read() throws IOException {
1282 + top = reader.read();
1283 + return top;
1286 + public int compareTo( ReaderIterator other ) {
1287 + return top.compareTo( other.top );
1291 + public Tuple read() throws IOException {
1292 + if( uninitialized ) {
1293 + for( TypeReader<Tuple> reader : readers ) {
1294 + ReaderIterator iterator = new ReaderIterator( reader );
1296 + if( iterator.top != null ) {
1297 + iterators.add( iterator );
1300 + uninitialized = false;
1303 + Tuple result = null;
1305 + if( iterators.size() > 0 ) {
1306 + ReaderIterator iterator = iterators.poll();
1307 + result = iterator.top;
1309 + if( iterator.read() != null )
1310 + iterators.offer( iterator );
1313 + return result;
1316 + public void run() throws IOException {
1317 + for( TypeReader<Tuple> reader : readers ) {
1318 + ReaderIterator iterator = new ReaderIterator( reader );
1320 + if( iterator.top != null ) {
1321 + iterators.add( iterator );
1325 + while( iterators.size() > 0 ) {
1326 + ReaderIterator iterator = iterators.poll();
1327 + processor.process( iterator.top );
1329 + if( iterator.read() != null ) {
1330 + iterators.offer( iterator );
1334 + if( closeOnExit )
1335 + processor.close();
1338 + public void setProcessor( Step step ) throws IncompatibleProcessorException {
1339 + Linkage.link(this,step);
1343 + public Processor<Tuple> orderedWriter( final ArrayOutput output ) {
1344 + return new Processor<Tuple>() {
1345 + public void process( Tuple t ) throws IOException {
1346 + t.write( output.getDataOutput() );
1349 + public void close() {}
1350 + };
1353 + public TypeReader<Tuple> orderedReader(final ArrayInput input) {
1354 + return new TupleOrderedReader( input );
1357 + public TypeReader<Tuple> orderedReader(ArrayInput input, int bufferSize) {
1358 + return orderedReader(input);
1361 + public static class TupleOrderedReader implements TypeReader<Tuple> {
1362 + public Processor<Tuple> processor;
1363 + public ArrayInput input;
1365 + public TupleOrderedReader( ArrayInput input ) {
1366 + this.input = input;
1369 + public Tuple read() throws IOException {
1370 + try {
1371 + Tuple t = new Tuple();
1372 + t.readFields( input.getDataInput() );
1373 + return t;
1374 + } catch( EOFException e ) {
1375 + return null;
1379 + public void run() throws IOException {
1380 + while(true) {
1381 + Tuple t = read();
1383 + if( t == null )
1384 + break;
1386 + processor.process( t );
1389 + processor.close();
1392 + public void setProcessor(Step step) throws IncompatibleProcessorException {
1393 + Linkage.link( this, step );
1396 + }
1398 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java
1399 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java 1969-12-31 19:00:00.000000000 -0500
1400 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java 2007-08-31 09:41:35.000000000 -0400
1401 @@ -0,0 +1,123 @@
1402 +/* Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/JJTQueryParserState.java */
1404 +package com.yahoo.pig.impl.logicalLayer.parser;
1406 +class JJTQueryParserState {
1407 + private java.util.Stack nodes;
1408 + private java.util.Stack marks;
1410 + private int sp; // number of nodes on stack
1411 + private int mk; // current mark
1412 + private boolean node_created;
1414 + JJTQueryParserState() {
1415 + nodes = new java.util.Stack();
1416 + marks = new java.util.Stack();
1417 + sp = 0;
1418 + mk = 0;
1421 + /* Determines whether the current node was actually closed and
1422 + pushed. This should only be called in the final user action of a
1423 + node scope. */
1424 + boolean nodeCreated() {
1425 + return node_created;
1428 + /* Call this to reinitialize the node stack. It is called
1429 + automatically by the parser's ReInit() method. */
1430 + void reset() {
1431 + nodes.removeAllElements();
1432 + marks.removeAllElements();
1433 + sp = 0;
1434 + mk = 0;
1437 + /* Returns the root node of the AST. It only makes sense to call
1438 + this after a successful parse. */
1439 + Node rootNode() {
1440 + return (Node)nodes.elementAt(0);
1443 + /* Pushes a node on to the stack. */
1444 + void pushNode(Node n) {
1445 + nodes.push(n);
1446 + ++sp;
1449 + /* Returns the node on the top of the stack, and remove it from the
1450 + stack. */
1451 + Node popNode() {
1452 + if (--sp < mk) {
1453 + mk = ((Integer)marks.pop()).intValue();
1455 + return (Node)nodes.pop();
1458 + /* Returns the node currently on the top of the stack. */
1459 + Node peekNode() {
1460 + return (Node)nodes.peek();
1463 + /* Returns the number of children on the stack in the current node
1464 + scope. */
1465 + int nodeArity() {
1466 + return sp - mk;
1470 + void clearNodeScope(Node n) {
1471 + while (sp > mk) {
1472 + popNode();
1474 + mk = ((Integer)marks.pop()).intValue();
1478 + void openNodeScope(Node n) {
1479 + marks.push(new Integer(mk));
1480 + mk = sp;
1481 + n.jjtOpen();
1485 + /* A definite node is constructed from a specified number of
1486 + children. That number of nodes are popped from the stack and
1487 + made the children of the definite node. Then the definite node
1488 + is pushed on to the stack. */
1489 + void closeNodeScope(Node n, int num) {
1490 + mk = ((Integer)marks.pop()).intValue();
1491 + while (num-- > 0) {
1492 + Node c = popNode();
1493 + c.jjtSetParent(n);
1494 + n.jjtAddChild(c, num);
1496 + n.jjtClose();
1497 + pushNode(n);
1498 + node_created = true;
1502 + /* A conditional node is constructed if its condition is true. All
1503 + the nodes that have been pushed since the node was opened are
1504 + made children of the the conditional node, which is then pushed
1505 + on to the stack. If the condition is false the node is not
1506 + constructed and they are left on the stack. */
1507 + void closeNodeScope(Node n, boolean condition) {
1508 + if (condition) {
1509 + int a = nodeArity();
1510 + mk = ((Integer)marks.pop()).intValue();
1511 + while (a-- > 0) {
1512 + Node c = popNode();
1513 + c.jjtSetParent(n);
1514 + n.jjtAddChild(c, a);
1516 + n.jjtClose();
1517 + pushNode(n);
1518 + node_created = true;
1519 + } else {
1520 + mk = ((Integer)marks.pop()).intValue();
1521 + node_created = false;
1525 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java
1526 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java 1969-12-31 19:00:00.000000000 -0500
1527 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Node.java 2007-08-31 09:41:35.000000000 -0400
1528 @@ -0,0 +1,34 @@
1529 +/* Generated By:JJTree: Do not edit this line. Node.java */
1531 +package com.yahoo.pig.impl.logicalLayer.parser;
1533 +/* All AST nodes must implement this interface. It provides basic
1534 + machinery for constructing the parent and child relationships
1535 + between nodes. */
1537 +public interface Node {
1539 + /** This method is called after the node has been made the current
1540 + node. It indicates that child nodes can now be added to it. */
1541 + public void jjtOpen();
1543 + /** This method is called after all the child nodes have been
1544 + added. */
1545 + public void jjtClose();
1547 + /** This pair of methods are used to inform the node of its
1548 + parent. */
1549 + public void jjtSetParent(Node n);
1550 + public Node jjtGetParent();
1552 + /** This method tells the node to add its argument to the node's
1553 + list of children. */
1554 + public void jjtAddChild(Node n, int i);
1556 + /** This method returns a child node. The children are numbered
1557 + from zero, left to right. */
1558 + public Node jjtGetChild(int i);
1560 + /** Return the number of children the node has. */
1561 + public int jjtGetNumChildren();
1563 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java
1564 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java 1969-12-31 19:00:00.000000000 -0500
1565 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/ParseException.java 2007-08-31 09:41:35.000000000 -0400
1566 @@ -0,0 +1,192 @@
1567 +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
1568 +package com.yahoo.pig.impl.logicalLayer.parser;
1570 +/**
1571 + * This exception is thrown when parse errors are encountered.
1572 + * You can explicitly create objects of this exception type by
1573 + * calling the method generateParseException in the generated
1574 + * parser.
1576 + * You can modify this class to customize your error reporting
1577 + * mechanisms so long as you retain the public fields.
1578 + */
1579 +public class ParseException extends Exception {
1581 + /**
1582 + * This constructor is used by the method "generateParseException"
1583 + * in the generated parser. Calling this constructor generates
1584 + * a new object of this type with the fields "currentToken",
1585 + * "expectedTokenSequences", and "tokenImage" set. The boolean
1586 + * flag "specialConstructor" is also set to true to indicate that
1587 + * this constructor was used to create this object.
1588 + * This constructor calls its super class with the empty string
1589 + * to force the "toString" method of parent class "Throwable" to
1590 + * print the error message in the form:
1591 + * ParseException: <result of getMessage>
1592 + */
1593 + public ParseException(Token currentTokenVal,
1594 + int[][] expectedTokenSequencesVal,
1595 + String[] tokenImageVal
1598 + super("");
1599 + specialConstructor = true;
1600 + currentToken = currentTokenVal;
1601 + expectedTokenSequences = expectedTokenSequencesVal;
1602 + tokenImage = tokenImageVal;
1605 + /**
1606 + * The following constructors are for use by you for whatever
1607 + * purpose you can think of. Constructing the exception in this
1608 + * manner makes the exception behave in the normal way - i.e., as
1609 + * documented in the class "Throwable". The fields "errorToken",
1610 + * "expectedTokenSequences", and "tokenImage" do not contain
1611 + * relevant information. The JavaCC generated code does not use
1612 + * these constructors.
1613 + */
1615 + public ParseException() {
1616 + super();
1617 + specialConstructor = false;
1620 + public ParseException(String message) {
1621 + super(message);
1622 + specialConstructor = false;
1625 + /**
1626 + * This variable determines which constructor was used to create
1627 + * this object and thereby affects the semantics of the
1628 + * "getMessage" method (see below).
1629 + */
1630 + protected boolean specialConstructor;
1632 + /**
1633 + * This is the last token that has been consumed successfully. If
1634 + * this object has been created due to a parse error, the token
1635 + * followng this token will (therefore) be the first error token.
1636 + */
1637 + public Token currentToken;
1639 + /**
1640 + * Each entry in this array is an array of integers. Each array
1641 + * of integers represents a sequence of tokens (by their ordinal
1642 + * values) that is expected at this point of the parse.
1643 + */
1644 + public int[][] expectedTokenSequences;
1646 + /**
1647 + * This is a reference to the "tokenImage" array of the generated
1648 + * parser within which the parse error occurred. This array is
1649 + * defined in the generated ...Constants interface.
1650 + */
1651 + public String[] tokenImage;
1653 + /**
1654 + * This method has the standard behavior when this object has been
1655 + * created using the standard constructors. Otherwise, it uses
1656 + * "currentToken" and "expectedTokenSequences" to generate a parse
1657 + * error message and returns it. If this object has been created
1658 + * due to a parse error, and you do not catch it (it gets thrown
1659 + * from the parser), then this method is called during the printing
1660 + * of the final stack trace, and hence the correct error message
1661 + * gets displayed.
1662 + */
1663 + public String getMessage() {
1664 + if (!specialConstructor) {
1665 + return super.getMessage();
1667 + StringBuffer expected = new StringBuffer();
1668 + int maxSize = 0;
1669 + for (int i = 0; i < expectedTokenSequences.length; i++) {
1670 + if (maxSize < expectedTokenSequences[i].length) {
1671 + maxSize = expectedTokenSequences[i].length;
1673 + for (int j = 0; j < expectedTokenSequences[i].length; j++) {
1674 + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
1676 + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
1677 + expected.append("...");
1679 + expected.append(eol).append(" ");
1681 + String retval = "Encountered \"";
1682 + Token tok = currentToken.next;
1683 + for (int i = 0; i < maxSize; i++) {
1684 + if (i != 0) retval += " ";
1685 + if (tok.kind == 0) {
1686 + retval += tokenImage[0];
1687 + break;
1689 + retval += add_escapes(tok.image);
1690 + tok = tok.next;
1692 + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
1693 + retval += "." + eol;
1694 + if (expectedTokenSequences.length == 1) {
1695 + retval += "Was expecting:" + eol + " ";
1696 + } else {
1697 + retval += "Was expecting one of:" + eol + " ";
1699 + retval += expected.toString();
1700 + return retval;
1703 + /**
1704 + * The end of line string for this machine.
1705 + */
1706 + protected String eol = System.getProperty("line.separator", "\n");
1708 + /**
1709 + * Used to convert raw characters to their escaped version
1710 + * when these raw version cannot be used as part of an ASCII
1711 + * string literal.
1712 + */
1713 + protected String add_escapes(String str) {
1714 + StringBuffer retval = new StringBuffer();
1715 + char ch;
1716 + for (int i = 0; i < str.length(); i++) {
1717 + switch (str.charAt(i))
1719 + case 0 :
1720 + continue;
1721 + case '\b':
1722 + retval.append("\\b");
1723 + continue;
1724 + case '\t':
1725 + retval.append("\\t");
1726 + continue;
1727 + case '\n':
1728 + retval.append("\\n");
1729 + continue;
1730 + case '\f':
1731 + retval.append("\\f");
1732 + continue;
1733 + case '\r':
1734 + retval.append("\\r");
1735 + continue;
1736 + case '\"':
1737 + retval.append("\\\"");
1738 + continue;
1739 + case '\'':
1740 + retval.append("\\\'");
1741 + continue;
1742 + case '\\':
1743 + retval.append("\\\\");
1744 + continue;
1745 + default:
1746 + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
1747 + String s = "0000" + Integer.toString(ch, 16);
1748 + retval.append("\\u" + s.substring(s.length() - 4, s.length()));
1749 + } else {
1750 + retval.append(ch);
1752 + continue;
1755 + return retval.toString();
1759 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java
1760 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java 1969-12-31 19:00:00.000000000 -0500
1761 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.java 2007-08-31 09:41:35.000000000 -0400
1762 @@ -0,0 +1,5111 @@
1763 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParser.java */
1764 +package com.yahoo.pig.impl.logicalLayer.parser;
1765 +import java.io.*;
1766 +import java.util.*;
1767 +import java.lang.reflect.*;
1768 +import com.yahoo.pig.impl.logicalLayer.*;
1769 +import com.yahoo.pig.impl.eval.*;
1770 +import com.yahoo.pig.impl.eval.func.*;
1771 +import com.yahoo.pig.impl.eval.groupby.*;
1772 +import com.yahoo.pig.impl.eval.filter.*;
1773 +import com.yahoo.pig.impl.eval.window.*;
1774 +import com.yahoo.pig.impl.eval.sad.*;
1775 +import com.yahoo.pig.impl.logicalLayer.schema.*;
1776 +import com.yahoo.pig.*;
1777 +import com.yahoo.pig.impl.PigContext;
1778 +import com.yahoo.pig.PigServer.ExecType;
1779 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
1780 +import com.yahoo.pig.impl.io.FileLocalizer;
1781 +import com.yahoo.pig.builtin.*;
1782 +public class QueryParser/*@bgen(jjtree)*/implements QueryParserTreeConstants, QueryParserConstants {/*@bgen(jjtree)*/
1783 + protected JJTQueryParserState jjtree = new JJTQueryParserState();private PigContext pigContext;
1784 + private Map<String, IntermedResult> aliases;
1786 + public QueryParser(InputStream in, PigContext pigContext, Map aliases) {
1787 + this(in);
1788 + this.pigContext = pigContext;
1789 + this.aliases = aliases;
1792 + public class EvalSpecPipeAndSchema{
1793 + EvalSpecPipe pipe;
1794 + SchemaItemList schema;
1797 + public class CogroupInput {
1798 + public LogicalOperator op;
1799 + public GroupBySpec spec;
1802 + static String unquote(String s) {
1803 + return s.substring(1, s.length()-1);
1806 + static int undollar(String s) {
1807 + return Integer.parseInt(s.substring(1, s.length()));
1810 + NestableEvalItem newFuncEvalItem(EvalFunc func, EvalItemList args) throws ParseException {
1811 + if (func instanceof AtomEvalFunc) return new AtomFuncEvalItem(pigContext, (AtomEvalFunc) func, args);
1812 + else if (func instanceof TupleEvalFunc) return new TupleFuncEvalItem(pigContext, (TupleEvalFunc) func, args);
1813 + else if (func instanceof BagEvalFunc) return new BagFuncEvalItem(pigContext, (BagEvalFunc) func, args);
1814 + else throw new ParseException("Error: unknown Eval Function type: " + func.getClass().getName());
1818 + LogicalOperator makeLORead(String alias) throws ParseException {
1819 + if (!aliases.containsKey(alias)) throw new ParseException("Unrecognized alias: " + alias);
1821 + LORead readOp = new LORead(pigContext, aliases.get(alias));
1822 + readOp.alias = alias;
1823 + return readOp;
1828 + String massageFilename(String filename) throws IOException {
1829 + if (pigContext.getExecType() != ExecType.LOCAL) {
1830 + if (filename.startsWith(FileLocalizer.LOCAL_PREFIX)) {
1831 + filename = FileLocalizer.hadoopify(filename);
1832 + } else {
1833 + if (filename.startsWith(FileLocalizer.HADOOP_PREFIX)) {
1834 + filename = filename.substring(FileLocalizer.HADOOP_PREFIX.length());
1839 + return filename;
1842 + LogicalOperator parseCogroup(ArrayList<CogroupInput> gis) throws ParseException{
1843 + int n = gis.size();
1845 + LogicalOperator[] los = new LogicalOperator[n];
1846 + GroupBySpec[] specs = new GroupBySpec[n];
1848 + for (int i = 0; i < n ; i++){
1850 + CogroupInput gi = gis.get(i);
1851 + los[i] = gi.op;
1852 + specs[i] = gi.spec;
1855 + return new LOCogroup(pigContext, los, specs);
1859 + LogicalOperator rewriteCross(ArrayList<LogicalOperator> inputs) throws IOException, ParseException{
1860 + ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
1861 + Iterator<LogicalOperator> iter = inputs.iterator();
1862 + int n = inputs.size();
1864 + EvalSpecPipe pipe = new EvalSpecPipe(pigContext);
1865 + EvalItemList list = new EvalItemList(pigContext);
1866 + pipe.add(list);
1867 + for (int i=0; i< n; i++){
1869 + CogroupInput gi = new CogroupInput();
1870 + gis.add(gi);
1872 + gi.op = inputs.get(i);
1873 + EvalItemList itemList = new EvalItemList(pigContext);
1874 + itemList.add(new ConstEvalItem(pigContext, n+""));
1875 + itemList.add(new ConstEvalItem(pigContext, i+""));
1876 + gi.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFCross.class.getName()), itemList, false);
1878 + ColEvalItem item = new ColEvalItem(pigContext, i+1);
1879 + EvalItemList subSpec = new EvalItemList(pigContext);
1880 + subSpec.add(new StarEvalItem(pigContext));
1881 + item.subColSpec = subSpec;
1883 + list.add(item);
1886 + return new LOEval(pigContext, parseCogroup(gis),pipe);
1889 + LOLoad getDefaultLoadOperator(boolean continuous, String filename) throws IOException{
1891 + String[] args = null;
1892 + /*
1893 + if (continuous){
1894 + args = new String[2];
1895 + args[0]="\t";
1896 + args[1]="0";
1898 + */
1899 + StorageFunc loadFunc = (StorageFunc) pigContext.getUDF(PigStorage.class.getName());
1900 + return new LOLoad(pigContext, massageFilename(filename), loadFunc, args);
1903 + void assertAtomic(EvalItem item, boolean desiredAtomic) throws ParseException{
1904 + Boolean isAtomic = null;
1905 + if (item instanceof ConstEvalItem || item instanceof AtomFuncEvalItem)
1906 + isAtomic = true;
1907 + else if (item instanceof FuncEvalItem)
1908 + isAtomic = false;
1910 + if (isAtomic != null && isAtomic != desiredAtomic){
1911 + if (desiredAtomic)
1912 + throw new ParseException("Atomic field expected but found non-atomic field");
1913 + else
1914 + throw new ParseException("Non-atomic field expected but found atomic field");
1918 + EvalItem copyItemAndAddSpec(EvalItem item, EvalSpec spec) throws ParseException{
1919 + assertAtomic(item,false);
1920 + item = item.copy();
1921 + if (!(item instanceof NestableEvalItem))
1922 + throw new ParseException("Internal Error: Cannot add spec to non-nestable field.");
1923 + NestableEvalItem nestableItem = (NestableEvalItem)item;
1924 + EvalSpecPipe specPipe = nestableItem.nestedEval;
1925 + nestableItem.addNestedEvalSpec(spec);
1926 + return item;
1929 +// Parse is the Starting function.
1930 + final public LogicalPlan Parse() throws ParseException {
1931 + /*@bgen(jjtree) Parse */
1932 + SimpleNode jjtn000 = new SimpleNode(JJTPARSE);
1933 + boolean jjtc000 = true;
1934 + jjtree.openNodeScope(jjtn000);LogicalOperator root; Token t1;
1935 + try {
1936 + if (jj_2_1(2)) {
1937 + t1 = jj_consume_token(IDENTIFIER);
1938 + jj_consume_token(52);
1939 + root = Expr();
1940 + jj_consume_token(53);
1941 + root.alias = t1.image;
1942 + } else {
1943 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1944 + case LOAD:
1945 + case FILTER:
1946 + case FOREACH:
1947 + case COGROUP:
1948 + case CROSS:
1949 + case UNION:
1950 + case GROUP:
1951 + case IDENTIFIER:
1952 + case 54:
1953 + root = Expr();
1954 + jj_consume_token(53);
1955 + break;
1956 + default:
1957 + jj_la1[0] = jj_gen;
1958 + jj_consume_token(-1);
1959 + throw new ParseException();
1962 + jjtree.closeNodeScope(jjtn000, true);
1963 + jjtc000 = false;
1964 + {if (true) return new LogicalPlan(root, pigContext);}
1965 + } catch (Throwable jjte000) {
1966 + if (jjtc000) {
1967 + jjtree.clearNodeScope(jjtn000);
1968 + jjtc000 = false;
1969 + } else {
1970 + jjtree.popNode();
1972 + if (jjte000 instanceof RuntimeException) {
1973 + {if (true) throw (RuntimeException)jjte000;}
1975 + if (jjte000 instanceof ParseException) {
1976 + {if (true) throw (ParseException)jjte000;}
1978 + {if (true) throw (Error)jjte000;}
1979 + } finally {
1980 + if (jjtc000) {
1981 + jjtree.closeNodeScope(jjtn000, true);
1984 + throw new Error("Missing return statement in function");
1987 + final public LogicalOperator Expr() throws ParseException {
1988 + /*@bgen(jjtree) Expr */
1989 + SimpleNode jjtn000 = new SimpleNode(JJTEXPR);
1990 + boolean jjtc000 = true;
1991 + jjtree.openNodeScope(jjtn000);LogicalOperator op; SchemaItemList schema;
1992 + try {
1993 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1994 + case IDENTIFIER:
1995 + case 54:
1996 + op = NestedExpr();
1997 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1998 + case AS:
1999 + jj_consume_token(AS);
2000 + schema = AsClause();
2001 + op.schema=schema;
2002 + break;
2003 + default:
2004 + jj_la1[1] = jj_gen;
2007 + break;
2008 + case LOAD:
2009 + case FILTER:
2010 + case FOREACH:
2011 + case COGROUP:
2012 + case CROSS:
2013 + case UNION:
2014 + case GROUP:
2015 + op = BaseExpr();
2016 + break;
2017 + default:
2018 + jj_la1[2] = jj_gen;
2019 + jj_consume_token(-1);
2020 + throw new ParseException();
2022 + jjtree.closeNodeScope(jjtn000, true);
2023 + jjtc000 = false;
2024 + {if (true) return op;}
2025 + } catch (Throwable jjte000) {
2026 + if (jjtc000) {
2027 + jjtree.clearNodeScope(jjtn000);
2028 + jjtc000 = false;
2029 + } else {
2030 + jjtree.popNode();
2032 + if (jjte000 instanceof RuntimeException) {
2033 + {if (true) throw (RuntimeException)jjte000;}
2035 + if (jjte000 instanceof ParseException) {
2036 + {if (true) throw (ParseException)jjte000;}
2038 + {if (true) throw (Error)jjte000;}
2039 + } finally {
2040 + if (jjtc000) {
2041 + jjtree.closeNodeScope(jjtn000, true);
2044 + throw new Error("Missing return statement in function");
2047 + final public LogicalOperator NestedExpr() throws ParseException {
2048 + /*@bgen(jjtree) NestedExpr */
2049 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDEXPR);
2050 + boolean jjtc000 = true;
2051 + jjtree.openNodeScope(jjtn000);LogicalOperator op;
2052 + try {
2053 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2054 + case IDENTIFIER:
2055 + op = Alias();
2056 + break;
2057 + default:
2058 + jj_la1[3] = jj_gen;
2059 + if (jj_2_2(2)) {
2060 + jj_consume_token(54);
2061 + op = NestedExpr();
2062 + jj_consume_token(55);
2063 + } else {
2064 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2065 + case 54:
2066 + jj_consume_token(54);
2067 + op = BaseExpr();
2068 + jj_consume_token(55);
2069 + break;
2070 + default:
2071 + jj_la1[4] = jj_gen;
2072 + jj_consume_token(-1);
2073 + throw new ParseException();
2077 + jjtree.closeNodeScope(jjtn000, true);
2078 + jjtc000 = false;
2079 + {if (true) return op;}
2080 + } catch (Throwable jjte000) {
2081 + if (jjtc000) {
2082 + jjtree.clearNodeScope(jjtn000);
2083 + jjtc000 = false;
2084 + } else {
2085 + jjtree.popNode();
2087 + if (jjte000 instanceof RuntimeException) {
2088 + {if (true) throw (RuntimeException)jjte000;}
2090 + if (jjte000 instanceof ParseException) {
2091 + {if (true) throw (ParseException)jjte000;}
2093 + {if (true) throw (Error)jjte000;}
2094 + } finally {
2095 + if (jjtc000) {
2096 + jjtree.closeNodeScope(jjtn000, true);
2099 + throw new Error("Missing return statement in function");
2102 +// A reference to an alias
2103 + final public LogicalOperator Alias() throws ParseException {
2104 + /*@bgen(jjtree) Alias */
2105 + SimpleNode jjtn000 = new SimpleNode(JJTALIAS);
2106 + boolean jjtc000 = true;
2107 + jjtree.openNodeScope(jjtn000);Token t1; LogicalOperator op;
2108 + try {
2109 + t1 = jj_consume_token(IDENTIFIER);
2110 + jjtree.closeNodeScope(jjtn000, true);
2111 + jjtc000 = false;
2112 + op = makeLORead(t1.image);
2113 + {if (true) return op;}
2114 + } finally {
2115 + if (jjtc000) {
2116 + jjtree.closeNodeScope(jjtn000, true);
2119 + throw new Error("Missing return statement in function");
2122 + final public LogicalOperator BaseExpr() throws ParseException {
2123 + /*@bgen(jjtree) BaseExpr */
2124 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEXPR);
2125 + boolean jjtc000 = true;
2126 + jjtree.openNodeScope(jjtn000);LogicalOperator op; SchemaItemList schema; Token t1, t2;
2127 + try {
2128 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2129 + case LOAD:
2130 + jj_consume_token(LOAD);
2131 + op = LoadClause();
2132 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2133 + case AS:
2134 + jj_consume_token(AS);
2135 + schema = AsClause();
2136 + op.schema=schema;
2137 + break;
2138 + default:
2139 + jj_la1[5] = jj_gen;
2142 + break;
2143 + case COGROUP:
2144 + case GROUP:
2145 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2146 + case GROUP:
2147 + jj_consume_token(GROUP);
2148 + break;
2149 + case COGROUP:
2150 + jj_consume_token(COGROUP);
2151 + break;
2152 + default:
2153 + jj_la1[6] = jj_gen;
2154 + jj_consume_token(-1);
2155 + throw new ParseException();
2157 + op = CogroupClause();
2158 + break;
2159 + case FILTER:
2160 + jj_consume_token(FILTER);
2161 + op = FilterClause();
2162 + break;
2163 + case CROSS:
2164 + jj_consume_token(CROSS);
2165 + op = CrossClause();
2166 + break;
2167 + case UNION:
2168 + jj_consume_token(UNION);
2169 + op = UnionClause();
2170 + break;
2171 + case FOREACH:
2172 + jj_consume_token(FOREACH);
2173 + op = ForEachClause();
2174 + break;
2175 + default:
2176 + jj_la1[7] = jj_gen;
2177 + jj_consume_token(-1);
2178 + throw new ParseException();
2180 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2181 + case PARALLEL:
2182 + jj_consume_token(PARALLEL);
2183 + t2 = jj_consume_token(NUMBER);
2184 + op.requestedParallelism = Integer.parseInt(t2.image);
2185 + break;
2186 + default:
2187 + jj_la1[8] = jj_gen;
2190 + jjtree.closeNodeScope(jjtn000, true);
2191 + jjtc000 = false;
2192 + {if (true) return op;}
2193 + } catch (Throwable jjte000) {
2194 + if (jjtc000) {
2195 + jjtree.clearNodeScope(jjtn000);
2196 + jjtc000 = false;
2197 + } else {
2198 + jjtree.popNode();
2200 + if (jjte000 instanceof RuntimeException) {
2201 + {if (true) throw (RuntimeException)jjte000;}
2203 + if (jjte000 instanceof ParseException) {
2204 + {if (true) throw (ParseException)jjte000;}
2206 + {if (true) throw (Error)jjte000;}
2207 + } finally {
2208 + if (jjtc000) {
2209 + jjtree.closeNodeScope(jjtn000, true);
2212 + throw new Error("Missing return statement in function");
2215 + final public LogicalOperator LoadClause() throws ParseException {
2216 + /*@bgen(jjtree) LoadClause */
2217 + SimpleNode jjtn000 = new SimpleNode(JJTLOADCLAUSE);
2218 + boolean jjtc000 = true;
2219 + jjtree.openNodeScope(jjtn000);Token t1, t2; String filename; StorageFunc loadFunc = null;
2220 + ArrayList<String> loadParams = new ArrayList<String>(); LOLoad lo=null; boolean continuous=false;
2221 + try {
2222 + t1 = jj_consume_token(QUOTEDSTRING);
2223 + filename = unquote(t1.image);
2224 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2225 + case USING:
2226 + jj_consume_token(USING);
2227 + loadFunc = LoadFunction();
2228 + jj_consume_token(54);
2229 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2230 + case QUOTEDSTRING:
2231 + t2 = jj_consume_token(QUOTEDSTRING);
2232 + loadParams.add(t2.image);
2233 + break;
2234 + default:
2235 + jj_la1[9] = jj_gen;
2238 + label_1:
2239 + while (true) {
2240 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2241 + case 56:
2243 + break;
2244 + default:
2245 + jj_la1[10] = jj_gen;
2246 + break label_1;
2248 + jj_consume_token(56);
2249 + t2 = jj_consume_token(QUOTEDSTRING);
2250 + loadParams.add(t2.image);
2252 + jj_consume_token(55);
2253 + lo = new LOLoad(pigContext, massageFilename(filename), loadFunc, loadParams);
2254 + break;
2255 + default:
2256 + jj_la1[11] = jj_gen;
2259 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2260 + case CONTINUOUSLY:
2261 + jj_consume_token(CONTINUOUSLY);
2262 + continuous=true;
2263 + break;
2264 + default:
2265 + jj_la1[12] = jj_gen;
2268 + jjtree.closeNodeScope(jjtn000, true);
2269 + jjtc000 = false;
2270 + if (lo == null){
2271 + lo = getDefaultLoadOperator(continuous,filename);
2273 + if (continuous)
2274 + lo.setOutputType(LogicalOperator.MONOTONE);
2275 + {if (true) return lo;}
2276 + } catch (Throwable jjte000) {
2277 + if (jjtc000) {
2278 + jjtree.clearNodeScope(jjtn000);
2279 + jjtc000 = false;
2280 + } else {
2281 + jjtree.popNode();
2283 + if (jjte000 instanceof RuntimeException) {
2284 + {if (true) throw (RuntimeException)jjte000;}
2286 + if (jjte000 instanceof ParseException) {
2287 + {if (true) throw (ParseException)jjte000;}
2289 + {if (true) throw (Error)jjte000;}
2290 + } finally {
2291 + if (jjtc000) {
2292 + jjtree.closeNodeScope(jjtn000, true);
2295 + throw new Error("Missing return statement in function");
2298 + final public LogicalOperator FilterClause() throws ParseException {
2299 + /*@bgen(jjtree) FilterClause */
2300 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERCLAUSE);
2301 + boolean jjtc000 = true;
2302 + jjtree.openNodeScope(jjtn000);Cond cond; LogicalOperator input;
2303 + try {
2304 + input = NestedExpr();
2305 + jj_consume_token(BY);
2306 + cond = PCond(input.outputSchema(),null);
2307 + jjtree.closeNodeScope(jjtn000, true);
2308 + jjtc000 = false;
2309 + EvalSpecPipe specPipe = new EvalSpecPipe(pigContext);
2310 + specPipe.add(new FilterSpec(cond));
2311 + {if (true) return new LOEval(pigContext, input, specPipe);}
2312 + } catch (Throwable jjte000) {
2313 + if (jjtc000) {
2314 + jjtree.clearNodeScope(jjtn000);
2315 + jjtc000 = false;
2316 + } else {
2317 + jjtree.popNode();
2319 + if (jjte000 instanceof RuntimeException) {
2320 + {if (true) throw (RuntimeException)jjte000;}
2322 + if (jjte000 instanceof ParseException) {
2323 + {if (true) throw (ParseException)jjte000;}
2325 + {if (true) throw (Error)jjte000;}
2326 + } finally {
2327 + if (jjtc000) {
2328 + jjtree.closeNodeScope(jjtn000, true);
2331 + throw new Error("Missing return statement in function");
2334 + final public Cond PCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2335 + /*@bgen(jjtree) PCond */
2336 + SimpleNode jjtn000 = new SimpleNode(JJTPCOND);
2337 + boolean jjtc000 = true;
2338 + jjtree.openNodeScope(jjtn000);Cond cond = null;
2339 + try {
2340 + cond = POrCond(over,pipes);
2341 + jjtree.closeNodeScope(jjtn000, true);
2342 + jjtc000 = false;
2343 + {if (true) return cond;}
2344 + } catch (Throwable jjte000) {
2345 + if (jjtc000) {
2346 + jjtree.clearNodeScope(jjtn000);
2347 + jjtc000 = false;
2348 + } else {
2349 + jjtree.popNode();
2351 + if (jjte000 instanceof RuntimeException) {
2352 + {if (true) throw (RuntimeException)jjte000;}
2354 + if (jjte000 instanceof ParseException) {
2355 + {if (true) throw (ParseException)jjte000;}
2357 + {if (true) throw (Error)jjte000;}
2358 + } finally {
2359 + if (jjtc000) {
2360 + jjtree.closeNodeScope(jjtn000, true);
2363 + throw new Error("Missing return statement in function");
2366 + final public Cond POrCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2367 + /*@bgen(jjtree) POrCond */
2368 + SimpleNode jjtn000 = new SimpleNode(JJTPORCOND);
2369 + boolean jjtc000 = true;
2370 + jjtree.openNodeScope(jjtn000);Cond cond; List<Cond> cList = new ArrayList<Cond>();
2371 + try {
2372 + cond = PAndCond(over,pipes);
2373 + cList.add(cond);
2374 + label_2:
2375 + while (true) {
2376 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2377 + case OR:
2379 + break;
2380 + default:
2381 + jj_la1[13] = jj_gen;
2382 + break label_2;
2384 + jj_consume_token(OR);
2385 + cond = PAndCond(over,pipes);
2386 + cList.add(cond);
2388 + jjtree.closeNodeScope(jjtn000, true);
2389 + jjtc000 = false;
2390 + if (cList.size()==1)
2391 + {if (true) return cond;}
2392 + else
2393 + {if (true) return new OrCond(cList);}
2394 + } catch (Throwable jjte000) {
2395 + if (jjtc000) {
2396 + jjtree.clearNodeScope(jjtn000);
2397 + jjtc000 = false;
2398 + } else {
2399 + jjtree.popNode();
2401 + if (jjte000 instanceof RuntimeException) {
2402 + {if (true) throw (RuntimeException)jjte000;}
2404 + if (jjte000 instanceof ParseException) {
2405 + {if (true) throw (ParseException)jjte000;}
2407 + {if (true) throw (Error)jjte000;}
2408 + } finally {
2409 + if (jjtc000) {
2410 + jjtree.closeNodeScope(jjtn000, true);
2413 + throw new Error("Missing return statement in function");
2416 + final public Cond PAndCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2417 + /*@bgen(jjtree) PAndCond */
2418 + SimpleNode jjtn000 = new SimpleNode(JJTPANDCOND);
2419 + boolean jjtc000 = true;
2420 + jjtree.openNodeScope(jjtn000);Cond cond = null; List<Cond> cList = new ArrayList<Cond>();
2421 + try {
2422 + cond = PUnaryCond(over,pipes);
2423 + cList.add(cond);
2424 + label_3:
2425 + while (true) {
2426 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2427 + case AND:
2429 + break;
2430 + default:
2431 + jj_la1[14] = jj_gen;
2432 + break label_3;
2434 + jj_consume_token(AND);
2435 + cond = PUnaryCond(over,pipes);
2436 + cList.add(cond);
2438 + jjtree.closeNodeScope(jjtn000, true);
2439 + jjtc000 = false;
2440 + if (cList.size()==1)
2441 + {if (true) return cond;}
2442 + else
2443 + {if (true) return new AndCond(cList);}
2444 + } catch (Throwable jjte000) {
2445 + if (jjtc000) {
2446 + jjtree.clearNodeScope(jjtn000);
2447 + jjtc000 = false;
2448 + } else {
2449 + jjtree.popNode();
2451 + if (jjte000 instanceof RuntimeException) {
2452 + {if (true) throw (RuntimeException)jjte000;}
2454 + if (jjte000 instanceof ParseException) {
2455 + {if (true) throw (ParseException)jjte000;}
2457 + {if (true) throw (Error)jjte000;}
2458 + } finally {
2459 + if (jjtc000) {
2460 + jjtree.closeNodeScope(jjtn000, true);
2463 + throw new Error("Missing return statement in function");
2466 + final public Cond PUnaryCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2467 + /*@bgen(jjtree) PUnaryCond */
2468 + SimpleNode jjtn000 = new SimpleNode(JJTPUNARYCOND);
2469 + boolean jjtc000 = true;
2470 + jjtree.openNodeScope(jjtn000);Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;
2471 + try {
2472 + if (jj_2_3(2147483647)) {
2473 + jj_consume_token(54);
2474 + cond = PCond(over,pipes);
2475 + jj_consume_token(55);
2476 + } else if (jj_2_4(2147483647)) {
2477 + func = FilterFunction();
2478 + jj_consume_token(54);
2479 + args = EvalArgs(over,pipes);
2480 + jj_consume_token(55);
2481 + cond = new FuncCond(func, args);
2482 + } else {
2483 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2484 + case NOT:
2485 + cond = PNotCond(over,pipes);
2486 + break;
2487 + default:
2488 + jj_la1[15] = jj_gen;
2489 + if (jj_2_5(2147483647)) {
2490 + c1 = InfixExpr(over,pipes);
2491 + t1 = jj_consume_token(FILTEROP);
2492 + c2 = InfixExpr(over,pipes);
2493 + cond = new CompCond(c1, t1.image, c2);
2494 + } else if (jj_2_6(2)) {
2495 + c1 = InfixExpr(over,pipes);
2496 + jj_consume_token(MATCHES);
2497 + t1 = jj_consume_token(QUOTEDSTRING);
2498 + cond = new RegexpCond(c1, unquote(t1.image));
2499 + } else {
2500 + jj_consume_token(-1);
2501 + throw new ParseException();
2505 + jjtree.closeNodeScope(jjtn000, true);
2506 + jjtc000 = false;
2507 + {if (true) return cond;}
2508 + } catch (Throwable jjte000) {
2509 + if (jjtc000) {
2510 + jjtree.clearNodeScope(jjtn000);
2511 + jjtc000 = false;
2512 + } else {
2513 + jjtree.popNode();
2515 + if (jjte000 instanceof RuntimeException) {
2516 + {if (true) throw (RuntimeException)jjte000;}
2518 + if (jjte000 instanceof ParseException) {
2519 + {if (true) throw (ParseException)jjte000;}
2521 + {if (true) throw (Error)jjte000;}
2522 + } finally {
2523 + if (jjtc000) {
2524 + jjtree.closeNodeScope(jjtn000, true);
2527 + throw new Error("Missing return statement in function");
2530 + final public Cond PNotCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2531 + /*@bgen(jjtree) PNotCond */
2532 + SimpleNode jjtn000 = new SimpleNode(JJTPNOTCOND);
2533 + boolean jjtc000 = true;
2534 + jjtree.openNodeScope(jjtn000);Cond c1;
2535 + try {
2536 + jj_consume_token(NOT);
2537 + c1 = PUnaryCond(over,pipes);
2538 + jjtree.closeNodeScope(jjtn000, true);
2539 + jjtc000 = false;
2540 + {if (true) return new NotCond(c1);}
2541 + } catch (Throwable jjte000) {
2542 + if (jjtc000) {
2543 + jjtree.clearNodeScope(jjtn000);
2544 + jjtc000 = false;
2545 + } else {
2546 + jjtree.popNode();
2548 + if (jjte000 instanceof RuntimeException) {
2549 + {if (true) throw (RuntimeException)jjte000;}
2551 + if (jjte000 instanceof ParseException) {
2552 + {if (true) throw (ParseException)jjte000;}
2554 + {if (true) throw (Error)jjte000;}
2555 + } finally {
2556 + if (jjtc000) {
2557 + jjtree.closeNodeScope(jjtn000, true);
2560 + throw new Error("Missing return statement in function");
2563 + final public LogicalOperator CogroupClause() throws ParseException {
2564 + /*@bgen(jjtree) CogroupClause */
2565 + SimpleNode jjtn000 = new SimpleNode(JJTCOGROUPCLAUSE);
2566 + boolean jjtc000 = true;
2567 + jjtree.openNodeScope(jjtn000);CogroupInput gi; ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
2568 + try {
2569 + gi = GroupItem();
2570 + gis.add(gi);
2571 + label_4:
2572 + while (true) {
2573 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2574 + case 56:
2576 + break;
2577 + default:
2578 + jj_la1[16] = jj_gen;
2579 + break label_4;
2581 + jj_consume_token(56);
2582 + gi = GroupItem();
2583 + gis.add(gi);
2585 + jjtree.closeNodeScope(jjtn000, true);
2586 + jjtc000 = false;
2587 + {if (true) return parseCogroup(gis);}
2588 + } catch (Throwable jjte000) {
2589 + if (jjtc000) {
2590 + jjtree.clearNodeScope(jjtn000);
2591 + jjtc000 = false;
2592 + } else {
2593 + jjtree.popNode();
2595 + if (jjte000 instanceof RuntimeException) {
2596 + {if (true) throw (RuntimeException)jjte000;}
2598 + if (jjte000 instanceof ParseException) {
2599 + {if (true) throw (ParseException)jjte000;}
2601 + {if (true) throw (Error)jjte000;}
2602 + } finally {
2603 + if (jjtc000) {
2604 + jjtree.closeNodeScope(jjtn000, true);
2607 + throw new Error("Missing return statement in function");
2610 + final public CogroupInput GroupItem() throws ParseException {
2611 + /*@bgen(jjtree) GroupItem */
2612 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPITEM);
2613 + boolean jjtc000 = true;
2614 + jjtree.openNodeScope(jjtn000);LogicalOperator op; GroupFunc groupFunc; CogroupInput cogroupInput = new CogroupInput();
2615 + try {
2616 + cogroupInput.op = NestedExpr();
2617 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2618 + case BY:
2619 + jj_consume_token(BY);
2620 + cogroupInput.spec = GroupByExpr(cogroupInput.op.outputSchema());
2621 + break;
2622 + case ALL:
2623 + jj_consume_token(ALL);
2624 + cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAll.class.getName()), new EvalItemList(pigContext), false);
2625 + break;
2626 + case ANY:
2627 + jj_consume_token(ANY);
2628 + cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAny.class.getName()), new EvalItemList(pigContext), false);
2629 + break;
2630 + default:
2631 + jj_la1[17] = jj_gen;
2632 + jj_consume_token(-1);
2633 + throw new ParseException();
2635 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2636 + case INNER:
2637 + case OUTER:
2638 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2639 + case INNER:
2640 + jj_consume_token(INNER);
2641 + cogroupInput.spec.isInner = true;
2642 + break;
2643 + case OUTER:
2644 + jj_consume_token(OUTER);
2645 + break;
2646 + default:
2647 + jj_la1[18] = jj_gen;
2648 + jj_consume_token(-1);
2649 + throw new ParseException();
2651 + break;
2652 + default:
2653 + jj_la1[19] = jj_gen;
2656 + jjtree.closeNodeScope(jjtn000, true);
2657 + jjtc000 = false;
2658 + {if (true) return cogroupInput;}
2659 + } catch (Throwable jjte000) {
2660 + if (jjtc000) {
2661 + jjtree.clearNodeScope(jjtn000);
2662 + jjtc000 = false;
2663 + } else {
2664 + jjtree.popNode();
2666 + if (jjte000 instanceof RuntimeException) {
2667 + {if (true) throw (RuntimeException)jjte000;}
2669 + if (jjte000 instanceof ParseException) {
2670 + {if (true) throw (ParseException)jjte000;}
2672 + {if (true) throw (Error)jjte000;}
2673 + } finally {
2674 + if (jjtc000) {
2675 + jjtree.closeNodeScope(jjtn000, true);
2678 + throw new Error("Missing return statement in function");
2681 + final public GroupBySpec GroupByExpr(SchemaItem over) throws ParseException {
2682 + /*@bgen(jjtree) GroupByExpr */
2683 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYEXPR);
2684 + boolean jjtc000 = true;
2685 + jjtree.openNodeScope(jjtn000);Token t1; GroupBySpec spec = null; EvalItem projItem = null; EvalItemList proj = null; String s; GroupFunc func = null;
2686 + try {
2687 + if (jj_2_7(2)) {
2688 + func = GroupFunction();
2689 + jj_consume_token(54);
2690 + proj = SimpleProjOrEmpty(over);
2691 + jj_consume_token(55);
2692 + spec = new GroupBySpec(pigContext, func, proj, false);
2693 + } else {
2694 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2695 + case STAR:
2696 + case GROUP:
2697 + case IDENTIFIER:
2698 + case QUOTEDSTRING:
2699 + case DOLLARVAR:
2700 + case 54:
2701 + proj = BracketedSimpleProj(over);
2702 + spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFTupleNoop.class.getName()), proj, false);
2703 + break;
2704 + default:
2705 + jj_la1[20] = jj_gen;
2706 + jj_consume_token(-1);
2707 + throw new ParseException();
2710 + jjtree.closeNodeScope(jjtn000, true);
2711 + jjtc000 = false;
2712 + {if (true) return spec;}
2713 + } catch (Throwable jjte000) {
2714 + if (jjtc000) {
2715 + jjtree.clearNodeScope(jjtn000);
2716 + jjtc000 = false;
2717 + } else {
2718 + jjtree.popNode();
2720 + if (jjte000 instanceof RuntimeException) {
2721 + {if (true) throw (RuntimeException)jjte000;}
2723 + if (jjte000 instanceof ParseException) {
2724 + {if (true) throw (ParseException)jjte000;}
2726 + {if (true) throw (Error)jjte000;}
2727 + } finally {
2728 + if (jjtc000) {
2729 + jjtree.closeNodeScope(jjtn000, true);
2732 + throw new Error("Missing return statement in function");
2735 +//Used in serialization and deserialization
2736 + final public GroupBySpec GroupBySpec() throws ParseException {
2737 + /*@bgen(jjtree) GroupBySpec */
2738 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYSPEC);
2739 + boolean jjtc000 = true;
2740 + jjtree.openNodeScope(jjtn000);GroupBySpec spec = null;
2741 + try {
2742 + spec = GroupByExpr(null);
2743 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2744 + case INNER:
2745 + case OUTER:
2746 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2747 + case INNER:
2748 + jj_consume_token(INNER);
2749 + spec.isInner = true;
2750 + break;
2751 + case OUTER:
2752 + jj_consume_token(OUTER);
2753 + break;
2754 + default:
2755 + jj_la1[21] = jj_gen;
2756 + jj_consume_token(-1);
2757 + throw new ParseException();
2759 + break;
2760 + default:
2761 + jj_la1[22] = jj_gen;
2764 + jjtree.closeNodeScope(jjtn000, true);
2765 + jjtc000 = false;
2766 + {if (true) return spec;}
2767 + } catch (Throwable jjte000) {
2768 + if (jjtc000) {
2769 + jjtree.clearNodeScope(jjtn000);
2770 + jjtc000 = false;
2771 + } else {
2772 + jjtree.popNode();
2774 + if (jjte000 instanceof RuntimeException) {
2775 + {if (true) throw (RuntimeException)jjte000;}
2777 + if (jjte000 instanceof ParseException) {
2778 + {if (true) throw (ParseException)jjte000;}
2780 + {if (true) throw (Error)jjte000;}
2781 + } finally {
2782 + if (jjtc000) {
2783 + jjtree.closeNodeScope(jjtn000, true);
2786 + throw new Error("Missing return statement in function");
2789 + final public LogicalOperator CrossClause() throws ParseException {
2790 + /*@bgen(jjtree) CrossClause */
2791 + SimpleNode jjtn000 = new SimpleNode(JJTCROSSCLAUSE);
2792 + boolean jjtc000 = true;
2793 + jjtree.openNodeScope(jjtn000);LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();
2794 + try {
2795 + op = NestedExpr();
2796 + inputs.add(op);
2797 + label_5:
2798 + while (true) {
2799 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2800 + case 56:
2802 + break;
2803 + default:
2804 + jj_la1[23] = jj_gen;
2805 + break label_5;
2807 + jj_consume_token(56);
2808 + op = NestedExpr();
2809 + inputs.add(op);
2811 + jjtree.closeNodeScope(jjtn000, true);
2812 + jjtc000 = false;
2813 + {if (true) return rewriteCross(inputs);}
2814 + } catch (Throwable jjte000) {
2815 + if (jjtc000) {
2816 + jjtree.clearNodeScope(jjtn000);
2817 + jjtc000 = false;
2818 + } else {
2819 + jjtree.popNode();
2821 + if (jjte000 instanceof RuntimeException) {
2822 + {if (true) throw (RuntimeException)jjte000;}
2824 + if (jjte000 instanceof ParseException) {
2825 + {if (true) throw (ParseException)jjte000;}
2827 + {if (true) throw (Error)jjte000;}
2828 + } finally {
2829 + if (jjtc000) {
2830 + jjtree.closeNodeScope(jjtn000, true);
2833 + throw new Error("Missing return statement in function");
2836 + final public LogicalOperator UnionClause() throws ParseException {
2837 + /*@bgen(jjtree) UnionClause */
2838 + SimpleNode jjtn000 = new SimpleNode(JJTUNIONCLAUSE);
2839 + boolean jjtc000 = true;
2840 + jjtree.openNodeScope(jjtn000);LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();
2841 + try {
2842 + op = NestedExpr();
2843 + inputs.add(op);
2844 + label_6:
2845 + while (true) {
2846 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2847 + case 56:
2849 + break;
2850 + default:
2851 + jj_la1[24] = jj_gen;
2852 + break label_6;
2854 + jj_consume_token(56);
2855 + op = NestedExpr();
2856 + inputs.add(op);
2858 + jjtree.closeNodeScope(jjtn000, true);
2859 + jjtc000 = false;
2860 + {if (true) return new LOUnion(pigContext, inputs);}
2861 + } catch (Throwable jjte000) {
2862 + if (jjtc000) {
2863 + jjtree.clearNodeScope(jjtn000);
2864 + jjtc000 = false;
2865 + } else {
2866 + jjtree.popNode();
2868 + if (jjte000 instanceof RuntimeException) {
2869 + {if (true) throw (RuntimeException)jjte000;}
2871 + if (jjte000 instanceof ParseException) {
2872 + {if (true) throw (ParseException)jjte000;}
2874 + {if (true) throw (Error)jjte000;}
2875 + } finally {
2876 + if (jjtc000) {
2877 + jjtree.closeNodeScope(jjtn000, true);
2880 + throw new Error("Missing return statement in function");
2883 + final public LogicalOperator ForEachClause() throws ParseException {
2884 + /*@bgen(jjtree) ForEachClause */
2885 + SimpleNode jjtn000 = new SimpleNode(JJTFOREACHCLAUSE);
2886 + boolean jjtc000 = true;
2887 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema specPipeAndSchema = null; LogicalOperator input, op;
2888 + try {
2889 + input = NestedExpr();
2890 + specPipeAndSchema = NestedBlock(input.outputSchema());
2891 + jjtree.closeNodeScope(jjtn000, true);
2892 + jjtc000 = false;
2893 + op = new LOEval(pigContext, input, specPipeAndSchema.pipe);
2894 + op.schema = specPipeAndSchema.schema;
2895 + {if (true) return op;}
2896 + } catch (Throwable jjte000) {
2897 + if (jjtc000) {
2898 + jjtree.clearNodeScope(jjtn000);
2899 + jjtc000 = false;
2900 + } else {
2901 + jjtree.popNode();
2903 + if (jjte000 instanceof RuntimeException) {
2904 + {if (true) throw (RuntimeException)jjte000;}
2906 + if (jjte000 instanceof ParseException) {
2907 + {if (true) throw (ParseException)jjte000;}
2909 + {if (true) throw (Error)jjte000;}
2910 + } finally {
2911 + if (jjtc000) {
2912 + jjtree.closeNodeScope(jjtn000, true);
2915 + throw new Error("Missing return statement in function");
2918 + final public EvalSpecPipeAndSchema NestedBlock(SchemaItem over) throws ParseException {
2919 + /*@bgen(jjtree) NestedBlock */
2920 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDBLOCK);
2921 + boolean jjtc000 = true;
2922 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema pipeAndSchema; Map<String, EvalItem> pipes = new HashMap<String, EvalItem>();
2923 + try {
2924 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2925 + case GENERATE:
2926 + pipeAndSchema = GenerateStatement(over,pipes);
2927 + break;
2928 + case 57:
2929 + jj_consume_token(57);
2930 + label_7:
2931 + while (true) {
2932 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2933 + case IDENTIFIER:
2935 + break;
2936 + default:
2937 + jj_la1[25] = jj_gen;
2938 + break label_7;
2940 + NestedCommand(over,pipes);
2941 + jj_consume_token(53);
2943 + pipeAndSchema = GenerateStatement(over,pipes);
2944 + jj_consume_token(53);
2945 + jj_consume_token(58);
2946 + break;
2947 + default:
2948 + jj_la1[26] = jj_gen;
2949 + jj_consume_token(-1);
2950 + throw new ParseException();
2952 + jjtree.closeNodeScope(jjtn000, true);
2953 + jjtc000 = false;
2954 + {if (true) return pipeAndSchema;}
2955 + } catch (Throwable jjte000) {
2956 + if (jjtc000) {
2957 + jjtree.clearNodeScope(jjtn000);
2958 + jjtc000 = false;
2959 + } else {
2960 + jjtree.popNode();
2962 + if (jjte000 instanceof RuntimeException) {
2963 + {if (true) throw (RuntimeException)jjte000;}
2965 + if (jjte000 instanceof ParseException) {
2966 + {if (true) throw (ParseException)jjte000;}
2968 + {if (true) throw (Error)jjte000;}
2969 + } finally {
2970 + if (jjtc000) {
2971 + jjtree.closeNodeScope(jjtn000, true);
2974 + throw new Error("Missing return statement in function");
2977 + final public void NestedCommand(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
2978 + /*@bgen(jjtree) NestedCommand */
2979 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDCOMMAND);
2980 + boolean jjtc000 = true;
2981 + jjtree.openNodeScope(jjtn000);Token t; EvalItem item;
2982 + try {
2983 + t = jj_consume_token(IDENTIFIER);
2984 + jj_consume_token(52);
2985 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
2986 + case GROUP:
2987 + case IDENTIFIER:
2988 + case QUOTEDSTRING:
2989 + case DOLLARVAR:
2990 + case 54:
2991 + item = InfixExpr(over,pipes);
2992 + break;
2993 + case FILTER:
2994 + item = NestedFilter(over,pipes);
2995 + break;
2996 + case ORDER:
2997 + case ARRANGE:
2998 + item = NestedSortOrArrange(over,pipes);
2999 + break;
3000 + case DISTINCT:
3001 + item = NestedDistinct(over,pipes);
3002 + break;
3003 + default:
3004 + jj_la1[27] = jj_gen;
3005 + jj_consume_token(-1);
3006 + throw new ParseException();
3008 + jjtree.closeNodeScope(jjtn000, true);
3009 + jjtc000 = false;
3010 + pipes.put(t.image,item);
3011 + } catch (Throwable jjte000) {
3012 + if (jjtc000) {
3013 + jjtree.clearNodeScope(jjtn000);
3014 + jjtc000 = false;
3015 + } else {
3016 + jjtree.popNode();
3018 + if (jjte000 instanceof RuntimeException) {
3019 + {if (true) throw (RuntimeException)jjte000;}
3021 + if (jjte000 instanceof ParseException) {
3022 + {if (true) throw (ParseException)jjte000;}
3024 + {if (true) throw (Error)jjte000;}
3025 + } finally {
3026 + if (jjtc000) {
3027 + jjtree.closeNodeScope(jjtn000, true);
3032 + final public EvalItem NestedFilter(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3033 + /*@bgen(jjtree) NestedFilter */
3034 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDFILTER);
3035 + boolean jjtc000 = true;
3036 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem item; SchemaItem subSchema = null;
3037 + try {
3038 + jj_consume_token(FILTER);
3039 + item = BaseEvalItem(over,pipes);
3040 + subSchema = item.mapInputSchema(over);
3041 + jj_consume_token(BY);
3042 + cond = PCond(subSchema,null);
3043 + jjtree.closeNodeScope(jjtn000, true);
3044 + jjtc000 = false;
3045 + {if (true) return copyItemAndAddSpec(item,new FilterSpec(cond));}
3046 + } catch (Throwable jjte000) {
3047 + if (jjtc000) {
3048 + jjtree.clearNodeScope(jjtn000);
3049 + jjtc000 = false;
3050 + } else {
3051 + jjtree.popNode();
3053 + if (jjte000 instanceof RuntimeException) {
3054 + {if (true) throw (RuntimeException)jjte000;}
3056 + if (jjte000 instanceof ParseException) {
3057 + {if (true) throw (ParseException)jjte000;}
3059 + {if (true) throw (Error)jjte000;}
3060 + } finally {
3061 + if (jjtc000) {
3062 + jjtree.closeNodeScope(jjtn000, true);
3065 + throw new Error("Missing return statement in function");
3068 + final public EvalItem NestedSortOrArrange(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3069 + /*@bgen(jjtree) NestedSortOrArrange */
3070 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDSORTORARRANGE);
3071 + boolean jjtc000 = true;
3072 + jjtree.openNodeScope(jjtn000);EvalItemList list; EvalItem item; SchemaItem subSchema = null; Token t;
3073 + try {
3074 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3075 + case ORDER:
3076 + t = jj_consume_token(ORDER);
3077 + break;
3078 + case ARRANGE:
3079 + t = jj_consume_token(ARRANGE);
3080 + break;
3081 + default:
3082 + jj_la1[28] = jj_gen;
3083 + jj_consume_token(-1);
3084 + throw new ParseException();
3086 + item = BaseEvalItem(over,pipes);
3087 + subSchema = item.mapInputSchema(over);
3088 + jj_consume_token(BY);
3089 + list = SimpleProj(subSchema);
3090 + jjtree.closeNodeScope(jjtn000, true);
3091 + jjtc000 = false;
3092 + {if (true) return copyItemAndAddSpec(item,new SortArrangeSpec(list,t.image.equalsIgnoreCase("arrange")));}
3093 + } catch (Throwable jjte000) {
3094 + if (jjtc000) {
3095 + jjtree.clearNodeScope(jjtn000);
3096 + jjtc000 = false;
3097 + } else {
3098 + jjtree.popNode();
3100 + if (jjte000 instanceof RuntimeException) {
3101 + {if (true) throw (RuntimeException)jjte000;}
3103 + if (jjte000 instanceof ParseException) {
3104 + {if (true) throw (ParseException)jjte000;}
3106 + {if (true) throw (Error)jjte000;}
3107 + } finally {
3108 + if (jjtc000) {
3109 + jjtree.closeNodeScope(jjtn000, true);
3112 + throw new Error("Missing return statement in function");
3115 + final public EvalItem NestedDistinct(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3116 + /*@bgen(jjtree) NestedDistinct */
3117 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDDISTINCT);
3118 + boolean jjtc000 = true;
3119 + jjtree.openNodeScope(jjtn000);EvalItemList list; EvalItem item; LogicalOperator subOp = null; Token t;
3120 + try {
3121 + jj_consume_token(DISTINCT);
3122 + item = BaseEvalItem(over,pipes);
3123 + jjtree.closeNodeScope(jjtn000, true);
3124 + jjtc000 = false;
3125 + list = new EvalItemList(pigContext); list.add(new StarEvalItem(pigContext));
3126 + {if (true) return copyItemAndAddSpec(item,new DistinctSpec(list));}
3127 + } catch (Throwable jjte000) {
3128 + if (jjtc000) {
3129 + jjtree.clearNodeScope(jjtn000);
3130 + jjtc000 = false;
3131 + } else {
3132 + jjtree.popNode();
3134 + if (jjte000 instanceof RuntimeException) {
3135 + {if (true) throw (RuntimeException)jjte000;}
3137 + if (jjte000 instanceof ParseException) {
3138 + {if (true) throw (ParseException)jjte000;}
3140 + {if (true) throw (Error)jjte000;}
3141 + } finally {
3142 + if (jjtc000) {
3143 + jjtree.closeNodeScope(jjtn000, true);
3146 + throw new Error("Missing return statement in function");
3149 + final public EvalSpecPipeAndSchema GenerateStatement(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3150 + /*@bgen(jjtree) GenerateStatement */
3151 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATESTATEMENT);
3152 + boolean jjtc000 = true;
3153 + jjtree.openNodeScope(jjtn000);EvalSpecPipeAndSchema pipeAndSchema = new EvalSpecPipeAndSchema(); EvalSpecPipe pipe = null; SchemaItemList schema;
3154 + try {
3155 + jj_consume_token(GENERATE);
3156 + pipe = FlattenedGenerateItemList(over,pipes);
3157 + jjtree.closeNodeScope(jjtn000, true);
3158 + jjtc000 = false;
3159 + pipeAndSchema.pipe = pipe;
3160 + {if (true) return pipeAndSchema;}
3161 + } catch (Throwable jjte000) {
3162 + if (jjtc000) {
3163 + jjtree.clearNodeScope(jjtn000);
3164 + jjtc000 = false;
3165 + } else {
3166 + jjtree.popNode();
3168 + if (jjte000 instanceof RuntimeException) {
3169 + {if (true) throw (RuntimeException)jjte000;}
3171 + if (jjte000 instanceof ParseException) {
3172 + {if (true) throw (ParseException)jjte000;}
3174 + {if (true) throw (Error)jjte000;}
3175 + } finally {
3176 + if (jjtc000) {
3177 + jjtree.closeNodeScope(jjtn000, true);
3180 + throw new Error("Missing return statement in function");
3183 + final public EvalSpecPipe FlattenedGenerateItemList(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3184 + /*@bgen(jjtree) FlattenedGenerateItemList */
3185 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEMLIST);
3186 + boolean jjtc000 = true;
3187 + jjtree.openNodeScope(jjtn000);EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalItemList list = new EvalItemList(pigContext); EvalItem item;
3188 + try {
3189 + item = FlattenedGenerateItem(over,pipes);
3190 + list.add(item);
3191 + label_8:
3192 + while (true) {
3193 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3194 + case 56:
3196 + break;
3197 + default:
3198 + jj_la1[29] = jj_gen;
3199 + break label_8;
3201 + jj_consume_token(56);
3202 + item = FlattenedGenerateItem(over,pipes);
3203 + list.add(item);
3205 + jjtree.closeNodeScope(jjtn000, true);
3206 + jjtc000 = false;
3207 + pipe.add(list); {if (true) return pipe;}
3208 + } catch (Throwable jjte000) {
3209 + if (jjtc000) {
3210 + jjtree.clearNodeScope(jjtn000);
3211 + jjtc000 = false;
3212 + } else {
3213 + jjtree.popNode();
3215 + if (jjte000 instanceof RuntimeException) {
3216 + {if (true) throw (RuntimeException)jjte000;}
3218 + if (jjte000 instanceof ParseException) {
3219 + {if (true) throw (ParseException)jjte000;}
3221 + {if (true) throw (Error)jjte000;}
3222 + } finally {
3223 + if (jjtc000) {
3224 + jjtree.closeNodeScope(jjtn000, true);
3227 + throw new Error("Missing return statement in function");
3230 + final public EvalItem FlattenedGenerateItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3231 + /*@bgen(jjtree) FlattenedGenerateItem */
3232 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEM);
3233 + boolean jjtc000 = true;
3234 + jjtree.openNodeScope(jjtn000);EvalItem item; SchemaItem schema = null;
3235 + try {
3236 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3237 + case FLATTEN:
3238 + jj_consume_token(FLATTEN);
3239 + jj_consume_token(54);
3240 + item = GenerateItem(over,pipes);
3241 + jj_consume_token(55);
3242 + if (!(item instanceof NestableEvalItem) ||
3243 + (item instanceof AtomFuncEvalItem) ){
3244 + {if (true) throw new ParseException("Cannot flatten atom field");}
3247 + EvalItemList list = new EvalItemList(pigContext);
3248 + list.add(new StarEvalItem(pigContext));
3249 + ((NestableEvalItem)item).subColSpec = list;
3250 + break;
3251 + case STAR:
3252 + case GROUP:
3253 + case IDENTIFIER:
3254 + case QUOTEDSTRING:
3255 + case DOLLARVAR:
3256 + case 54:
3257 + item = GenerateItem(over,pipes);
3258 + break;
3259 + default:
3260 + jj_la1[30] = jj_gen;
3261 + jj_consume_token(-1);
3262 + throw new ParseException();
3264 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3265 + case AS:
3266 + jj_consume_token(AS);
3267 + schema = SchemaElement();
3268 + break;
3269 + default:
3270 + jj_la1[31] = jj_gen;
3273 + jjtree.closeNodeScope(jjtn000, true);
3274 + jjtc000 = false;
3275 + item.schema = schema;
3276 + {if (true) return item;}
3277 + } catch (Throwable jjte000) {
3278 + if (jjtc000) {
3279 + jjtree.clearNodeScope(jjtn000);
3280 + jjtc000 = false;
3281 + } else {
3282 + jjtree.popNode();
3284 + if (jjte000 instanceof RuntimeException) {
3285 + {if (true) throw (RuntimeException)jjte000;}
3287 + if (jjte000 instanceof ParseException) {
3288 + {if (true) throw (ParseException)jjte000;}
3290 + {if (true) throw (Error)jjte000;}
3291 + } finally {
3292 + if (jjtc000) {
3293 + jjtree.closeNodeScope(jjtn000, true);
3296 + throw new Error("Missing return statement in function");
3299 + final public EvalItem GenerateItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3300 + /*@bgen(jjtree) GenerateItem */
3301 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATEITEM);
3302 + boolean jjtc000 = true;
3303 + jjtree.openNodeScope(jjtn000);EvalItem item;
3304 + try {
3305 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3306 + case GROUP:
3307 + case IDENTIFIER:
3308 + case QUOTEDSTRING:
3309 + case DOLLARVAR:
3310 + case 54:
3311 + item = InfixExpr(over,pipes);
3312 + break;
3313 + case STAR:
3314 + item = Star();
3315 + break;
3316 + default:
3317 + jj_la1[32] = jj_gen;
3318 + jj_consume_token(-1);
3319 + throw new ParseException();
3321 + jjtree.closeNodeScope(jjtn000, true);
3322 + jjtc000 = false;
3323 + {if (true) return item;}
3324 + } catch (Throwable jjte000) {
3325 + if (jjtc000) {
3326 + jjtree.clearNodeScope(jjtn000);
3327 + jjtc000 = false;
3328 + } else {
3329 + jjtree.popNode();
3331 + if (jjte000 instanceof RuntimeException) {
3332 + {if (true) throw (RuntimeException)jjte000;}
3334 + if (jjte000 instanceof ParseException) {
3335 + {if (true) throw (ParseException)jjte000;}
3337 + {if (true) throw (Error)jjte000;}
3338 + } finally {
3339 + if (jjtc000) {
3340 + jjtree.closeNodeScope(jjtn000, true);
3343 + throw new Error("Missing return statement in function");
3346 + final public EvalItem InfixExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3347 + /*@bgen(jjtree) InfixExpr */
3348 + SimpleNode jjtn000 = new SimpleNode(JJTINFIXEXPR);
3349 + boolean jjtc000 = true;
3350 + jjtree.openNodeScope(jjtn000);EvalItem expr;
3351 + try {
3352 + expr = AdditiveExpr(over,pipes);
3353 + jjtree.closeNodeScope(jjtn000, true);
3354 + jjtc000 = false;
3355 + {if (true) return expr;}
3356 + } catch (Throwable jjte000) {
3357 + if (jjtc000) {
3358 + jjtree.clearNodeScope(jjtn000);
3359 + jjtc000 = false;
3360 + } else {
3361 + jjtree.popNode();
3363 + if (jjte000 instanceof RuntimeException) {
3364 + {if (true) throw (RuntimeException)jjte000;}
3366 + if (jjte000 instanceof ParseException) {
3367 + {if (true) throw (ParseException)jjte000;}
3369 + {if (true) throw (Error)jjte000;}
3370 + } finally {
3371 + if (jjtc000) {
3372 + jjtree.closeNodeScope(jjtn000, true);
3375 + throw new Error("Missing return statement in function");
3378 + final public EvalItem AdditiveExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3379 + /*@bgen(jjtree) AdditiveExpr */
3380 + SimpleNode jjtn000 = new SimpleNode(JJTADDITIVEEXPR);
3381 + boolean jjtc000 = true;
3382 + jjtree.openNodeScope(jjtn000);Token t; EvalItem lhs, rhs; EvalItemList args;
3383 + try {
3384 + lhs = MultiplicativeExpr(over,pipes);
3385 + label_9:
3386 + while (true) {
3387 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3388 + case 59:
3389 + case 60:
3391 + break;
3392 + default:
3393 + jj_la1[33] = jj_gen;
3394 + break label_9;
3396 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3397 + case 59:
3398 + t = jj_consume_token(59);
3399 + break;
3400 + case 60:
3401 + t = jj_consume_token(60);
3402 + break;
3403 + default:
3404 + jj_la1[34] = jj_gen;
3405 + jj_consume_token(-1);
3406 + throw new ParseException();
3408 + rhs = MultiplicativeExpr(over,pipes);
3409 + assertAtomic(lhs,true);
3410 + assertAtomic(rhs,true);
3411 + args = new EvalItemList(pigContext);
3412 + args.add(lhs);
3413 + args.add(rhs);
3414 + if (t.image.equals("+")){
3415 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("ADD"), args);
3416 + }else{
3417 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("SUBTRACT"), args);
3420 + jjtree.closeNodeScope(jjtn000, true);
3421 + jjtc000 = false;
3422 + {if (true) return lhs;}
3423 + } catch (Throwable jjte000) {
3424 + if (jjtc000) {
3425 + jjtree.clearNodeScope(jjtn000);
3426 + jjtc000 = false;
3427 + } else {
3428 + jjtree.popNode();
3430 + if (jjte000 instanceof RuntimeException) {
3431 + {if (true) throw (RuntimeException)jjte000;}
3433 + if (jjte000 instanceof ParseException) {
3434 + {if (true) throw (ParseException)jjte000;}
3436 + {if (true) throw (Error)jjte000;}
3437 + } finally {
3438 + if (jjtc000) {
3439 + jjtree.closeNodeScope(jjtn000, true);
3442 + throw new Error("Missing return statement in function");
3445 + final public EvalItem MultiplicativeExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3446 + /*@bgen(jjtree) MultiplicativeExpr */
3447 + SimpleNode jjtn000 = new SimpleNode(JJTMULTIPLICATIVEEXPR);
3448 + boolean jjtc000 = true;
3449 + jjtree.openNodeScope(jjtn000);Token t; EvalItem lhs, rhs; EvalItemList args;
3450 + try {
3451 + lhs = UnaryExpr(over,pipes);
3452 + label_10:
3453 + while (true) {
3454 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3455 + case STAR:
3456 + case 61:
3458 + break;
3459 + default:
3460 + jj_la1[35] = jj_gen;
3461 + break label_10;
3463 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3464 + case STAR:
3465 + t = jj_consume_token(STAR);
3466 + break;
3467 + case 61:
3468 + t = jj_consume_token(61);
3469 + break;
3470 + default:
3471 + jj_la1[36] = jj_gen;
3472 + jj_consume_token(-1);
3473 + throw new ParseException();
3475 + rhs = UnaryExpr(over,pipes);
3476 + assertAtomic(lhs,true);
3477 + assertAtomic(rhs,true);
3478 + args = new EvalItemList(pigContext);
3479 + args.add(lhs);
3480 + args.add(rhs);
3481 + if (t.image.equals("*")){
3482 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("MULTIPLY"), args);
3483 + }else{
3484 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("DIVIDE"), args);
3487 + jjtree.closeNodeScope(jjtn000, true);
3488 + jjtc000 = false;
3489 + {if (true) return lhs;}
3490 + } catch (Throwable jjte000) {
3491 + if (jjtc000) {
3492 + jjtree.clearNodeScope(jjtn000);
3493 + jjtc000 = false;
3494 + } else {
3495 + jjtree.popNode();
3497 + if (jjte000 instanceof RuntimeException) {
3498 + {if (true) throw (RuntimeException)jjte000;}
3500 + if (jjte000 instanceof ParseException) {
3501 + {if (true) throw (ParseException)jjte000;}
3503 + {if (true) throw (Error)jjte000;}
3504 + } finally {
3505 + if (jjtc000) {
3506 + jjtree.closeNodeScope(jjtn000, true);
3509 + throw new Error("Missing return statement in function");
3512 + final public EvalItem UnaryExpr(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3513 + /*@bgen(jjtree) UnaryExpr */
3514 + SimpleNode jjtn000 = new SimpleNode(JJTUNARYEXPR);
3515 + boolean jjtc000 = true;
3516 + jjtree.openNodeScope(jjtn000);EvalItem expr;
3517 + try {
3518 + if (jj_2_8(2147483647)) {
3519 + expr = BaseEvalItem(over,pipes);
3520 + } else {
3521 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3522 + case 54:
3523 + jj_consume_token(54);
3524 + expr = InfixExpr(over,pipes);
3525 + jj_consume_token(55);
3526 + break;
3527 + default:
3528 + jj_la1[37] = jj_gen;
3529 + jj_consume_token(-1);
3530 + throw new ParseException();
3533 + jjtree.closeNodeScope(jjtn000, true);
3534 + jjtc000 = false;
3535 + {if (true) return expr;}
3536 + } catch (Throwable jjte000) {
3537 + if (jjtc000) {
3538 + jjtree.clearNodeScope(jjtn000);
3539 + jjtc000 = false;
3540 + } else {
3541 + jjtree.popNode();
3543 + if (jjte000 instanceof RuntimeException) {
3544 + {if (true) throw (RuntimeException)jjte000;}
3546 + if (jjte000 instanceof ParseException) {
3547 + {if (true) throw (ParseException)jjte000;}
3549 + {if (true) throw (Error)jjte000;}
3550 + } finally {
3551 + if (jjtc000) {
3552 + jjtree.closeNodeScope(jjtn000, true);
3555 + throw new Error("Missing return statement in function");
3558 + final public EvalItem BaseEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3559 + /*@bgen(jjtree) BaseEvalItem */
3560 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEVALITEM);
3561 + boolean jjtc000 = true;
3562 + jjtree.openNodeScope(jjtn000);EvalItem item;EvalItemList projection; SchemaItem subSchema = null;
3563 + try {
3564 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3565 + case QUOTEDSTRING:
3566 + item = Const();
3567 + break;
3568 + case GROUP:
3569 + case IDENTIFIER:
3570 + case DOLLARVAR:
3571 + case 54:
3572 + if (jj_2_9(2147483647)) {
3573 + item = FuncEvalItem(over,pipes);
3574 + } else {
3575 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3576 + case GROUP:
3577 + case IDENTIFIER:
3578 + case DOLLARVAR:
3579 + item = PColEvalItem(over,pipes);
3580 + break;
3581 + case 54:
3582 + item = BinCond(over,pipes);
3583 + break;
3584 + default:
3585 + jj_la1[38] = jj_gen;
3586 + jj_consume_token(-1);
3587 + throw new ParseException();
3590 + subSchema = item.mapInputSchema(over);
3591 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3592 + case 62:
3593 + jj_consume_token(62);
3594 + projection = BracketedSimpleProj(subSchema);
3595 + assertAtomic(item,false);
3596 + ((NestableEvalItem)item).addNestedEvalSpec(projection);
3597 + break;
3598 + default:
3599 + jj_la1[39] = jj_gen;
3602 + break;
3603 + default:
3604 + jj_la1[40] = jj_gen;
3605 + jj_consume_token(-1);
3606 + throw new ParseException();
3608 + jjtree.closeNodeScope(jjtn000, true);
3609 + jjtc000 = false;
3610 + {if (true) return item;}
3611 + } catch (Throwable jjte000) {
3612 + if (jjtc000) {
3613 + jjtree.clearNodeScope(jjtn000);
3614 + jjtc000 = false;
3615 + } else {
3616 + jjtree.popNode();
3618 + if (jjte000 instanceof RuntimeException) {
3619 + {if (true) throw (RuntimeException)jjte000;}
3621 + if (jjte000 instanceof ParseException) {
3622 + {if (true) throw (ParseException)jjte000;}
3624 + {if (true) throw (Error)jjte000;}
3625 + } finally {
3626 + if (jjtc000) {
3627 + jjtree.closeNodeScope(jjtn000, true);
3630 + throw new Error("Missing return statement in function");
3633 + final public NestableEvalItem BinCond(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3634 + /*@bgen(jjtree) BinCond */
3635 + SimpleNode jjtn000 = new SimpleNode(JJTBINCOND);
3636 + boolean jjtc000 = true;
3637 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;
3638 + try {
3639 + jj_consume_token(54);
3640 + cond = PCond(over,pipes);
3641 + jj_consume_token(63);
3642 + ifTrue = BaseEvalItem(over,pipes);
3643 + jj_consume_token(64);
3644 + ifFalse = BaseEvalItem(over,pipes);
3645 + jj_consume_token(55);
3646 + jjtree.closeNodeScope(jjtn000, true);
3647 + jjtc000 = false;
3648 + {if (true) return new BinCond(pigContext, cond,ifTrue,ifFalse);}
3649 + } catch (Throwable jjte000) {
3650 + if (jjtc000) {
3651 + jjtree.clearNodeScope(jjtn000);
3652 + jjtc000 = false;
3653 + } else {
3654 + jjtree.popNode();
3656 + if (jjte000 instanceof RuntimeException) {
3657 + {if (true) throw (RuntimeException)jjte000;}
3659 + if (jjte000 instanceof ParseException) {
3660 + {if (true) throw (ParseException)jjte000;}
3662 + {if (true) throw (Error)jjte000;}
3663 + } finally {
3664 + if (jjtc000) {
3665 + jjtree.closeNodeScope(jjtn000, true);
3668 + throw new Error("Missing return statement in function");
3671 + final public NestableEvalItem FuncEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3672 + /*@bgen(jjtree) FuncEvalItem */
3673 + SimpleNode jjtn000 = new SimpleNode(JJTFUNCEVALITEM);
3674 + boolean jjtc000 = true;
3675 + jjtree.openNodeScope(jjtn000);EvalFunc func; EvalItemList args; NestableEvalItem i;
3676 + try {
3677 + func = EvalFunction();
3678 + jj_consume_token(54);
3679 + args = EvalArgs(over,pipes);
3680 + jj_consume_token(55);
3681 + i = newFuncEvalItem(func, args);
3682 + jjtree.closeNodeScope(jjtn000, true);
3683 + jjtc000 = false;
3684 + {if (true) return i;}
3685 + } catch (Throwable jjte000) {
3686 + if (jjtc000) {
3687 + jjtree.clearNodeScope(jjtn000);
3688 + jjtc000 = false;
3689 + } else {
3690 + jjtree.popNode();
3692 + if (jjte000 instanceof RuntimeException) {
3693 + {if (true) throw (RuntimeException)jjte000;}
3695 + if (jjte000 instanceof ParseException) {
3696 + {if (true) throw (ParseException)jjte000;}
3698 + {if (true) throw (Error)jjte000;}
3699 + } finally {
3700 + if (jjtc000) {
3701 + jjtree.closeNodeScope(jjtn000, true);
3704 + throw new Error("Missing return statement in function");
3707 + final public EvalItemList EvalArgs(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3708 + /*@bgen(jjtree) EvalArgs */
3709 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGS);
3710 + boolean jjtc000 = true;
3711 + jjtree.openNodeScope(jjtn000);EvalItemList list = new EvalItemList(pigContext); EvalItem item;
3712 + try {
3713 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3714 + case STAR:
3715 + case GROUP:
3716 + case IDENTIFIER:
3717 + case QUOTEDSTRING:
3718 + case DOLLARVAR:
3719 + case 54:
3720 + item = EvalArgsItem(over,pipes);
3721 + list.add(item);
3722 + label_11:
3723 + while (true) {
3724 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3725 + case 56:
3727 + break;
3728 + default:
3729 + jj_la1[41] = jj_gen;
3730 + break label_11;
3732 + jj_consume_token(56);
3733 + item = EvalArgsItem(over,pipes);
3734 + list.add(item);
3736 + break;
3737 + default:
3738 + jj_la1[42] = jj_gen;
3739 + list = new EvalItemList(pigContext);
3741 + jjtree.closeNodeScope(jjtn000, true);
3742 + jjtc000 = false;
3743 + if (!list.isSimple()){
3744 + {if (true) throw new ParseException("Cannot have non-jave function as an argument");}
3746 + {if (true) return list;}
3747 + } catch (Throwable jjte000) {
3748 + if (jjtc000) {
3749 + jjtree.clearNodeScope(jjtn000);
3750 + jjtc000 = false;
3751 + } else {
3752 + jjtree.popNode();
3754 + if (jjte000 instanceof RuntimeException) {
3755 + {if (true) throw (RuntimeException)jjte000;}
3757 + if (jjte000 instanceof ParseException) {
3758 + {if (true) throw (ParseException)jjte000;}
3760 + {if (true) throw (Error)jjte000;}
3761 + } finally {
3762 + if (jjtc000) {
3763 + jjtree.closeNodeScope(jjtn000, true);
3766 + throw new Error("Missing return statement in function");
3769 + final public EvalItem EvalArgsItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
3770 + /*@bgen(jjtree) EvalArgsItem */
3771 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGSITEM);
3772 + boolean jjtc000 = true;
3773 + jjtree.openNodeScope(jjtn000);EvalItem item;
3774 + try {
3775 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3776 + case GROUP:
3777 + case IDENTIFIER:
3778 + case QUOTEDSTRING:
3779 + case DOLLARVAR:
3780 + case 54:
3781 + item = InfixExpr(over,pipes);
3782 + break;
3783 + case STAR:
3784 + item = Star();
3785 + break;
3786 + default:
3787 + jj_la1[43] = jj_gen;
3788 + jj_consume_token(-1);
3789 + throw new ParseException();
3791 + jjtree.closeNodeScope(jjtn000, true);
3792 + jjtc000 = false;
3793 + {if (true) return item;}
3794 + } catch (Throwable jjte000) {
3795 + if (jjtc000) {
3796 + jjtree.clearNodeScope(jjtn000);
3797 + jjtc000 = false;
3798 + } else {
3799 + jjtree.popNode();
3801 + if (jjte000 instanceof RuntimeException) {
3802 + {if (true) throw (RuntimeException)jjte000;}
3804 + if (jjte000 instanceof ParseException) {
3805 + {if (true) throw (ParseException)jjte000;}
3807 + {if (true) throw (Error)jjte000;}
3808 + } finally {
3809 + if (jjtc000) {
3810 + jjtree.closeNodeScope(jjtn000, true);
3813 + throw new Error("Missing return statement in function");
3816 +// Map a user schema onto a LogicalOperator
3817 + final public SchemaItemList AsClause() throws ParseException {
3818 + /*@bgen(jjtree) AsClause */
3819 + SimpleNode jjtn000 = new SimpleNode(JJTASCLAUSE);
3820 + boolean jjtc000 = true;
3821 + jjtree.openNodeScope(jjtn000);Token t1; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); Token t = null;
3822 + try {
3823 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3824 + case GROUP:
3825 + case IDENTIFIER:
3826 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3827 + case IDENTIFIER:
3828 + t = jj_consume_token(IDENTIFIER);
3829 + break;
3830 + case GROUP:
3831 + t = jj_consume_token(GROUP);
3832 + break;
3833 + default:
3834 + jj_la1[44] = jj_gen;
3835 + jj_consume_token(-1);
3836 + throw new ParseException();
3838 + jj_consume_token(64);
3839 + break;
3840 + default:
3841 + jj_la1[45] = jj_gen;
3844 + jj_consume_token(54);
3845 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3846 + case GROUP:
3847 + case IDENTIFIER:
3848 + case 54:
3849 + case 65:
3850 + item = SchemaElement();
3851 + list.add(item);
3852 + label_12:
3853 + while (true) {
3854 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3855 + case 56:
3857 + break;
3858 + default:
3859 + jj_la1[46] = jj_gen;
3860 + break label_12;
3862 + jj_consume_token(56);
3863 + item = SchemaElement();
3864 + list.add(item);
3866 + break;
3867 + default:
3868 + jj_la1[47] = jj_gen;
3869 + list = new SchemaItemList();
3871 + jj_consume_token(55);
3872 + jjtree.closeNodeScope(jjtn000, true);
3873 + jjtc000 = false;
3874 + if (t!=null)
3875 + list.alias = t.image;
3876 + {if (true) return list;}
3877 + } catch (Throwable jjte000) {
3878 + if (jjtc000) {
3879 + jjtree.clearNodeScope(jjtn000);
3880 + jjtc000 = false;
3881 + } else {
3882 + jjtree.popNode();
3884 + if (jjte000 instanceof RuntimeException) {
3885 + {if (true) throw (RuntimeException)jjte000;}
3887 + if (jjte000 instanceof ParseException) {
3888 + {if (true) throw (ParseException)jjte000;}
3890 + {if (true) throw (Error)jjte000;}
3891 + } finally {
3892 + if (jjtc000) {
3893 + jjtree.closeNodeScope(jjtn000, true);
3896 + throw new Error("Missing return statement in function");
3899 + final public SchemaItem SchemaElement() throws ParseException {
3900 + /*@bgen(jjtree) SchemaElement */
3901 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAELEMENT);
3902 + boolean jjtc000 = true;
3903 + jjtree.openNodeScope(jjtn000);Token t1; SchemaItem item = null;
3904 + try {
3905 + if (jj_2_10(2147483647)) {
3906 + item = SchemaBag();
3907 + } else if (jj_2_11(2147483647)) {
3908 + item = SchemaTuple();
3909 + } else if (jj_2_12(2147483647)) {
3910 + item = SchemaField();
3911 + } else {
3912 + jj_consume_token(-1);
3913 + throw new ParseException();
3915 + jjtree.closeNodeScope(jjtn000, true);
3916 + jjtc000 = false;
3917 + {if (true) return item;}
3918 + } catch (Throwable jjte000) {
3919 + if (jjtc000) {
3920 + jjtree.clearNodeScope(jjtn000);
3921 + jjtc000 = false;
3922 + } else {
3923 + jjtree.popNode();
3925 + if (jjte000 instanceof RuntimeException) {
3926 + {if (true) throw (RuntimeException)jjte000;}
3928 + if (jjte000 instanceof ParseException) {
3929 + {if (true) throw (ParseException)jjte000;}
3931 + {if (true) throw (Error)jjte000;}
3932 + } finally {
3933 + if (jjtc000) {
3934 + jjtree.closeNodeScope(jjtn000, true);
3937 + throw new Error("Missing return statement in function");
3940 + final public SchemaItem SchemaField() throws ParseException {
3941 + /*@bgen(jjtree) SchemaField */
3942 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAFIELD);
3943 + boolean jjtc000 = true;
3944 + jjtree.openNodeScope(jjtn000);Token t1;
3945 + try {
3946 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3947 + case IDENTIFIER:
3948 + t1 = jj_consume_token(IDENTIFIER);
3949 + break;
3950 + case GROUP:
3951 + t1 = jj_consume_token(GROUP);
3952 + break;
3953 + default:
3954 + jj_la1[48] = jj_gen;
3955 + jj_consume_token(-1);
3956 + throw new ParseException();
3958 + jjtree.closeNodeScope(jjtn000, true);
3959 + jjtc000 = false;
3960 + {if (true) return new SchemaField(t1.image);}
3961 + } finally {
3962 + if (jjtc000) {
3963 + jjtree.closeNodeScope(jjtn000, true);
3966 + throw new Error("Missing return statement in function");
3969 + final public SchemaItem SchemaTuple() throws ParseException {
3970 + /*@bgen(jjtree) SchemaTuple */
3971 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMATUPLE);
3972 + boolean jjtc000 = true;
3973 + jjtree.openNodeScope(jjtn000);Token t1 = null; SchemaItem item = null; SchemaItemList list = new SchemaItemList();
3974 + try {
3975 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3976 + case GROUP:
3977 + case IDENTIFIER:
3978 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3979 + case IDENTIFIER:
3980 + t1 = jj_consume_token(IDENTIFIER);
3981 + break;
3982 + case GROUP:
3983 + t1 = jj_consume_token(GROUP);
3984 + break;
3985 + default:
3986 + jj_la1[49] = jj_gen;
3987 + jj_consume_token(-1);
3988 + throw new ParseException();
3990 + jj_consume_token(64);
3991 + break;
3992 + default:
3993 + jj_la1[50] = jj_gen;
3996 + jj_consume_token(54);
3997 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
3998 + case GROUP:
3999 + case IDENTIFIER:
4000 + case 54:
4001 + case 65:
4002 + item = SchemaElement();
4003 + list.add(item);
4004 + label_13:
4005 + while (true) {
4006 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4007 + case 56:
4009 + break;
4010 + default:
4011 + jj_la1[51] = jj_gen;
4012 + break label_13;
4014 + jj_consume_token(56);
4015 + item = SchemaElement();
4016 + list.add(item);
4018 + break;
4019 + default:
4020 + jj_la1[52] = jj_gen;
4023 + jj_consume_token(55);
4024 + jjtree.closeNodeScope(jjtn000, true);
4025 + jjtc000 = false;
4026 + if (t1!=null)
4027 + list.alias = t1.image;
4028 + list.setIsBag(false);
4029 + {if (true) return list;}
4030 + } catch (Throwable jjte000) {
4031 + if (jjtc000) {
4032 + jjtree.clearNodeScope(jjtn000);
4033 + jjtc000 = false;
4034 + } else {
4035 + jjtree.popNode();
4037 + if (jjte000 instanceof RuntimeException) {
4038 + {if (true) throw (RuntimeException)jjte000;}
4040 + if (jjte000 instanceof ParseException) {
4041 + {if (true) throw (ParseException)jjte000;}
4043 + {if (true) throw (Error)jjte000;}
4044 + } finally {
4045 + if (jjtc000) {
4046 + jjtree.closeNodeScope(jjtn000, true);
4049 + throw new Error("Missing return statement in function");
4052 + final public SchemaItem SchemaBag() throws ParseException {
4053 + /*@bgen(jjtree) SchemaBag */
4054 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMABAG);
4055 + boolean jjtc000 = true;
4056 + jjtree.openNodeScope(jjtn000);Token t1=null; SchemaItem item = null; SchemaItemList list = new SchemaItemList();
4057 + try {
4058 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4059 + case IDENTIFIER:
4060 + t1 = jj_consume_token(IDENTIFIER);
4061 + jj_consume_token(64);
4062 + break;
4063 + default:
4064 + jj_la1[53] = jj_gen;
4067 + jj_consume_token(65);
4068 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4069 + case GROUP:
4070 + case IDENTIFIER:
4071 + case 54:
4072 + case 65:
4073 + item = SchemaElement();
4074 + list.add(item);
4075 + label_14:
4076 + while (true) {
4077 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4078 + case 56:
4080 + break;
4081 + default:
4082 + jj_la1[54] = jj_gen;
4083 + break label_14;
4085 + jj_consume_token(56);
4086 + item = SchemaElement();
4087 + list.add(item);
4089 + break;
4090 + default:
4091 + jj_la1[55] = jj_gen;
4094 + jj_consume_token(66);
4095 + jjtree.closeNodeScope(jjtn000, true);
4096 + jjtc000 = false;
4097 + if (t1!=null)
4098 + list.alias = t1.image;
4099 + list.setIsBag(true);
4100 + {if (true) return list;}
4101 + } catch (Throwable jjte000) {
4102 + if (jjtc000) {
4103 + jjtree.clearNodeScope(jjtn000);
4104 + jjtc000 = false;
4105 + } else {
4106 + jjtree.popNode();
4108 + if (jjte000 instanceof RuntimeException) {
4109 + {if (true) throw (RuntimeException)jjte000;}
4111 + if (jjte000 instanceof ParseException) {
4112 + {if (true) throw (ParseException)jjte000;}
4114 + {if (true) throw (Error)jjte000;}
4115 + } finally {
4116 + if (jjtc000) {
4117 + jjtree.closeNodeScope(jjtn000, true);
4120 + throw new Error("Missing return statement in function");
4123 +// Used in serialization and deserialization
4124 + final public EvalSpecPipe PEvalSpecPipe() throws ParseException {
4125 + /*@bgen(jjtree) PEvalSpecPipe */
4126 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPECPIPE);
4127 + boolean jjtc000 = true;
4128 + jjtree.openNodeScope(jjtn000);EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalSpec spec;
4129 + try {
4130 + label_15:
4131 + while (true) {
4132 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4133 + case 65:
4135 + break;
4136 + default:
4137 + jj_la1[56] = jj_gen;
4138 + break label_15;
4140 + jj_consume_token(65);
4141 + spec = PEvalSpec();
4142 + jj_consume_token(66);
4143 + pipe.add(spec);
4145 + jjtree.closeNodeScope(jjtn000, true);
4146 + jjtc000 = false;
4147 + {if (true) return pipe;}
4148 + } catch (Throwable jjte000) {
4149 + if (jjtc000) {
4150 + jjtree.clearNodeScope(jjtn000);
4151 + jjtc000 = false;
4152 + } else {
4153 + jjtree.popNode();
4155 + if (jjte000 instanceof RuntimeException) {
4156 + {if (true) throw (RuntimeException)jjte000;}
4158 + if (jjte000 instanceof ParseException) {
4159 + {if (true) throw (ParseException)jjte000;}
4161 + {if (true) throw (Error)jjte000;}
4162 + } finally {
4163 + if (jjtc000) {
4164 + jjtree.closeNodeScope(jjtn000, true);
4167 + throw new Error("Missing return statement in function");
4170 + final public EvalSpec PEvalSpec() throws ParseException {
4171 + /*@bgen(jjtree) PEvalSpec */
4172 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPEC);
4173 + boolean jjtc000 = true;
4174 + jjtree.openNodeScope(jjtn000);EvalSpec spec;
4175 + try {
4176 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4177 + case FILTER:
4178 + jj_consume_token(FILTER);
4179 + spec = PFilter();
4180 + break;
4181 + case EVAL:
4182 + jj_consume_token(EVAL);
4183 + spec = PEvalItemList();
4184 + break;
4185 + case ORDER:
4186 + case ARRANGE:
4187 + case DISTINCT:
4188 + spec = PSAD();
4189 + break;
4190 + default:
4191 + jj_la1[57] = jj_gen;
4192 + jj_consume_token(-1);
4193 + throw new ParseException();
4195 + jjtree.closeNodeScope(jjtn000, true);
4196 + jjtc000 = false;
4197 + {if (true) return spec;}
4198 + } catch (Throwable jjte000) {
4199 + if (jjtc000) {
4200 + jjtree.clearNodeScope(jjtn000);
4201 + jjtc000 = false;
4202 + } else {
4203 + jjtree.popNode();
4205 + if (jjte000 instanceof RuntimeException) {
4206 + {if (true) throw (RuntimeException)jjte000;}
4208 + if (jjte000 instanceof ParseException) {
4209 + {if (true) throw (ParseException)jjte000;}
4211 + {if (true) throw (Error)jjte000;}
4212 + } finally {
4213 + if (jjtc000) {
4214 + jjtree.closeNodeScope(jjtn000, true);
4217 + throw new Error("Missing return statement in function");
4220 + final public EvalSpec PFilter() throws ParseException {
4221 + /*@bgen(jjtree) PFilter */
4222 + SimpleNode jjtn000 = new SimpleNode(JJTPFILTER);
4223 + boolean jjtc000 = true;
4224 + jjtree.openNodeScope(jjtn000);Cond cond;
4225 + try {
4226 + cond = PCond(null,null);
4227 + jjtree.closeNodeScope(jjtn000, true);
4228 + jjtc000 = false;
4229 + {if (true) return new FilterSpec(cond);}
4230 + } catch (Throwable jjte000) {
4231 + if (jjtc000) {
4232 + jjtree.clearNodeScope(jjtn000);
4233 + jjtc000 = false;
4234 + } else {
4235 + jjtree.popNode();
4237 + if (jjte000 instanceof RuntimeException) {
4238 + {if (true) throw (RuntimeException)jjte000;}
4240 + if (jjte000 instanceof ParseException) {
4241 + {if (true) throw (ParseException)jjte000;}
4243 + {if (true) throw (Error)jjte000;}
4244 + } finally {
4245 + if (jjtc000) {
4246 + jjtree.closeNodeScope(jjtn000, true);
4249 + throw new Error("Missing return statement in function");
4252 + final public EvalSpec PSAD() throws ParseException {
4253 + /*@bgen(jjtree) PSAD */
4254 + SimpleNode jjtn000 = new SimpleNode(JJTPSAD);
4255 + boolean jjtc000 = true;
4256 + jjtree.openNodeScope(jjtn000);EvalSpec sad; EvalItemList proj;
4257 + try {
4258 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4259 + case ORDER:
4260 + jj_consume_token(ORDER);
4261 + jj_consume_token(BY);
4262 + proj = SimpleProj(null);
4263 + sad = new SortArrangeSpec(proj, false);
4264 + break;
4265 + case ARRANGE:
4266 + jj_consume_token(ARRANGE);
4267 + jj_consume_token(BY);
4268 + proj = SimpleProj(null);
4269 + sad = new SortArrangeSpec(proj, true);
4270 + break;
4271 + case DISTINCT:
4272 + jj_consume_token(DISTINCT);
4273 + proj = SimpleProj(null);
4274 + sad = new DistinctSpec(proj);
4275 + break;
4276 + default:
4277 + jj_la1[58] = jj_gen;
4278 + jj_consume_token(-1);
4279 + throw new ParseException();
4281 + jjtree.closeNodeScope(jjtn000, true);
4282 + jjtc000 = false;
4283 + {if (true) return sad;}
4284 + } catch (Throwable jjte000) {
4285 + if (jjtc000) {
4286 + jjtree.clearNodeScope(jjtn000);
4287 + jjtc000 = false;
4288 + } else {
4289 + jjtree.popNode();
4291 + if (jjte000 instanceof RuntimeException) {
4292 + {if (true) throw (RuntimeException)jjte000;}
4294 + if (jjte000 instanceof ParseException) {
4295 + {if (true) throw (ParseException)jjte000;}
4297 + {if (true) throw (Error)jjte000;}
4298 + } finally {
4299 + if (jjtc000) {
4300 + jjtree.closeNodeScope(jjtn000, true);
4303 + throw new Error("Missing return statement in function");
4306 + final public EvalItemList PEvalItemList() throws ParseException {
4307 + /*@bgen(jjtree) PEvalItemList */
4308 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEMLIST);
4309 + boolean jjtc000 = true;
4310 + jjtree.openNodeScope(jjtn000);EvalItemList list = new EvalItemList(pigContext); EvalItem item;
4311 + try {
4312 + item = PEvalItem();
4313 + list.add(item);
4314 + label_16:
4315 + while (true) {
4316 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4317 + case 56:
4319 + break;
4320 + default:
4321 + jj_la1[59] = jj_gen;
4322 + break label_16;
4324 + jj_consume_token(56);
4325 + item = PEvalItem();
4326 + list.add(item);
4328 + jjtree.closeNodeScope(jjtn000, true);
4329 + jjtc000 = false;
4330 + {if (true) return list;}
4331 + } catch (Throwable jjte000) {
4332 + if (jjtc000) {
4333 + jjtree.clearNodeScope(jjtn000);
4334 + jjtc000 = false;
4335 + } else {
4336 + jjtree.popNode();
4338 + if (jjte000 instanceof RuntimeException) {
4339 + {if (true) throw (RuntimeException)jjte000;}
4341 + if (jjte000 instanceof ParseException) {
4342 + {if (true) throw (ParseException)jjte000;}
4344 + {if (true) throw (Error)jjte000;}
4345 + } finally {
4346 + if (jjtc000) {
4347 + jjtree.closeNodeScope(jjtn000, true);
4350 + throw new Error("Missing return statement in function");
4353 + final public EvalItem PEvalItem() throws ParseException {
4354 + /*@bgen(jjtree) PEvalItem */
4355 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEM);
4356 + boolean jjtc000 = true;
4357 + jjtree.openNodeScope(jjtn000);EvalItem item; EvalSpec subSpec; EvalItemList subProj; LogicalOperator subOp = null;
4358 + try {
4359 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4360 + case QUOTEDSTRING:
4361 + item = Const();
4362 + break;
4363 + case STAR:
4364 + item = Star();
4365 + break;
4366 + case IDENTIFIER:
4367 + case DOLLARVAR:
4368 + case 54:
4369 + item = PNestableEvalItem();
4370 + label_17:
4371 + while (true) {
4372 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4373 + case 65:
4375 + break;
4376 + default:
4377 + jj_la1[60] = jj_gen;
4378 + break label_17;
4380 + jj_consume_token(65);
4381 + subSpec = PEvalSpec();
4382 + jj_consume_token(66);
4383 + ((NestableEvalItem) item).addNestedEvalSpec(subSpec);
4385 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4386 + case 62:
4387 + jj_consume_token(62);
4388 + jj_consume_token(54);
4389 + Star();
4390 + jj_consume_token(55);
4391 + EvalItemList list = new EvalItemList(pigContext);
4392 + list.add(new StarEvalItem(pigContext));
4393 + ((NestableEvalItem) item).subColSpec = list;
4394 + break;
4395 + default:
4396 + jj_la1[61] = jj_gen;
4399 + break;
4400 + default:
4401 + jj_la1[62] = jj_gen;
4402 + jj_consume_token(-1);
4403 + throw new ParseException();
4405 + jjtree.closeNodeScope(jjtn000, true);
4406 + jjtc000 = false;
4407 + {if (true) return item;}
4408 + } catch (Throwable jjte000) {
4409 + if (jjtc000) {
4410 + jjtree.clearNodeScope(jjtn000);
4411 + jjtc000 = false;
4412 + } else {
4413 + jjtree.popNode();
4415 + if (jjte000 instanceof RuntimeException) {
4416 + {if (true) throw (RuntimeException)jjte000;}
4418 + if (jjte000 instanceof ParseException) {
4419 + {if (true) throw (ParseException)jjte000;}
4421 + {if (true) throw (Error)jjte000;}
4422 + } finally {
4423 + if (jjtc000) {
4424 + jjtree.closeNodeScope(jjtn000, true);
4427 + throw new Error("Missing return statement in function");
4430 + final public NestableEvalItem PNestableEvalItem() throws ParseException {
4431 + /*@bgen(jjtree) PNestableEvalItem */
4432 + SimpleNode jjtn000 = new SimpleNode(JJTPNESTABLEEVALITEM);
4433 + boolean jjtc000 = true;
4434 + jjtree.openNodeScope(jjtn000);NestableEvalItem item;
4435 + try {
4436 + if (jj_2_13(2147483647)) {
4437 + item = EvalFunctionItem();
4438 + } else if (jj_2_14(2147483647)) {
4439 + item = DollarVar();
4440 + } else if (jj_2_15(2147483647)) {
4441 + item = SerializedBinCond();
4442 + } else {
4443 + jj_consume_token(-1);
4444 + throw new ParseException();
4446 + jjtree.closeNodeScope(jjtn000, true);
4447 + jjtc000 = false;
4448 + {if (true) return item;}
4449 + } catch (Throwable jjte000) {
4450 + if (jjtc000) {
4451 + jjtree.clearNodeScope(jjtn000);
4452 + jjtc000 = false;
4453 + } else {
4454 + jjtree.popNode();
4456 + if (jjte000 instanceof RuntimeException) {
4457 + {if (true) throw (RuntimeException)jjte000;}
4459 + if (jjte000 instanceof ParseException) {
4460 + {if (true) throw (ParseException)jjte000;}
4462 + {if (true) throw (Error)jjte000;}
4463 + } finally {
4464 + if (jjtc000) {
4465 + jjtree.closeNodeScope(jjtn000, true);
4468 + throw new Error("Missing return statement in function");
4471 + final public NestableEvalItem EvalFunctionItem() throws ParseException {
4472 + /*@bgen(jjtree) EvalFunctionItem */
4473 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTIONITEM);
4474 + boolean jjtc000 = true;
4475 + jjtree.openNodeScope(jjtn000);EvalFunc func; EvalItemList args; NestableEvalItem i;
4476 + try {
4477 + func = EvalFunction();
4478 + jj_consume_token(54);
4479 + args = PEvalItemList();
4480 + jj_consume_token(55);
4481 + i = newFuncEvalItem(func, args);
4482 + jjtree.closeNodeScope(jjtn000, true);
4483 + jjtc000 = false;
4484 + {if (true) return i;}
4485 + } catch (Throwable jjte000) {
4486 + if (jjtc000) {
4487 + jjtree.clearNodeScope(jjtn000);
4488 + jjtc000 = false;
4489 + } else {
4490 + jjtree.popNode();
4492 + if (jjte000 instanceof RuntimeException) {
4493 + {if (true) throw (RuntimeException)jjte000;}
4495 + if (jjte000 instanceof ParseException) {
4496 + {if (true) throw (ParseException)jjte000;}
4498 + {if (true) throw (Error)jjte000;}
4499 + } finally {
4500 + if (jjtc000) {
4501 + jjtree.closeNodeScope(jjtn000, true);
4504 + throw new Error("Missing return statement in function");
4507 + final public NestableEvalItem SerializedBinCond() throws ParseException {
4508 + /*@bgen(jjtree) SerializedBinCond */
4509 + SimpleNode jjtn000 = new SimpleNode(JJTSERIALIZEDBINCOND);
4510 + boolean jjtc000 = true;
4511 + jjtree.openNodeScope(jjtn000);Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;
4512 + try {
4513 + jj_consume_token(54);
4514 + cond = PSerializedCond();
4515 + jj_consume_token(63);
4516 + ifTrue = PEvalItem();
4517 + jj_consume_token(64);
4518 + ifFalse = PEvalItem();
4519 + jj_consume_token(55);
4520 + jjtree.closeNodeScope(jjtn000, true);
4521 + jjtc000 = false;
4522 + {if (true) return new BinCond(pigContext, cond,ifTrue,ifFalse);}
4523 + } catch (Throwable jjte000) {
4524 + if (jjtc000) {
4525 + jjtree.clearNodeScope(jjtn000);
4526 + jjtc000 = false;
4527 + } else {
4528 + jjtree.popNode();
4530 + if (jjte000 instanceof RuntimeException) {
4531 + {if (true) throw (RuntimeException)jjte000;}
4533 + if (jjte000 instanceof ParseException) {
4534 + {if (true) throw (ParseException)jjte000;}
4536 + {if (true) throw (Error)jjte000;}
4537 + } finally {
4538 + if (jjtc000) {
4539 + jjtree.closeNodeScope(jjtn000, true);
4542 + throw new Error("Missing return statement in function");
4545 + final public Cond PSerializedCond() throws ParseException {
4546 + /*@bgen(jjtree) PSerializedCond */
4547 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDCOND);
4548 + boolean jjtc000 = true;
4549 + jjtree.openNodeScope(jjtn000);Cond cond = null;
4550 + try {
4551 + cond = PSerializedOrCond();
4552 + jjtree.closeNodeScope(jjtn000, true);
4553 + jjtc000 = false;
4554 + {if (true) return cond;}
4555 + } catch (Throwable jjte000) {
4556 + if (jjtc000) {
4557 + jjtree.clearNodeScope(jjtn000);
4558 + jjtc000 = false;
4559 + } else {
4560 + jjtree.popNode();
4562 + if (jjte000 instanceof RuntimeException) {
4563 + {if (true) throw (RuntimeException)jjte000;}
4565 + if (jjte000 instanceof ParseException) {
4566 + {if (true) throw (ParseException)jjte000;}
4568 + {if (true) throw (Error)jjte000;}
4569 + } finally {
4570 + if (jjtc000) {
4571 + jjtree.closeNodeScope(jjtn000, true);
4574 + throw new Error("Missing return statement in function");
4577 + final public Cond PSerializedOrCond() throws ParseException {
4578 + /*@bgen(jjtree) PSerializedOrCond */
4579 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDORCOND);
4580 + boolean jjtc000 = true;
4581 + jjtree.openNodeScope(jjtn000);Cond cond; List<Cond> cList = new ArrayList<Cond>();
4582 + try {
4583 + cond = PSerializedAndCond();
4584 + cList.add(cond);
4585 + label_18:
4586 + while (true) {
4587 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4588 + case OR:
4590 + break;
4591 + default:
4592 + jj_la1[63] = jj_gen;
4593 + break label_18;
4595 + jj_consume_token(OR);
4596 + cond = PSerializedAndCond();
4597 + cList.add(cond);
4599 + jjtree.closeNodeScope(jjtn000, true);
4600 + jjtc000 = false;
4601 + if (cList.size()==1)
4602 + {if (true) return cond;}
4603 + else
4604 + {if (true) return new OrCond(cList);}
4605 + } catch (Throwable jjte000) {
4606 + if (jjtc000) {
4607 + jjtree.clearNodeScope(jjtn000);
4608 + jjtc000 = false;
4609 + } else {
4610 + jjtree.popNode();
4612 + if (jjte000 instanceof RuntimeException) {
4613 + {if (true) throw (RuntimeException)jjte000;}
4615 + if (jjte000 instanceof ParseException) {
4616 + {if (true) throw (ParseException)jjte000;}
4618 + {if (true) throw (Error)jjte000;}
4619 + } finally {
4620 + if (jjtc000) {
4621 + jjtree.closeNodeScope(jjtn000, true);
4624 + throw new Error("Missing return statement in function");
4627 + final public Cond PSerializedAndCond() throws ParseException {
4628 + /*@bgen(jjtree) PSerializedAndCond */
4629 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDANDCOND);
4630 + boolean jjtc000 = true;
4631 + jjtree.openNodeScope(jjtn000);Cond cond = null; List<Cond> cList = new ArrayList<Cond>();
4632 + try {
4633 + cond = PSerializedUnaryCond();
4634 + cList.add(cond);
4635 + label_19:
4636 + while (true) {
4637 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4638 + case AND:
4640 + break;
4641 + default:
4642 + jj_la1[64] = jj_gen;
4643 + break label_19;
4645 + jj_consume_token(AND);
4646 + cond = PSerializedUnaryCond();
4647 + cList.add(cond);
4649 + jjtree.closeNodeScope(jjtn000, true);
4650 + jjtc000 = false;
4651 + if (cList.size()==1)
4652 + {if (true) return cond;}
4653 + else
4654 + {if (true) return new AndCond(cList);}
4655 + } catch (Throwable jjte000) {
4656 + if (jjtc000) {
4657 + jjtree.clearNodeScope(jjtn000);
4658 + jjtc000 = false;
4659 + } else {
4660 + jjtree.popNode();
4662 + if (jjte000 instanceof RuntimeException) {
4663 + {if (true) throw (RuntimeException)jjte000;}
4665 + if (jjte000 instanceof ParseException) {
4666 + {if (true) throw (ParseException)jjte000;}
4668 + {if (true) throw (Error)jjte000;}
4669 + } finally {
4670 + if (jjtc000) {
4671 + jjtree.closeNodeScope(jjtn000, true);
4674 + throw new Error("Missing return statement in function");
4677 + final public Cond PSerializedUnaryCond() throws ParseException {
4678 + /*@bgen(jjtree) PSerializedUnaryCond */
4679 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDUNARYCOND);
4680 + boolean jjtc000 = true;
4681 + jjtree.openNodeScope(jjtn000);Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;
4682 + try {
4683 + if (jj_2_16(2147483647)) {
4684 + jj_consume_token(54);
4685 + cond = PSerializedCond();
4686 + jj_consume_token(55);
4687 + } else {
4688 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4689 + case NOT:
4690 + cond = PSerializedNotCond();
4691 + break;
4692 + default:
4693 + jj_la1[65] = jj_gen;
4694 + if (jj_2_17(2147483647)) {
4695 + c1 = PEvalItem();
4696 + t1 = jj_consume_token(FILTEROP);
4697 + c2 = PEvalItem();
4698 + cond = new CompCond(c1, t1.image, c2);
4699 + } else if (jj_2_18(2147483647)) {
4700 + c1 = PEvalItem();
4701 + jj_consume_token(MATCHES);
4702 + t1 = jj_consume_token(QUOTEDSTRING);
4703 + cond = new RegexpCond(c1, unquote(t1.image));
4704 + } else {
4705 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4706 + case IDENTIFIER:
4707 + func = FilterFunction();
4708 + jj_consume_token(54);
4709 + args = PEvalItemList();
4710 + jj_consume_token(55);
4711 + cond = new FuncCond(func, args);
4712 + break;
4713 + default:
4714 + jj_la1[66] = jj_gen;
4715 + jj_consume_token(-1);
4716 + throw new ParseException();
4721 + jjtree.closeNodeScope(jjtn000, true);
4722 + jjtc000 = false;
4723 + {if (true) return cond;}
4724 + } catch (Throwable jjte000) {
4725 + if (jjtc000) {
4726 + jjtree.clearNodeScope(jjtn000);
4727 + jjtc000 = false;
4728 + } else {
4729 + jjtree.popNode();
4731 + if (jjte000 instanceof RuntimeException) {
4732 + {if (true) throw (RuntimeException)jjte000;}
4734 + if (jjte000 instanceof ParseException) {
4735 + {if (true) throw (ParseException)jjte000;}
4737 + {if (true) throw (Error)jjte000;}
4738 + } finally {
4739 + if (jjtc000) {
4740 + jjtree.closeNodeScope(jjtn000, true);
4743 + throw new Error("Missing return statement in function");
4746 + final public Cond PSerializedNotCond() throws ParseException {
4747 + /*@bgen(jjtree) PSerializedNotCond */
4748 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDNOTCOND);
4749 + boolean jjtc000 = true;
4750 + jjtree.openNodeScope(jjtn000);Cond c1;
4751 + try {
4752 + jj_consume_token(NOT);
4753 + c1 = PSerializedUnaryCond();
4754 + jjtree.closeNodeScope(jjtn000, true);
4755 + jjtc000 = false;
4756 + {if (true) return new NotCond(c1);}
4757 + } catch (Throwable jjte000) {
4758 + if (jjtc000) {
4759 + jjtree.clearNodeScope(jjtn000);
4760 + jjtc000 = false;
4761 + } else {
4762 + jjtree.popNode();
4764 + if (jjte000 instanceof RuntimeException) {
4765 + {if (true) throw (RuntimeException)jjte000;}
4767 + if (jjte000 instanceof ParseException) {
4768 + {if (true) throw (ParseException)jjte000;}
4770 + {if (true) throw (Error)jjte000;}
4771 + } finally {
4772 + if (jjtc000) {
4773 + jjtree.closeNodeScope(jjtn000, true);
4776 + throw new Error("Missing return statement in function");
4779 +//CQ stuff
4780 + final public EvalSpec PWindow() throws ParseException {
4781 + /*@bgen(jjtree) PWindow */
4782 + SimpleNode jjtn000 = new SimpleNode(JJTPWINDOW);
4783 + boolean jjtc000 = true;
4784 + jjtree.openNodeScope(jjtn000);EvalSpec spec; int numTuples; double time;
4785 + try {
4786 + jj_consume_token(WINDOW);
4787 + if (jj_2_19(2)) {
4788 + time = PTimeWindow();
4789 + spec = new TimeWindowSpec(WindowSpec.windowType.SLIDING, time);
4790 + } else {
4791 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4792 + case NUMBER:
4793 + numTuples = PTupleWindow();
4794 + spec = new TupleWindowSpec(WindowSpec.windowType.SLIDING, numTuples);
4795 + break;
4796 + default:
4797 + jj_la1[67] = jj_gen;
4798 + jj_consume_token(-1);
4799 + throw new ParseException();
4802 + jjtree.closeNodeScope(jjtn000, true);
4803 + jjtc000 = false;
4804 + {if (true) return spec;}
4805 + } catch (Throwable jjte000) {
4806 + if (jjtc000) {
4807 + jjtree.clearNodeScope(jjtn000);
4808 + jjtc000 = false;
4809 + } else {
4810 + jjtree.popNode();
4812 + if (jjte000 instanceof RuntimeException) {
4813 + {if (true) throw (RuntimeException)jjte000;}
4815 + if (jjte000 instanceof ParseException) {
4816 + {if (true) throw (ParseException)jjte000;}
4818 + {if (true) throw (Error)jjte000;}
4819 + } finally {
4820 + if (jjtc000) {
4821 + jjtree.closeNodeScope(jjtn000, true);
4824 + throw new Error("Missing return statement in function");
4827 + final public double PTimeWindow() throws ParseException {
4828 + /*@bgen(jjtree) PTimeWindow */
4829 + SimpleNode jjtn000 = new SimpleNode(JJTPTIMEWINDOW);
4830 + boolean jjtc000 = true;
4831 + jjtree.openNodeScope(jjtn000);double n; Token t;
4832 + try {
4833 + t = jj_consume_token(NUMBER);
4834 + n = Double.parseDouble(t.image);
4835 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
4836 + case SECONDS:
4837 + jj_consume_token(SECONDS);
4838 + break;
4839 + case MINUTES:
4840 + jj_consume_token(MINUTES);
4841 + n = n*60;
4842 + break;
4843 + case HOURS:
4844 + jj_consume_token(HOURS);
4845 + n = n * 3600;
4846 + break;
4847 + default:
4848 + jj_la1[68] = jj_gen;
4849 + jj_consume_token(-1);
4850 + throw new ParseException();
4852 + jjtree.closeNodeScope(jjtn000, true);
4853 + jjtc000 = false;
4854 + {if (true) return n;}
4855 + } finally {
4856 + if (jjtc000) {
4857 + jjtree.closeNodeScope(jjtn000, true);
4860 + throw new Error("Missing return statement in function");
4863 + final public int PTupleWindow() throws ParseException {
4864 + /*@bgen(jjtree) PTupleWindow */
4865 + SimpleNode jjtn000 = new SimpleNode(JJTPTUPLEWINDOW);
4866 + boolean jjtc000 = true;
4867 + jjtree.openNodeScope(jjtn000);int n; Token t;
4868 + try {
4869 + t = jj_consume_token(NUMBER);
4870 + try{
4871 + n = Integer.parseInt(t.image);
4872 + }catch(NumberFormatException e){
4873 + {if (true) throw new ParseException("Only whole number tuple windows allowed.");}
4875 + jj_consume_token(TUPLES);
4876 + jjtree.closeNodeScope(jjtn000, true);
4877 + jjtc000 = false;
4878 + {if (true) return n;}
4879 + } finally {
4880 + if (jjtc000) {
4881 + jjtree.closeNodeScope(jjtn000, true);
4884 + throw new Error("Missing return statement in function");
4887 +// These the simple non-terminals that are shared across many
4888 + final public EvalFunc EvalFunction() throws ParseException {
4889 + /*@bgen(jjtree) EvalFunction */
4890 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTION);
4891 + boolean jjtc000 = true;
4892 + jjtree.openNodeScope(jjtn000);String funcName;
4893 + try {
4894 + funcName = QualifiedFunction();
4895 + jjtree.closeNodeScope(jjtn000, true);
4896 + jjtc000 = false;
4897 + {if (true) return (EvalFunc) pigContext.getUDF(funcName);}
4898 + } catch (Throwable jjte000) {
4899 + if (jjtc000) {
4900 + jjtree.clearNodeScope(jjtn000);
4901 + jjtc000 = false;
4902 + } else {
4903 + jjtree.popNode();
4905 + if (jjte000 instanceof RuntimeException) {
4906 + {if (true) throw (RuntimeException)jjte000;}
4908 + if (jjte000 instanceof ParseException) {
4909 + {if (true) throw (ParseException)jjte000;}
4911 + {if (true) throw (Error)jjte000;}
4912 + } finally {
4913 + if (jjtc000) {
4914 + jjtree.closeNodeScope(jjtn000, true);
4917 + throw new Error("Missing return statement in function");
4920 + final public GroupFunc GroupFunction() throws ParseException {
4921 + /*@bgen(jjtree) GroupFunction */
4922 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPFUNCTION);
4923 + boolean jjtc000 = true;
4924 + jjtree.openNodeScope(jjtn000);String funcName;
4925 + try {
4926 + funcName = QualifiedFunction();
4927 + jjtree.closeNodeScope(jjtn000, true);
4928 + jjtc000 = false;
4929 + {if (true) return (GroupFunc) pigContext.getUDF(funcName);}
4930 + } catch (Throwable jjte000) {
4931 + if (jjtc000) {
4932 + jjtree.clearNodeScope(jjtn000);
4933 + jjtc000 = false;
4934 + } else {
4935 + jjtree.popNode();
4937 + if (jjte000 instanceof RuntimeException) {
4938 + {if (true) throw (RuntimeException)jjte000;}
4940 + if (jjte000 instanceof ParseException) {
4941 + {if (true) throw (ParseException)jjte000;}
4943 + {if (true) throw (Error)jjte000;}
4944 + } finally {
4945 + if (jjtc000) {
4946 + jjtree.closeNodeScope(jjtn000, true);
4949 + throw new Error("Missing return statement in function");
4952 + final public StorageFunc LoadFunction() throws ParseException {
4953 + /*@bgen(jjtree) LoadFunction */
4954 + SimpleNode jjtn000 = new SimpleNode(JJTLOADFUNCTION);
4955 + boolean jjtc000 = true;
4956 + jjtree.openNodeScope(jjtn000);String funcName;
4957 + try {
4958 + funcName = QualifiedFunction();
4959 + jjtree.closeNodeScope(jjtn000, true);
4960 + jjtc000 = false;
4961 + {if (true) return (StorageFunc) pigContext.getUDF(funcName);}
4962 + } catch (Throwable jjte000) {
4963 + if (jjtc000) {
4964 + jjtree.clearNodeScope(jjtn000);
4965 + jjtc000 = false;
4966 + } else {
4967 + jjtree.popNode();
4969 + if (jjte000 instanceof RuntimeException) {
4970 + {if (true) throw (RuntimeException)jjte000;}
4972 + if (jjte000 instanceof ParseException) {
4973 + {if (true) throw (ParseException)jjte000;}
4975 + {if (true) throw (Error)jjte000;}
4976 + } finally {
4977 + if (jjtc000) {
4978 + jjtree.closeNodeScope(jjtn000, true);
4981 + throw new Error("Missing return statement in function");
4984 + final public FilterFunc FilterFunction() throws ParseException {
4985 + /*@bgen(jjtree) FilterFunction */
4986 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERFUNCTION);
4987 + boolean jjtc000 = true;
4988 + jjtree.openNodeScope(jjtn000);String funcName;
4989 + try {
4990 + funcName = QualifiedFunction();
4991 + jjtree.closeNodeScope(jjtn000, true);
4992 + jjtc000 = false;
4993 + {if (true) return (FilterFunc) pigContext.getUDF(funcName);}
4994 + } catch (Throwable jjte000) {
4995 + if (jjtc000) {
4996 + jjtree.clearNodeScope(jjtn000);
4997 + jjtc000 = false;
4998 + } else {
4999 + jjtree.popNode();
5001 + if (jjte000 instanceof RuntimeException) {
5002 + {if (true) throw (RuntimeException)jjte000;}
5004 + if (jjte000 instanceof ParseException) {
5005 + {if (true) throw (ParseException)jjte000;}
5007 + {if (true) throw (Error)jjte000;}
5008 + } finally {
5009 + if (jjtc000) {
5010 + jjtree.closeNodeScope(jjtn000, true);
5013 + throw new Error("Missing return statement in function");
5016 +/**
5017 + * Bug 831620 - '$' support
5018 + */
5019 + final public void ClassName() throws ParseException {
5020 + jj_consume_token(IDENTIFIER);
5021 + label_20:
5022 + while (true) {
5023 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5024 + case 62:
5025 + case 67:
5027 + break;
5028 + default:
5029 + jj_la1[69] = jj_gen;
5030 + break label_20;
5032 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5033 + case 62:
5034 + jj_consume_token(62);
5035 + jj_consume_token(IDENTIFIER);
5036 + break;
5037 + case 67:
5038 + jj_consume_token(67);
5039 + jj_consume_token(IDENTIFIER);
5040 + break;
5041 + default:
5042 + jj_la1[70] = jj_gen;
5043 + jj_consume_token(-1);
5044 + throw new ParseException();
5049 +/**
5050 + * Bug 831620 - '$' support
5051 + */
5052 + final public String QualifiedFunction() throws ParseException {
5053 + Token t1;StringBuffer s=new StringBuffer();
5054 + t1 = jj_consume_token(IDENTIFIER);
5055 + s.append(t1.image);
5056 + label_21:
5057 + while (true) {
5058 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5059 + case 62:
5060 + case 67:
5062 + break;
5063 + default:
5064 + jj_la1[71] = jj_gen;
5065 + break label_21;
5067 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5068 + case 62:
5069 + jj_consume_token(62);
5070 + t1 = jj_consume_token(IDENTIFIER);
5071 + s.append("." + t1.image);
5072 + break;
5073 + case 67:
5074 + jj_consume_token(67);
5075 + t1 = jj_consume_token(IDENTIFIER);
5076 + s.append("$" + t1.image);
5077 + break;
5078 + default:
5079 + jj_la1[72] = jj_gen;
5080 + jj_consume_token(-1);
5081 + throw new ParseException();
5084 + {if (true) return s.toString();}
5085 + throw new Error("Missing return statement in function");
5088 +// If there is one time it may not be bracketed, but if multiple, they must be bracketed
5089 + final public EvalItemList BracketedSimpleProj(SchemaItem over) throws ParseException {
5090 + /*@bgen(jjtree) BracketedSimpleProj */
5091 + SimpleNode jjtn000 = new SimpleNode(JJTBRACKETEDSIMPLEPROJ);
5092 + boolean jjtc000 = true;
5093 + jjtree.openNodeScope(jjtn000);EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);
5094 + try {
5095 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5096 + case STAR:
5097 + case GROUP:
5098 + case IDENTIFIER:
5099 + case QUOTEDSTRING:
5100 + case DOLLARVAR:
5101 + i = PSimpleProjItem(over);
5102 + proj.add(i);
5103 + break;
5104 + case 54:
5105 + jj_consume_token(54);
5106 + i = PSimpleProjItem(over);
5107 + proj.add(i);
5108 + label_22:
5109 + while (true) {
5110 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5111 + case 56:
5113 + break;
5114 + default:
5115 + jj_la1[73] = jj_gen;
5116 + break label_22;
5118 + jj_consume_token(56);
5119 + i = PSimpleProjItem(over);
5120 + proj.add(i);
5122 + jj_consume_token(55);
5123 + break;
5124 + default:
5125 + jj_la1[74] = jj_gen;
5126 + jj_consume_token(-1);
5127 + throw new ParseException();
5129 + jjtree.closeNodeScope(jjtn000, true);
5130 + jjtc000 = false;
5131 + {if (true) return proj;}
5132 + } catch (Throwable jjte000) {
5133 + if (jjtc000) {
5134 + jjtree.clearNodeScope(jjtn000);
5135 + jjtc000 = false;
5136 + } else {
5137 + jjtree.popNode();
5139 + if (jjte000 instanceof RuntimeException) {
5140 + {if (true) throw (RuntimeException)jjte000;}
5142 + if (jjte000 instanceof ParseException) {
5143 + {if (true) throw (ParseException)jjte000;}
5145 + {if (true) throw (Error)jjte000;}
5146 + } finally {
5147 + if (jjtc000) {
5148 + jjtree.closeNodeScope(jjtn000, true);
5151 + throw new Error("Missing return statement in function");
5154 + final public EvalItemList SimpleProjOrEmpty(SchemaItem over) throws ParseException {
5155 + /*@bgen(jjtree) SimpleProjOrEmpty */
5156 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJOREMPTY);
5157 + boolean jjtc000 = true;
5158 + jjtree.openNodeScope(jjtn000);EvalItemList list;
5159 + try {
5160 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5161 + case STAR:
5162 + case GROUP:
5163 + case IDENTIFIER:
5164 + case QUOTEDSTRING:
5165 + case DOLLARVAR:
5166 + list = SimpleProj(over);
5167 + break;
5168 + default:
5169 + jj_la1[75] = jj_gen;
5170 + list = new EvalItemList(pigContext);
5172 + jjtree.closeNodeScope(jjtn000, true);
5173 + jjtc000 = false;
5174 + {if (true) return list;}
5175 + } catch (Throwable jjte000) {
5176 + if (jjtc000) {
5177 + jjtree.clearNodeScope(jjtn000);
5178 + jjtc000 = false;
5179 + } else {
5180 + jjtree.popNode();
5182 + if (jjte000 instanceof RuntimeException) {
5183 + {if (true) throw (RuntimeException)jjte000;}
5185 + if (jjte000 instanceof ParseException) {
5186 + {if (true) throw (ParseException)jjte000;}
5188 + {if (true) throw (Error)jjte000;}
5189 + } finally {
5190 + if (jjtc000) {
5191 + jjtree.closeNodeScope(jjtn000, true);
5194 + throw new Error("Missing return statement in function");
5197 +//Just a simple list of projection items
5198 + final public EvalItemList SimpleProj(SchemaItem over) throws ParseException {
5199 + /*@bgen(jjtree) SimpleProj */
5200 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJ);
5201 + boolean jjtc000 = true;
5202 + jjtree.openNodeScope(jjtn000);EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);
5203 + try {
5204 + i = PSimpleProjItem(over);
5205 + proj.add(i);
5206 + label_23:
5207 + while (true) {
5208 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5209 + case 56:
5211 + break;
5212 + default:
5213 + jj_la1[76] = jj_gen;
5214 + break label_23;
5216 + jj_consume_token(56);
5217 + i = PSimpleProjItem(over);
5218 + proj.add(i);
5220 + jjtree.closeNodeScope(jjtn000, true);
5221 + jjtc000 = false;
5222 + {if (true) return proj;}
5223 + } catch (Throwable jjte000) {
5224 + if (jjtc000) {
5225 + jjtree.clearNodeScope(jjtn000);
5226 + jjtc000 = false;
5227 + } else {
5228 + jjtree.popNode();
5230 + if (jjte000 instanceof RuntimeException) {
5231 + {if (true) throw (RuntimeException)jjte000;}
5233 + if (jjte000 instanceof ParseException) {
5234 + {if (true) throw (ParseException)jjte000;}
5236 + {if (true) throw (Error)jjte000;}
5237 + } finally {
5238 + if (jjtc000) {
5239 + jjtree.closeNodeScope(jjtn000, true);
5242 + throw new Error("Missing return statement in function");
5245 + final public EvalItem PSimpleProjItem(SchemaItem over) throws ParseException {
5246 + /*@bgen(jjtree) PSimpleProjItem */
5247 + SimpleNode jjtn000 = new SimpleNode(JJTPSIMPLEPROJITEM);
5248 + boolean jjtc000 = true;
5249 + jjtree.openNodeScope(jjtn000);EvalItem item;
5250 + try {
5251 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5252 + case QUOTEDSTRING:
5253 + item = Const();
5254 + break;
5255 + case GROUP:
5256 + case IDENTIFIER:
5257 + case DOLLARVAR:
5258 + item = PColEvalItem(over,null);
5259 + break;
5260 + case STAR:
5261 + item = Star();
5262 + break;
5263 + default:
5264 + jj_la1[77] = jj_gen;
5265 + jj_consume_token(-1);
5266 + throw new ParseException();
5268 + jjtree.closeNodeScope(jjtn000, true);
5269 + jjtc000 = false;
5270 + {if (true) return item;}
5271 + } catch (Throwable jjte000) {
5272 + if (jjtc000) {
5273 + jjtree.clearNodeScope(jjtn000);
5274 + jjtc000 = false;
5275 + } else {
5276 + jjtree.popNode();
5278 + if (jjte000 instanceof RuntimeException) {
5279 + {if (true) throw (RuntimeException)jjte000;}
5281 + if (jjte000 instanceof ParseException) {
5282 + {if (true) throw (ParseException)jjte000;}
5284 + {if (true) throw (Error)jjte000;}
5285 + } finally {
5286 + if (jjtc000) {
5287 + jjtree.closeNodeScope(jjtn000, true);
5290 + throw new Error("Missing return statement in function");
5293 + final public EvalItem Star() throws ParseException {
5294 + /*@bgen(jjtree) Star */
5295 + SimpleNode jjtn000 = new SimpleNode(JJTSTAR);
5296 + boolean jjtc000 = true;
5297 + jjtree.openNodeScope(jjtn000);Token t1;
5298 + try {
5299 + t1 = jj_consume_token(STAR);
5300 + jjtree.closeNodeScope(jjtn000, true);
5301 + jjtc000 = false;
5302 + {if (true) return new StarEvalItem(pigContext);}
5303 + } finally {
5304 + if (jjtc000) {
5305 + jjtree.closeNodeScope(jjtn000, true);
5308 + throw new Error("Missing return statement in function");
5311 + final public EvalItem Const() throws ParseException {
5312 + /*@bgen(jjtree) Const */
5313 + SimpleNode jjtn000 = new SimpleNode(JJTCONST);
5314 + boolean jjtc000 = true;
5315 + jjtree.openNodeScope(jjtn000);Token t1;
5316 + try {
5317 + t1 = jj_consume_token(QUOTEDSTRING);
5318 + jjtree.closeNodeScope(jjtn000, true);
5319 + jjtc000 = false;
5320 + {if (true) return new ConstEvalItem(pigContext, unquote(t1.image));}
5321 + } finally {
5322 + if (jjtc000) {
5323 + jjtree.closeNodeScope(jjtn000, true);
5326 + throw new Error("Missing return statement in function");
5329 + final public EvalItem PColEvalItem(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
5330 + /*@bgen(jjtree) PColEvalItem */
5331 + SimpleNode jjtn000 = new SimpleNode(JJTPCOLEVALITEM);
5332 + boolean jjtc000 = true;
5333 + jjtree.openNodeScope(jjtn000);EvalItem item;
5334 + try {
5335 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5336 + case DOLLARVAR:
5337 + item = DollarVar();
5338 + break;
5339 + case GROUP:
5340 + case IDENTIFIER:
5341 + item = AliasField(over, pipes);
5342 + break;
5343 + default:
5344 + jj_la1[78] = jj_gen;
5345 + jj_consume_token(-1);
5346 + throw new ParseException();
5348 + jjtree.closeNodeScope(jjtn000, true);
5349 + jjtc000 = false;
5350 + {if (true) return item;}
5351 + } catch (Throwable jjte000) {
5352 + if (jjtc000) {
5353 + jjtree.clearNodeScope(jjtn000);
5354 + jjtc000 = false;
5355 + } else {
5356 + jjtree.popNode();
5358 + if (jjte000 instanceof RuntimeException) {
5359 + {if (true) throw (RuntimeException)jjte000;}
5361 + if (jjte000 instanceof ParseException) {
5362 + {if (true) throw (ParseException)jjte000;}
5364 + {if (true) throw (Error)jjte000;}
5365 + } finally {
5366 + if (jjtc000) {
5367 + jjtree.closeNodeScope(jjtn000, true);
5370 + throw new Error("Missing return statement in function");
5373 + final public ColEvalItem DollarVar() throws ParseException {
5374 + /*@bgen(jjtree) DollarVar */
5375 + SimpleNode jjtn000 = new SimpleNode(JJTDOLLARVAR);
5376 + boolean jjtc000 = true;
5377 + jjtree.openNodeScope(jjtn000);Token t1;
5378 + try {
5379 + t1 = jj_consume_token(DOLLARVAR);
5380 + jjtree.closeNodeScope(jjtn000, true);
5381 + jjtc000 = false;
5382 + {if (true) return new ColEvalItem(pigContext, undollar(t1.image));}
5383 + } finally {
5384 + if (jjtc000) {
5385 + jjtree.closeNodeScope(jjtn000, true);
5388 + throw new Error("Missing return statement in function");
5391 + final public EvalItem AliasField(SchemaItem over, Map<String, EvalItem> pipes) throws ParseException {
5392 + /*@bgen(jjtree) AliasField */
5393 + SimpleNode jjtn000 = new SimpleNode(JJTALIASFIELD);
5394 + boolean jjtc000 = true;
5395 + jjtree.openNodeScope(jjtn000);Token t1;
5396 + try {
5397 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
5398 + case GROUP:
5399 + t1 = jj_consume_token(GROUP);
5400 + break;
5401 + case IDENTIFIER:
5402 + t1 = jj_consume_token(IDENTIFIER);
5403 + break;
5404 + default:
5405 + jj_la1[79] = jj_gen;
5406 + jj_consume_token(-1);
5407 + throw new ParseException();
5409 + jjtree.closeNodeScope(jjtn000, true);
5410 + jjtc000 = false;
5411 + int i; EvalItem item = null;
5412 + if (pipes!=null)
5413 + item = pipes.get(t1.image);
5415 + if (item == null){
5416 + if ( over == null || (i = over.colFor(t1.image)) == -1)
5417 + {if (true) throw new ParseException("Invalid alias: " + t1.image + " in " + over.alias + "--> " + over);}
5418 + item = new ColEvalItem(pigContext, i);
5420 + {if (true) return item;}
5421 + } finally {
5422 + if (jjtc000) {
5423 + jjtree.closeNodeScope(jjtn000, true);
5426 + throw new Error("Missing return statement in function");
5429 + final private boolean jj_2_1(int xla) {
5430 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5431 + try { return !jj_3_1(); }
5432 + catch(LookaheadSuccess ls) { return true; }
5433 + finally { jj_save(0, xla); }
5436 + final private boolean jj_2_2(int xla) {
5437 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5438 + try { return !jj_3_2(); }
5439 + catch(LookaheadSuccess ls) { return true; }
5440 + finally { jj_save(1, xla); }
5443 + final private boolean jj_2_3(int xla) {
5444 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5445 + try { return !jj_3_3(); }
5446 + catch(LookaheadSuccess ls) { return true; }
5447 + finally { jj_save(2, xla); }
5450 + final private boolean jj_2_4(int xla) {
5451 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5452 + try { return !jj_3_4(); }
5453 + catch(LookaheadSuccess ls) { return true; }
5454 + finally { jj_save(3, xla); }
5457 + final private boolean jj_2_5(int xla) {
5458 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5459 + try { return !jj_3_5(); }
5460 + catch(LookaheadSuccess ls) { return true; }
5461 + finally { jj_save(4, xla); }
5464 + final private boolean jj_2_6(int xla) {
5465 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5466 + try { return !jj_3_6(); }
5467 + catch(LookaheadSuccess ls) { return true; }
5468 + finally { jj_save(5, xla); }
5471 + final private boolean jj_2_7(int xla) {
5472 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5473 + try { return !jj_3_7(); }
5474 + catch(LookaheadSuccess ls) { return true; }
5475 + finally { jj_save(6, xla); }
5478 + final private boolean jj_2_8(int xla) {
5479 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5480 + try { return !jj_3_8(); }
5481 + catch(LookaheadSuccess ls) { return true; }
5482 + finally { jj_save(7, xla); }
5485 + final private boolean jj_2_9(int xla) {
5486 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5487 + try { return !jj_3_9(); }
5488 + catch(LookaheadSuccess ls) { return true; }
5489 + finally { jj_save(8, xla); }
5492 + final private boolean jj_2_10(int xla) {
5493 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5494 + try { return !jj_3_10(); }
5495 + catch(LookaheadSuccess ls) { return true; }
5496 + finally { jj_save(9, xla); }
5499 + final private boolean jj_2_11(int xla) {
5500 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5501 + try { return !jj_3_11(); }
5502 + catch(LookaheadSuccess ls) { return true; }
5503 + finally { jj_save(10, xla); }
5506 + final private boolean jj_2_12(int xla) {
5507 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5508 + try { return !jj_3_12(); }
5509 + catch(LookaheadSuccess ls) { return true; }
5510 + finally { jj_save(11, xla); }
5513 + final private boolean jj_2_13(int xla) {
5514 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5515 + try { return !jj_3_13(); }
5516 + catch(LookaheadSuccess ls) { return true; }
5517 + finally { jj_save(12, xla); }
5520 + final private boolean jj_2_14(int xla) {
5521 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5522 + try { return !jj_3_14(); }
5523 + catch(LookaheadSuccess ls) { return true; }
5524 + finally { jj_save(13, xla); }
5527 + final private boolean jj_2_15(int xla) {
5528 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5529 + try { return !jj_3_15(); }
5530 + catch(LookaheadSuccess ls) { return true; }
5531 + finally { jj_save(14, xla); }
5534 + final private boolean jj_2_16(int xla) {
5535 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5536 + try { return !jj_3_16(); }
5537 + catch(LookaheadSuccess ls) { return true; }
5538 + finally { jj_save(15, xla); }
5541 + final private boolean jj_2_17(int xla) {
5542 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5543 + try { return !jj_3_17(); }
5544 + catch(LookaheadSuccess ls) { return true; }
5545 + finally { jj_save(16, xla); }
5548 + final private boolean jj_2_18(int xla) {
5549 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5550 + try { return !jj_3_18(); }
5551 + catch(LookaheadSuccess ls) { return true; }
5552 + finally { jj_save(17, xla); }
5555 + final private boolean jj_2_19(int xla) {
5556 + jj_la = xla; jj_lastpos = jj_scanpos = token;
5557 + try { return !jj_3_19(); }
5558 + catch(LookaheadSuccess ls) { return true; }
5559 + finally { jj_save(18, xla); }
5562 + final private boolean jj_3R_63() {
5563 + if (jj_3R_85()) return true;
5564 + Token xsp;
5565 + while (true) {
5566 + xsp = jj_scanpos;
5567 + if (jj_3R_86()) { jj_scanpos = xsp; break; }
5569 + return false;
5572 + final private boolean jj_3R_121() {
5573 + if (jj_3R_26()) return true;
5574 + if (jj_scan_token(54)) return true;
5575 + if (jj_3R_55()) return true;
5576 + if (jj_scan_token(55)) return true;
5577 + return false;
5580 + final private boolean jj_3R_120() {
5581 + if (jj_3R_38()) return true;
5582 + if (jj_scan_token(MATCHES)) return true;
5583 + if (jj_scan_token(QUOTEDSTRING)) return true;
5584 + return false;
5587 + final private boolean jj_3R_119() {
5588 + if (jj_3R_38()) return true;
5589 + if (jj_scan_token(FILTEROP)) return true;
5590 + if (jj_3R_38()) return true;
5591 + return false;
5594 + final private boolean jj_3R_118() {
5595 + if (jj_3R_129()) return true;
5596 + return false;
5599 + final private boolean jj_3R_117() {
5600 + if (jj_scan_token(54)) return true;
5601 + if (jj_3R_37()) return true;
5602 + if (jj_scan_token(55)) return true;
5603 + return false;
5606 + final private boolean jj_3R_99() {
5607 + Token xsp;
5608 + xsp = jj_scanpos;
5609 + if (jj_3R_117()) {
5610 + jj_scanpos = xsp;
5611 + if (jj_3R_118()) {
5612 + jj_scanpos = xsp;
5613 + if (jj_3R_119()) {
5614 + jj_scanpos = xsp;
5615 + if (jj_3R_120()) {
5616 + jj_scanpos = xsp;
5617 + if (jj_3R_121()) return true;
5622 + return false;
5625 + final private boolean jj_3R_64() {
5626 + if (jj_scan_token(OR)) return true;
5627 + if (jj_3R_63()) return true;
5628 + return false;
5631 + final private boolean jj_3R_126() {
5632 + Token xsp;
5633 + xsp = jj_scanpos;
5634 + if (jj_scan_token(29)) {
5635 + jj_scanpos = xsp;
5636 + if (jj_scan_token(46)) return true;
5638 + return false;
5641 + final private boolean jj_3R_42() {
5642 + if (jj_3R_63()) return true;
5643 + Token xsp;
5644 + while (true) {
5645 + xsp = jj_scanpos;
5646 + if (jj_3R_64()) { jj_scanpos = xsp; break; }
5648 + return false;
5651 + final private boolean jj_3R_100() {
5652 + if (jj_scan_token(AND)) return true;
5653 + if (jj_3R_99()) return true;
5654 + return false;
5657 + final private boolean jj_3R_25() {
5658 + if (jj_3R_42()) return true;
5659 + return false;
5662 + final private boolean jj_3R_35() {
5663 + if (jj_scan_token(DOLLARVAR)) return true;
5664 + return false;
5667 + final private boolean jj_3R_79() {
5668 + if (jj_3R_99()) return true;
5669 + Token xsp;
5670 + while (true) {
5671 + xsp = jj_scanpos;
5672 + if (jj_3R_100()) { jj_scanpos = xsp; break; }
5674 + return false;
5677 + final private boolean jj_3R_116() {
5678 + if (jj_3R_81()) return true;
5679 + return false;
5682 + final private boolean jj_3R_112() {
5683 + if (jj_3R_126()) return true;
5684 + return false;
5687 + final private boolean jj_3R_115() {
5688 + if (jj_3R_27()) return true;
5689 + return false;
5692 + final private boolean jj_3R_111() {
5693 + if (jj_3R_35()) return true;
5694 + return false;
5697 + final private boolean jj_3R_94() {
5698 + Token xsp;
5699 + xsp = jj_scanpos;
5700 + if (jj_3R_115()) {
5701 + jj_scanpos = xsp;
5702 + if (jj_3R_116()) return true;
5704 + return false;
5707 + final private boolean jj_3R_91() {
5708 + Token xsp;
5709 + xsp = jj_scanpos;
5710 + if (jj_3R_111()) {
5711 + jj_scanpos = xsp;
5712 + if (jj_3R_112()) return true;
5714 + return false;
5717 + final private boolean jj_3R_80() {
5718 + if (jj_scan_token(OR)) return true;
5719 + if (jj_3R_79()) return true;
5720 + return false;
5723 + final private boolean jj_3R_56() {
5724 + if (jj_3R_79()) return true;
5725 + Token xsp;
5726 + while (true) {
5727 + xsp = jj_scanpos;
5728 + if (jj_3R_80()) { jj_scanpos = xsp; break; }
5730 + return false;
5733 + final private boolean jj_3R_68() {
5734 + if (jj_scan_token(QUOTEDSTRING)) return true;
5735 + return false;
5738 + final private boolean jj_3R_74() {
5739 + return false;
5742 + final private boolean jj_3R_37() {
5743 + if (jj_3R_56()) return true;
5744 + return false;
5747 + final private boolean jj_3R_95() {
5748 + if (jj_scan_token(56)) return true;
5749 + if (jj_3R_94()) return true;
5750 + return false;
5753 + final private boolean jj_3R_81() {
5754 + if (jj_scan_token(STAR)) return true;
5755 + return false;
5758 + final private boolean jj_3R_73() {
5759 + if (jj_3R_94()) return true;
5760 + Token xsp;
5761 + while (true) {
5762 + xsp = jj_scanpos;
5763 + if (jj_3R_95()) { jj_scanpos = xsp; break; }
5765 + return false;
5768 + final private boolean jj_3R_48() {
5769 + Token xsp;
5770 + xsp = jj_scanpos;
5771 + if (jj_3R_73()) {
5772 + jj_scanpos = xsp;
5773 + if (jj_3R_74()) return true;
5775 + return false;
5778 + final private boolean jj_3R_134() {
5779 + if (jj_3R_81()) return true;
5780 + return false;
5783 + final private boolean jj_3R_133() {
5784 + if (jj_3R_91()) return true;
5785 + return false;
5788 + final private boolean jj_3R_30() {
5789 + if (jj_3R_47()) return true;
5790 + if (jj_scan_token(54)) return true;
5791 + if (jj_3R_48()) return true;
5792 + if (jj_scan_token(55)) return true;
5793 + return false;
5796 + final private boolean jj_3R_139() {
5797 + if (jj_scan_token(56)) return true;
5798 + if (jj_3R_127()) return true;
5799 + return false;
5802 + final private boolean jj_3R_132() {
5803 + if (jj_3R_68()) return true;
5804 + return false;
5807 + final private boolean jj_3R_127() {
5808 + Token xsp;
5809 + xsp = jj_scanpos;
5810 + if (jj_3R_132()) {
5811 + jj_scanpos = xsp;
5812 + if (jj_3R_133()) {
5813 + jj_scanpos = xsp;
5814 + if (jj_3R_134()) return true;
5817 + return false;
5820 + final private boolean jj_3R_36() {
5821 + if (jj_scan_token(54)) return true;
5822 + if (jj_3R_37()) return true;
5823 + if (jj_scan_token(63)) return true;
5824 + if (jj_3R_38()) return true;
5825 + if (jj_scan_token(64)) return true;
5826 + if (jj_3R_38()) return true;
5827 + if (jj_scan_token(55)) return true;
5828 + return false;
5831 + final private boolean jj_3_15() {
5832 + if (jj_3R_36()) return true;
5833 + return false;
5836 + final private boolean jj_3_13() {
5837 + if (jj_3R_34()) return true;
5838 + return false;
5841 + final private boolean jj_3_14() {
5842 + if (jj_3R_35()) return true;
5843 + return false;
5846 + final private boolean jj_3R_92() {
5847 + if (jj_scan_token(54)) return true;
5848 + if (jj_3R_25()) return true;
5849 + if (jj_scan_token(63)) return true;
5850 + if (jj_3R_29()) return true;
5851 + if (jj_scan_token(64)) return true;
5852 + if (jj_3R_29()) return true;
5853 + if (jj_scan_token(55)) return true;
5854 + return false;
5857 + final private boolean jj_3R_72() {
5858 + if (jj_scan_token(62)) return true;
5859 + if (jj_3R_93()) return true;
5860 + return false;
5863 + final private boolean jj_3R_34() {
5864 + if (jj_3R_47()) return true;
5865 + if (jj_scan_token(54)) return true;
5866 + if (jj_3R_55()) return true;
5867 + if (jj_scan_token(55)) return true;
5868 + return false;
5871 + final private boolean jj_3R_138() {
5872 + if (jj_3R_127()) return true;
5873 + Token xsp;
5874 + while (true) {
5875 + xsp = jj_scanpos;
5876 + if (jj_3R_139()) { jj_scanpos = xsp; break; }
5878 + return false;
5881 + final private boolean jj_3R_124() {
5882 + if (jj_3R_131()) return true;
5883 + return false;
5886 + final private boolean jj_3_9() {
5887 + if (jj_3R_30()) return true;
5888 + return false;
5891 + final private boolean jj_3R_103() {
5892 + if (jj_3R_36()) return true;
5893 + return false;
5896 + final private boolean jj_3R_102() {
5897 + if (jj_3R_35()) return true;
5898 + return false;
5901 + final private boolean jj_3R_101() {
5902 + if (jj_3R_34()) return true;
5903 + return false;
5906 + final private boolean jj_3R_82() {
5907 + Token xsp;
5908 + xsp = jj_scanpos;
5909 + if (jj_3R_101()) {
5910 + jj_scanpos = xsp;
5911 + if (jj_3R_102()) {
5912 + jj_scanpos = xsp;
5913 + if (jj_3R_103()) return true;
5916 + return false;
5919 + final private boolean jj_3R_128() {
5920 + if (jj_scan_token(56)) return true;
5921 + if (jj_3R_127()) return true;
5922 + return false;
5925 + final private boolean jj_3R_71() {
5926 + if (jj_3R_92()) return true;
5927 + return false;
5930 + final private boolean jj_3R_70() {
5931 + if (jj_3R_91()) return true;
5932 + return false;
5935 + final private boolean jj_3R_69() {
5936 + if (jj_3R_30()) return true;
5937 + return false;
5940 + final private boolean jj_3R_84() {
5941 + if (jj_scan_token(62)) return true;
5942 + if (jj_scan_token(54)) return true;
5943 + if (jj_3R_81()) return true;
5944 + if (jj_scan_token(55)) return true;
5945 + return false;
5948 + final private boolean jj_3R_114() {
5949 + if (jj_scan_token(54)) return true;
5950 + if (jj_3R_127()) return true;
5951 + Token xsp;
5952 + while (true) {
5953 + xsp = jj_scanpos;
5954 + if (jj_3R_128()) { jj_scanpos = xsp; break; }
5956 + if (jj_scan_token(55)) return true;
5957 + return false;
5960 + final private boolean jj_3R_62() {
5961 + if (jj_scan_token(IDENTIFIER)) return true;
5962 + return false;
5965 + final private boolean jj_3R_113() {
5966 + if (jj_3R_127()) return true;
5967 + return false;
5970 + final private boolean jj_3R_93() {
5971 + Token xsp;
5972 + xsp = jj_scanpos;
5973 + if (jj_3R_113()) {
5974 + jj_scanpos = xsp;
5975 + if (jj_3R_114()) return true;
5977 + return false;
5980 + final private boolean jj_3R_83() {
5981 + if (jj_scan_token(65)) return true;
5982 + if (jj_3R_104()) return true;
5983 + if (jj_scan_token(66)) return true;
5984 + return false;
5987 + final private boolean jj_3R_46() {
5988 + Token xsp;
5989 + xsp = jj_scanpos;
5990 + if (jj_3R_69()) {
5991 + jj_scanpos = xsp;
5992 + if (jj_3R_70()) {
5993 + jj_scanpos = xsp;
5994 + if (jj_3R_71()) return true;
5997 + xsp = jj_scanpos;
5998 + if (jj_3R_72()) jj_scanpos = xsp;
5999 + return false;
6002 + final private boolean jj_3R_45() {
6003 + if (jj_3R_68()) return true;
6004 + return false;
6007 + final private boolean jj_3R_29() {
6008 + Token xsp;
6009 + xsp = jj_scanpos;
6010 + if (jj_3R_45()) {
6011 + jj_scanpos = xsp;
6012 + if (jj_3R_46()) return true;
6014 + return false;
6017 + final private boolean jj_3_8() {
6018 + if (jj_3R_29()) return true;
6019 + return false;
6022 + final private boolean jj_3R_59() {
6023 + if (jj_3R_82()) return true;
6024 + Token xsp;
6025 + while (true) {
6026 + xsp = jj_scanpos;
6027 + if (jj_3R_83()) { jj_scanpos = xsp; break; }
6029 + xsp = jj_scanpos;
6030 + if (jj_3R_84()) jj_scanpos = xsp;
6031 + return false;
6034 + final private boolean jj_3R_88() {
6035 + if (jj_scan_token(67)) return true;
6036 + if (jj_scan_token(IDENTIFIER)) return true;
6037 + return false;
6040 + final private boolean jj_3R_41() {
6041 + if (jj_scan_token(54)) return true;
6042 + return false;
6045 + final private boolean jj_3R_58() {
6046 + if (jj_3R_81()) return true;
6047 + return false;
6050 + final private boolean jj_3R_87() {
6051 + if (jj_scan_token(62)) return true;
6052 + if (jj_scan_token(IDENTIFIER)) return true;
6053 + return false;
6056 + final private boolean jj_3_2() {
6057 + if (jj_scan_token(54)) return true;
6058 + if (jj_3R_24()) return true;
6059 + return false;
6062 + final private boolean jj_3R_57() {
6063 + if (jj_3R_68()) return true;
6064 + return false;
6067 + final private boolean jj_3R_65() {
6068 + Token xsp;
6069 + xsp = jj_scanpos;
6070 + if (jj_3R_87()) {
6071 + jj_scanpos = xsp;
6072 + if (jj_3R_88()) return true;
6074 + return false;
6077 + final private boolean jj_3R_40() {
6078 + if (jj_3R_62()) return true;
6079 + return false;
6082 + final private boolean jj_3R_38() {
6083 + Token xsp;
6084 + xsp = jj_scanpos;
6085 + if (jj_3R_57()) {
6086 + jj_scanpos = xsp;
6087 + if (jj_3R_58()) {
6088 + jj_scanpos = xsp;
6089 + if (jj_3R_59()) return true;
6092 + return false;
6095 + final private boolean jj_3R_123() {
6096 + if (jj_scan_token(EVAL)) return true;
6097 + if (jj_3R_55()) return true;
6098 + return false;
6101 + final private boolean jj_3R_24() {
6102 + Token xsp;
6103 + xsp = jj_scanpos;
6104 + if (jj_3R_40()) {
6105 + jj_scanpos = xsp;
6106 + if (jj_3_2()) {
6107 + jj_scanpos = xsp;
6108 + if (jj_3R_41()) return true;
6111 + return false;
6114 + final private boolean jj_3R_43() {
6115 + if (jj_scan_token(IDENTIFIER)) return true;
6116 + Token xsp;
6117 + while (true) {
6118 + xsp = jj_scanpos;
6119 + if (jj_3R_65()) { jj_scanpos = xsp; break; }
6121 + return false;
6124 + final private boolean jj_3R_110() {
6125 + if (jj_scan_token(54)) return true;
6126 + if (jj_3R_27()) return true;
6127 + if (jj_scan_token(55)) return true;
6128 + return false;
6131 + final private boolean jj_3R_78() {
6132 + if (jj_scan_token(56)) return true;
6133 + if (jj_3R_38()) return true;
6134 + return false;
6137 + final private boolean jj_3R_109() {
6138 + if (jj_3R_29()) return true;
6139 + return false;
6142 + final private boolean jj_3R_89() {
6143 + Token xsp;
6144 + xsp = jj_scanpos;
6145 + if (jj_3R_109()) {
6146 + jj_scanpos = xsp;
6147 + if (jj_3R_110()) return true;
6149 + return false;
6152 + final private boolean jj_3R_55() {
6153 + if (jj_3R_38()) return true;
6154 + Token xsp;
6155 + while (true) {
6156 + xsp = jj_scanpos;
6157 + if (jj_3R_78()) { jj_scanpos = xsp; break; }
6159 + return false;
6162 + final private boolean jj_3R_137() {
6163 + if (jj_scan_token(DISTINCT)) return true;
6164 + if (jj_3R_138()) return true;
6165 + return false;
6168 + final private boolean jj_3R_136() {
6169 + if (jj_scan_token(ARRANGE)) return true;
6170 + if (jj_scan_token(BY)) return true;
6171 + if (jj_3R_138()) return true;
6172 + return false;
6175 + final private boolean jj_3R_135() {
6176 + if (jj_scan_token(ORDER)) return true;
6177 + if (jj_scan_token(BY)) return true;
6178 + if (jj_3R_138()) return true;
6179 + return false;
6182 + final private boolean jj_3R_131() {
6183 + Token xsp;
6184 + xsp = jj_scanpos;
6185 + if (jj_3R_135()) {
6186 + jj_scanpos = xsp;
6187 + if (jj_3R_136()) {
6188 + jj_scanpos = xsp;
6189 + if (jj_3R_137()) return true;
6192 + return false;
6195 + final private boolean jj_3R_26() {
6196 + if (jj_3R_43()) return true;
6197 + return false;
6200 + final private boolean jj_3R_90() {
6201 + Token xsp;
6202 + xsp = jj_scanpos;
6203 + if (jj_scan_token(27)) {
6204 + jj_scanpos = xsp;
6205 + if (jj_scan_token(61)) return true;
6207 + if (jj_3R_89()) return true;
6208 + return false;
6211 + final private boolean jj_3_1() {
6212 + if (jj_scan_token(IDENTIFIER)) return true;
6213 + if (jj_scan_token(52)) return true;
6214 + return false;
6217 + final private boolean jj_3R_130() {
6218 + if (jj_3R_25()) return true;
6219 + return false;
6222 + final private boolean jj_3R_66() {
6223 + if (jj_3R_89()) return true;
6224 + Token xsp;
6225 + while (true) {
6226 + xsp = jj_scanpos;
6227 + if (jj_3R_90()) { jj_scanpos = xsp; break; }
6229 + return false;
6232 + final private boolean jj_3R_122() {
6233 + if (jj_scan_token(FILTER)) return true;
6234 + if (jj_3R_130()) return true;
6235 + return false;
6238 + final private boolean jj_3R_104() {
6239 + Token xsp;
6240 + xsp = jj_scanpos;
6241 + if (jj_3R_122()) {
6242 + jj_scanpos = xsp;
6243 + if (jj_3R_123()) {
6244 + jj_scanpos = xsp;
6245 + if (jj_3R_124()) return true;
6248 + return false;
6251 + final private boolean jj_3R_28() {
6252 + if (jj_3R_43()) return true;
6253 + return false;
6256 + final private boolean jj_3R_47() {
6257 + if (jj_3R_43()) return true;
6258 + return false;
6261 + final private boolean jj_3_7() {
6262 + if (jj_3R_28()) return true;
6263 + if (jj_scan_token(54)) return true;
6264 + return false;
6267 + final private boolean jj_3R_67() {
6268 + Token xsp;
6269 + xsp = jj_scanpos;
6270 + if (jj_scan_token(59)) {
6271 + jj_scanpos = xsp;
6272 + if (jj_scan_token(60)) return true;
6274 + if (jj_3R_66()) return true;
6275 + return false;
6278 + final private boolean jj_3R_76() {
6279 + if (jj_scan_token(56)) return true;
6280 + if (jj_3R_75()) return true;
6281 + return false;
6284 + final private boolean jj_3R_61() {
6285 + if (jj_scan_token(HOURS)) return true;
6286 + return false;
6289 + final private boolean jj_3R_44() {
6290 + if (jj_3R_66()) return true;
6291 + Token xsp;
6292 + while (true) {
6293 + xsp = jj_scanpos;
6294 + if (jj_3R_67()) { jj_scanpos = xsp; break; }
6296 + return false;
6299 + final private boolean jj_3R_60() {
6300 + if (jj_scan_token(MINUTES)) return true;
6301 + return false;
6304 + final private boolean jj_3R_51() {
6305 + return false;
6308 + final private boolean jj_3R_49() {
6309 + if (jj_scan_token(IDENTIFIER)) return true;
6310 + if (jj_scan_token(64)) return true;
6311 + return false;
6314 + final private boolean jj_3R_50() {
6315 + if (jj_3R_75()) return true;
6316 + Token xsp;
6317 + while (true) {
6318 + xsp = jj_scanpos;
6319 + if (jj_3R_76()) { jj_scanpos = xsp; break; }
6321 + return false;
6324 + final private boolean jj_3R_27() {
6325 + if (jj_3R_44()) return true;
6326 + return false;
6329 + final private boolean jj_3R_31() {
6330 + Token xsp;
6331 + xsp = jj_scanpos;
6332 + if (jj_3R_49()) jj_scanpos = xsp;
6333 + if (jj_scan_token(65)) return true;
6334 + xsp = jj_scanpos;
6335 + if (jj_3R_50()) {
6336 + jj_scanpos = xsp;
6337 + if (jj_3R_51()) return true;
6339 + if (jj_scan_token(66)) return true;
6340 + return false;
6343 + final private boolean jj_3R_39() {
6344 + if (jj_scan_token(NUMBER)) return true;
6345 + Token xsp;
6346 + xsp = jj_scanpos;
6347 + if (jj_scan_token(35)) {
6348 + jj_scanpos = xsp;
6349 + if (jj_3R_60()) {
6350 + jj_scanpos = xsp;
6351 + if (jj_3R_61()) return true;
6354 + return false;
6357 + final private boolean jj_3_19() {
6358 + if (jj_3R_39()) return true;
6359 + return false;
6362 + final private boolean jj_3R_77() {
6363 + if (jj_scan_token(56)) return true;
6364 + if (jj_3R_75()) return true;
6365 + return false;
6368 + final private boolean jj_3R_54() {
6369 + return false;
6372 + final private boolean jj_3R_125() {
6373 + if (jj_scan_token(NOT)) return true;
6374 + if (jj_3R_85()) return true;
6375 + return false;
6378 + final private boolean jj_3_5() {
6379 + if (jj_3R_27()) return true;
6380 + if (jj_scan_token(FILTEROP)) return true;
6381 + return false;
6384 + final private boolean jj_3_4() {
6385 + if (jj_3R_26()) return true;
6386 + if (jj_scan_token(54)) return true;
6387 + return false;
6390 + final private boolean jj_3_3() {
6391 + if (jj_scan_token(54)) return true;
6392 + if (jj_3R_25()) return true;
6393 + if (jj_scan_token(55)) return true;
6394 + return false;
6397 + final private boolean jj_3_6() {
6398 + if (jj_3R_27()) return true;
6399 + if (jj_scan_token(MATCHES)) return true;
6400 + if (jj_scan_token(QUOTEDSTRING)) return true;
6401 + return false;
6404 + final private boolean jj_3R_108() {
6405 + if (jj_3R_27()) return true;
6406 + if (jj_scan_token(FILTEROP)) return true;
6407 + if (jj_3R_27()) return true;
6408 + return false;
6411 + final private boolean jj_3R_53() {
6412 + if (jj_3R_75()) return true;
6413 + Token xsp;
6414 + while (true) {
6415 + xsp = jj_scanpos;
6416 + if (jj_3R_77()) { jj_scanpos = xsp; break; }
6418 + return false;
6421 + final private boolean jj_3R_107() {
6422 + if (jj_3R_125()) return true;
6423 + return false;
6426 + final private boolean jj_3R_52() {
6427 + Token xsp;
6428 + xsp = jj_scanpos;
6429 + if (jj_scan_token(46)) {
6430 + jj_scanpos = xsp;
6431 + if (jj_scan_token(29)) return true;
6433 + if (jj_scan_token(64)) return true;
6434 + return false;
6437 + final private boolean jj_3R_106() {
6438 + if (jj_3R_26()) return true;
6439 + if (jj_scan_token(54)) return true;
6440 + if (jj_3R_48()) return true;
6441 + if (jj_scan_token(55)) return true;
6442 + return false;
6445 + final private boolean jj_3R_32() {
6446 + Token xsp;
6447 + xsp = jj_scanpos;
6448 + if (jj_3R_52()) jj_scanpos = xsp;
6449 + if (jj_scan_token(54)) return true;
6450 + xsp = jj_scanpos;
6451 + if (jj_3R_53()) {
6452 + jj_scanpos = xsp;
6453 + if (jj_3R_54()) return true;
6455 + if (jj_scan_token(55)) return true;
6456 + return false;
6459 + final private boolean jj_3R_105() {
6460 + if (jj_scan_token(54)) return true;
6461 + if (jj_3R_25()) return true;
6462 + if (jj_scan_token(55)) return true;
6463 + return false;
6466 + final private boolean jj_3_11() {
6467 + if (jj_3R_32()) return true;
6468 + return false;
6471 + final private boolean jj_3R_85() {
6472 + Token xsp;
6473 + xsp = jj_scanpos;
6474 + if (jj_3R_105()) {
6475 + jj_scanpos = xsp;
6476 + if (jj_3R_106()) {
6477 + jj_scanpos = xsp;
6478 + if (jj_3R_107()) {
6479 + jj_scanpos = xsp;
6480 + if (jj_3R_108()) {
6481 + jj_scanpos = xsp;
6482 + if (jj_3_6()) return true;
6487 + return false;
6490 + final private boolean jj_3_10() {
6491 + if (jj_3R_31()) return true;
6492 + return false;
6495 + final private boolean jj_3_12() {
6496 + if (jj_3R_33()) return true;
6497 + return false;
6500 + final private boolean jj_3R_33() {
6501 + Token xsp;
6502 + xsp = jj_scanpos;
6503 + if (jj_scan_token(46)) {
6504 + jj_scanpos = xsp;
6505 + if (jj_scan_token(29)) return true;
6507 + return false;
6510 + final private boolean jj_3_18() {
6511 + if (jj_3R_38()) return true;
6512 + if (jj_scan_token(MATCHES)) return true;
6513 + return false;
6516 + final private boolean jj_3R_129() {
6517 + if (jj_scan_token(NOT)) return true;
6518 + if (jj_3R_99()) return true;
6519 + return false;
6522 + final private boolean jj_3R_97() {
6523 + if (jj_3R_32()) return true;
6524 + return false;
6527 + final private boolean jj_3_17() {
6528 + if (jj_3R_38()) return true;
6529 + if (jj_scan_token(FILTEROP)) return true;
6530 + return false;
6533 + final private boolean jj_3R_96() {
6534 + if (jj_3R_31()) return true;
6535 + return false;
6538 + final private boolean jj_3R_86() {
6539 + if (jj_scan_token(AND)) return true;
6540 + if (jj_3R_85()) return true;
6541 + return false;
6544 + final private boolean jj_3R_75() {
6545 + Token xsp;
6546 + xsp = jj_scanpos;
6547 + if (jj_3R_96()) {
6548 + jj_scanpos = xsp;
6549 + if (jj_3R_97()) {
6550 + jj_scanpos = xsp;
6551 + if (jj_3R_98()) return true;
6554 + return false;
6557 + final private boolean jj_3R_98() {
6558 + if (jj_3R_33()) return true;
6559 + return false;
6562 + final private boolean jj_3_16() {
6563 + if (jj_scan_token(54)) return true;
6564 + if (jj_3R_37()) return true;
6565 + if (jj_scan_token(55)) return true;
6566 + return false;
6569 + public QueryParserTokenManager token_source;
6570 + SimpleCharStream jj_input_stream;
6571 + public Token token, jj_nt;
6572 + private int jj_ntk;
6573 + private Token jj_scanpos, jj_lastpos;
6574 + private int jj_la;
6575 + public boolean lookingAhead = false;
6576 + private boolean jj_semLA;
6577 + private int jj_gen;
6578 + final private int[] jj_la1 = new int[80];
6579 + static private int[] jj_la1_0;
6580 + static private int[] jj_la1_1;
6581 + static private int[] jj_la1_2;
6582 + static {
6583 + jj_la1_0();
6584 + jj_la1_1();
6585 + jj_la1_2();
6587 + private static void jj_la1_0() {
6588 + jj_la1_0 = new int[] {0x200e1c00,0x400000,0x200e1c00,0x0,0x0,0x400000,0x20020000,0x200e1c00,0x10000000,0x0,0x0,0x1000000,0x0,0x80000000,0x40000000,0x0,0x0,0xb00000,0x6000000,0x6000000,0x28000000,0x6000000,0x6000000,0x0,0x0,0x0,0x0,0x2001c800,0xc000,0x0,0x28000000,0x400000,0x28000000,0x0,0x0,0x8000000,0x8000000,0x0,0x20000000,0x0,0x20000000,0x0,0x28000000,0x28000000,0x20000000,0x20000000,0x0,0x20000000,0x20000000,0x20000000,0x20000000,0x0,0x20000000,0x0,0x0,0x20000000,0x0,0x1c800,0x1c000,0x0,0x0,0x0,0x8000000,0x80000000,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x28000000,0x28000000,0x0,0x28000000,0x20000000,0x20000000,};
6590 + private static void jj_la1_1() {
6591 + jj_la1_1 = new int[] {0x404000,0x0,0x404000,0x4000,0x400000,0x0,0x0,0x0,0x0,0x40000,0x1000000,0x0,0x2,0x0,0x0,0x1,0x1000000,0x0,0x0,0x0,0x4c4000,0x0,0x0,0x1000000,0x1000000,0x4000,0x2000080,0x4c4000,0x0,0x1000000,0x4c4100,0x0,0x4c4000,0x18000000,0x18000000,0x20000000,0x20000000,0x400000,0x484000,0x40000000,0x4c4000,0x1000000,0x4c4000,0x4c4000,0x4000,0x4000,0x1000000,0x404000,0x4000,0x4000,0x4000,0x1000000,0x404000,0x4000,0x1000000,0x404000,0x0,0x200,0x0,0x1000000,0x0,0x40000000,0x4c4000,0x0,0x0,0x1,0x4000,0x8000,0x38,0x40000000,0x40000000,0x40000000,0x40000000,0x1000000,0x4c4000,0xc4000,0x1000000,0xc4000,0x84000,0x4000,};
6593 + private static void jj_la1_2() {
6594 + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x8,0x8,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
6596 + final private JJCalls[] jj_2_rtns = new JJCalls[19];
6597 + private boolean jj_rescan = false;
6598 + private int jj_gc = 0;
6600 + public QueryParser(java.io.InputStream stream) {
6601 + this(stream, null);
6603 + public QueryParser(java.io.InputStream stream, String encoding) {
6604 + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
6605 + token_source = new QueryParserTokenManager(jj_input_stream);
6606 + token = new Token();
6607 + jj_ntk = -1;
6608 + jj_gen = 0;
6609 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6610 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6613 + public void ReInit(java.io.InputStream stream) {
6614 + ReInit(stream, null);
6616 + public void ReInit(java.io.InputStream stream, String encoding) {
6617 + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
6618 + token_source.ReInit(jj_input_stream);
6619 + token = new Token();
6620 + jj_ntk = -1;
6621 + jjtree.reset();
6622 + jj_gen = 0;
6623 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6624 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6627 + public QueryParser(java.io.Reader stream) {
6628 + jj_input_stream = new SimpleCharStream(stream, 1, 1);
6629 + token_source = new QueryParserTokenManager(jj_input_stream);
6630 + token = new Token();
6631 + jj_ntk = -1;
6632 + jj_gen = 0;
6633 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6634 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6637 + public void ReInit(java.io.Reader stream) {
6638 + jj_input_stream.ReInit(stream, 1, 1);
6639 + token_source.ReInit(jj_input_stream);
6640 + token = new Token();
6641 + jj_ntk = -1;
6642 + jjtree.reset();
6643 + jj_gen = 0;
6644 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6645 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6648 + public QueryParser(QueryParserTokenManager tm) {
6649 + token_source = tm;
6650 + token = new Token();
6651 + jj_ntk = -1;
6652 + jj_gen = 0;
6653 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6654 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6657 + public void ReInit(QueryParserTokenManager tm) {
6658 + token_source = tm;
6659 + token = new Token();
6660 + jj_ntk = -1;
6661 + jjtree.reset();
6662 + jj_gen = 0;
6663 + for (int i = 0; i < 80; i++) jj_la1[i] = -1;
6664 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
6667 + final private Token jj_consume_token(int kind) throws ParseException {
6668 + Token oldToken;
6669 + if ((oldToken = token).next != null) token = token.next;
6670 + else token = token.next = token_source.getNextToken();
6671 + jj_ntk = -1;
6672 + if (token.kind == kind) {
6673 + jj_gen++;
6674 + if (++jj_gc > 100) {
6675 + jj_gc = 0;
6676 + for (int i = 0; i < jj_2_rtns.length; i++) {
6677 + JJCalls c = jj_2_rtns[i];
6678 + while (c != null) {
6679 + if (c.gen < jj_gen) c.first = null;
6680 + c = c.next;
6684 + return token;
6686 + token = oldToken;
6687 + jj_kind = kind;
6688 + throw generateParseException();
6691 + static private final class LookaheadSuccess extends java.lang.Error { }
6692 + final private LookaheadSuccess jj_ls = new LookaheadSuccess();
6693 + final private boolean jj_scan_token(int kind) {
6694 + if (jj_scanpos == jj_lastpos) {
6695 + jj_la--;
6696 + if (jj_scanpos.next == null) {
6697 + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
6698 + } else {
6699 + jj_lastpos = jj_scanpos = jj_scanpos.next;
6701 + } else {
6702 + jj_scanpos = jj_scanpos.next;
6704 + if (jj_rescan) {
6705 + int i = 0; Token tok = token;
6706 + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
6707 + if (tok != null) jj_add_error_token(kind, i);
6709 + if (jj_scanpos.kind != kind) return true;
6710 + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
6711 + return false;
6714 + final public Token getNextToken() {
6715 + if (token.next != null) token = token.next;
6716 + else token = token.next = token_source.getNextToken();
6717 + jj_ntk = -1;
6718 + jj_gen++;
6719 + return token;
6722 + final public Token getToken(int index) {
6723 + Token t = lookingAhead ? jj_scanpos : token;
6724 + for (int i = 0; i < index; i++) {
6725 + if (t.next != null) t = t.next;
6726 + else t = t.next = token_source.getNextToken();
6728 + return t;
6731 + final private int jj_ntk() {
6732 + if ((jj_nt=token.next) == null)
6733 + return (jj_ntk = (token.next=token_source.getNextToken()).kind);
6734 + else
6735 + return (jj_ntk = jj_nt.kind);
6738 + private java.util.Vector jj_expentries = new java.util.Vector();
6739 + private int[] jj_expentry;
6740 + private int jj_kind = -1;
6741 + private int[] jj_lasttokens = new int[100];
6742 + private int jj_endpos;
6744 + private void jj_add_error_token(int kind, int pos) {
6745 + if (pos >= 100) return;
6746 + if (pos == jj_endpos + 1) {
6747 + jj_lasttokens[jj_endpos++] = kind;
6748 + } else if (jj_endpos != 0) {
6749 + jj_expentry = new int[jj_endpos];
6750 + for (int i = 0; i < jj_endpos; i++) {
6751 + jj_expentry[i] = jj_lasttokens[i];
6753 + boolean exists = false;
6754 + for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
6755 + int[] oldentry = (int[])(e.nextElement());
6756 + if (oldentry.length == jj_expentry.length) {
6757 + exists = true;
6758 + for (int i = 0; i < jj_expentry.length; i++) {
6759 + if (oldentry[i] != jj_expentry[i]) {
6760 + exists = false;
6761 + break;
6764 + if (exists) break;
6767 + if (!exists) jj_expentries.addElement(jj_expentry);
6768 + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
6772 + public ParseException generateParseException() {
6773 + jj_expentries.removeAllElements();
6774 + boolean[] la1tokens = new boolean[68];
6775 + for (int i = 0; i < 68; i++) {
6776 + la1tokens[i] = false;
6778 + if (jj_kind >= 0) {
6779 + la1tokens[jj_kind] = true;
6780 + jj_kind = -1;
6782 + for (int i = 0; i < 80; i++) {
6783 + if (jj_la1[i] == jj_gen) {
6784 + for (int j = 0; j < 32; j++) {
6785 + if ((jj_la1_0[i] & (1<<j)) != 0) {
6786 + la1tokens[j] = true;
6788 + if ((jj_la1_1[i] & (1<<j)) != 0) {
6789 + la1tokens[32+j] = true;
6791 + if ((jj_la1_2[i] & (1<<j)) != 0) {
6792 + la1tokens[64+j] = true;
6797 + for (int i = 0; i < 68; i++) {
6798 + if (la1tokens[i]) {
6799 + jj_expentry = new int[1];
6800 + jj_expentry[0] = i;
6801 + jj_expentries.addElement(jj_expentry);
6804 + jj_endpos = 0;
6805 + jj_rescan_token();
6806 + jj_add_error_token(0, 0);
6807 + int[][] exptokseq = new int[jj_expentries.size()][];
6808 + for (int i = 0; i < jj_expentries.size(); i++) {
6809 + exptokseq[i] = (int[])jj_expentries.elementAt(i);
6811 + return new ParseException(token, exptokseq, tokenImage);
6814 + final public void enable_tracing() {
6817 + final public void disable_tracing() {
6820 + final private void jj_rescan_token() {
6821 + jj_rescan = true;
6822 + for (int i = 0; i < 19; i++) {
6823 + try {
6824 + JJCalls p = jj_2_rtns[i];
6825 + do {
6826 + if (p.gen > jj_gen) {
6827 + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
6828 + switch (i) {
6829 + case 0: jj_3_1(); break;
6830 + case 1: jj_3_2(); break;
6831 + case 2: jj_3_3(); break;
6832 + case 3: jj_3_4(); break;
6833 + case 4: jj_3_5(); break;
6834 + case 5: jj_3_6(); break;
6835 + case 6: jj_3_7(); break;
6836 + case 7: jj_3_8(); break;
6837 + case 8: jj_3_9(); break;
6838 + case 9: jj_3_10(); break;
6839 + case 10: jj_3_11(); break;
6840 + case 11: jj_3_12(); break;
6841 + case 12: jj_3_13(); break;
6842 + case 13: jj_3_14(); break;
6843 + case 14: jj_3_15(); break;
6844 + case 15: jj_3_16(); break;
6845 + case 16: jj_3_17(); break;
6846 + case 17: jj_3_18(); break;
6847 + case 18: jj_3_19(); break;
6850 + p = p.next;
6851 + } while (p != null);
6852 + } catch(LookaheadSuccess ls) { }
6854 + jj_rescan = false;
6857 + final private void jj_save(int index, int xla) {
6858 + JJCalls p = jj_2_rtns[index];
6859 + while (p.gen > jj_gen) {
6860 + if (p.next == null) { p = p.next = new JJCalls(); break; }
6861 + p = p.next;
6863 + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
6866 + static final class JJCalls {
6867 + int gen;
6868 + Token first;
6869 + int arg;
6870 + JJCalls next;
6874 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj
6875 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj 1969-12-31 19:00:00.000000000 -0500
6876 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj 2007-08-31 09:41:35.000000000 -0400
6877 @@ -0,0 +1,3258 @@
6878 +/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParser.jj */
6879 +/*@egen*//*
6880 + * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
6881 + * See accompanying LICENSE file.
6882 + */
6883 +/**
6884 + * JavaCC file
6885 + * This file lists the grammar for PIG Latin.
6886 + * QueryParser program ouputs a ParseTree given a Valid Pig Latin Query
6887 + */
6888 +options {
6889 + // Generate non-static functions
6890 + STATIC = false;
6891 + // Case is ignored in keywords
6892 + IGNORE_CASE = true;
6895 +PARSER_BEGIN(QueryParser)
6896 +package com.yahoo.pig.impl.logicalLayer.parser;
6897 +import java.io.*;
6898 +import java.util.*;
6899 +import java.lang.reflect.*;
6900 +import com.yahoo.pig.impl.logicalLayer.*;
6901 +import com.yahoo.pig.impl.eval.*;
6902 +import com.yahoo.pig.impl.eval.func.*;
6903 +import com.yahoo.pig.impl.eval.groupby.*;
6904 +import com.yahoo.pig.impl.eval.filter.*;
6905 +import com.yahoo.pig.impl.eval.window.*;
6906 +import com.yahoo.pig.impl.eval.sad.*;
6907 +import com.yahoo.pig.impl.logicalLayer.schema.*;
6908 +import com.yahoo.pig.*;
6909 +import com.yahoo.pig.impl.PigContext;
6910 +import com.yahoo.pig.PigServer.ExecType;
6911 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
6912 +import com.yahoo.pig.impl.io.FileLocalizer;
6913 +import com.yahoo.pig.builtin.*;
6914 +public class QueryParser/*@bgen(jjtree)*/implements QueryParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
6915 + protected JJTQueryParserState jjtree = new JJTQueryParserState();
6917 +/*@egen*/
6918 + private PigContext pigContext;
6919 + private Map<String, IntermedResult> aliases;
6921 + public QueryParser(InputStream in, PigContext pigContext, Map aliases) {
6922 + this(in);
6923 + this.pigContext = pigContext;
6924 + this.aliases = aliases;
6927 + public class EvalSpecPipeAndSchema{
6928 + EvalSpecPipe pipe;
6929 + SchemaItemList schema;
6932 + public class CogroupInput {
6933 + public LogicalOperator op;
6934 + public GroupBySpec spec;
6937 + static String unquote(String s) {
6938 + return s.substring(1, s.length()-1);
6941 + static int undollar(String s) {
6942 + return Integer.parseInt(s.substring(1, s.length()));
6945 + NestableEvalItem newFuncEvalItem(EvalFunc func, EvalItemList args) throws ParseException {
6946 + if (func instanceof AtomEvalFunc) return new AtomFuncEvalItem(pigContext, (AtomEvalFunc) func, args);
6947 + else if (func instanceof TupleEvalFunc) return new TupleFuncEvalItem(pigContext, (TupleEvalFunc) func, args);
6948 + else if (func instanceof BagEvalFunc) return new BagFuncEvalItem(pigContext, (BagEvalFunc) func, args);
6949 + else throw new ParseException("Error: unknown Eval Function type: " + func.getClass().getName());
6953 + LogicalOperator makeLORead(String alias) throws ParseException {
6954 + if (!aliases.containsKey(alias)) throw new ParseException("Unrecognized alias: " + alias);
6956 + LORead readOp = new LORead(pigContext, aliases.get(alias));
6957 + readOp.alias = alias;
6958 + return readOp;
6963 + String massageFilename(String filename) throws IOException {
6964 + if (pigContext.getExecType() != ExecType.LOCAL) {
6965 + if (filename.startsWith(FileLocalizer.LOCAL_PREFIX)) {
6966 + filename = FileLocalizer.hadoopify(filename);
6967 + } else {
6968 + if (filename.startsWith(FileLocalizer.HADOOP_PREFIX)) {
6969 + filename = filename.substring(FileLocalizer.HADOOP_PREFIX.length());
6974 + return filename;
6977 + LogicalOperator parseCogroup(ArrayList<CogroupInput> gis) throws ParseException{
6978 + int n = gis.size();
6980 + LogicalOperator[] los = new LogicalOperator[n];
6981 + GroupBySpec[] specs = new GroupBySpec[n];
6983 + for (int i = 0; i < n ; i++){
6985 + CogroupInput gi = gis.get(i);
6986 + los[i] = gi.op;
6987 + specs[i] = gi.spec;
6990 + return new LOCogroup(pigContext, los, specs);
6994 + LogicalOperator rewriteCross(ArrayList<LogicalOperator> inputs) throws IOException, ParseException{
6995 + ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();
6996 + Iterator<LogicalOperator> iter = inputs.iterator();
6997 + int n = inputs.size();
6999 + EvalSpecPipe pipe = new EvalSpecPipe(pigContext);
7000 + EvalItemList list = new EvalItemList(pigContext);
7001 + pipe.add(list);
7002 + for (int i=0; i< n; i++){
7004 + CogroupInput gi = new CogroupInput();
7005 + gis.add(gi);
7007 + gi.op = inputs.get(i);
7008 + EvalItemList itemList = new EvalItemList(pigContext);
7009 + itemList.add(new ConstEvalItem(pigContext, n+""));
7010 + itemList.add(new ConstEvalItem(pigContext, i+""));
7011 + gi.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFCross.class.getName()), itemList, false);
7013 + ColEvalItem item = new ColEvalItem(pigContext, i+1);
7014 + EvalItemList subSpec = new EvalItemList(pigContext);
7015 + subSpec.add(new StarEvalItem(pigContext));
7016 + item.subColSpec = subSpec;
7018 + list.add(item);
7021 + return new LOEval(pigContext, parseCogroup(gis),pipe);
7024 + LOLoad getDefaultLoadOperator(boolean continuous, String filename) throws IOException{
7026 + String[] args = null;
7027 + /*
7028 + if (continuous){
7029 + args = new String[2];
7030 + args[0]="\t";
7031 + args[1]="0";
7033 + */
7034 + StorageFunc loadFunc = (StorageFunc) pigContext.getUDF(PigStorage.class.getName());
7035 + return new LOLoad(pigContext, massageFilename(filename), loadFunc, args);
7038 + void assertAtomic(EvalItem item, boolean desiredAtomic) throws ParseException{
7039 + Boolean isAtomic = null;
7040 + if (item instanceof ConstEvalItem || item instanceof AtomFuncEvalItem)
7041 + isAtomic = true;
7042 + else if (item instanceof FuncEvalItem)
7043 + isAtomic = false;
7045 + if (isAtomic != null && isAtomic != desiredAtomic){
7046 + if (desiredAtomic)
7047 + throw new ParseException("Atomic field expected but found non-atomic field");
7048 + else
7049 + throw new ParseException("Non-atomic field expected but found atomic field");
7051 + }
7053 + EvalItem copyItemAndAddSpec(EvalItem item, EvalSpec spec) throws ParseException{
7054 + assertAtomic(item,false);
7055 + item = item.copy();
7056 + if (!(item instanceof NestableEvalItem))
7057 + throw new ParseException("Internal Error: Cannot add spec to non-nestable field.");
7058 + NestableEvalItem nestableItem = (NestableEvalItem)item;
7059 + EvalSpecPipe specPipe = nestableItem.nestedEval;
7060 + nestableItem.addNestedEvalSpec(spec);
7061 + return item;
7067 +PARSER_END(QueryParser)
7069 +// Skip all the new lines, tabs and spaces
7070 +SKIP : { " " | "\r" | "\t" | "\n" }
7072 +// Skip comments(single line and multiline)
7073 +SKIP : {
7074 + <"--"(~["\r","\n"])*>
7075 +| <"/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
7077 +// Comparison operators that can be used in a filter:
7078 +TOKEN : { <#STRFILTEROP : "eq" | "gt" | "lt" | "gte" | "lte" | "neq" > }
7079 +TOKEN : { <#NUMFILTEROP : "==" | "<" | "<=" | ">" | ">=" | "!=" > }
7080 +TOKEN : { <FILTEROP : <STRFILTEROP> | <NUMFILTEROP> > }
7082 +// List all the keywords in the language
7083 +TOKEN : { <LOAD : "load"> }
7084 +TOKEN : { <FILTER : "filter"> }
7085 +TOKEN : { <FOREACH : "foreach"> }
7086 +TOKEN : { <MATCHES : "matches"> }
7087 +TOKEN : { <ORDER : "order"> }
7088 +TOKEN : { <ARRANGE : "arrange"> }
7089 +TOKEN : { <DISTINCT : "distinct"> }
7090 +TOKEN : { <COGROUP : "cogroup"> }
7091 +TOKEN : { <CROSS : "cross"> }
7092 +TOKEN : { <UNION : "union"> }
7093 +TOKEN : { <ALL : "all"> }
7094 +TOKEN : { <ANY : "any"> }
7095 +TOKEN : { <AS : "as"> }
7096 +TOKEN : { <BY : "by"> }
7097 +TOKEN : { <USING : "using"> }
7098 +TOKEN : { <INNER : "inner"> }
7099 +TOKEN : { <OUTER : "outer"> }
7100 +TOKEN : { <STAR : "*"> }
7101 +TOKEN : { <PARALLEL : "parallel"> }
7102 +TOKEN : { <GROUP : "group"> }
7103 +TOKEN : { <AND : "and"> }
7104 +TOKEN : { <OR : "or"> }
7105 +TOKEN : { <NOT : "not"> }
7106 +TOKEN : { <CONTINUOUSLY : "continuously"> }
7107 +TOKEN : { <WINDOW : "window"> }
7108 +TOKEN : { <SECONDS : "seconds"> }
7109 +TOKEN : { <MINUTES : "minutes"> }
7110 +TOKEN : { <HOURS : "hours"> }
7111 +TOKEN : { <TUPLES : "tuples"> }
7112 +TOKEN : { <GENERATE : "generate"> }
7113 +TOKEN : { <FLATTEN : "flatten"> }
7114 +TOKEN : { <EVAL : "eval"> }
7116 +TOKEN:
7118 + <#LETTER : ["a"-"z", "A"-"Z"] >
7119 +| <#DIGIT : ["0"-"9"] >
7120 +| <#SPECIALCHAR : ["_"] >
7121 +| <#FSSPECIALCHAR: ["-", ":", "/"]>
7122 +| <IDENTIFIER: ( <LETTER> )+ ( <DIGIT> | <LETTER> | <SPECIALCHAR> | "::")* >
7124 +// Define Numeric Constants
7125 +TOKEN :
7127 + < NUMBER: <INTEGER> | <FLOAT> | <FLOAT> ( ["e","E"] ([ "-","+"])? <FLOAT> )?>
7128 +| < #FLOAT: <INTEGER> ( "." <INTEGER> )? | "." <INTEGER> >
7129 +| < INTEGER: ( <DIGIT> )+ >
7132 +TOKEN : { <QUOTEDSTRING : "'" (~["'"])* "'"> }
7133 +// Pig has special variables starting with $
7134 +TOKEN : { <DOLLARVAR : "$" <INTEGER> > }
7136 +// Parse is the Starting function.
7137 +LogicalPlan Parse() : {/*@bgen(jjtree) Parse */
7138 + SimpleNode jjtn000 = new SimpleNode(JJTPARSE);
7139 + boolean jjtc000 = true;
7140 + jjtree.openNodeScope(jjtn000);
7141 +/*@egen*/LogicalOperator root; Token t1;}
7142 +{/*@bgen(jjtree) Parse */
7143 + try {
7144 +/*@egen*/
7146 + LOOKAHEAD(2)
7147 + (t1 = <IDENTIFIER> "=" root = Expr() ";"{root.alias = t1.image;})
7148 +| (root = Expr() ";")
7149 + )/*@bgen(jjtree)*/
7151 + jjtree.closeNodeScope(jjtn000, true);
7152 + jjtc000 = false;
7154 +/*@egen*/
7155 + { return new LogicalPlan(root, pigContext); }/*@bgen(jjtree)*/
7156 + } catch (Throwable jjte000) {
7157 + if (jjtc000) {
7158 + jjtree.clearNodeScope(jjtn000);
7159 + jjtc000 = false;
7160 + } else {
7161 + jjtree.popNode();
7163 + if (jjte000 instanceof RuntimeException) {
7164 + throw (RuntimeException)jjte000;
7166 + if (jjte000 instanceof ParseException) {
7167 + throw (ParseException)jjte000;
7169 + throw (Error)jjte000;
7170 + } finally {
7171 + if (jjtc000) {
7172 + jjtree.closeNodeScope(jjtn000, true);
7175 +/*@egen*/
7178 +LogicalOperator Expr() : {/*@bgen(jjtree) Expr */
7179 + SimpleNode jjtn000 = new SimpleNode(JJTEXPR);
7180 + boolean jjtc000 = true;
7181 + jjtree.openNodeScope(jjtn000);
7182 +/*@egen*/LogicalOperator op; SchemaItemList schema;}
7183 +{/*@bgen(jjtree) Expr */
7184 + try {
7185 +/*@egen*/
7187 + ( op = NestedExpr() [ <AS> schema = AsClause() {op.schema=schema;} ] )
7188 +| op = BaseExpr()
7189 + )/*@bgen(jjtree)*/
7191 + jjtree.closeNodeScope(jjtn000, true);
7192 + jjtc000 = false;
7194 +/*@egen*/
7195 + {return op;}/*@bgen(jjtree)*/
7196 + } catch (Throwable jjte000) {
7197 + if (jjtc000) {
7198 + jjtree.clearNodeScope(jjtn000);
7199 + jjtc000 = false;
7200 + } else {
7201 + jjtree.popNode();
7203 + if (jjte000 instanceof RuntimeException) {
7204 + throw (RuntimeException)jjte000;
7206 + if (jjte000 instanceof ParseException) {
7207 + throw (ParseException)jjte000;
7209 + throw (Error)jjte000;
7210 + } finally {
7211 + if (jjtc000) {
7212 + jjtree.closeNodeScope(jjtn000, true);
7215 +/*@egen*/
7218 +LogicalOperator NestedExpr() : {/*@bgen(jjtree) NestedExpr */
7219 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDEXPR);
7220 + boolean jjtc000 = true;
7221 + jjtree.openNodeScope(jjtn000);
7222 +/*@egen*/LogicalOperator op;}
7223 +{/*@bgen(jjtree) NestedExpr */
7224 + try {
7225 +/*@egen*/
7227 + (op = Alias())
7228 +| LOOKAHEAD(2) ( "(" op = NestedExpr() ")" )
7229 +| ( "(" op = BaseExpr() ")" )
7230 + )/*@bgen(jjtree)*/
7232 + jjtree.closeNodeScope(jjtn000, true);
7233 + jjtc000 = false;
7235 +/*@egen*/
7236 + {return op;}/*@bgen(jjtree)*/
7237 + } catch (Throwable jjte000) {
7238 + if (jjtc000) {
7239 + jjtree.clearNodeScope(jjtn000);
7240 + jjtc000 = false;
7241 + } else {
7242 + jjtree.popNode();
7244 + if (jjte000 instanceof RuntimeException) {
7245 + throw (RuntimeException)jjte000;
7247 + if (jjte000 instanceof ParseException) {
7248 + throw (ParseException)jjte000;
7250 + throw (Error)jjte000;
7251 + } finally {
7252 + if (jjtc000) {
7253 + jjtree.closeNodeScope(jjtn000, true);
7256 +/*@egen*/
7259 +// A reference to an alias
7260 +LogicalOperator Alias() : {/*@bgen(jjtree) Alias */
7261 + SimpleNode jjtn000 = new SimpleNode(JJTALIAS);
7262 + boolean jjtc000 = true;
7263 + jjtree.openNodeScope(jjtn000);
7264 +/*@egen*/Token t1; LogicalOperator op;}
7265 +{/*@bgen(jjtree) Alias */
7266 + try {
7267 +/*@egen*/
7268 + t1 = <IDENTIFIER>/*@bgen(jjtree)*/
7270 + jjtree.closeNodeScope(jjtn000, true);
7271 + jjtc000 = false;
7273 +/*@egen*/
7275 + op = makeLORead(t1.image);
7276 + return op;
7277 + }/*@bgen(jjtree)*/
7278 + } finally {
7279 + if (jjtc000) {
7280 + jjtree.closeNodeScope(jjtn000, true);
7283 +/*@egen*/
7290 +LogicalOperator BaseExpr() : {/*@bgen(jjtree) BaseExpr */
7291 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEXPR);
7292 + boolean jjtc000 = true;
7293 + jjtree.openNodeScope(jjtn000);
7294 +/*@egen*/LogicalOperator op; SchemaItemList schema; Token t1, t2;}
7295 +{/*@bgen(jjtree) BaseExpr */
7296 + try {
7297 +/*@egen*/
7300 + (<LOAD> op = LoadClause() [<AS> schema = AsClause() {op.schema=schema;} ])
7301 +| ((<GROUP> | <COGROUP>) op = CogroupClause())
7302 +| (<FILTER> op = FilterClause())
7303 +| (<CROSS> op = CrossClause())
7304 +| (<UNION> op = UnionClause())
7305 +| (<FOREACH> op = ForEachClause())
7307 + [<PARALLEL> t2=<NUMBER> { op.requestedParallelism = Integer.parseInt(t2.image);} ]
7308 + )/*@bgen(jjtree)*/
7310 + jjtree.closeNodeScope(jjtn000, true);
7311 + jjtc000 = false;
7313 +/*@egen*/
7314 + {return op;}/*@bgen(jjtree)*/
7315 + } catch (Throwable jjte000) {
7316 + if (jjtc000) {
7317 + jjtree.clearNodeScope(jjtn000);
7318 + jjtc000 = false;
7319 + } else {
7320 + jjtree.popNode();
7322 + if (jjte000 instanceof RuntimeException) {
7323 + throw (RuntimeException)jjte000;
7325 + if (jjte000 instanceof ParseException) {
7326 + throw (ParseException)jjte000;
7328 + throw (Error)jjte000;
7329 + } finally {
7330 + if (jjtc000) {
7331 + jjtree.closeNodeScope(jjtn000, true);
7334 +/*@egen*/
7337 +LogicalOperator LoadClause() : {/*@bgen(jjtree) LoadClause */
7338 + SimpleNode jjtn000 = new SimpleNode(JJTLOADCLAUSE);
7339 + boolean jjtc000 = true;
7340 + jjtree.openNodeScope(jjtn000);
7341 +/*@egen*/Token t1, t2; String filename; StorageFunc loadFunc = null;
7342 + ArrayList<String> loadParams = new ArrayList<String>(); LOLoad lo=null; boolean continuous=false;}
7343 +{/*@bgen(jjtree) LoadClause */
7344 + try {
7345 +/*@egen*/
7346 + ( t1 = <QUOTEDSTRING> {filename = unquote(t1.image);}
7347 + (<USING> loadFunc = LoadFunction() "(" (t2 = <QUOTEDSTRING> {loadParams.add(t2.image);})?
7348 + ( "," t2 = <QUOTEDSTRING> {loadParams.add(t2.image);})*
7349 + ")"
7350 + {lo = new LOLoad(pigContext, massageFilename(filename), loadFunc, loadParams);}
7351 + )?
7353 + [ <CONTINUOUSLY> {continuous=true;} ]/*@bgen(jjtree)*/
7355 + jjtree.closeNodeScope(jjtn000, true);
7356 + jjtc000 = false;
7358 +/*@egen*/
7360 + if (lo == null){
7361 + lo = getDefaultLoadOperator(continuous,filename);
7362 + }
7363 + if (continuous)
7364 + lo.setOutputType(LogicalOperator.MONOTONE);
7365 + return lo;
7366 + }/*@bgen(jjtree)*/
7367 + } catch (Throwable jjte000) {
7368 + if (jjtc000) {
7369 + jjtree.clearNodeScope(jjtn000);
7370 + jjtc000 = false;
7371 + } else {
7372 + jjtree.popNode();
7374 + if (jjte000 instanceof RuntimeException) {
7375 + throw (RuntimeException)jjte000;
7377 + if (jjte000 instanceof ParseException) {
7378 + throw (ParseException)jjte000;
7380 + throw (Error)jjte000;
7381 + } finally {
7382 + if (jjtc000) {
7383 + jjtree.closeNodeScope(jjtn000, true);
7386 +/*@egen*/
7389 +LogicalOperator FilterClause():
7390 +{/*@bgen(jjtree) FilterClause */
7391 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERCLAUSE);
7392 + boolean jjtc000 = true;
7393 + jjtree.openNodeScope(jjtn000);
7394 +/*@egen*/Cond cond; LogicalOperator input;}
7395 +{/*@bgen(jjtree) FilterClause */
7396 + try {
7397 +/*@egen*/
7398 + input = NestedExpr()
7399 + <BY> cond = PCond(input.outputSchema(),null)/*@bgen(jjtree)*/
7401 + jjtree.closeNodeScope(jjtn000, true);
7402 + jjtc000 = false;
7404 +/*@egen*/
7406 + EvalSpecPipe specPipe = new EvalSpecPipe(pigContext);
7407 + specPipe.add(new FilterSpec(cond));
7408 + return new LOEval(pigContext, input, specPipe);
7409 + }/*@bgen(jjtree)*/
7410 + } catch (Throwable jjte000) {
7411 + if (jjtc000) {
7412 + jjtree.clearNodeScope(jjtn000);
7413 + jjtc000 = false;
7414 + } else {
7415 + jjtree.popNode();
7417 + if (jjte000 instanceof RuntimeException) {
7418 + throw (RuntimeException)jjte000;
7420 + if (jjte000 instanceof ParseException) {
7421 + throw (ParseException)jjte000;
7423 + throw (Error)jjte000;
7424 + } finally {
7425 + if (jjtc000) {
7426 + jjtree.closeNodeScope(jjtn000, true);
7429 +/*@egen*/
7434 +Cond PCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PCond */
7435 + SimpleNode jjtn000 = new SimpleNode(JJTPCOND);
7436 + boolean jjtc000 = true;
7437 + jjtree.openNodeScope(jjtn000);
7438 +/*@egen*/Cond cond = null;}
7439 +{/*@bgen(jjtree) PCond */
7440 + try {
7441 +/*@egen*/
7442 + cond = POrCond(over,pipes)/*@bgen(jjtree)*/
7444 + jjtree.closeNodeScope(jjtn000, true);
7445 + jjtc000 = false;
7447 +/*@egen*/
7448 + {return cond;}/*@bgen(jjtree)*/
7449 + } catch (Throwable jjte000) {
7450 + if (jjtc000) {
7451 + jjtree.clearNodeScope(jjtn000);
7452 + jjtc000 = false;
7453 + } else {
7454 + jjtree.popNode();
7456 + if (jjte000 instanceof RuntimeException) {
7457 + throw (RuntimeException)jjte000;
7459 + if (jjte000 instanceof ParseException) {
7460 + throw (ParseException)jjte000;
7462 + throw (Error)jjte000;
7463 + } finally {
7464 + if (jjtc000) {
7465 + jjtree.closeNodeScope(jjtn000, true);
7468 +/*@egen*/
7471 +Cond POrCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) POrCond */
7472 + SimpleNode jjtn000 = new SimpleNode(JJTPORCOND);
7473 + boolean jjtc000 = true;
7474 + jjtree.openNodeScope(jjtn000);
7475 +/*@egen*/Cond cond; List<Cond> cList = new ArrayList<Cond>();}
7476 +{/*@bgen(jjtree) POrCond */
7477 + try {
7478 +/*@egen*/
7480 + cond = PAndCond(over,pipes) {cList.add(cond);}
7481 + ( <OR> cond = PAndCond(over,pipes) {cList.add(cond);})*
7482 + )/*@bgen(jjtree)*/
7484 + jjtree.closeNodeScope(jjtn000, true);
7485 + jjtc000 = false;
7487 +/*@egen*/
7489 + if (cList.size()==1)
7490 + return cond;
7491 + else
7492 + return new OrCond(cList);
7493 + }/*@bgen(jjtree)*/
7494 + } catch (Throwable jjte000) {
7495 + if (jjtc000) {
7496 + jjtree.clearNodeScope(jjtn000);
7497 + jjtc000 = false;
7498 + } else {
7499 + jjtree.popNode();
7501 + if (jjte000 instanceof RuntimeException) {
7502 + throw (RuntimeException)jjte000;
7504 + if (jjte000 instanceof ParseException) {
7505 + throw (ParseException)jjte000;
7507 + throw (Error)jjte000;
7508 + } finally {
7509 + if (jjtc000) {
7510 + jjtree.closeNodeScope(jjtn000, true);
7513 +/*@egen*/
7516 +Cond PAndCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PAndCond */
7517 + SimpleNode jjtn000 = new SimpleNode(JJTPANDCOND);
7518 + boolean jjtc000 = true;
7519 + jjtree.openNodeScope(jjtn000);
7520 +/*@egen*/Cond cond = null; List<Cond> cList = new ArrayList<Cond>();}
7521 +{/*@bgen(jjtree) PAndCond */
7522 + try {
7523 +/*@egen*/
7525 + cond = PUnaryCond(over,pipes) {cList.add(cond);}
7526 + ( <AND> cond = PUnaryCond(over,pipes) {cList.add(cond);} )*
7527 + )/*@bgen(jjtree)*/
7529 + jjtree.closeNodeScope(jjtn000, true);
7530 + jjtc000 = false;
7532 +/*@egen*/
7534 + if (cList.size()==1)
7535 + return cond;
7536 + else
7537 + return new AndCond(cList);
7538 + }/*@bgen(jjtree)*/
7539 + } catch (Throwable jjte000) {
7540 + if (jjtc000) {
7541 + jjtree.clearNodeScope(jjtn000);
7542 + jjtc000 = false;
7543 + } else {
7544 + jjtree.popNode();
7546 + if (jjte000 instanceof RuntimeException) {
7547 + throw (RuntimeException)jjte000;
7549 + if (jjte000 instanceof ParseException) {
7550 + throw (ParseException)jjte000;
7552 + throw (Error)jjte000;
7553 + } finally {
7554 + if (jjtc000) {
7555 + jjtree.closeNodeScope(jjtn000, true);
7558 +/*@egen*/
7561 +Cond PUnaryCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PUnaryCond */
7562 + SimpleNode jjtn000 = new SimpleNode(JJTPUNARYCOND);
7563 + boolean jjtc000 = true;
7564 + jjtree.openNodeScope(jjtn000);
7565 +/*@egen*/Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;}
7566 +{/*@bgen(jjtree) PUnaryCond */
7567 + try {
7568 +/*@egen*/
7570 + LOOKAHEAD("(" PCond(over,pipes) ")")
7571 + ("(" cond = PCond(over,pipes) ")")
7572 +| LOOKAHEAD(FilterFunction() "(") (func=FilterFunction() "(" args=EvalArgs(over,pipes) ")" {cond = new FuncCond(func, args);})
7573 +| cond = PNotCond(over,pipes)
7574 +| LOOKAHEAD(InfixExpr(over,pipes) <FILTEROP>)
7575 + (c1=InfixExpr(over,pipes) t1=<FILTEROP> c2=InfixExpr(over,pipes) {cond = new CompCond(c1, t1.image, c2);})
7576 +| LOOKAHEAD(2)
7577 + (c1=InfixExpr(over,pipes) <MATCHES> t1=<QUOTEDSTRING> {cond = new RegexpCond(c1, unquote(t1.image));})
7578 + )/*@bgen(jjtree)*/
7580 + jjtree.closeNodeScope(jjtn000, true);
7581 + jjtc000 = false;
7583 +/*@egen*/
7584 + {return cond;}/*@bgen(jjtree)*/
7585 + } catch (Throwable jjte000) {
7586 + if (jjtc000) {
7587 + jjtree.clearNodeScope(jjtn000);
7588 + jjtc000 = false;
7589 + } else {
7590 + jjtree.popNode();
7592 + if (jjte000 instanceof RuntimeException) {
7593 + throw (RuntimeException)jjte000;
7595 + if (jjte000 instanceof ParseException) {
7596 + throw (ParseException)jjte000;
7598 + throw (Error)jjte000;
7599 + } finally {
7600 + if (jjtc000) {
7601 + jjtree.closeNodeScope(jjtn000, true);
7604 +/*@egen*/
7607 +Cond PNotCond(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) PNotCond */
7608 + SimpleNode jjtn000 = new SimpleNode(JJTPNOTCOND);
7609 + boolean jjtc000 = true;
7610 + jjtree.openNodeScope(jjtn000);
7611 +/*@egen*/Cond c1;}
7612 +{/*@bgen(jjtree) PNotCond */
7613 + try {
7614 +/*@egen*/
7615 + <NOT> c1=PUnaryCond(over,pipes)/*@bgen(jjtree)*/
7617 + jjtree.closeNodeScope(jjtn000, true);
7618 + jjtc000 = false;
7620 +/*@egen*/
7621 + {return new NotCond(c1);}/*@bgen(jjtree)*/
7622 + } catch (Throwable jjte000) {
7623 + if (jjtc000) {
7624 + jjtree.clearNodeScope(jjtn000);
7625 + jjtc000 = false;
7626 + } else {
7627 + jjtree.popNode();
7629 + if (jjte000 instanceof RuntimeException) {
7630 + throw (RuntimeException)jjte000;
7632 + if (jjte000 instanceof ParseException) {
7633 + throw (ParseException)jjte000;
7635 + throw (Error)jjte000;
7636 + } finally {
7637 + if (jjtc000) {
7638 + jjtree.closeNodeScope(jjtn000, true);
7641 +/*@egen*/
7646 +LogicalOperator CogroupClause() : {/*@bgen(jjtree) CogroupClause */
7647 + SimpleNode jjtn000 = new SimpleNode(JJTCOGROUPCLAUSE);
7648 + boolean jjtc000 = true;
7649 + jjtree.openNodeScope(jjtn000);
7650 +/*@egen*/CogroupInput gi; ArrayList<CogroupInput> gis = new ArrayList<CogroupInput>();}
7651 +{/*@bgen(jjtree) CogroupClause */
7652 + try {
7653 +/*@egen*/
7654 + (gi = GroupItem() { gis.add(gi); }
7655 + ("," gi = GroupItem() { gis.add(gi); })*)/*@bgen(jjtree)*/
7657 + jjtree.closeNodeScope(jjtn000, true);
7658 + jjtc000 = false;
7660 +/*@egen*/
7661 + {return parseCogroup(gis);}/*@bgen(jjtree)*/
7662 + } catch (Throwable jjte000) {
7663 + if (jjtc000) {
7664 + jjtree.clearNodeScope(jjtn000);
7665 + jjtc000 = false;
7666 + } else {
7667 + jjtree.popNode();
7669 + if (jjte000 instanceof RuntimeException) {
7670 + throw (RuntimeException)jjte000;
7672 + if (jjte000 instanceof ParseException) {
7673 + throw (ParseException)jjte000;
7675 + throw (Error)jjte000;
7676 + } finally {
7677 + if (jjtc000) {
7678 + jjtree.closeNodeScope(jjtn000, true);
7681 +/*@egen*/
7685 +CogroupInput GroupItem() : {/*@bgen(jjtree) GroupItem */
7686 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPITEM);
7687 + boolean jjtc000 = true;
7688 + jjtree.openNodeScope(jjtn000);
7689 +/*@egen*/LogicalOperator op; GroupFunc groupFunc; CogroupInput cogroupInput = new CogroupInput();}
7690 +{/*@bgen(jjtree) GroupItem */
7691 + try {
7692 +/*@egen*/
7694 + cogroupInput.op = NestedExpr()
7697 + ( <BY> cogroupInput.spec = GroupByExpr(cogroupInput.op.outputSchema()) )
7698 +| <ALL> {cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAll.class.getName()), new EvalItemList(pigContext), false);}
7699 +| <ANY> {cogroupInput.spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFAny.class.getName()), new EvalItemList(pigContext), false);}
7701 + [<INNER> {cogroupInput.spec.isInner = true;} | <OUTER>]
7703 + )/*@bgen(jjtree)*/
7705 + jjtree.closeNodeScope(jjtn000, true);
7706 + jjtc000 = false;
7708 +/*@egen*/
7709 + {return cogroupInput;}/*@bgen(jjtree)*/
7710 + } catch (Throwable jjte000) {
7711 + if (jjtc000) {
7712 + jjtree.clearNodeScope(jjtn000);
7713 + jjtc000 = false;
7714 + } else {
7715 + jjtree.popNode();
7717 + if (jjte000 instanceof RuntimeException) {
7718 + throw (RuntimeException)jjte000;
7720 + if (jjte000 instanceof ParseException) {
7721 + throw (ParseException)jjte000;
7723 + throw (Error)jjte000;
7724 + } finally {
7725 + if (jjtc000) {
7726 + jjtree.closeNodeScope(jjtn000, true);
7729 +/*@egen*/
7732 +GroupBySpec GroupByExpr(SchemaItem over) : {/*@bgen(jjtree) GroupByExpr */
7733 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYEXPR);
7734 + boolean jjtc000 = true;
7735 + jjtree.openNodeScope(jjtn000);
7736 +/*@egen*/Token t1; GroupBySpec spec = null; EvalItem projItem = null; EvalItemList proj = null; String s; GroupFunc func = null;}
7737 +{/*@bgen(jjtree) GroupByExpr */
7738 + try {
7739 +/*@egen*/
7741 + LOOKAHEAD(2) (func = GroupFunction() "(" proj = SimpleProjOrEmpty(over) ")" {spec = new GroupBySpec(pigContext, func, proj, false);})
7742 +| (proj = BracketedSimpleProj(over)) {spec = new GroupBySpec(pigContext, (GroupFunc) pigContext.getUDF(GFTupleNoop.class.getName()), proj, false);}
7743 + )/*@bgen(jjtree)*/
7745 + jjtree.closeNodeScope(jjtn000, true);
7746 + jjtc000 = false;
7748 +/*@egen*/
7749 + {return spec;}/*@bgen(jjtree)*/
7750 + } catch (Throwable jjte000) {
7751 + if (jjtc000) {
7752 + jjtree.clearNodeScope(jjtn000);
7753 + jjtc000 = false;
7754 + } else {
7755 + jjtree.popNode();
7757 + if (jjte000 instanceof RuntimeException) {
7758 + throw (RuntimeException)jjte000;
7760 + if (jjte000 instanceof ParseException) {
7761 + throw (ParseException)jjte000;
7763 + throw (Error)jjte000;
7764 + } finally {
7765 + if (jjtc000) {
7766 + jjtree.closeNodeScope(jjtn000, true);
7769 +/*@egen*/
7772 +//Used in serialization and deserialization
7773 +GroupBySpec GroupBySpec() : {/*@bgen(jjtree) GroupBySpec */
7774 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPBYSPEC);
7775 + boolean jjtc000 = true;
7776 + jjtree.openNodeScope(jjtn000);
7777 +/*@egen*/GroupBySpec spec = null;}
7778 +{/*@bgen(jjtree) GroupBySpec */
7779 + try {
7780 +/*@egen*/
7781 + (spec = GroupByExpr(null)
7782 + [<INNER> {spec.isInner = true;} | <OUTER>])/*@bgen(jjtree)*/
7784 + jjtree.closeNodeScope(jjtn000, true);
7785 + jjtc000 = false;
7787 +/*@egen*/
7788 + {return spec;}/*@bgen(jjtree)*/
7789 + } catch (Throwable jjte000) {
7790 + if (jjtc000) {
7791 + jjtree.clearNodeScope(jjtn000);
7792 + jjtc000 = false;
7793 + } else {
7794 + jjtree.popNode();
7796 + if (jjte000 instanceof RuntimeException) {
7797 + throw (RuntimeException)jjte000;
7799 + if (jjte000 instanceof ParseException) {
7800 + throw (ParseException)jjte000;
7802 + throw (Error)jjte000;
7803 + } finally {
7804 + if (jjtc000) {
7805 + jjtree.closeNodeScope(jjtn000, true);
7808 +/*@egen*/
7811 +LogicalOperator CrossClause() : {/*@bgen(jjtree) CrossClause */
7812 + SimpleNode jjtn000 = new SimpleNode(JJTCROSSCLAUSE);
7813 + boolean jjtc000 = true;
7814 + jjtree.openNodeScope(jjtn000);
7815 +/*@egen*/LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();}
7816 +{/*@bgen(jjtree) CrossClause */
7817 + try {
7818 +/*@egen*/
7820 + op = NestedExpr() { inputs.add(op); }
7821 + ("," op = NestedExpr() { inputs.add(op); })*
7822 + )/*@bgen(jjtree)*/
7824 + jjtree.closeNodeScope(jjtn000, true);
7825 + jjtc000 = false;
7827 +/*@egen*/
7828 + {return rewriteCross(inputs);}/*@bgen(jjtree)*/
7829 + } catch (Throwable jjte000) {
7830 + if (jjtc000) {
7831 + jjtree.clearNodeScope(jjtn000);
7832 + jjtc000 = false;
7833 + } else {
7834 + jjtree.popNode();
7836 + if (jjte000 instanceof RuntimeException) {
7837 + throw (RuntimeException)jjte000;
7839 + if (jjte000 instanceof ParseException) {
7840 + throw (ParseException)jjte000;
7842 + throw (Error)jjte000;
7843 + } finally {
7844 + if (jjtc000) {
7845 + jjtree.closeNodeScope(jjtn000, true);
7848 +/*@egen*/
7851 +LogicalOperator UnionClause() : {/*@bgen(jjtree) UnionClause */
7852 + SimpleNode jjtn000 = new SimpleNode(JJTUNIONCLAUSE);
7853 + boolean jjtc000 = true;
7854 + jjtree.openNodeScope(jjtn000);
7855 +/*@egen*/LogicalOperator op; ArrayList<LogicalOperator> inputs = new ArrayList<LogicalOperator>();}
7856 +{/*@bgen(jjtree) UnionClause */
7857 + try {
7858 +/*@egen*/
7859 + (op = NestedExpr() { inputs.add(op); }
7860 + ("," op = NestedExpr() { inputs.add(op); })*)/*@bgen(jjtree)*/
7862 + jjtree.closeNodeScope(jjtn000, true);
7863 + jjtc000 = false;
7865 +/*@egen*/
7866 + {return new LOUnion(pigContext, inputs);}/*@bgen(jjtree)*/
7867 + } catch (Throwable jjte000) {
7868 + if (jjtc000) {
7869 + jjtree.clearNodeScope(jjtn000);
7870 + jjtc000 = false;
7871 + } else {
7872 + jjtree.popNode();
7874 + if (jjte000 instanceof RuntimeException) {
7875 + throw (RuntimeException)jjte000;
7877 + if (jjte000 instanceof ParseException) {
7878 + throw (ParseException)jjte000;
7880 + throw (Error)jjte000;
7881 + } finally {
7882 + if (jjtc000) {
7883 + jjtree.closeNodeScope(jjtn000, true);
7886 +/*@egen*/
7890 +LogicalOperator ForEachClause() : {/*@bgen(jjtree) ForEachClause */
7891 + SimpleNode jjtn000 = new SimpleNode(JJTFOREACHCLAUSE);
7892 + boolean jjtc000 = true;
7893 + jjtree.openNodeScope(jjtn000);
7894 +/*@egen*/EvalSpecPipeAndSchema specPipeAndSchema = null; LogicalOperator input, op; }
7895 +{/*@bgen(jjtree) ForEachClause */
7896 + try {
7897 +/*@egen*/
7899 + input = NestedExpr()
7900 + specPipeAndSchema = NestedBlock(input.outputSchema())
7901 + )/*@bgen(jjtree)*/
7903 + jjtree.closeNodeScope(jjtn000, true);
7904 + jjtc000 = false;
7906 +/*@egen*/
7908 + op = new LOEval(pigContext, input, specPipeAndSchema.pipe);
7909 + op.schema = specPipeAndSchema.schema;
7910 + return op;
7911 + }/*@bgen(jjtree)*/
7912 + } catch (Throwable jjte000) {
7913 + if (jjtc000) {
7914 + jjtree.clearNodeScope(jjtn000);
7915 + jjtc000 = false;
7916 + } else {
7917 + jjtree.popNode();
7919 + if (jjte000 instanceof RuntimeException) {
7920 + throw (RuntimeException)jjte000;
7922 + if (jjte000 instanceof ParseException) {
7923 + throw (ParseException)jjte000;
7925 + throw (Error)jjte000;
7926 + } finally {
7927 + if (jjtc000) {
7928 + jjtree.closeNodeScope(jjtn000, true);
7931 +/*@egen*/
7934 +EvalSpecPipeAndSchema NestedBlock(SchemaItem over):
7935 +{/*@bgen(jjtree) NestedBlock */
7936 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDBLOCK);
7937 + boolean jjtc000 = true;
7938 + jjtree.openNodeScope(jjtn000);
7939 +/*@egen*/EvalSpecPipeAndSchema pipeAndSchema; Map<String, EvalItem> pipes = new HashMap<String, EvalItem>();}
7940 +{/*@bgen(jjtree) NestedBlock */
7941 + try {
7942 +/*@egen*/
7944 + pipeAndSchema = GenerateStatement(over,pipes)
7945 +| ("{" (NestedCommand(over,pipes) ";")* pipeAndSchema = GenerateStatement(over,pipes) ";" "}")
7946 + )/*@bgen(jjtree)*/
7948 + jjtree.closeNodeScope(jjtn000, true);
7949 + jjtc000 = false;
7951 +/*@egen*/
7952 + {return pipeAndSchema;}/*@bgen(jjtree)*/
7953 + } catch (Throwable jjte000) {
7954 + if (jjtc000) {
7955 + jjtree.clearNodeScope(jjtn000);
7956 + jjtc000 = false;
7957 + } else {
7958 + jjtree.popNode();
7960 + if (jjte000 instanceof RuntimeException) {
7961 + throw (RuntimeException)jjte000;
7963 + if (jjte000 instanceof ParseException) {
7964 + throw (ParseException)jjte000;
7966 + throw (Error)jjte000;
7967 + } finally {
7968 + if (jjtc000) {
7969 + jjtree.closeNodeScope(jjtn000, true);
7972 +/*@egen*/
7975 +void NestedCommand(SchemaItem over, Map<String, EvalItem> pipes):
7976 +{/*@bgen(jjtree) NestedCommand */
7977 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDCOMMAND);
7978 + boolean jjtc000 = true;
7979 + jjtree.openNodeScope(jjtn000);
7980 +/*@egen*/Token t; EvalItem item;}
7981 +{/*@bgen(jjtree) NestedCommand */
7982 + try {
7983 +/*@egen*/
7985 + t = <IDENTIFIER> "="
7987 + item = InfixExpr(over,pipes)
7988 +| item = NestedFilter(over,pipes)
7989 +| item = NestedSortOrArrange(over,pipes)
7990 +| item = NestedDistinct(over,pipes)
7992 + )/*@bgen(jjtree)*/
7994 + jjtree.closeNodeScope(jjtn000, true);
7995 + jjtc000 = false;
7997 +/*@egen*/
7998 + {pipes.put(t.image,item);}/*@bgen(jjtree)*/
7999 + } catch (Throwable jjte000) {
8000 + if (jjtc000) {
8001 + jjtree.clearNodeScope(jjtn000);
8002 + jjtc000 = false;
8003 + } else {
8004 + jjtree.popNode();
8006 + if (jjte000 instanceof RuntimeException) {
8007 + throw (RuntimeException)jjte000;
8009 + if (jjte000 instanceof ParseException) {
8010 + throw (ParseException)jjte000;
8012 + throw (Error)jjte000;
8013 + } finally {
8014 + if (jjtc000) {
8015 + jjtree.closeNodeScope(jjtn000, true);
8018 +/*@egen*/
8021 +EvalItem NestedFilter(SchemaItem over, Map<String, EvalItem> pipes):
8022 +{/*@bgen(jjtree) NestedFilter */
8023 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDFILTER);
8024 + boolean jjtc000 = true;
8025 + jjtree.openNodeScope(jjtn000);
8026 +/*@egen*/Cond cond; EvalItem item; SchemaItem subSchema = null;}
8027 +{/*@bgen(jjtree) NestedFilter */
8028 + try {
8029 +/*@egen*/
8030 + <FILTER> item = BaseEvalItem(over,pipes) { subSchema = item.mapInputSchema(over); }
8031 + <BY> cond = PCond(subSchema,null)/*@bgen(jjtree)*/
8033 + jjtree.closeNodeScope(jjtn000, true);
8034 + jjtc000 = false;
8036 +/*@egen*/
8037 + { return copyItemAndAddSpec(item,new FilterSpec(cond)); }/*@bgen(jjtree)*/
8038 + } catch (Throwable jjte000) {
8039 + if (jjtc000) {
8040 + jjtree.clearNodeScope(jjtn000);
8041 + jjtc000 = false;
8042 + } else {
8043 + jjtree.popNode();
8045 + if (jjte000 instanceof RuntimeException) {
8046 + throw (RuntimeException)jjte000;
8048 + if (jjte000 instanceof ParseException) {
8049 + throw (ParseException)jjte000;
8051 + throw (Error)jjte000;
8052 + } finally {
8053 + if (jjtc000) {
8054 + jjtree.closeNodeScope(jjtn000, true);
8057 +/*@egen*/
8060 +EvalItem NestedSortOrArrange(SchemaItem over, Map<String, EvalItem> pipes):
8061 +{/*@bgen(jjtree) NestedSortOrArrange */
8062 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDSORTORARRANGE);
8063 + boolean jjtc000 = true;
8064 + jjtree.openNodeScope(jjtn000);
8065 +/*@egen*/EvalItemList list; EvalItem item; SchemaItem subSchema = null; Token t;}
8066 +{/*@bgen(jjtree) NestedSortOrArrange */
8067 + try {
8068 +/*@egen*/
8070 + ( t = <ORDER> | t = <ARRANGE> )
8071 + item = BaseEvalItem(over,pipes) { subSchema = item.mapInputSchema(over); }
8072 + <BY> list = SimpleProj(subSchema)
8073 + )/*@bgen(jjtree)*/
8075 + jjtree.closeNodeScope(jjtn000, true);
8076 + jjtc000 = false;
8078 +/*@egen*/
8079 + { return copyItemAndAddSpec(item,new SortArrangeSpec(list,t.image.equalsIgnoreCase("arrange"))); }/*@bgen(jjtree)*/
8080 + } catch (Throwable jjte000) {
8081 + if (jjtc000) {
8082 + jjtree.clearNodeScope(jjtn000);
8083 + jjtc000 = false;
8084 + } else {
8085 + jjtree.popNode();
8087 + if (jjte000 instanceof RuntimeException) {
8088 + throw (RuntimeException)jjte000;
8090 + if (jjte000 instanceof ParseException) {
8091 + throw (ParseException)jjte000;
8093 + throw (Error)jjte000;
8094 + } finally {
8095 + if (jjtc000) {
8096 + jjtree.closeNodeScope(jjtn000, true);
8099 +/*@egen*/
8102 +EvalItem NestedDistinct(SchemaItem over, Map<String, EvalItem> pipes):
8103 +{/*@bgen(jjtree) NestedDistinct */
8104 + SimpleNode jjtn000 = new SimpleNode(JJTNESTEDDISTINCT);
8105 + boolean jjtc000 = true;
8106 + jjtree.openNodeScope(jjtn000);
8107 +/*@egen*/EvalItemList list; EvalItem item; LogicalOperator subOp = null; Token t;}
8108 +{/*@bgen(jjtree) NestedDistinct */
8109 + try {
8110 +/*@egen*/
8112 + <DISTINCT>
8113 + item = BaseEvalItem(over,pipes)
8114 + )/*@bgen(jjtree)*/
8116 + jjtree.closeNodeScope(jjtn000, true);
8117 + jjtc000 = false;
8119 +/*@egen*/
8120 + {
8121 + list = new EvalItemList(pigContext); list.add(new StarEvalItem(pigContext));
8122 + return copyItemAndAddSpec(item,new DistinctSpec(list));
8123 + }/*@bgen(jjtree)*/
8124 + } catch (Throwable jjte000) {
8125 + if (jjtc000) {
8126 + jjtree.clearNodeScope(jjtn000);
8127 + jjtc000 = false;
8128 + } else {
8129 + jjtree.popNode();
8131 + if (jjte000 instanceof RuntimeException) {
8132 + throw (RuntimeException)jjte000;
8134 + if (jjte000 instanceof ParseException) {
8135 + throw (ParseException)jjte000;
8137 + throw (Error)jjte000;
8138 + } finally {
8139 + if (jjtc000) {
8140 + jjtree.closeNodeScope(jjtn000, true);
8143 +/*@egen*/
8147 +EvalSpecPipeAndSchema GenerateStatement(SchemaItem over, Map<String, EvalItem> pipes):
8148 +{/*@bgen(jjtree) GenerateStatement */
8149 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATESTATEMENT);
8150 + boolean jjtc000 = true;
8151 + jjtree.openNodeScope(jjtn000);
8152 +/*@egen*/EvalSpecPipeAndSchema pipeAndSchema = new EvalSpecPipeAndSchema(); EvalSpecPipe pipe = null; SchemaItemList schema;}
8153 +{/*@bgen(jjtree) GenerateStatement */
8154 + try {
8155 +/*@egen*/
8157 + <GENERATE>
8158 + pipe = FlattenedGenerateItemList(over,pipes)
8159 + )/*@bgen(jjtree)*/
8161 + jjtree.closeNodeScope(jjtn000, true);
8162 + jjtc000 = false;
8164 +/*@egen*/
8166 + pipeAndSchema.pipe = pipe;
8167 + return pipeAndSchema;
8168 + }/*@bgen(jjtree)*/
8169 + } catch (Throwable jjte000) {
8170 + if (jjtc000) {
8171 + jjtree.clearNodeScope(jjtn000);
8172 + jjtc000 = false;
8173 + } else {
8174 + jjtree.popNode();
8176 + if (jjte000 instanceof RuntimeException) {
8177 + throw (RuntimeException)jjte000;
8179 + if (jjte000 instanceof ParseException) {
8180 + throw (ParseException)jjte000;
8182 + throw (Error)jjte000;
8183 + } finally {
8184 + if (jjtc000) {
8185 + jjtree.closeNodeScope(jjtn000, true);
8188 +/*@egen*/
8191 +EvalSpecPipe FlattenedGenerateItemList(SchemaItem over, Map<String, EvalItem> pipes):
8192 +{/*@bgen(jjtree) FlattenedGenerateItemList */
8193 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEMLIST);
8194 + boolean jjtc000 = true;
8195 + jjtree.openNodeScope(jjtn000);
8196 +/*@egen*/EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
8197 +{/*@bgen(jjtree) FlattenedGenerateItemList */
8198 + try {
8199 +/*@egen*/
8201 + item = FlattenedGenerateItem(over,pipes) {list.add(item);}
8202 + ("," item = FlattenedGenerateItem(over,pipes) {list.add(item);})*
8203 + )/*@bgen(jjtree)*/
8205 + jjtree.closeNodeScope(jjtn000, true);
8206 + jjtc000 = false;
8208 +/*@egen*/
8209 + {pipe.add(list); return pipe;}/*@bgen(jjtree)*/
8210 + } catch (Throwable jjte000) {
8211 + if (jjtc000) {
8212 + jjtree.clearNodeScope(jjtn000);
8213 + jjtc000 = false;
8214 + } else {
8215 + jjtree.popNode();
8217 + if (jjte000 instanceof RuntimeException) {
8218 + throw (RuntimeException)jjte000;
8220 + if (jjte000 instanceof ParseException) {
8221 + throw (ParseException)jjte000;
8223 + throw (Error)jjte000;
8224 + } finally {
8225 + if (jjtc000) {
8226 + jjtree.closeNodeScope(jjtn000, true);
8229 +/*@egen*/
8233 +EvalItem FlattenedGenerateItem(SchemaItem over, Map<String, EvalItem> pipes):
8234 +{/*@bgen(jjtree) FlattenedGenerateItem */
8235 + SimpleNode jjtn000 = new SimpleNode(JJTFLATTENEDGENERATEITEM);
8236 + boolean jjtc000 = true;
8237 + jjtree.openNodeScope(jjtn000);
8238 +/*@egen*/EvalItem item; SchemaItem schema = null;}
8239 +{/*@bgen(jjtree) FlattenedGenerateItem */
8240 + try {
8241 +/*@egen*/
8244 + ( <FLATTEN> "(" item = GenerateItem(over,pipes) ")"
8246 + if (!(item instanceof NestableEvalItem) ||
8247 + (item instanceof AtomFuncEvalItem) ){
8248 + throw new ParseException("Cannot flatten atom field");
8251 + EvalItemList list = new EvalItemList(pigContext);
8252 + list.add(new StarEvalItem(pigContext));
8253 + ((NestableEvalItem)item).subColSpec = list;
8256 +| (item = GenerateItem(over,pipes))
8258 + [ <AS> schema = SchemaElement() ]
8259 + )/*@bgen(jjtree)*/
8261 + jjtree.closeNodeScope(jjtn000, true);
8262 + jjtc000 = false;
8264 +/*@egen*/
8266 + item.schema = schema;
8267 + return item;
8268 + }/*@bgen(jjtree)*/
8269 + } catch (Throwable jjte000) {
8270 + if (jjtc000) {
8271 + jjtree.clearNodeScope(jjtn000);
8272 + jjtc000 = false;
8273 + } else {
8274 + jjtree.popNode();
8276 + if (jjte000 instanceof RuntimeException) {
8277 + throw (RuntimeException)jjte000;
8279 + if (jjte000 instanceof ParseException) {
8280 + throw (ParseException)jjte000;
8282 + throw (Error)jjte000;
8283 + } finally {
8284 + if (jjtc000) {
8285 + jjtree.closeNodeScope(jjtn000, true);
8288 +/*@egen*/
8291 +EvalItem GenerateItem(SchemaItem over, Map<String, EvalItem> pipes):
8292 +{/*@bgen(jjtree) GenerateItem */
8293 + SimpleNode jjtn000 = new SimpleNode(JJTGENERATEITEM);
8294 + boolean jjtc000 = true;
8295 + jjtree.openNodeScope(jjtn000);
8296 +/*@egen*/EvalItem item;}
8297 +{/*@bgen(jjtree) GenerateItem */
8298 + try {
8299 +/*@egen*/
8301 + item = InfixExpr(over,pipes)
8302 +| item = Star()
8303 + )/*@bgen(jjtree)*/
8305 + jjtree.closeNodeScope(jjtn000, true);
8306 + jjtc000 = false;
8308 +/*@egen*/
8309 + {return item;}/*@bgen(jjtree)*/
8310 + } catch (Throwable jjte000) {
8311 + if (jjtc000) {
8312 + jjtree.clearNodeScope(jjtn000);
8313 + jjtc000 = false;
8314 + } else {
8315 + jjtree.popNode();
8317 + if (jjte000 instanceof RuntimeException) {
8318 + throw (RuntimeException)jjte000;
8320 + if (jjte000 instanceof ParseException) {
8321 + throw (ParseException)jjte000;
8323 + throw (Error)jjte000;
8324 + } finally {
8325 + if (jjtc000) {
8326 + jjtree.closeNodeScope(jjtn000, true);
8329 +/*@egen*/
8333 +EvalItem InfixExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) InfixExpr */
8334 + SimpleNode jjtn000 = new SimpleNode(JJTINFIXEXPR);
8335 + boolean jjtc000 = true;
8336 + jjtree.openNodeScope(jjtn000);
8337 +/*@egen*/ EvalItem expr; }
8338 +{/*@bgen(jjtree) InfixExpr */
8339 + try {
8340 +/*@egen*/
8341 + expr = AdditiveExpr(over,pipes)/*@bgen(jjtree)*/
8343 + jjtree.closeNodeScope(jjtn000, true);
8344 + jjtc000 = false;
8346 +/*@egen*/
8347 + {return expr;}/*@bgen(jjtree)*/
8348 + } catch (Throwable jjte000) {
8349 + if (jjtc000) {
8350 + jjtree.clearNodeScope(jjtn000);
8351 + jjtc000 = false;
8352 + } else {
8353 + jjtree.popNode();
8355 + if (jjte000 instanceof RuntimeException) {
8356 + throw (RuntimeException)jjte000;
8358 + if (jjte000 instanceof ParseException) {
8359 + throw (ParseException)jjte000;
8361 + throw (Error)jjte000;
8362 + } finally {
8363 + if (jjtc000) {
8364 + jjtree.closeNodeScope(jjtn000, true);
8367 +/*@egen*/
8370 +EvalItem AdditiveExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) AdditiveExpr */
8371 + SimpleNode jjtn000 = new SimpleNode(JJTADDITIVEEXPR);
8372 + boolean jjtc000 = true;
8373 + jjtree.openNodeScope(jjtn000);
8374 +/*@egen*/ Token t; EvalItem lhs, rhs; EvalItemList args; }
8375 +{/*@bgen(jjtree) AdditiveExpr */
8376 + try {
8377 +/*@egen*/
8379 + lhs = MultiplicativeExpr(over,pipes)
8381 + ( t = "+" | t = "-" ) rhs = MultiplicativeExpr(over,pipes)
8384 + assertAtomic(lhs,true);
8385 + assertAtomic(rhs,true);
8386 + args = new EvalItemList(pigContext);
8387 + args.add(lhs);
8388 + args.add(rhs);
8389 + if (t.image.equals("+")){
8390 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("ADD"), args);
8391 + }else{
8392 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("SUBTRACT"), args);
8395 + )*
8396 + )/*@bgen(jjtree)*/
8398 + jjtree.closeNodeScope(jjtn000, true);
8399 + jjtc000 = false;
8401 +/*@egen*/
8402 + {return lhs;}/*@bgen(jjtree)*/
8403 + } catch (Throwable jjte000) {
8404 + if (jjtc000) {
8405 + jjtree.clearNodeScope(jjtn000);
8406 + jjtc000 = false;
8407 + } else {
8408 + jjtree.popNode();
8410 + if (jjte000 instanceof RuntimeException) {
8411 + throw (RuntimeException)jjte000;
8413 + if (jjte000 instanceof ParseException) {
8414 + throw (ParseException)jjte000;
8416 + throw (Error)jjte000;
8417 + } finally {
8418 + if (jjtc000) {
8419 + jjtree.closeNodeScope(jjtn000, true);
8422 +/*@egen*/
8425 +EvalItem MultiplicativeExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) MultiplicativeExpr */
8426 + SimpleNode jjtn000 = new SimpleNode(JJTMULTIPLICATIVEEXPR);
8427 + boolean jjtc000 = true;
8428 + jjtree.openNodeScope(jjtn000);
8429 +/*@egen*/ Token t; EvalItem lhs, rhs; EvalItemList args; }
8430 +{/*@bgen(jjtree) MultiplicativeExpr */
8431 + try {
8432 +/*@egen*/
8434 + lhs = UnaryExpr(over,pipes)
8436 + ( t = <STAR> | t = "/" ) rhs = UnaryExpr(over,pipes)
8438 + assertAtomic(lhs,true);
8439 + assertAtomic(rhs,true);
8440 + args = new EvalItemList(pigContext);
8441 + args.add(lhs);
8442 + args.add(rhs);
8443 + if (t.image.equals("*")){
8444 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("MULTIPLY"), args);
8445 + }else{
8446 + lhs = newFuncEvalItem((EvalFunc)pigContext.getUDF("DIVIDE"), args);
8449 + )*
8450 + )/*@bgen(jjtree)*/
8452 + jjtree.closeNodeScope(jjtn000, true);
8453 + jjtc000 = false;
8455 +/*@egen*/
8456 + {return lhs;}/*@bgen(jjtree)*/
8457 + } catch (Throwable jjte000) {
8458 + if (jjtc000) {
8459 + jjtree.clearNodeScope(jjtn000);
8460 + jjtc000 = false;
8461 + } else {
8462 + jjtree.popNode();
8464 + if (jjte000 instanceof RuntimeException) {
8465 + throw (RuntimeException)jjte000;
8467 + if (jjte000 instanceof ParseException) {
8468 + throw (ParseException)jjte000;
8470 + throw (Error)jjte000;
8471 + } finally {
8472 + if (jjtc000) {
8473 + jjtree.closeNodeScope(jjtn000, true);
8476 +/*@egen*/
8479 +EvalItem UnaryExpr(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) UnaryExpr */
8480 + SimpleNode jjtn000 = new SimpleNode(JJTUNARYEXPR);
8481 + boolean jjtc000 = true;
8482 + jjtree.openNodeScope(jjtn000);
8483 +/*@egen*/ EvalItem expr; }
8484 +{/*@bgen(jjtree) UnaryExpr */
8485 + try {
8486 +/*@egen*/
8488 + LOOKAHEAD(BaseEvalItem(over,pipes)) expr = BaseEvalItem(over,pipes)
8489 +| ( "(" expr = InfixExpr(over,pipes) ")" )
8490 + )/*@bgen(jjtree)*/
8492 + jjtree.closeNodeScope(jjtn000, true);
8493 + jjtc000 = false;
8495 +/*@egen*/
8496 + {return expr;}/*@bgen(jjtree)*/
8497 + } catch (Throwable jjte000) {
8498 + if (jjtc000) {
8499 + jjtree.clearNodeScope(jjtn000);
8500 + jjtc000 = false;
8501 + } else {
8502 + jjtree.popNode();
8504 + if (jjte000 instanceof RuntimeException) {
8505 + throw (RuntimeException)jjte000;
8507 + if (jjte000 instanceof ParseException) {
8508 + throw (ParseException)jjte000;
8510 + throw (Error)jjte000;
8511 + } finally {
8512 + if (jjtc000) {
8513 + jjtree.closeNodeScope(jjtn000, true);
8516 +/*@egen*/
8520 +EvalItem BaseEvalItem(SchemaItem over, Map<String, EvalItem> pipes) :
8521 +{/*@bgen(jjtree) BaseEvalItem */
8522 + SimpleNode jjtn000 = new SimpleNode(JJTBASEEVALITEM);
8523 + boolean jjtc000 = true;
8524 + jjtree.openNodeScope(jjtn000);
8525 +/*@egen*/EvalItem item;EvalItemList projection; SchemaItem subSchema = null;}
8526 +{/*@bgen(jjtree) BaseEvalItem */
8527 + try {
8528 +/*@egen*/
8530 + item = Const()
8531 +| (
8533 + LOOKAHEAD(FuncEvalItem(over,pipes))
8534 + item = FuncEvalItem(over,pipes)
8535 + | item = PColEvalItem(over,pipes)
8536 + | item = BinCond(over,pipes)
8538 + { subSchema = item.mapInputSchema(over); }
8539 + [
8540 + "." projection = BracketedSimpleProj(subSchema)
8542 + assertAtomic(item,false);
8543 + ((NestableEvalItem)item).addNestedEvalSpec(projection);
8547 + )/*@bgen(jjtree)*/
8549 + jjtree.closeNodeScope(jjtn000, true);
8550 + jjtc000 = false;
8552 +/*@egen*/
8553 + {return item;}/*@bgen(jjtree)*/
8554 + } catch (Throwable jjte000) {
8555 + if (jjtc000) {
8556 + jjtree.clearNodeScope(jjtn000);
8557 + jjtc000 = false;
8558 + } else {
8559 + jjtree.popNode();
8561 + if (jjte000 instanceof RuntimeException) {
8562 + throw (RuntimeException)jjte000;
8564 + if (jjte000 instanceof ParseException) {
8565 + throw (ParseException)jjte000;
8567 + throw (Error)jjte000;
8568 + } finally {
8569 + if (jjtc000) {
8570 + jjtree.closeNodeScope(jjtn000, true);
8573 +/*@egen*/
8578 +NestableEvalItem BinCond(SchemaItem over, Map<String, EvalItem> pipes):
8579 +{/*@bgen(jjtree) BinCond */
8580 + SimpleNode jjtn000 = new SimpleNode(JJTBINCOND);
8581 + boolean jjtc000 = true;
8582 + jjtree.openNodeScope(jjtn000);
8583 +/*@egen*/Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;}
8584 +{/*@bgen(jjtree) BinCond */
8585 + try {
8586 +/*@egen*/
8588 + "(" cond = PCond(over,pipes) "?" ifTrue = BaseEvalItem(over,pipes)
8589 + ":" ifFalse = BaseEvalItem(over,pipes) ")"
8590 + )/*@bgen(jjtree)*/
8592 + jjtree.closeNodeScope(jjtn000, true);
8593 + jjtc000 = false;
8595 +/*@egen*/
8596 + { return new BinCond(pigContext, cond,ifTrue,ifFalse);}/*@bgen(jjtree)*/
8597 + } catch (Throwable jjte000) {
8598 + if (jjtc000) {
8599 + jjtree.clearNodeScope(jjtn000);
8600 + jjtc000 = false;
8601 + } else {
8602 + jjtree.popNode();
8604 + if (jjte000 instanceof RuntimeException) {
8605 + throw (RuntimeException)jjte000;
8607 + if (jjte000 instanceof ParseException) {
8608 + throw (ParseException)jjte000;
8610 + throw (Error)jjte000;
8611 + } finally {
8612 + if (jjtc000) {
8613 + jjtree.closeNodeScope(jjtn000, true);
8616 +/*@egen*/
8620 +NestableEvalItem FuncEvalItem(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) FuncEvalItem */
8621 + SimpleNode jjtn000 = new SimpleNode(JJTFUNCEVALITEM);
8622 + boolean jjtc000 = true;
8623 + jjtree.openNodeScope(jjtn000);
8624 +/*@egen*/EvalFunc func; EvalItemList args; NestableEvalItem i;}
8625 +{/*@bgen(jjtree) FuncEvalItem */
8626 + try {
8627 +/*@egen*/
8628 + func=EvalFunction() "(" args=EvalArgs(over,pipes) ")" {i = newFuncEvalItem(func, args);}/*@bgen(jjtree)*/
8630 + jjtree.closeNodeScope(jjtn000, true);
8631 + jjtc000 = false;
8633 +/*@egen*/
8634 + {return i;}/*@bgen(jjtree)*/
8635 + } catch (Throwable jjte000) {
8636 + if (jjtc000) {
8637 + jjtree.clearNodeScope(jjtn000);
8638 + jjtc000 = false;
8639 + } else {
8640 + jjtree.popNode();
8642 + if (jjte000 instanceof RuntimeException) {
8643 + throw (RuntimeException)jjte000;
8645 + if (jjte000 instanceof ParseException) {
8646 + throw (ParseException)jjte000;
8648 + throw (Error)jjte000;
8649 + } finally {
8650 + if (jjtc000) {
8651 + jjtree.closeNodeScope(jjtn000, true);
8654 +/*@egen*/
8657 +EvalItemList EvalArgs(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) EvalArgs */
8658 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGS);
8659 + boolean jjtc000 = true;
8660 + jjtree.openNodeScope(jjtn000);
8661 +/*@egen*/EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
8662 +{/*@bgen(jjtree) EvalArgs */
8663 + try {
8664 +/*@egen*/
8666 + (item=EvalArgsItem(over,pipes) {list.add(item);}
8667 + ("," item=EvalArgsItem(over,pipes) {list.add(item);})*)
8668 + | {list = new EvalItemList(pigContext);}
8669 + )/*@bgen(jjtree)*/
8671 + jjtree.closeNodeScope(jjtn000, true);
8672 + jjtc000 = false;
8674 +/*@egen*/
8676 + if (!list.isSimple()){
8677 + throw new ParseException("Cannot have non-jave function as an argument");
8679 + return list;
8680 + }/*@bgen(jjtree)*/
8681 + } catch (Throwable jjte000) {
8682 + if (jjtc000) {
8683 + jjtree.clearNodeScope(jjtn000);
8684 + jjtc000 = false;
8685 + } else {
8686 + jjtree.popNode();
8688 + if (jjte000 instanceof RuntimeException) {
8689 + throw (RuntimeException)jjte000;
8691 + if (jjte000 instanceof ParseException) {
8692 + throw (ParseException)jjte000;
8694 + throw (Error)jjte000;
8695 + } finally {
8696 + if (jjtc000) {
8697 + jjtree.closeNodeScope(jjtn000, true);
8700 +/*@egen*/
8703 +EvalItem EvalArgsItem(SchemaItem over, Map<String, EvalItem> pipes):
8704 +{/*@bgen(jjtree) EvalArgsItem */
8705 + SimpleNode jjtn000 = new SimpleNode(JJTEVALARGSITEM);
8706 + boolean jjtc000 = true;
8707 + jjtree.openNodeScope(jjtn000);
8708 +/*@egen*/EvalItem item;}
8709 +{/*@bgen(jjtree) EvalArgsItem */
8710 + try {
8711 +/*@egen*/
8713 + item = InfixExpr(over,pipes)
8714 +| item = Star()
8715 + )/*@bgen(jjtree)*/
8717 + jjtree.closeNodeScope(jjtn000, true);
8718 + jjtc000 = false;
8720 +/*@egen*/
8721 + {return item;}/*@bgen(jjtree)*/
8722 + } catch (Throwable jjte000) {
8723 + if (jjtc000) {
8724 + jjtree.clearNodeScope(jjtn000);
8725 + jjtc000 = false;
8726 + } else {
8727 + jjtree.popNode();
8729 + if (jjte000 instanceof RuntimeException) {
8730 + throw (RuntimeException)jjte000;
8732 + if (jjte000 instanceof ParseException) {
8733 + throw (ParseException)jjte000;
8735 + throw (Error)jjte000;
8736 + } finally {
8737 + if (jjtc000) {
8738 + jjtree.closeNodeScope(jjtn000, true);
8741 +/*@egen*/
8747 +// Map a user schema onto a LogicalOperator
8748 +SchemaItemList AsClause() : {/*@bgen(jjtree) AsClause */
8749 + SimpleNode jjtn000 = new SimpleNode(JJTASCLAUSE);
8750 + boolean jjtc000 = true;
8751 + jjtree.openNodeScope(jjtn000);
8752 +/*@egen*/Token t1; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); Token t = null;}
8753 +{/*@bgen(jjtree) AsClause */
8754 + try {
8755 +/*@egen*/
8757 + [ ( t = <IDENTIFIER> | t = <GROUP> ) ":" ] "("
8758 + (
8760 + item=SchemaElement() { list.add(item); }
8761 + ( "," item=SchemaElement() { list.add(item); } )*
8764 +| {list = new SchemaItemList();}
8766 + ")"
8767 + )/*@bgen(jjtree)*/
8769 + jjtree.closeNodeScope(jjtn000, true);
8770 + jjtc000 = false;
8772 +/*@egen*/
8774 + if (t!=null)
8775 + list.alias = t.image;
8776 + return list;
8777 + }/*@bgen(jjtree)*/
8778 + } catch (Throwable jjte000) {
8779 + if (jjtc000) {
8780 + jjtree.clearNodeScope(jjtn000);
8781 + jjtc000 = false;
8782 + } else {
8783 + jjtree.popNode();
8785 + if (jjte000 instanceof RuntimeException) {
8786 + throw (RuntimeException)jjte000;
8788 + if (jjte000 instanceof ParseException) {
8789 + throw (ParseException)jjte000;
8791 + throw (Error)jjte000;
8792 + } finally {
8793 + if (jjtc000) {
8794 + jjtree.closeNodeScope(jjtn000, true);
8797 +/*@egen*/
8800 +SchemaItem SchemaElement() : {/*@bgen(jjtree) SchemaElement */
8801 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAELEMENT);
8802 + boolean jjtc000 = true;
8803 + jjtree.openNodeScope(jjtn000);
8804 +/*@egen*/ Token t1; SchemaItem item = null;}
8805 +{/*@bgen(jjtree) SchemaElement */
8806 + try {
8807 +/*@egen*/
8808 + (LOOKAHEAD(SchemaBag()) item = SchemaBag()
8809 +| LOOKAHEAD(SchemaTuple()) item = SchemaTuple()
8810 +| LOOKAHEAD(SchemaField()) item = SchemaField() )/*@bgen(jjtree)*/
8812 + jjtree.closeNodeScope(jjtn000, true);
8813 + jjtc000 = false;
8815 +/*@egen*/
8816 + {return item;}/*@bgen(jjtree)*/
8817 + } catch (Throwable jjte000) {
8818 + if (jjtc000) {
8819 + jjtree.clearNodeScope(jjtn000);
8820 + jjtc000 = false;
8821 + } else {
8822 + jjtree.popNode();
8824 + if (jjte000 instanceof RuntimeException) {
8825 + throw (RuntimeException)jjte000;
8827 + if (jjte000 instanceof ParseException) {
8828 + throw (ParseException)jjte000;
8830 + throw (Error)jjte000;
8831 + } finally {
8832 + if (jjtc000) {
8833 + jjtree.closeNodeScope(jjtn000, true);
8836 +/*@egen*/
8839 +SchemaItem SchemaField() : {/*@bgen(jjtree) SchemaField */
8840 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMAFIELD);
8841 + boolean jjtc000 = true;
8842 + jjtree.openNodeScope(jjtn000);
8843 +/*@egen*/Token t1;}
8844 +{/*@bgen(jjtree) SchemaField */
8845 + try {
8846 +/*@egen*/
8847 + ( ( t1 = <IDENTIFIER> | t1 = <GROUP> )/*@bgen(jjtree)*/
8849 + jjtree.closeNodeScope(jjtn000, true);
8850 + jjtc000 = false;
8852 +/*@egen*/ { return new SchemaField(t1.image); } )/*@bgen(jjtree)*/
8853 + } finally {
8854 + if (jjtc000) {
8855 + jjtree.closeNodeScope(jjtn000, true);
8858 +/*@egen*/
8861 +SchemaItem SchemaTuple() : {/*@bgen(jjtree) SchemaTuple */
8862 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMATUPLE);
8863 + boolean jjtc000 = true;
8864 + jjtree.openNodeScope(jjtn000);
8865 +/*@egen*/Token t1 = null; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); }
8866 +{/*@bgen(jjtree) SchemaTuple */
8867 + try {
8868 +/*@egen*/
8869 + (
8870 + [( t1 = <IDENTIFIER> | t1 = <GROUP> ) ":"] "("
8871 + (
8872 + ( item=SchemaElement() { list.add(item); }
8873 + ( "," item=SchemaElement() {list.add(item);} )*
8875 +| {}
8877 + ")"
8878 + )/*@bgen(jjtree)*/
8880 + jjtree.closeNodeScope(jjtn000, true);
8881 + jjtc000 = false;
8883 +/*@egen*/
8885 + if (t1!=null)
8886 + list.alias = t1.image;
8887 + list.setIsBag(false);
8888 + return list;
8889 + }/*@bgen(jjtree)*/
8890 + } catch (Throwable jjte000) {
8891 + if (jjtc000) {
8892 + jjtree.clearNodeScope(jjtn000);
8893 + jjtc000 = false;
8894 + } else {
8895 + jjtree.popNode();
8897 + if (jjte000 instanceof RuntimeException) {
8898 + throw (RuntimeException)jjte000;
8900 + if (jjte000 instanceof ParseException) {
8901 + throw (ParseException)jjte000;
8903 + throw (Error)jjte000;
8904 + } finally {
8905 + if (jjtc000) {
8906 + jjtree.closeNodeScope(jjtn000, true);
8909 +/*@egen*/
8912 +SchemaItem SchemaBag() : {/*@bgen(jjtree) SchemaBag */
8913 + SimpleNode jjtn000 = new SimpleNode(JJTSCHEMABAG);
8914 + boolean jjtc000 = true;
8915 + jjtree.openNodeScope(jjtn000);
8916 +/*@egen*/Token t1=null; SchemaItem item = null; SchemaItemList list = new SchemaItemList(); }
8917 +{/*@bgen(jjtree) SchemaBag */
8918 + try {
8919 +/*@egen*/
8920 + (
8921 + [ t1 = <IDENTIFIER> ":" ] "["
8923 + ( item=SchemaElement() { list.add(item); }
8924 + ( "," item=SchemaElement() {list.add(item);} )*
8926 +| {}
8928 + "]"
8929 + )/*@bgen(jjtree)*/
8931 + jjtree.closeNodeScope(jjtn000, true);
8932 + jjtc000 = false;
8934 +/*@egen*/
8936 + if (t1!=null)
8937 + list.alias = t1.image;
8938 + list.setIsBag(true);
8939 + return list;
8940 + }/*@bgen(jjtree)*/
8941 + } catch (Throwable jjte000) {
8942 + if (jjtc000) {
8943 + jjtree.clearNodeScope(jjtn000);
8944 + jjtc000 = false;
8945 + } else {
8946 + jjtree.popNode();
8948 + if (jjte000 instanceof RuntimeException) {
8949 + throw (RuntimeException)jjte000;
8951 + if (jjte000 instanceof ParseException) {
8952 + throw (ParseException)jjte000;
8954 + throw (Error)jjte000;
8955 + } finally {
8956 + if (jjtc000) {
8957 + jjtree.closeNodeScope(jjtn000, true);
8960 +/*@egen*/
8968 +// Used in serialization and deserialization
8970 +EvalSpecPipe PEvalSpecPipe() : {/*@bgen(jjtree) PEvalSpecPipe */
8971 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPECPIPE);
8972 + boolean jjtc000 = true;
8973 + jjtree.openNodeScope(jjtn000);
8974 +/*@egen*/EvalSpecPipe pipe = new EvalSpecPipe(pigContext); EvalSpec spec;}
8975 +{/*@bgen(jjtree) PEvalSpecPipe */
8976 +try {
8977 +/*@egen*/
8978 +(("["spec=PEvalSpec()"]" {pipe.add(spec);})*)/*@bgen(jjtree)*/
8980 + jjtree.closeNodeScope(jjtn000, true);
8981 + jjtc000 = false;
8983 +/*@egen*/
8984 + {return pipe;}/*@bgen(jjtree)*/
8985 +} catch (Throwable jjte000) {
8986 + if (jjtc000) {
8987 + jjtree.clearNodeScope(jjtn000);
8988 + jjtc000 = false;
8989 + } else {
8990 + jjtree.popNode();
8992 + if (jjte000 instanceof RuntimeException) {
8993 + throw (RuntimeException)jjte000;
8995 + if (jjte000 instanceof ParseException) {
8996 + throw (ParseException)jjte000;
8998 + throw (Error)jjte000;
8999 +} finally {
9000 + if (jjtc000) {
9001 + jjtree.closeNodeScope(jjtn000, true);
9004 +/*@egen*/
9007 +EvalSpec PEvalSpec() : {/*@bgen(jjtree) PEvalSpec */
9008 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALSPEC);
9009 + boolean jjtc000 = true;
9010 + jjtree.openNodeScope(jjtn000);
9011 +/*@egen*/EvalSpec spec;}
9012 +{/*@bgen(jjtree) PEvalSpec */
9013 + try {
9014 +/*@egen*/
9015 + (<FILTER> spec=PFilter() | <EVAL> spec=PEvalItemList() | spec=PSAD())/*@bgen(jjtree)*/
9017 + jjtree.closeNodeScope(jjtn000, true);
9018 + jjtc000 = false;
9020 +/*@egen*/
9021 + {return spec;}/*@bgen(jjtree)*/
9022 + } catch (Throwable jjte000) {
9023 + if (jjtc000) {
9024 + jjtree.clearNodeScope(jjtn000);
9025 + jjtc000 = false;
9026 + } else {
9027 + jjtree.popNode();
9029 + if (jjte000 instanceof RuntimeException) {
9030 + throw (RuntimeException)jjte000;
9032 + if (jjte000 instanceof ParseException) {
9033 + throw (ParseException)jjte000;
9035 + throw (Error)jjte000;
9036 + } finally {
9037 + if (jjtc000) {
9038 + jjtree.closeNodeScope(jjtn000, true);
9041 +/*@egen*/
9044 +EvalSpec PFilter() :
9045 +{/*@bgen(jjtree) PFilter */
9046 + SimpleNode jjtn000 = new SimpleNode(JJTPFILTER);
9047 + boolean jjtc000 = true;
9048 + jjtree.openNodeScope(jjtn000);
9049 +/*@egen*/Cond cond;}
9050 +{/*@bgen(jjtree) PFilter */
9051 + try {
9052 +/*@egen*/
9053 + cond = PCond(null,null)/*@bgen(jjtree)*/
9055 + jjtree.closeNodeScope(jjtn000, true);
9056 + jjtc000 = false;
9058 +/*@egen*/
9059 + {return new FilterSpec(cond);}/*@bgen(jjtree)*/
9060 + } catch (Throwable jjte000) {
9061 + if (jjtc000) {
9062 + jjtree.clearNodeScope(jjtn000);
9063 + jjtc000 = false;
9064 + } else {
9065 + jjtree.popNode();
9067 + if (jjte000 instanceof RuntimeException) {
9068 + throw (RuntimeException)jjte000;
9070 + if (jjte000 instanceof ParseException) {
9071 + throw (ParseException)jjte000;
9073 + throw (Error)jjte000;
9074 + } finally {
9075 + if (jjtc000) {
9076 + jjtree.closeNodeScope(jjtn000, true);
9079 +/*@egen*/
9082 +EvalSpec PSAD() : {/*@bgen(jjtree) PSAD */
9083 + SimpleNode jjtn000 = new SimpleNode(JJTPSAD);
9084 + boolean jjtc000 = true;
9085 + jjtree.openNodeScope(jjtn000);
9086 +/*@egen*/EvalSpec sad; EvalItemList proj;}
9087 +{/*@bgen(jjtree) PSAD */
9088 + try {
9089 +/*@egen*/
9090 + ((<ORDER> <BY> proj=SimpleProj(null) {sad = new SortArrangeSpec(proj, false);})
9091 +| (<ARRANGE> <BY> proj=SimpleProj(null) {sad = new SortArrangeSpec(proj, true);})
9092 +| (<DISTINCT> proj=SimpleProj(null) {sad = new DistinctSpec(proj);}))/*@bgen(jjtree)*/
9094 + jjtree.closeNodeScope(jjtn000, true);
9095 + jjtc000 = false;
9097 +/*@egen*/
9098 + {return sad;}/*@bgen(jjtree)*/
9099 + } catch (Throwable jjte000) {
9100 + if (jjtc000) {
9101 + jjtree.clearNodeScope(jjtn000);
9102 + jjtc000 = false;
9103 + } else {
9104 + jjtree.popNode();
9106 + if (jjte000 instanceof RuntimeException) {
9107 + throw (RuntimeException)jjte000;
9109 + if (jjte000 instanceof ParseException) {
9110 + throw (ParseException)jjte000;
9112 + throw (Error)jjte000;
9113 + } finally {
9114 + if (jjtc000) {
9115 + jjtree.closeNodeScope(jjtn000, true);
9118 +/*@egen*/
9121 +EvalItemList PEvalItemList() : {/*@bgen(jjtree) PEvalItemList */
9122 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEMLIST);
9123 + boolean jjtc000 = true;
9124 + jjtree.openNodeScope(jjtn000);
9125 +/*@egen*/EvalItemList list = new EvalItemList(pigContext); EvalItem item;}
9126 +{/*@bgen(jjtree) PEvalItemList */
9127 + try {
9128 +/*@egen*/
9129 + (item=PEvalItem() {list.add(item);}
9130 + ("," item=PEvalItem() {list.add(item);})*)/*@bgen(jjtree)*/
9132 + jjtree.closeNodeScope(jjtn000, true);
9133 + jjtc000 = false;
9135 +/*@egen*/
9136 + {return list;}/*@bgen(jjtree)*/
9137 + } catch (Throwable jjte000) {
9138 + if (jjtc000) {
9139 + jjtree.clearNodeScope(jjtn000);
9140 + jjtc000 = false;
9141 + } else {
9142 + jjtree.popNode();
9144 + if (jjte000 instanceof RuntimeException) {
9145 + throw (RuntimeException)jjte000;
9147 + if (jjte000 instanceof ParseException) {
9148 + throw (ParseException)jjte000;
9150 + throw (Error)jjte000;
9151 + } finally {
9152 + if (jjtc000) {
9153 + jjtree.closeNodeScope(jjtn000, true);
9156 +/*@egen*/
9159 +EvalItem PEvalItem() : {/*@bgen(jjtree) PEvalItem */
9160 + SimpleNode jjtn000 = new SimpleNode(JJTPEVALITEM);
9161 + boolean jjtc000 = true;
9162 + jjtree.openNodeScope(jjtn000);
9163 +/*@egen*/EvalItem item; EvalSpec subSpec; EvalItemList subProj; LogicalOperator subOp = null;}
9164 +{/*@bgen(jjtree) PEvalItem */
9165 + try {
9166 +/*@egen*/
9168 + item=Const()
9169 +| item = Star()
9170 +| (
9171 + item=PNestableEvalItem()
9172 + ( "["subSpec=PEvalSpec()"]" {((NestableEvalItem) item).addNestedEvalSpec(subSpec);})*
9174 + "." "(" Star() ")"
9176 + EvalItemList list = new EvalItemList(pigContext);
9177 + list.add(new StarEvalItem(pigContext));
9178 + ((NestableEvalItem) item).subColSpec = list;
9181 + )
9182 + )/*@bgen(jjtree)*/
9184 + jjtree.closeNodeScope(jjtn000, true);
9185 + jjtc000 = false;
9187 +/*@egen*/
9188 + {return item;}/*@bgen(jjtree)*/
9189 + } catch (Throwable jjte000) {
9190 + if (jjtc000) {
9191 + jjtree.clearNodeScope(jjtn000);
9192 + jjtc000 = false;
9193 + } else {
9194 + jjtree.popNode();
9196 + if (jjte000 instanceof RuntimeException) {
9197 + throw (RuntimeException)jjte000;
9199 + if (jjte000 instanceof ParseException) {
9200 + throw (ParseException)jjte000;
9202 + throw (Error)jjte000;
9203 + } finally {
9204 + if (jjtc000) {
9205 + jjtree.closeNodeScope(jjtn000, true);
9208 +/*@egen*/
9212 +NestableEvalItem PNestableEvalItem() : {/*@bgen(jjtree) PNestableEvalItem */
9213 + SimpleNode jjtn000 = new SimpleNode(JJTPNESTABLEEVALITEM);
9214 + boolean jjtc000 = true;
9215 + jjtree.openNodeScope(jjtn000);
9216 +/*@egen*/NestableEvalItem item;}
9217 +{/*@bgen(jjtree) PNestableEvalItem */
9218 + try {
9219 +/*@egen*/
9221 + (LOOKAHEAD(EvalFunctionItem()) item=EvalFunctionItem()
9222 +| LOOKAHEAD(DollarVar()) item=DollarVar()
9223 +| LOOKAHEAD(SerializedBinCond()) item = SerializedBinCond())/*@bgen(jjtree)*/
9225 + jjtree.closeNodeScope(jjtn000, true);
9226 + jjtc000 = false;
9228 +/*@egen*/
9229 + {return item;}/*@bgen(jjtree)*/
9230 + } catch (Throwable jjte000) {
9231 + if (jjtc000) {
9232 + jjtree.clearNodeScope(jjtn000);
9233 + jjtc000 = false;
9234 + } else {
9235 + jjtree.popNode();
9237 + if (jjte000 instanceof RuntimeException) {
9238 + throw (RuntimeException)jjte000;
9240 + if (jjte000 instanceof ParseException) {
9241 + throw (ParseException)jjte000;
9243 + throw (Error)jjte000;
9244 + } finally {
9245 + if (jjtc000) {
9246 + jjtree.closeNodeScope(jjtn000, true);
9249 +/*@egen*/
9252 +NestableEvalItem EvalFunctionItem() : {/*@bgen(jjtree) EvalFunctionItem */
9253 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTIONITEM);
9254 + boolean jjtc000 = true;
9255 + jjtree.openNodeScope(jjtn000);
9256 +/*@egen*/EvalFunc func; EvalItemList args; NestableEvalItem i;}
9257 +{/*@bgen(jjtree) EvalFunctionItem */
9258 + try {
9259 +/*@egen*/
9260 + func=EvalFunction() "(" args=PEvalItemList() ")" {i = newFuncEvalItem(func, args);}/*@bgen(jjtree)*/
9262 + jjtree.closeNodeScope(jjtn000, true);
9263 + jjtc000 = false;
9265 +/*@egen*/
9266 + {return i;}/*@bgen(jjtree)*/
9267 + } catch (Throwable jjte000) {
9268 + if (jjtc000) {
9269 + jjtree.clearNodeScope(jjtn000);
9270 + jjtc000 = false;
9271 + } else {
9272 + jjtree.popNode();
9274 + if (jjte000 instanceof RuntimeException) {
9275 + throw (RuntimeException)jjte000;
9277 + if (jjte000 instanceof ParseException) {
9278 + throw (ParseException)jjte000;
9280 + throw (Error)jjte000;
9281 + } finally {
9282 + if (jjtc000) {
9283 + jjtree.closeNodeScope(jjtn000, true);
9286 +/*@egen*/
9290 +NestableEvalItem SerializedBinCond():
9291 +{/*@bgen(jjtree) SerializedBinCond */
9292 + SimpleNode jjtn000 = new SimpleNode(JJTSERIALIZEDBINCOND);
9293 + boolean jjtc000 = true;
9294 + jjtree.openNodeScope(jjtn000);
9295 +/*@egen*/Cond cond; EvalItem ifTrue, ifFalse; NestableEvalItem ret = null;}
9296 +{/*@bgen(jjtree) SerializedBinCond */
9297 + try {
9298 +/*@egen*/
9300 + "(" cond = PSerializedCond() "?" ifTrue = PEvalItem()
9301 + ":" ifFalse = PEvalItem() ")"
9302 + )/*@bgen(jjtree)*/
9304 + jjtree.closeNodeScope(jjtn000, true);
9305 + jjtc000 = false;
9307 +/*@egen*/
9308 + {
9309 + return new BinCond(pigContext, cond,ifTrue,ifFalse);
9310 + }/*@bgen(jjtree)*/
9311 + } catch (Throwable jjte000) {
9312 + if (jjtc000) {
9313 + jjtree.clearNodeScope(jjtn000);
9314 + jjtc000 = false;
9315 + } else {
9316 + jjtree.popNode();
9318 + if (jjte000 instanceof RuntimeException) {
9319 + throw (RuntimeException)jjte000;
9321 + if (jjte000 instanceof ParseException) {
9322 + throw (ParseException)jjte000;
9324 + throw (Error)jjte000;
9325 + } finally {
9326 + if (jjtc000) {
9327 + jjtree.closeNodeScope(jjtn000, true);
9330 +/*@egen*/
9334 +Cond PSerializedCond() : {/*@bgen(jjtree) PSerializedCond */
9335 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDCOND);
9336 + boolean jjtc000 = true;
9337 + jjtree.openNodeScope(jjtn000);
9338 +/*@egen*/Cond cond = null;}
9339 +{/*@bgen(jjtree) PSerializedCond */
9340 + try {
9341 +/*@egen*/
9342 + cond = PSerializedOrCond()/*@bgen(jjtree)*/
9344 + jjtree.closeNodeScope(jjtn000, true);
9345 + jjtc000 = false;
9347 +/*@egen*/
9348 + {return cond;}/*@bgen(jjtree)*/
9349 + } catch (Throwable jjte000) {
9350 + if (jjtc000) {
9351 + jjtree.clearNodeScope(jjtn000);
9352 + jjtc000 = false;
9353 + } else {
9354 + jjtree.popNode();
9356 + if (jjte000 instanceof RuntimeException) {
9357 + throw (RuntimeException)jjte000;
9359 + if (jjte000 instanceof ParseException) {
9360 + throw (ParseException)jjte000;
9362 + throw (Error)jjte000;
9363 + } finally {
9364 + if (jjtc000) {
9365 + jjtree.closeNodeScope(jjtn000, true);
9368 +/*@egen*/
9371 +Cond PSerializedOrCond() : {/*@bgen(jjtree) PSerializedOrCond */
9372 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDORCOND);
9373 + boolean jjtc000 = true;
9374 + jjtree.openNodeScope(jjtn000);
9375 +/*@egen*/Cond cond; List<Cond> cList = new ArrayList<Cond>();}
9376 +{/*@bgen(jjtree) PSerializedOrCond */
9377 + try {
9378 +/*@egen*/
9380 + cond = PSerializedAndCond() {cList.add(cond);}
9381 + ( <OR> cond = PSerializedAndCond() {cList.add(cond);})*
9382 + )/*@bgen(jjtree)*/
9384 + jjtree.closeNodeScope(jjtn000, true);
9385 + jjtc000 = false;
9387 +/*@egen*/
9389 + if (cList.size()==1)
9390 + return cond;
9391 + else
9392 + return new OrCond(cList);
9393 + }/*@bgen(jjtree)*/
9394 + } catch (Throwable jjte000) {
9395 + if (jjtc000) {
9396 + jjtree.clearNodeScope(jjtn000);
9397 + jjtc000 = false;
9398 + } else {
9399 + jjtree.popNode();
9401 + if (jjte000 instanceof RuntimeException) {
9402 + throw (RuntimeException)jjte000;
9404 + if (jjte000 instanceof ParseException) {
9405 + throw (ParseException)jjte000;
9407 + throw (Error)jjte000;
9408 + } finally {
9409 + if (jjtc000) {
9410 + jjtree.closeNodeScope(jjtn000, true);
9413 +/*@egen*/
9416 +Cond PSerializedAndCond() : {/*@bgen(jjtree) PSerializedAndCond */
9417 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDANDCOND);
9418 + boolean jjtc000 = true;
9419 + jjtree.openNodeScope(jjtn000);
9420 +/*@egen*/Cond cond = null; List<Cond> cList = new ArrayList<Cond>();}
9421 +{/*@bgen(jjtree) PSerializedAndCond */
9422 + try {
9423 +/*@egen*/
9425 + cond = PSerializedUnaryCond() {cList.add(cond);}
9426 + ( <AND> cond = PSerializedUnaryCond() {cList.add(cond);} )*
9427 + )/*@bgen(jjtree)*/
9429 + jjtree.closeNodeScope(jjtn000, true);
9430 + jjtc000 = false;
9432 +/*@egen*/
9434 + if (cList.size()==1)
9435 + return cond;
9436 + else
9437 + return new AndCond(cList);
9438 + }/*@bgen(jjtree)*/
9439 + } catch (Throwable jjte000) {
9440 + if (jjtc000) {
9441 + jjtree.clearNodeScope(jjtn000);
9442 + jjtc000 = false;
9443 + } else {
9444 + jjtree.popNode();
9446 + if (jjte000 instanceof RuntimeException) {
9447 + throw (RuntimeException)jjte000;
9449 + if (jjte000 instanceof ParseException) {
9450 + throw (ParseException)jjte000;
9452 + throw (Error)jjte000;
9453 + } finally {
9454 + if (jjtc000) {
9455 + jjtree.closeNodeScope(jjtn000, true);
9458 +/*@egen*/
9461 +Cond PSerializedUnaryCond() : {/*@bgen(jjtree) PSerializedUnaryCond */
9462 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDUNARYCOND);
9463 + boolean jjtc000 = true;
9464 + jjtree.openNodeScope(jjtn000);
9465 +/*@egen*/Cond cond = null; EvalItem c1, c2; Token t1; FilterFunc func; EvalItemList args;}
9466 +{/*@bgen(jjtree) PSerializedUnaryCond */
9467 + try {
9468 +/*@egen*/
9470 + LOOKAHEAD("(" PSerializedCond() ")")
9471 + ("(" cond = PSerializedCond() ")")
9472 +| cond = PSerializedNotCond()
9473 +| LOOKAHEAD(PEvalItem() <FILTEROP>)
9474 + (c1=PEvalItem() t1=<FILTEROP> c2=PEvalItem() {cond = new CompCond(c1, t1.image, c2);})
9475 +| LOOKAHEAD(PEvalItem() <MATCHES>)
9476 + (c1=PEvalItem() <MATCHES> t1=<QUOTEDSTRING> {cond = new RegexpCond(c1, unquote(t1.image));})
9477 +| (func=FilterFunction() "(" args=PEvalItemList() ")" {cond = new FuncCond(func, args);})
9478 + )/*@bgen(jjtree)*/
9480 + jjtree.closeNodeScope(jjtn000, true);
9481 + jjtc000 = false;
9483 +/*@egen*/
9484 + {return cond;}/*@bgen(jjtree)*/
9485 + } catch (Throwable jjte000) {
9486 + if (jjtc000) {
9487 + jjtree.clearNodeScope(jjtn000);
9488 + jjtc000 = false;
9489 + } else {
9490 + jjtree.popNode();
9492 + if (jjte000 instanceof RuntimeException) {
9493 + throw (RuntimeException)jjte000;
9495 + if (jjte000 instanceof ParseException) {
9496 + throw (ParseException)jjte000;
9498 + throw (Error)jjte000;
9499 + } finally {
9500 + if (jjtc000) {
9501 + jjtree.closeNodeScope(jjtn000, true);
9504 +/*@egen*/
9507 +Cond PSerializedNotCond() : {/*@bgen(jjtree) PSerializedNotCond */
9508 + SimpleNode jjtn000 = new SimpleNode(JJTPSERIALIZEDNOTCOND);
9509 + boolean jjtc000 = true;
9510 + jjtree.openNodeScope(jjtn000);
9511 +/*@egen*/Cond c1;}
9512 +{/*@bgen(jjtree) PSerializedNotCond */
9513 + try {
9514 +/*@egen*/
9515 + <NOT> c1=PSerializedUnaryCond()/*@bgen(jjtree)*/
9517 + jjtree.closeNodeScope(jjtn000, true);
9518 + jjtc000 = false;
9520 +/*@egen*/
9521 + {return new NotCond(c1);}/*@bgen(jjtree)*/
9522 + } catch (Throwable jjte000) {
9523 + if (jjtc000) {
9524 + jjtree.clearNodeScope(jjtn000);
9525 + jjtc000 = false;
9526 + } else {
9527 + jjtree.popNode();
9529 + if (jjte000 instanceof RuntimeException) {
9530 + throw (RuntimeException)jjte000;
9532 + if (jjte000 instanceof ParseException) {
9533 + throw (ParseException)jjte000;
9535 + throw (Error)jjte000;
9536 + } finally {
9537 + if (jjtc000) {
9538 + jjtree.closeNodeScope(jjtn000, true);
9541 +/*@egen*/
9550 +//CQ stuff
9552 +EvalSpec PWindow() : {/*@bgen(jjtree) PWindow */
9553 + SimpleNode jjtn000 = new SimpleNode(JJTPWINDOW);
9554 + boolean jjtc000 = true;
9555 + jjtree.openNodeScope(jjtn000);
9556 +/*@egen*/EvalSpec spec; int numTuples; double time;}
9557 +{/*@bgen(jjtree) PWindow */
9558 + try {
9559 +/*@egen*/
9560 + ( <WINDOW>
9561 + ( LOOKAHEAD(2)
9562 + time = PTimeWindow() { spec = new TimeWindowSpec(WindowSpec.windowType.SLIDING, time); } |
9563 + numTuples = PTupleWindow() { spec = new TupleWindowSpec(WindowSpec.windowType.SLIDING, numTuples);}
9565 + )/*@bgen(jjtree)*/
9567 + jjtree.closeNodeScope(jjtn000, true);
9568 + jjtc000 = false;
9570 +/*@egen*/
9571 + {return spec;}/*@bgen(jjtree)*/
9572 + } catch (Throwable jjte000) {
9573 + if (jjtc000) {
9574 + jjtree.clearNodeScope(jjtn000);
9575 + jjtc000 = false;
9576 + } else {
9577 + jjtree.popNode();
9579 + if (jjte000 instanceof RuntimeException) {
9580 + throw (RuntimeException)jjte000;
9582 + if (jjte000 instanceof ParseException) {
9583 + throw (ParseException)jjte000;
9585 + throw (Error)jjte000;
9586 + } finally {
9587 + if (jjtc000) {
9588 + jjtree.closeNodeScope(jjtn000, true);
9591 +/*@egen*/
9594 +double PTimeWindow() : {/*@bgen(jjtree) PTimeWindow */
9595 + SimpleNode jjtn000 = new SimpleNode(JJTPTIMEWINDOW);
9596 + boolean jjtc000 = true;
9597 + jjtree.openNodeScope(jjtn000);
9598 +/*@egen*/double n; Token t;}
9599 +{/*@bgen(jjtree) PTimeWindow */
9600 + try {
9601 +/*@egen*/
9602 + ( t = <NUMBER> { n = Double.parseDouble(t.image); }
9603 + ( <SECONDS> |
9604 + <MINUTES> { n = n*60; } |
9605 + <HOURS> { n = n * 3600; }
9607 + )/*@bgen(jjtree)*/
9609 + jjtree.closeNodeScope(jjtn000, true);
9610 + jjtc000 = false;
9612 +/*@egen*/
9613 + {return n;}/*@bgen(jjtree)*/
9614 + } finally {
9615 + if (jjtc000) {
9616 + jjtree.closeNodeScope(jjtn000, true);
9619 +/*@egen*/
9622 +int PTupleWindow() : {/*@bgen(jjtree) PTupleWindow */
9623 + SimpleNode jjtn000 = new SimpleNode(JJTPTUPLEWINDOW);
9624 + boolean jjtc000 = true;
9625 + jjtree.openNodeScope(jjtn000);
9626 +/*@egen*/int n; Token t;}
9627 +{/*@bgen(jjtree) PTupleWindow */
9628 + try {
9629 +/*@egen*/
9630 + ( t = <NUMBER> { try{
9631 + n = Integer.parseInt(t.image);
9632 + }catch(NumberFormatException e){
9633 + throw new ParseException("Only whole number tuple windows allowed.");
9635 + }
9636 + <TUPLES>
9637 + )/*@bgen(jjtree)*/
9639 + jjtree.closeNodeScope(jjtn000, true);
9640 + jjtc000 = false;
9642 +/*@egen*/
9643 + {return n;}/*@bgen(jjtree)*/
9644 + } finally {
9645 + if (jjtc000) {
9646 + jjtree.closeNodeScope(jjtn000, true);
9649 +/*@egen*/
9658 +// These the simple non-terminals that are shared across many
9660 +EvalFunc EvalFunction() : {/*@bgen(jjtree) EvalFunction */
9661 + SimpleNode jjtn000 = new SimpleNode(JJTEVALFUNCTION);
9662 + boolean jjtc000 = true;
9663 + jjtree.openNodeScope(jjtn000);
9664 +/*@egen*/String funcName;}
9665 +{/*@bgen(jjtree) EvalFunction */
9666 + try {
9667 +/*@egen*/
9668 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9670 + jjtree.closeNodeScope(jjtn000, true);
9671 + jjtc000 = false;
9673 +/*@egen*/
9674 + {return (EvalFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9675 + } catch (Throwable jjte000) {
9676 + if (jjtc000) {
9677 + jjtree.clearNodeScope(jjtn000);
9678 + jjtc000 = false;
9679 + } else {
9680 + jjtree.popNode();
9682 + if (jjte000 instanceof RuntimeException) {
9683 + throw (RuntimeException)jjte000;
9685 + if (jjte000 instanceof ParseException) {
9686 + throw (ParseException)jjte000;
9688 + throw (Error)jjte000;
9689 + } finally {
9690 + if (jjtc000) {
9691 + jjtree.closeNodeScope(jjtn000, true);
9694 +/*@egen*/
9697 +GroupFunc GroupFunction() : {/*@bgen(jjtree) GroupFunction */
9698 + SimpleNode jjtn000 = new SimpleNode(JJTGROUPFUNCTION);
9699 + boolean jjtc000 = true;
9700 + jjtree.openNodeScope(jjtn000);
9701 +/*@egen*/String funcName;}
9702 +{/*@bgen(jjtree) GroupFunction */
9703 + try {
9704 +/*@egen*/
9705 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9707 + jjtree.closeNodeScope(jjtn000, true);
9708 + jjtc000 = false;
9710 +/*@egen*/
9711 + {return (GroupFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9712 + } catch (Throwable jjte000) {
9713 + if (jjtc000) {
9714 + jjtree.clearNodeScope(jjtn000);
9715 + jjtc000 = false;
9716 + } else {
9717 + jjtree.popNode();
9719 + if (jjte000 instanceof RuntimeException) {
9720 + throw (RuntimeException)jjte000;
9722 + if (jjte000 instanceof ParseException) {
9723 + throw (ParseException)jjte000;
9725 + throw (Error)jjte000;
9726 + } finally {
9727 + if (jjtc000) {
9728 + jjtree.closeNodeScope(jjtn000, true);
9731 +/*@egen*/
9734 +StorageFunc LoadFunction() : {/*@bgen(jjtree) LoadFunction */
9735 + SimpleNode jjtn000 = new SimpleNode(JJTLOADFUNCTION);
9736 + boolean jjtc000 = true;
9737 + jjtree.openNodeScope(jjtn000);
9738 +/*@egen*/String funcName;}
9739 +{/*@bgen(jjtree) LoadFunction */
9740 + try {
9741 +/*@egen*/
9742 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9744 + jjtree.closeNodeScope(jjtn000, true);
9745 + jjtc000 = false;
9747 +/*@egen*/
9748 + {return (StorageFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9749 + } catch (Throwable jjte000) {
9750 + if (jjtc000) {
9751 + jjtree.clearNodeScope(jjtn000);
9752 + jjtc000 = false;
9753 + } else {
9754 + jjtree.popNode();
9756 + if (jjte000 instanceof RuntimeException) {
9757 + throw (RuntimeException)jjte000;
9759 + if (jjte000 instanceof ParseException) {
9760 + throw (ParseException)jjte000;
9762 + throw (Error)jjte000;
9763 + } finally {
9764 + if (jjtc000) {
9765 + jjtree.closeNodeScope(jjtn000, true);
9768 +/*@egen*/
9771 +FilterFunc FilterFunction() : {/*@bgen(jjtree) FilterFunction */
9772 + SimpleNode jjtn000 = new SimpleNode(JJTFILTERFUNCTION);
9773 + boolean jjtc000 = true;
9774 + jjtree.openNodeScope(jjtn000);
9775 +/*@egen*/String funcName;}
9776 +{/*@bgen(jjtree) FilterFunction */
9777 + try {
9778 +/*@egen*/
9779 + funcName = QualifiedFunction()/*@bgen(jjtree)*/
9781 + jjtree.closeNodeScope(jjtn000, true);
9782 + jjtc000 = false;
9784 +/*@egen*/
9785 + {return (FilterFunc) pigContext.getUDF(funcName);}/*@bgen(jjtree)*/
9786 + } catch (Throwable jjte000) {
9787 + if (jjtc000) {
9788 + jjtree.clearNodeScope(jjtn000);
9789 + jjtc000 = false;
9790 + } else {
9791 + jjtree.popNode();
9793 + if (jjte000 instanceof RuntimeException) {
9794 + throw (RuntimeException)jjte000;
9796 + if (jjte000 instanceof ParseException) {
9797 + throw (ParseException)jjte000;
9799 + throw (Error)jjte000;
9800 + } finally {
9801 + if (jjtc000) {
9802 + jjtree.closeNodeScope(jjtn000, true);
9805 +/*@egen*/
9808 +/**
9809 + * Bug 831620 - '$' support
9810 + */
9811 +void ClassName() : {} { <IDENTIFIER> (("." <IDENTIFIER>)|("$" <IDENTIFIER>))* }
9813 +/**
9814 + * Bug 831620 - '$' support
9815 + */
9816 +String QualifiedFunction() : {Token t1;StringBuffer s=new StringBuffer();}
9818 + ((t1=<IDENTIFIER> { s.append(t1.image);}
9819 + (("." t1=<IDENTIFIER> {s.append("." + t1.image);})|
9820 + ("$" t1=<IDENTIFIER> {s.append("$" + t1.image);}))*))
9821 + {return s.toString();}
9825 +// If there is one time it may not be bracketed, but if multiple, they must be bracketed
9826 +EvalItemList BracketedSimpleProj(SchemaItem over) : {/*@bgen(jjtree) BracketedSimpleProj */
9827 + SimpleNode jjtn000 = new SimpleNode(JJTBRACKETEDSIMPLEPROJ);
9828 + boolean jjtc000 = true;
9829 + jjtree.openNodeScope(jjtn000);
9830 +/*@egen*/EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);}
9831 +{/*@bgen(jjtree) BracketedSimpleProj */
9832 + try {
9833 +/*@egen*/
9835 + i = PSimpleProjItem(over) {proj.add(i);}
9836 +| ("(" i = PSimpleProjItem(over) {proj.add(i);}
9837 + ("," i = PSimpleProjItem(over) {proj.add(i);})*
9838 + ")")
9839 + )/*@bgen(jjtree)*/
9841 + jjtree.closeNodeScope(jjtn000, true);
9842 + jjtc000 = false;
9844 +/*@egen*/
9845 + {return proj;}/*@bgen(jjtree)*/
9846 + } catch (Throwable jjte000) {
9847 + if (jjtc000) {
9848 + jjtree.clearNodeScope(jjtn000);
9849 + jjtc000 = false;
9850 + } else {
9851 + jjtree.popNode();
9853 + if (jjte000 instanceof RuntimeException) {
9854 + throw (RuntimeException)jjte000;
9856 + if (jjte000 instanceof ParseException) {
9857 + throw (ParseException)jjte000;
9859 + throw (Error)jjte000;
9860 + } finally {
9861 + if (jjtc000) {
9862 + jjtree.closeNodeScope(jjtn000, true);
9865 +/*@egen*/
9868 +EvalItemList SimpleProjOrEmpty(SchemaItem over) : {/*@bgen(jjtree) SimpleProjOrEmpty */
9869 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJOREMPTY);
9870 + boolean jjtc000 = true;
9871 + jjtree.openNodeScope(jjtn000);
9872 +/*@egen*/EvalItemList list;}
9873 +{/*@bgen(jjtree) SimpleProjOrEmpty */
9874 + try {
9875 +/*@egen*/
9877 + list = SimpleProj(over)
9878 +| {list = new EvalItemList(pigContext);}
9879 + )/*@bgen(jjtree)*/
9881 + jjtree.closeNodeScope(jjtn000, true);
9882 + jjtc000 = false;
9884 +/*@egen*/
9885 + {return list;}/*@bgen(jjtree)*/
9886 + } catch (Throwable jjte000) {
9887 + if (jjtc000) {
9888 + jjtree.clearNodeScope(jjtn000);
9889 + jjtc000 = false;
9890 + } else {
9891 + jjtree.popNode();
9893 + if (jjte000 instanceof RuntimeException) {
9894 + throw (RuntimeException)jjte000;
9896 + if (jjte000 instanceof ParseException) {
9897 + throw (ParseException)jjte000;
9899 + throw (Error)jjte000;
9900 + } finally {
9901 + if (jjtc000) {
9902 + jjtree.closeNodeScope(jjtn000, true);
9905 +/*@egen*/
9908 +//Just a simple list of projection items
9909 +EvalItemList SimpleProj(SchemaItem over) : {/*@bgen(jjtree) SimpleProj */
9910 + SimpleNode jjtn000 = new SimpleNode(JJTSIMPLEPROJ);
9911 + boolean jjtc000 = true;
9912 + jjtree.openNodeScope(jjtn000);
9913 +/*@egen*/EvalItem i = null; EvalItemList proj = new EvalItemList(pigContext);}
9914 +{/*@bgen(jjtree) SimpleProj */
9915 + try {
9916 +/*@egen*/
9918 + i = PSimpleProjItem(over) {proj.add(i);}
9919 + ("," i = PSimpleProjItem(over) {proj.add(i);})*
9920 + )/*@bgen(jjtree)*/
9922 + jjtree.closeNodeScope(jjtn000, true);
9923 + jjtc000 = false;
9925 +/*@egen*/
9926 + {return proj;}/*@bgen(jjtree)*/
9927 + } catch (Throwable jjte000) {
9928 + if (jjtc000) {
9929 + jjtree.clearNodeScope(jjtn000);
9930 + jjtc000 = false;
9931 + } else {
9932 + jjtree.popNode();
9934 + if (jjte000 instanceof RuntimeException) {
9935 + throw (RuntimeException)jjte000;
9937 + if (jjte000 instanceof ParseException) {
9938 + throw (ParseException)jjte000;
9940 + throw (Error)jjte000;
9941 + } finally {
9942 + if (jjtc000) {
9943 + jjtree.closeNodeScope(jjtn000, true);
9946 +/*@egen*/
9949 +EvalItem PSimpleProjItem(SchemaItem over):
9950 +{/*@bgen(jjtree) PSimpleProjItem */
9951 + SimpleNode jjtn000 = new SimpleNode(JJTPSIMPLEPROJITEM);
9952 + boolean jjtc000 = true;
9953 + jjtree.openNodeScope(jjtn000);
9954 +/*@egen*/EvalItem item;}
9955 +{/*@bgen(jjtree) PSimpleProjItem */
9956 + try {
9957 +/*@egen*/
9959 + item = Const()
9960 +| item = PColEvalItem(over,null)
9961 +| item = Star()
9962 + )/*@bgen(jjtree)*/
9964 + jjtree.closeNodeScope(jjtn000, true);
9965 + jjtc000 = false;
9967 +/*@egen*/
9968 + {return item;}/*@bgen(jjtree)*/
9969 + } catch (Throwable jjte000) {
9970 + if (jjtc000) {
9971 + jjtree.clearNodeScope(jjtn000);
9972 + jjtc000 = false;
9973 + } else {
9974 + jjtree.popNode();
9976 + if (jjte000 instanceof RuntimeException) {
9977 + throw (RuntimeException)jjte000;
9979 + if (jjte000 instanceof ParseException) {
9980 + throw (ParseException)jjte000;
9982 + throw (Error)jjte000;
9983 + } finally {
9984 + if (jjtc000) {
9985 + jjtree.closeNodeScope(jjtn000, true);
9988 +/*@egen*/
9992 +EvalItem Star() : {/*@bgen(jjtree) Star */
9993 + SimpleNode jjtn000 = new SimpleNode(JJTSTAR);
9994 + boolean jjtc000 = true;
9995 + jjtree.openNodeScope(jjtn000);
9996 +/*@egen*/Token t1;}
9997 +{/*@bgen(jjtree) Star */
9998 + try {
9999 +/*@egen*/
10000 + t1=<STAR>/*@bgen(jjtree)*/
10002 + jjtree.closeNodeScope(jjtn000, true);
10003 + jjtc000 = false;
10005 +/*@egen*/
10006 + {return new StarEvalItem(pigContext);}/*@bgen(jjtree)*/
10007 + } finally {
10008 + if (jjtc000) {
10009 + jjtree.closeNodeScope(jjtn000, true);
10012 +/*@egen*/
10015 +EvalItem Const() : {/*@bgen(jjtree) Const */
10016 + SimpleNode jjtn000 = new SimpleNode(JJTCONST);
10017 + boolean jjtc000 = true;
10018 + jjtree.openNodeScope(jjtn000);
10019 +/*@egen*/Token t1;}
10020 +{/*@bgen(jjtree) Const */
10021 + try {
10022 +/*@egen*/
10023 + t1=<QUOTEDSTRING>/*@bgen(jjtree)*/
10025 + jjtree.closeNodeScope(jjtn000, true);
10026 + jjtc000 = false;
10028 +/*@egen*/
10029 + {return new ConstEvalItem(pigContext, unquote(t1.image));}/*@bgen(jjtree)*/
10030 + } finally {
10031 + if (jjtc000) {
10032 + jjtree.closeNodeScope(jjtn000, true);
10035 +/*@egen*/
10038 +EvalItem PColEvalItem(SchemaItem over, Map<String, EvalItem> pipes):
10039 +{/*@bgen(jjtree) PColEvalItem */
10040 + SimpleNode jjtn000 = new SimpleNode(JJTPCOLEVALITEM);
10041 + boolean jjtc000 = true;
10042 + jjtree.openNodeScope(jjtn000);
10043 +/*@egen*/EvalItem item;}
10044 +{/*@bgen(jjtree) PColEvalItem */
10045 + try {
10046 +/*@egen*/
10048 + item = DollarVar()
10049 +| item = AliasField(over, pipes)
10050 + )/*@bgen(jjtree)*/
10052 + jjtree.closeNodeScope(jjtn000, true);
10053 + jjtc000 = false;
10055 +/*@egen*/
10057 + return item;
10058 + }/*@bgen(jjtree)*/
10059 + } catch (Throwable jjte000) {
10060 + if (jjtc000) {
10061 + jjtree.clearNodeScope(jjtn000);
10062 + jjtc000 = false;
10063 + } else {
10064 + jjtree.popNode();
10066 + if (jjte000 instanceof RuntimeException) {
10067 + throw (RuntimeException)jjte000;
10069 + if (jjte000 instanceof ParseException) {
10070 + throw (ParseException)jjte000;
10072 + throw (Error)jjte000;
10073 + } finally {
10074 + if (jjtc000) {
10075 + jjtree.closeNodeScope(jjtn000, true);
10078 +/*@egen*/
10081 +ColEvalItem DollarVar() : {/*@bgen(jjtree) DollarVar */
10082 + SimpleNode jjtn000 = new SimpleNode(JJTDOLLARVAR);
10083 + boolean jjtc000 = true;
10084 + jjtree.openNodeScope(jjtn000);
10085 +/*@egen*/Token t1;}
10086 +{/*@bgen(jjtree) DollarVar */
10087 + try {
10088 +/*@egen*/
10089 + t1=<DOLLARVAR>/*@bgen(jjtree)*/
10091 + jjtree.closeNodeScope(jjtn000, true);
10092 + jjtc000 = false;
10094 +/*@egen*/
10095 + {return new ColEvalItem(pigContext, undollar(t1.image));}/*@bgen(jjtree)*/
10096 + } finally {
10097 + if (jjtc000) {
10098 + jjtree.closeNodeScope(jjtn000, true);
10101 +/*@egen*/
10104 +EvalItem AliasField(SchemaItem over, Map<String, EvalItem> pipes) : {/*@bgen(jjtree) AliasField */
10105 + SimpleNode jjtn000 = new SimpleNode(JJTALIASFIELD);
10106 + boolean jjtc000 = true;
10107 + jjtree.openNodeScope(jjtn000);
10108 +/*@egen*/Token t1;}
10109 +{/*@bgen(jjtree) AliasField */
10110 + try {
10111 +/*@egen*/
10112 + (t1=<GROUP> | t1=<IDENTIFIER>)/*@bgen(jjtree)*/
10114 + jjtree.closeNodeScope(jjtn000, true);
10115 + jjtc000 = false;
10117 +/*@egen*/
10118 + { int i; EvalItem item = null;
10119 + if (pipes!=null)
10120 + item = pipes.get(t1.image);
10122 + if (item == null){
10123 + if ( over == null || (i = over.colFor(t1.image)) == -1)
10124 + throw new ParseException("Invalid alias: " + t1.image + " in " + over.alias + "--> " + over);
10125 + item = new ColEvalItem(pigContext, i);
10127 + return item;
10128 + }/*@bgen(jjtree)*/
10129 + } finally {
10130 + if (jjtc000) {
10131 + jjtree.closeNodeScope(jjtn000, true);
10134 +/*@egen*/
10136 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java
10137 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java 1969-12-31 19:00:00.000000000 -0500
10138 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserConstants.java 2007-08-31 09:41:35.000000000 -0400
10139 @@ -0,0 +1,126 @@
10140 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParserConstants.java */
10141 +package com.yahoo.pig.impl.logicalLayer.parser;
10143 +public interface QueryParserConstants {
10145 + int EOF = 0;
10146 + int STRFILTEROP = 7;
10147 + int NUMFILTEROP = 8;
10148 + int FILTEROP = 9;
10149 + int LOAD = 10;
10150 + int FILTER = 11;
10151 + int FOREACH = 12;
10152 + int MATCHES = 13;
10153 + int ORDER = 14;
10154 + int ARRANGE = 15;
10155 + int DISTINCT = 16;
10156 + int COGROUP = 17;
10157 + int CROSS = 18;
10158 + int UNION = 19;
10159 + int ALL = 20;
10160 + int ANY = 21;
10161 + int AS = 22;
10162 + int BY = 23;
10163 + int USING = 24;
10164 + int INNER = 25;
10165 + int OUTER = 26;
10166 + int STAR = 27;
10167 + int PARALLEL = 28;
10168 + int GROUP = 29;
10169 + int AND = 30;
10170 + int OR = 31;
10171 + int NOT = 32;
10172 + int CONTINUOUSLY = 33;
10173 + int WINDOW = 34;
10174 + int SECONDS = 35;
10175 + int MINUTES = 36;
10176 + int HOURS = 37;
10177 + int TUPLES = 38;
10178 + int GENERATE = 39;
10179 + int FLATTEN = 40;
10180 + int EVAL = 41;
10181 + int LETTER = 42;
10182 + int DIGIT = 43;
10183 + int SPECIALCHAR = 44;
10184 + int FSSPECIALCHAR = 45;
10185 + int IDENTIFIER = 46;
10186 + int NUMBER = 47;
10187 + int FLOAT = 48;
10188 + int INTEGER = 49;
10189 + int QUOTEDSTRING = 50;
10190 + int DOLLARVAR = 51;
10192 + int DEFAULT = 0;
10194 + String[] tokenImage = {
10195 + "<EOF>",
10196 + "\" \"",
10197 + "\"\\r\"",
10198 + "\"\\t\"",
10199 + "\"\\n\"",
10200 + "<token of kind 5>",
10201 + "<token of kind 6>",
10202 + "<STRFILTEROP>",
10203 + "<NUMFILTEROP>",
10204 + "<FILTEROP>",
10205 + "\"load\"",
10206 + "\"filter\"",
10207 + "\"foreach\"",
10208 + "\"matches\"",
10209 + "\"order\"",
10210 + "\"arrange\"",
10211 + "\"distinct\"",
10212 + "\"cogroup\"",
10213 + "\"cross\"",
10214 + "\"union\"",
10215 + "\"all\"",
10216 + "\"any\"",
10217 + "\"as\"",
10218 + "\"by\"",
10219 + "\"using\"",
10220 + "\"inner\"",
10221 + "\"outer\"",
10222 + "\"*\"",
10223 + "\"parallel\"",
10224 + "\"group\"",
10225 + "\"and\"",
10226 + "\"or\"",
10227 + "\"not\"",
10228 + "\"continuously\"",
10229 + "\"window\"",
10230 + "\"seconds\"",
10231 + "\"minutes\"",
10232 + "\"hours\"",
10233 + "\"tuples\"",
10234 + "\"generate\"",
10235 + "\"flatten\"",
10236 + "\"eval\"",
10237 + "<LETTER>",
10238 + "<DIGIT>",
10239 + "<SPECIALCHAR>",
10240 + "<FSSPECIALCHAR>",
10241 + "<IDENTIFIER>",
10242 + "<NUMBER>",
10243 + "<FLOAT>",
10244 + "<INTEGER>",
10245 + "<QUOTEDSTRING>",
10246 + "<DOLLARVAR>",
10247 + "\"=\"",
10248 + "\";\"",
10249 + "\"(\"",
10250 + "\")\"",
10251 + "\",\"",
10252 + "\"{\"",
10253 + "\"}\"",
10254 + "\"+\"",
10255 + "\"-\"",
10256 + "\"/\"",
10257 + "\".\"",
10258 + "\"?\"",
10259 + "\":\"",
10260 + "\"[\"",
10261 + "\"]\"",
10262 + "\"$\"",
10263 + };
10266 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java
10267 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java 1969-12-31 19:00:00.000000000 -0500
10268 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTokenManager.java 2007-08-31 09:41:35.000000000 -0400
10269 @@ -0,0 +1,1481 @@
10270 +/* Generated By:JJTree&JavaCC: Do not edit this line. QueryParserTokenManager.java */
10271 +package com.yahoo.pig.impl.logicalLayer.parser;
10272 +import java.io.*;
10273 +import java.util.*;
10274 +import java.lang.reflect.*;
10275 +import com.yahoo.pig.impl.logicalLayer.*;
10276 +import com.yahoo.pig.impl.eval.*;
10277 +import com.yahoo.pig.impl.eval.func.*;
10278 +import com.yahoo.pig.impl.eval.groupby.*;
10279 +import com.yahoo.pig.impl.eval.filter.*;
10280 +import com.yahoo.pig.impl.eval.window.*;
10281 +import com.yahoo.pig.impl.eval.sad.*;
10282 +import com.yahoo.pig.impl.logicalLayer.schema.*;
10283 +import com.yahoo.pig.*;
10284 +import com.yahoo.pig.impl.PigContext;
10285 +import com.yahoo.pig.PigServer.ExecType;
10286 +import com.yahoo.pig.impl.physicalLayer.IntermedResult;
10287 +import com.yahoo.pig.impl.io.FileLocalizer;
10288 +import com.yahoo.pig.builtin.*;
10290 +public class QueryParserTokenManager implements QueryParserConstants
10292 + public java.io.PrintStream debugStream = System.out;
10293 + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
10294 +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
10296 + switch (pos)
10298 + case 0:
10299 + if ((active0 & 0x400L) != 0L)
10301 + jjmatchedKind = 46;
10302 + return 41;
10304 + if ((active0 & 0x20000000000L) != 0L)
10306 + jjmatchedKind = 46;
10307 + return 54;
10309 + if ((active0 & 0x2000000000000000L) != 0L)
10310 + return 3;
10311 + if ((active0 & 0x100000000L) != 0L)
10313 + jjmatchedKind = 46;
10314 + return 11;
10316 + if ((active0 & 0x1000000000000000L) != 0L)
10317 + return 0;
10318 + if ((active1 & 0x8L) != 0L)
10319 + return 28;
10320 + if ((active0 & 0x10000000000000L) != 0L)
10321 + return 14;
10322 + if ((active0 & 0x8020000000L) != 0L)
10324 + jjmatchedKind = 46;
10325 + return 44;
10327 + if ((active0 & 0x17ed7fff800L) != 0L)
10329 + jjmatchedKind = 46;
10330 + return 55;
10332 + if ((active0 & 0x4000000000000000L) != 0L)
10333 + return 56;
10334 + return -1;
10335 + case 1:
10336 + if ((active0 & 0x80c04000L) != 0L)
10337 + return 55;
10338 + if ((active0 & 0x3ff773fbc00L) != 0L)
10340 + if (jjmatchedPos != 1)
10342 + jjmatchedKind = 46;
10343 + jjmatchedPos = 1;
10345 + return 55;
10347 + return -1;
10348 + case 2:
10349 + if ((active0 & 0x140300000L) != 0L)
10350 + return 55;
10351 + if ((active0 & 0x3fe370ffc00L) != 0L)
10353 + jjmatchedKind = 46;
10354 + jjmatchedPos = 2;
10355 + return 55;
10357 + return -1;
10358 + case 3:
10359 + if ((active0 & 0x20000000400L) != 0L)
10360 + return 55;
10361 + if ((active0 & 0x1fe370ff800L) != 0L)
10363 + jjmatchedKind = 46;
10364 + jjmatchedPos = 3;
10365 + return 55;
10367 + return -1;
10368 + case 4:
10369 + if ((active0 & 0x20270c4000L) != 0L)
10370 + return 55;
10371 + if ((active0 & 0x1de1003b800L) != 0L)
10373 + jjmatchedKind = 46;
10374 + jjmatchedPos = 4;
10375 + return 55;
10377 + return -1;
10378 + case 5:
10379 + if ((active0 & 0x4400000800L) != 0L)
10380 + return 55;
10381 + if ((active0 & 0x19a1003b000L) != 0L)
10383 + jjmatchedKind = 46;
10384 + jjmatchedPos = 5;
10385 + return 55;
10387 + return -1;
10388 + case 6:
10389 + if ((active0 & 0x1180002b000L) != 0L)
10390 + return 55;
10391 + if ((active0 & 0x8210010000L) != 0L)
10393 + jjmatchedKind = 46;
10394 + jjmatchedPos = 6;
10395 + return 55;
10397 + return -1;
10398 + case 7:
10399 + if ((active0 & 0x8010010000L) != 0L)
10400 + return 55;
10401 + if ((active0 & 0x200000000L) != 0L)
10403 + jjmatchedKind = 46;
10404 + jjmatchedPos = 7;
10405 + return 55;
10407 + return -1;
10408 + case 8:
10409 + if ((active0 & 0x200000000L) != 0L)
10411 + jjmatchedKind = 46;
10412 + jjmatchedPos = 8;
10413 + return 55;
10415 + return -1;
10416 + case 9:
10417 + if ((active0 & 0x200000000L) != 0L)
10419 + jjmatchedKind = 46;
10420 + jjmatchedPos = 9;
10421 + return 55;
10423 + return -1;
10424 + case 10:
10425 + if ((active0 & 0x200000000L) != 0L)
10427 + jjmatchedKind = 46;
10428 + jjmatchedPos = 10;
10429 + return 55;
10431 + return -1;
10432 + default :
10433 + return -1;
10436 +private final int jjStartNfa_0(int pos, long active0, long active1)
10438 + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
10440 +private final int jjStopAtPos(int pos, int kind)
10442 + jjmatchedKind = kind;
10443 + jjmatchedPos = pos;
10444 + return pos + 1;
10446 +private final int jjStartNfaWithStates_0(int pos, int kind, int state)
10448 + jjmatchedKind = kind;
10449 + jjmatchedPos = pos;
10450 + try { curChar = input_stream.readChar(); }
10451 + catch(java.io.IOException e) { return pos + 1; }
10452 + return jjMoveNfa_0(state, pos + 1);
10454 +private final int jjMoveStringLiteralDfa0_0()
10456 + switch(curChar)
10458 + case 36:
10459 + return jjStartNfaWithStates_0(0, 67, 28);
10460 + case 40:
10461 + return jjStopAtPos(0, 54);
10462 + case 41:
10463 + return jjStopAtPos(0, 55);
10464 + case 42:
10465 + return jjStopAtPos(0, 27);
10466 + case 43:
10467 + return jjStopAtPos(0, 59);
10468 + case 44:
10469 + return jjStopAtPos(0, 56);
10470 + case 45:
10471 + return jjStartNfaWithStates_0(0, 60, 0);
10472 + case 46:
10473 + return jjStartNfaWithStates_0(0, 62, 56);
10474 + case 47:
10475 + return jjStartNfaWithStates_0(0, 61, 3);
10476 + case 58:
10477 + return jjStopAtPos(0, 64);
10478 + case 59:
10479 + return jjStopAtPos(0, 53);
10480 + case 61:
10481 + return jjStartNfaWithStates_0(0, 52, 14);
10482 + case 63:
10483 + return jjStopAtPos(0, 63);
10484 + case 91:
10485 + return jjStopAtPos(0, 65);
10486 + case 93:
10487 + return jjStopAtPos(0, 66);
10488 + case 65:
10489 + case 97:
10490 + return jjMoveStringLiteralDfa1_0(0x40708000L);
10491 + case 66:
10492 + case 98:
10493 + return jjMoveStringLiteralDfa1_0(0x800000L);
10494 + case 67:
10495 + case 99:
10496 + return jjMoveStringLiteralDfa1_0(0x200060000L);
10497 + case 68:
10498 + case 100:
10499 + return jjMoveStringLiteralDfa1_0(0x10000L);
10500 + case 69:
10501 + case 101:
10502 + return jjMoveStringLiteralDfa1_0(0x20000000000L);
10503 + case 70:
10504 + case 102:
10505 + return jjMoveStringLiteralDfa1_0(0x10000001800L);
10506 + case 71:
10507 + case 103:
10508 + return jjMoveStringLiteralDfa1_0(0x8020000000L);
10509 + case 72:
10510 + case 104:
10511 + return jjMoveStringLiteralDfa1_0(0x2000000000L);
10512 + case 73:
10513 + case 105:
10514 + return jjMoveStringLiteralDfa1_0(0x2000000L);
10515 + case 76:
10516 + case 108:
10517 + return jjMoveStringLiteralDfa1_0(0x400L);
10518 + case 77:
10519 + case 109:
10520 + return jjMoveStringLiteralDfa1_0(0x1000002000L);
10521 + case 78:
10522 + case 110:
10523 + return jjMoveStringLiteralDfa1_0(0x100000000L);
10524 + case 79:
10525 + case 111:
10526 + return jjMoveStringLiteralDfa1_0(0x84004000L);
10527 + case 80:
10528 + case 112:
10529 + return jjMoveStringLiteralDfa1_0(0x10000000L);
10530 + case 83:
10531 + case 115:
10532 + return jjMoveStringLiteralDfa1_0(0x800000000L);
10533 + case 84:
10534 + case 116:
10535 + return jjMoveStringLiteralDfa1_0(0x4000000000L);
10536 + case 85:
10537 + case 117:
10538 + return jjMoveStringLiteralDfa1_0(0x1080000L);
10539 + case 87:
10540 + case 119:
10541 + return jjMoveStringLiteralDfa1_0(0x400000000L);
10542 + case 123:
10543 + return jjStopAtPos(0, 57);
10544 + case 125:
10545 + return jjStopAtPos(0, 58);
10546 + default :
10547 + return jjMoveNfa_0(2, 0);
10550 +private final int jjMoveStringLiteralDfa1_0(long active0)
10552 + try { curChar = input_stream.readChar(); }
10553 + catch(java.io.IOException e) {
10554 + jjStopStringLiteralDfa_0(0, active0, 0L);
10555 + return 1;
10557 + switch(curChar)
10559 + case 65:
10560 + case 97:
10561 + return jjMoveStringLiteralDfa2_0(active0, 0x10002000L);
10562 + case 69:
10563 + case 101:
10564 + return jjMoveStringLiteralDfa2_0(active0, 0x8800000000L);
10565 + case 73:
10566 + case 105:
10567 + return jjMoveStringLiteralDfa2_0(active0, 0x1400010800L);
10568 + case 76:
10569 + case 108:
10570 + return jjMoveStringLiteralDfa2_0(active0, 0x10000100000L);
10571 + case 78:
10572 + case 110:
10573 + return jjMoveStringLiteralDfa2_0(active0, 0x42280000L);
10574 + case 79:
10575 + case 111:
10576 + return jjMoveStringLiteralDfa2_0(active0, 0x2300021400L);
10577 + case 82:
10578 + case 114:
10579 + if ((active0 & 0x80000000L) != 0L)
10581 + jjmatchedKind = 31;
10582 + jjmatchedPos = 1;
10584 + return jjMoveStringLiteralDfa2_0(active0, 0x2004c000L);
10585 + case 83:
10586 + case 115:
10587 + if ((active0 & 0x400000L) != 0L)
10588 + return jjStartNfaWithStates_0(1, 22, 55);
10589 + return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
10590 + case 85:
10591 + case 117:
10592 + return jjMoveStringLiteralDfa2_0(active0, 0x4004000000L);
10593 + case 86:
10594 + case 118:
10595 + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L);
10596 + case 89:
10597 + case 121:
10598 + if ((active0 & 0x800000L) != 0L)
10599 + return jjStartNfaWithStates_0(1, 23, 55);
10600 + break;
10601 + default :
10602 + break;
10604 + return jjStartNfa_0(0, active0, 0L);
10606 +private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
10608 + if (((active0 &= old0)) == 0L)
10609 + return jjStartNfa_0(0, old0, 0L);
10610 + try { curChar = input_stream.readChar(); }
10611 + catch(java.io.IOException e) {
10612 + jjStopStringLiteralDfa_0(1, active0, 0L);
10613 + return 2;
10615 + switch(curChar)
10617 + case 65:
10618 + case 97:
10619 + return jjMoveStringLiteralDfa3_0(active0, 0x30000000400L);
10620 + case 67:
10621 + case 99:
10622 + return jjMoveStringLiteralDfa3_0(active0, 0x800000000L);
10623 + case 68:
10624 + case 100:
10625 + if ((active0 & 0x40000000L) != 0L)
10626 + return jjStartNfaWithStates_0(2, 30, 55);
10627 + return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
10628 + case 71:
10629 + case 103:
10630 + return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
10631 + case 73:
10632 + case 105:
10633 + return jjMoveStringLiteralDfa3_0(active0, 0x1080000L);
10634 + case 76:
10635 + case 108:
10636 + if ((active0 & 0x100000L) != 0L)
10637 + return jjStartNfaWithStates_0(2, 20, 55);
10638 + return jjMoveStringLiteralDfa3_0(active0, 0x800L);
10639 + case 78:
10640 + case 110:
10641 + return jjMoveStringLiteralDfa3_0(active0, 0x9602000000L);
10642 + case 79:
10643 + case 111:
10644 + return jjMoveStringLiteralDfa3_0(active0, 0x20040000L);
10645 + case 80:
10646 + case 112:
10647 + return jjMoveStringLiteralDfa3_0(active0, 0x4000000000L);
10648 + case 82:
10649 + case 114:
10650 + return jjMoveStringLiteralDfa3_0(active0, 0x10009000L);
10651 + case 83:
10652 + case 115:
10653 + return jjMoveStringLiteralDfa3_0(active0, 0x10000L);
10654 + case 84:
10655 + case 116:
10656 + if ((active0 & 0x100000000L) != 0L)
10657 + return jjStartNfaWithStates_0(2, 32, 55);
10658 + return jjMoveStringLiteralDfa3_0(active0, 0x4002000L);
10659 + case 85:
10660 + case 117:
10661 + return jjMoveStringLiteralDfa3_0(active0, 0x2000000000L);
10662 + case 89:
10663 + case 121:
10664 + if ((active0 & 0x200000L) != 0L)
10665 + return jjStartNfaWithStates_0(2, 21, 55);
10666 + break;
10667 + default :
10668 + break;
10670 + return jjStartNfa_0(1, active0, 0L);
10672 +private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
10674 + if (((active0 &= old0)) == 0L)
10675 + return jjStartNfa_0(1, old0, 0L);
10676 + try { curChar = input_stream.readChar(); }
10677 + catch(java.io.IOException e) {
10678 + jjStopStringLiteralDfa_0(2, active0, 0L);
10679 + return 3;
10681 + switch(curChar)
10683 + case 65:
10684 + case 97:
10685 + return jjMoveStringLiteralDfa4_0(active0, 0x10008000L);
10686 + case 67:
10687 + case 99:
10688 + return jjMoveStringLiteralDfa4_0(active0, 0x2000L);
10689 + case 68:
10690 + case 100:
10691 + if ((active0 & 0x400L) != 0L)
10692 + return jjStartNfaWithStates_0(3, 10, 55);
10693 + return jjMoveStringLiteralDfa4_0(active0, 0x400000000L);
10694 + case 69:
10695 + case 101:
10696 + return jjMoveStringLiteralDfa4_0(active0, 0x8006005000L);
10697 + case 76:
10698 + case 108:
10699 + if ((active0 & 0x20000000000L) != 0L)
10700 + return jjStartNfaWithStates_0(3, 41, 55);
10701 + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000L);
10702 + case 78:
10703 + case 110:
10704 + return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
10705 + case 79:
10706 + case 111:
10707 + return jjMoveStringLiteralDfa4_0(active0, 0x800080000L);
10708 + case 82:
10709 + case 114:
10710 + return jjMoveStringLiteralDfa4_0(active0, 0x2000020000L);
10711 + case 83:
10712 + case 115:
10713 + return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
10714 + case 84:
10715 + case 116:
10716 + return jjMoveStringLiteralDfa4_0(active0, 0x10200010800L);
10717 + case 85:
10718 + case 117:
10719 + return jjMoveStringLiteralDfa4_0(active0, 0x1020000000L);
10720 + default :
10721 + break;
10723 + return jjStartNfa_0(2, active0, 0L);
10725 +private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
10727 + if (((active0 &= old0)) == 0L)
10728 + return jjStartNfa_0(2, old0, 0L);
10729 + try { curChar = input_stream.readChar(); }
10730 + catch(java.io.IOException e) {
10731 + jjStopStringLiteralDfa_0(3, active0, 0L);
10732 + return 4;
10734 + switch(curChar)
10736 + case 65:
10737 + case 97:
10738 + return jjMoveStringLiteralDfa5_0(active0, 0x1000L);
10739 + case 69:
10740 + case 101:
10741 + return jjMoveStringLiteralDfa5_0(active0, 0x4000000800L);
10742 + case 71:
10743 + case 103:
10744 + if ((active0 & 0x1000000L) != 0L)
10745 + return jjStartNfaWithStates_0(4, 24, 55);
10746 + break;
10747 + case 72:
10748 + case 104:
10749 + return jjMoveStringLiteralDfa5_0(active0, 0x2000L);
10750 + case 73:
10751 + case 105:
10752 + return jjMoveStringLiteralDfa5_0(active0, 0x200010000L);
10753 + case 76:
10754 + case 108:
10755 + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L);
10756 + case 78:
10757 + case 110:
10758 + if ((active0 & 0x80000L) != 0L)
10759 + return jjStartNfaWithStates_0(4, 19, 55);
10760 + return jjMoveStringLiteralDfa5_0(active0, 0x800008000L);
10761 + case 79:
10762 + case 111:
10763 + return jjMoveStringLiteralDfa5_0(active0, 0x400020000L);
10764 + case 80:
10765 + case 112:
10766 + if ((active0 & 0x20000000L) != 0L)
10767 + return jjStartNfaWithStates_0(4, 29, 55);
10768 + break;
10769 + case 82:
10770 + case 114:
10771 + if ((active0 & 0x4000L) != 0L)
10772 + return jjStartNfaWithStates_0(4, 14, 55);
10773 + else if ((active0 & 0x2000000L) != 0L)
10774 + return jjStartNfaWithStates_0(4, 25, 55);
10775 + else if ((active0 & 0x4000000L) != 0L)
10776 + return jjStartNfaWithStates_0(4, 26, 55);
10777 + return jjMoveStringLiteralDfa5_0(active0, 0x8000000000L);
10778 + case 83:
10779 + case 115:
10780 + if ((active0 & 0x40000L) != 0L)
10781 + return jjStartNfaWithStates_0(4, 18, 55);
10782 + else if ((active0 & 0x2000000000L) != 0L)
10783 + return jjStartNfaWithStates_0(4, 37, 55);
10784 + break;
10785 + case 84:
10786 + case 116:
10787 + return jjMoveStringLiteralDfa5_0(active0, 0x11000000000L);
10788 + default :
10789 + break;
10791 + return jjStartNfa_0(3, active0, 0L);
10793 +private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
10795 + if (((active0 &= old0)) == 0L)
10796 + return jjStartNfa_0(3, old0, 0L);
10797 + try { curChar = input_stream.readChar(); }
10798 + catch(java.io.IOException e) {
10799 + jjStopStringLiteralDfa_0(4, active0, 0L);
10800 + return 5;
10802 + switch(curChar)
10804 + case 65:
10805 + case 97:
10806 + return jjMoveStringLiteralDfa6_0(active0, 0x8000000000L);
10807 + case 67:
10808 + case 99:
10809 + return jjMoveStringLiteralDfa6_0(active0, 0x1000L);
10810 + case 68:
10811 + case 100:
10812 + return jjMoveStringLiteralDfa6_0(active0, 0x800000000L);
10813 + case 69:
10814 + case 101:
10815 + return jjMoveStringLiteralDfa6_0(active0, 0x11000002000L);
10816 + case 71:
10817 + case 103:
10818 + return jjMoveStringLiteralDfa6_0(active0, 0x8000L);
10819 + case 76:
10820 + case 108:
10821 + return jjMoveStringLiteralDfa6_0(active0, 0x10000000L);
10822 + case 78:
10823 + case 110:
10824 + return jjMoveStringLiteralDfa6_0(active0, 0x200010000L);
10825 + case 82:
10826 + case 114:
10827 + if ((active0 & 0x800L) != 0L)
10828 + return jjStartNfaWithStates_0(5, 11, 55);
10829 + break;
10830 + case 83:
10831 + case 115:
10832 + if ((active0 & 0x4000000000L) != 0L)
10833 + return jjStartNfaWithStates_0(5, 38, 55);
10834 + break;
10835 + case 85:
10836 + case 117:
10837 + return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
10838 + case 87:
10839 + case 119:
10840 + if ((active0 & 0x400000000L) != 0L)
10841 + return jjStartNfaWithStates_0(5, 34, 55);
10842 + break;
10843 + default :
10844 + break;
10846 + return jjStartNfa_0(4, active0, 0L);
10848 +private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
10850 + if (((active0 &= old0)) == 0L)
10851 + return jjStartNfa_0(4, old0, 0L);
10852 + try { curChar = input_stream.readChar(); }
10853 + catch(java.io.IOException e) {
10854 + jjStopStringLiteralDfa_0(5, active0, 0L);
10855 + return 6;
10857 + switch(curChar)
10859 + case 67:
10860 + case 99:
10861 + return jjMoveStringLiteralDfa7_0(active0, 0x10000L);
10862 + case 69:
10863 + case 101:
10864 + if ((active0 & 0x8000L) != 0L)
10865 + return jjStartNfaWithStates_0(6, 15, 55);
10866 + return jjMoveStringLiteralDfa7_0(active0, 0x10000000L);
10867 + case 72:
10868 + case 104:
10869 + if ((active0 & 0x1000L) != 0L)
10870 + return jjStartNfaWithStates_0(6, 12, 55);
10871 + break;
10872 + case 78:
10873 + case 110:
10874 + if ((active0 & 0x10000000000L) != 0L)
10875 + return jjStartNfaWithStates_0(6, 40, 55);
10876 + break;
10877 + case 80:
10878 + case 112:
10879 + if ((active0 & 0x20000L) != 0L)
10880 + return jjStartNfaWithStates_0(6, 17, 55);
10881 + break;
10882 + case 83:
10883 + case 115:
10884 + if ((active0 & 0x2000L) != 0L)
10885 + return jjStartNfaWithStates_0(6, 13, 55);
10886 + else if ((active0 & 0x800000000L) != 0L)
10887 + return jjStartNfaWithStates_0(6, 35, 55);
10888 + else if ((active0 & 0x1000000000L) != 0L)
10889 + return jjStartNfaWithStates_0(6, 36, 55);
10890 + break;
10891 + case 84:
10892 + case 116:
10893 + return jjMoveStringLiteralDfa7_0(active0, 0x8000000000L);
10894 + case 85:
10895 + case 117:
10896 + return jjMoveStringLiteralDfa7_0(active0, 0x200000000L);
10897 + default :
10898 + break;
10900 + return jjStartNfa_0(5, active0, 0L);
10902 +private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
10904 + if (((active0 &= old0)) == 0L)
10905 + return jjStartNfa_0(5, old0, 0L);
10906 + try { curChar = input_stream.readChar(); }
10907 + catch(java.io.IOException e) {
10908 + jjStopStringLiteralDfa_0(6, active0, 0L);
10909 + return 7;
10911 + switch(curChar)
10913 + case 69:
10914 + case 101:
10915 + if ((active0 & 0x8000000000L) != 0L)
10916 + return jjStartNfaWithStates_0(7, 39, 55);
10917 + break;
10918 + case 76:
10919 + case 108:
10920 + if ((active0 & 0x10000000L) != 0L)
10921 + return jjStartNfaWithStates_0(7, 28, 55);
10922 + break;
10923 + case 79:
10924 + case 111:
10925 + return jjMoveStringLiteralDfa8_0(active0, 0x200000000L);
10926 + case 84:
10927 + case 116:
10928 + if ((active0 & 0x10000L) != 0L)
10929 + return jjStartNfaWithStates_0(7, 16, 55);
10930 + break;
10931 + default :
10932 + break;
10934 + return jjStartNfa_0(6, active0, 0L);
10936 +private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
10938 + if (((active0 &= old0)) == 0L)
10939 + return jjStartNfa_0(6, old0, 0L);
10940 + try { curChar = input_stream.readChar(); }
10941 + catch(java.io.IOException e) {
10942 + jjStopStringLiteralDfa_0(7, active0, 0L);
10943 + return 8;
10945 + switch(curChar)
10947 + case 85:
10948 + case 117:
10949 + return jjMoveStringLiteralDfa9_0(active0, 0x200000000L);
10950 + default :
10951 + break;
10953 + return jjStartNfa_0(7, active0, 0L);
10955 +private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
10957 + if (((active0 &= old0)) == 0L)
10958 + return jjStartNfa_0(7, old0, 0L);
10959 + try { curChar = input_stream.readChar(); }
10960 + catch(java.io.IOException e) {
10961 + jjStopStringLiteralDfa_0(8, active0, 0L);
10962 + return 9;
10964 + switch(curChar)
10966 + case 83:
10967 + case 115:
10968 + return jjMoveStringLiteralDfa10_0(active0, 0x200000000L);
10969 + default :
10970 + break;
10972 + return jjStartNfa_0(8, active0, 0L);
10974 +private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
10976 + if (((active0 &= old0)) == 0L)
10977 + return jjStartNfa_0(8, old0, 0L);
10978 + try { curChar = input_stream.readChar(); }
10979 + catch(java.io.IOException e) {
10980 + jjStopStringLiteralDfa_0(9, active0, 0L);
10981 + return 10;
10983 + switch(curChar)
10985 + case 76:
10986 + case 108:
10987 + return jjMoveStringLiteralDfa11_0(active0, 0x200000000L);
10988 + default :
10989 + break;
10991 + return jjStartNfa_0(9, active0, 0L);
10993 +private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
10995 + if (((active0 &= old0)) == 0L)
10996 + return jjStartNfa_0(9, old0, 0L);
10997 + try { curChar = input_stream.readChar(); }
10998 + catch(java.io.IOException e) {
10999 + jjStopStringLiteralDfa_0(10, active0, 0L);
11000 + return 11;
11002 + switch(curChar)
11004 + case 89:
11005 + case 121:
11006 + if ((active0 & 0x200000000L) != 0L)
11007 + return jjStartNfaWithStates_0(11, 33, 55);
11008 + break;
11009 + default :
11010 + break;
11012 + return jjStartNfa_0(10, active0, 0L);
11014 +private final void jjCheckNAdd(int state)
11016 + if (jjrounds[state] != jjround)
11018 + jjstateSet[jjnewStateCnt++] = state;
11019 + jjrounds[state] = jjround;
11022 +private final void jjAddStates(int start, int end)
11024 + do {
11025 + jjstateSet[jjnewStateCnt++] = jjnextStates[start];
11026 + } while (start++ != end);
11028 +private final void jjCheckNAddTwoStates(int state1, int state2)
11030 + jjCheckNAdd(state1);
11031 + jjCheckNAdd(state2);
11033 +private final void jjCheckNAddStates(int start, int end)
11035 + do {
11036 + jjCheckNAdd(jjnextStates[start]);
11037 + } while (start++ != end);
11039 +private final void jjCheckNAddStates(int start)
11041 + jjCheckNAdd(jjnextStates[start]);
11042 + jjCheckNAdd(jjnextStates[start + 1]);
11044 +static final long[] jjbitVec0 = {
11045 + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
11047 +private final int jjMoveNfa_0(int startState, int curPos)
11049 + int[] nextStates;
11050 + int startsAt = 0;
11051 + jjnewStateCnt = 54;
11052 + int i = 1;
11053 + jjstateSet[0] = startState;
11054 + int j, kind = 0x7fffffff;
11055 + for (;;)
11057 + if (++jjround == 0x7fffffff)
11058 + ReInitRounds();
11059 + if (curChar < 64)
11061 + long l = 1L << curChar;
11062 + MatchLoop: do
11064 + switch(jjstateSet[--i])
11066 + case 11:
11067 + if ((0x3ff000000000000L & l) != 0L)
11069 + if (kind > 46)
11070 + kind = 46;
11071 + jjCheckNAddTwoStates(21, 23);
11073 + else if (curChar == 58)
11074 + jjstateSet[jjnewStateCnt++] = 22;
11075 + break;
11076 + case 54:
11077 + if ((0x3ff000000000000L & l) != 0L)
11079 + if (kind > 46)
11080 + kind = 46;
11081 + jjCheckNAddTwoStates(21, 23);
11083 + else if (curChar == 58)
11084 + jjstateSet[jjnewStateCnt++] = 22;
11085 + break;
11086 + case 41:
11087 + if ((0x3ff000000000000L & l) != 0L)
11089 + if (kind > 46)
11090 + kind = 46;
11091 + jjCheckNAddTwoStates(21, 23);
11093 + else if (curChar == 58)
11094 + jjstateSet[jjnewStateCnt++] = 22;
11095 + break;
11096 + case 44:
11097 + if ((0x3ff000000000000L & l) != 0L)
11099 + if (kind > 46)
11100 + kind = 46;
11101 + jjCheckNAddTwoStates(21, 23);
11103 + else if (curChar == 58)
11104 + jjstateSet[jjnewStateCnt++] = 22;
11105 + break;
11106 + case 55:
11107 + if ((0x3ff000000000000L & l) != 0L)
11109 + if (kind > 46)
11110 + kind = 46;
11111 + jjCheckNAddTwoStates(21, 23);
11113 + else if (curChar == 58)
11114 + jjstateSet[jjnewStateCnt++] = 22;
11115 + break;
11116 + case 56:
11117 + if ((0x3ff000000000000L & l) != 0L)
11119 + if (kind > 47)
11120 + kind = 47;
11121 + jjCheckNAdd(38);
11123 + if ((0x3ff000000000000L & l) != 0L)
11125 + if (kind > 47)
11126 + kind = 47;
11127 + jjCheckNAddTwoStates(30, 31);
11129 + break;
11130 + case 2:
11131 + if ((0x3ff000000000000L & l) != 0L)
11133 + if (kind > 47)
11134 + kind = 47;
11135 + jjCheckNAddStates(0, 6);
11137 + else if ((0x5000000000000000L & l) != 0L)
11139 + if (kind > 9)
11140 + kind = 9;
11142 + else if (curChar == 46)
11143 + jjCheckNAddTwoStates(30, 38);
11144 + else if (curChar == 36)
11145 + jjCheckNAdd(28);
11146 + else if (curChar == 39)
11147 + jjCheckNAddTwoStates(25, 26);
11148 + else if (curChar == 61)
11149 + jjCheckNAdd(14);
11150 + else if (curChar == 33)
11151 + jjCheckNAdd(14);
11152 + else if (curChar == 47)
11153 + jjstateSet[jjnewStateCnt++] = 3;
11154 + else if (curChar == 45)
11155 + jjstateSet[jjnewStateCnt++] = 0;
11156 + if (curChar == 60)
11157 + jjCheckNAdd(14);
11158 + else if (curChar == 62)
11159 + jjCheckNAdd(14);
11160 + break;
11161 + case 0:
11162 + if (curChar != 45)
11163 + break;
11164 + if (kind > 5)
11165 + kind = 5;
11166 + jjCheckNAdd(1);
11167 + break;
11168 + case 1:
11169 + if ((0xffffffffffffdbffL & l) == 0L)
11170 + break;
11171 + if (kind > 5)
11172 + kind = 5;
11173 + jjCheckNAdd(1);
11174 + break;
11175 + case 3:
11176 + if (curChar == 42)
11177 + jjCheckNAddTwoStates(4, 5);
11178 + break;
11179 + case 4:
11180 + if ((0xfffffbffffffffffL & l) != 0L)
11181 + jjCheckNAddTwoStates(4, 5);
11182 + break;
11183 + case 5:
11184 + if (curChar == 42)
11185 + jjCheckNAddStates(7, 9);
11186 + break;
11187 + case 6:
11188 + if ((0xffff7bffffffffffL & l) != 0L)
11189 + jjCheckNAddTwoStates(7, 5);
11190 + break;
11191 + case 7:
11192 + if ((0xfffffbffffffffffL & l) != 0L)
11193 + jjCheckNAddTwoStates(7, 5);
11194 + break;
11195 + case 8:
11196 + if (curChar == 47 && kind > 6)
11197 + kind = 6;
11198 + break;
11199 + case 9:
11200 + if (curChar == 47)
11201 + jjstateSet[jjnewStateCnt++] = 3;
11202 + break;
11203 + case 14:
11204 + if (curChar == 61 && kind > 9)
11205 + kind = 9;
11206 + break;
11207 + case 15:
11208 + if (curChar == 33)
11209 + jjCheckNAdd(14);
11210 + break;
11211 + case 16:
11212 + if (curChar == 62)
11213 + jjCheckNAdd(14);
11214 + break;
11215 + case 17:
11216 + if ((0x5000000000000000L & l) != 0L && kind > 9)
11217 + kind = 9;
11218 + break;
11219 + case 18:
11220 + if (curChar == 60)
11221 + jjCheckNAdd(14);
11222 + break;
11223 + case 19:
11224 + if (curChar == 61)
11225 + jjCheckNAdd(14);
11226 + break;
11227 + case 21:
11228 + if ((0x3ff000000000000L & l) == 0L)
11229 + break;
11230 + if (kind > 46)
11231 + kind = 46;
11232 + jjCheckNAddTwoStates(21, 23);
11233 + break;
11234 + case 22:
11235 + if (curChar != 58)
11236 + break;
11237 + if (kind > 46)
11238 + kind = 46;
11239 + jjCheckNAddTwoStates(21, 23);
11240 + break;
11241 + case 23:
11242 + if (curChar == 58)
11243 + jjstateSet[jjnewStateCnt++] = 22;
11244 + break;
11245 + case 24:
11246 + if (curChar == 39)
11247 + jjCheckNAddTwoStates(25, 26);
11248 + break;
11249 + case 25:
11250 + if ((0xffffff7fffffffffL & l) != 0L)
11251 + jjCheckNAddTwoStates(25, 26);
11252 + break;
11253 + case 26:
11254 + if (curChar == 39 && kind > 50)
11255 + kind = 50;
11256 + break;
11257 + case 27:
11258 + if (curChar == 36)
11259 + jjCheckNAdd(28);
11260 + break;
11261 + case 28:
11262 + if ((0x3ff000000000000L & l) == 0L)
11263 + break;
11264 + if (kind > 51)
11265 + kind = 51;
11266 + jjCheckNAdd(28);
11267 + break;
11268 + case 29:
11269 + if (curChar == 46)
11270 + jjCheckNAddTwoStates(30, 38);
11271 + break;
11272 + case 30:
11273 + if ((0x3ff000000000000L & l) == 0L)
11274 + break;
11275 + if (kind > 47)
11276 + kind = 47;
11277 + jjCheckNAddTwoStates(30, 31);
11278 + break;
11279 + case 32:
11280 + if ((0x280000000000L & l) != 0L)
11281 + jjCheckNAddTwoStates(33, 36);
11282 + break;
11283 + case 33:
11284 + if ((0x3ff000000000000L & l) == 0L)
11285 + break;
11286 + if (kind > 47)
11287 + kind = 47;
11288 + jjCheckNAddTwoStates(33, 34);
11289 + break;
11290 + case 34:
11291 + if (curChar == 46)
11292 + jjCheckNAdd(35);
11293 + break;
11294 + case 35:
11295 + if ((0x3ff000000000000L & l) == 0L)
11296 + break;
11297 + if (kind > 47)
11298 + kind = 47;
11299 + jjCheckNAdd(35);
11300 + break;
11301 + case 36:
11302 + if (curChar == 46)
11303 + jjCheckNAdd(37);
11304 + break;
11305 + case 37:
11306 + if ((0x3ff000000000000L & l) == 0L)
11307 + break;
11308 + if (kind > 47)
11309 + kind = 47;
11310 + jjCheckNAdd(37);
11311 + break;
11312 + case 38:
11313 + if ((0x3ff000000000000L & l) == 0L)
11314 + break;
11315 + if (kind > 47)
11316 + kind = 47;
11317 + jjCheckNAdd(38);
11318 + break;
11319 + case 45:
11320 + if ((0x3ff000000000000L & l) == 0L)
11321 + break;
11322 + if (kind > 47)
11323 + kind = 47;
11324 + jjCheckNAddStates(0, 6);
11325 + break;
11326 + case 46:
11327 + if ((0x3ff000000000000L & l) == 0L)
11328 + break;
11329 + if (kind > 47)
11330 + kind = 47;
11331 + jjCheckNAdd(46);
11332 + break;
11333 + case 47:
11334 + if ((0x3ff000000000000L & l) == 0L)
11335 + break;
11336 + if (kind > 47)
11337 + kind = 47;
11338 + jjCheckNAddStates(10, 12);
11339 + break;
11340 + case 48:
11341 + if (curChar == 46)
11342 + jjCheckNAdd(49);
11343 + break;
11344 + case 49:
11345 + if ((0x3ff000000000000L & l) == 0L)
11346 + break;
11347 + if (kind > 47)
11348 + kind = 47;
11349 + jjCheckNAddTwoStates(49, 31);
11350 + break;
11351 + case 50:
11352 + if ((0x3ff000000000000L & l) == 0L)
11353 + break;
11354 + if (kind > 47)
11355 + kind = 47;
11356 + jjCheckNAddTwoStates(50, 51);
11357 + break;
11358 + case 51:
11359 + if (curChar == 46)
11360 + jjCheckNAdd(52);
11361 + break;
11362 + case 52:
11363 + if ((0x3ff000000000000L & l) == 0L)
11364 + break;
11365 + if (kind > 47)
11366 + kind = 47;
11367 + jjCheckNAdd(52);
11368 + break;
11369 + case 53:
11370 + if ((0x3ff000000000000L & l) == 0L)
11371 + break;
11372 + if (kind > 49)
11373 + kind = 49;
11374 + jjCheckNAdd(53);
11375 + break;
11376 + default : break;
11378 + } while(i != startsAt);
11380 + else if (curChar < 128)
11382 + long l = 1L << (curChar & 077);
11383 + MatchLoop: do
11385 + switch(jjstateSet[--i])
11387 + case 11:
11388 + if ((0x7fffffe87fffffeL & l) != 0L)
11390 + if (kind > 46)
11391 + kind = 46;
11392 + jjCheckNAddTwoStates(21, 23);
11394 + if ((0x7fffffe07fffffeL & l) != 0L)
11396 + if (kind > 46)
11397 + kind = 46;
11398 + jjCheckNAddStates(13, 15);
11400 + if ((0x2000000020L & l) != 0L)
11401 + jjCheckNAdd(10);
11402 + break;
11403 + case 54:
11404 + if ((0x7fffffe87fffffeL & l) != 0L)
11406 + if (kind > 46)
11407 + kind = 46;
11408 + jjCheckNAddTwoStates(21, 23);
11410 + if ((0x7fffffe07fffffeL & l) != 0L)
11412 + if (kind > 46)
11413 + kind = 46;
11414 + jjCheckNAddStates(13, 15);
11416 + if ((0x2000000020000L & l) != 0L)
11418 + if (kind > 9)
11419 + kind = 9;
11421 + break;
11422 + case 41:
11423 + if ((0x7fffffe87fffffeL & l) != 0L)
11425 + if (kind > 46)
11426 + kind = 46;
11427 + jjCheckNAddTwoStates(21, 23);
11429 + if ((0x7fffffe07fffffeL & l) != 0L)
11431 + if (kind > 46)
11432 + kind = 46;
11433 + jjCheckNAddStates(13, 15);
11435 + if ((0x10000000100000L & l) != 0L)
11437 + if (kind > 9)
11438 + kind = 9;
11440 + if ((0x10000000100000L & l) != 0L)
11441 + jjCheckNAdd(40);
11442 + break;
11443 + case 44:
11444 + if ((0x7fffffe87fffffeL & l) != 0L)
11446 + if (kind > 46)
11447 + kind = 46;
11448 + jjCheckNAddTwoStates(21, 23);
11450 + if ((0x7fffffe07fffffeL & l) != 0L)
11452 + if (kind > 46)
11453 + kind = 46;
11454 + jjCheckNAddStates(13, 15);
11456 + if ((0x10000000100000L & l) != 0L)
11458 + if (kind > 9)
11459 + kind = 9;
11461 + if ((0x10000000100000L & l) != 0L)
11462 + jjCheckNAdd(40);
11463 + break;
11464 + case 55:
11465 + if ((0x7fffffe87fffffeL & l) != 0L)
11467 + if (kind > 46)
11468 + kind = 46;
11469 + jjCheckNAddTwoStates(21, 23);
11471 + if ((0x7fffffe07fffffeL & l) != 0L)
11473 + if (kind > 46)
11474 + kind = 46;
11475 + jjCheckNAddStates(13, 15);
11477 + break;
11478 + case 2:
11479 + if ((0x7fffffe07fffffeL & l) != 0L)
11481 + if (kind > 46)
11482 + kind = 46;
11483 + jjCheckNAddStates(13, 15);
11485 + if ((0x8000000080L & l) != 0L)
11486 + jjCheckNAddTwoStates(44, 42);
11487 + else if ((0x100000001000L & l) != 0L)
11488 + jjCheckNAddTwoStates(41, 42);
11489 + else if ((0x2000000020L & l) != 0L)
11490 + jjCheckNAdd(10);
11491 + else if ((0x400000004000L & l) != 0L)
11492 + jjstateSet[jjnewStateCnt++] = 11;
11493 + break;
11494 + case 1:
11495 + if (kind > 5)
11496 + kind = 5;
11497 + jjstateSet[jjnewStateCnt++] = 1;
11498 + break;
11499 + case 4:
11500 + jjCheckNAddTwoStates(4, 5);
11501 + break;
11502 + case 6:
11503 + case 7:
11504 + jjCheckNAddTwoStates(7, 5);
11505 + break;
11506 + case 10:
11507 + if ((0x2000000020000L & l) != 0L && kind > 9)
11508 + kind = 9;
11509 + break;
11510 + case 12:
11511 + if ((0x400000004000L & l) != 0L)
11512 + jjstateSet[jjnewStateCnt++] = 11;
11513 + break;
11514 + case 13:
11515 + if ((0x2000000020L & l) != 0L)
11516 + jjCheckNAdd(10);
11517 + break;
11518 + case 20:
11519 + if ((0x7fffffe07fffffeL & l) == 0L)
11520 + break;
11521 + if (kind > 46)
11522 + kind = 46;
11523 + jjCheckNAddStates(13, 15);
11524 + break;
11525 + case 21:
11526 + if ((0x7fffffe87fffffeL & l) == 0L)
11527 + break;
11528 + if (kind > 46)
11529 + kind = 46;
11530 + jjCheckNAddTwoStates(21, 23);
11531 + break;
11532 + case 25:
11533 + jjAddStates(16, 17);
11534 + break;
11535 + case 31:
11536 + if ((0x2000000020L & l) != 0L)
11537 + jjAddStates(18, 20);
11538 + break;
11539 + case 39:
11540 + if ((0x100000001000L & l) != 0L)
11541 + jjCheckNAddTwoStates(41, 42);
11542 + break;
11543 + case 40:
11544 + if ((0x2000000020L & l) != 0L && kind > 9)
11545 + kind = 9;
11546 + break;
11547 + case 42:
11548 + if ((0x10000000100000L & l) != 0L && kind > 9)
11549 + kind = 9;
11550 + break;
11551 + case 43:
11552 + if ((0x8000000080L & l) != 0L)
11553 + jjCheckNAddTwoStates(44, 42);
11554 + break;
11555 + default : break;
11557 + } while(i != startsAt);
11559 + else
11561 + int i2 = (curChar & 0xff) >> 6;
11562 + long l2 = 1L << (curChar & 077);
11563 + MatchLoop: do
11565 + switch(jjstateSet[--i])
11567 + case 1:
11568 + if ((jjbitVec0[i2] & l2) == 0L)
11569 + break;
11570 + if (kind > 5)
11571 + kind = 5;
11572 + jjstateSet[jjnewStateCnt++] = 1;
11573 + break;
11574 + case 4:
11575 + if ((jjbitVec0[i2] & l2) != 0L)
11576 + jjCheckNAddTwoStates(4, 5);
11577 + break;
11578 + case 6:
11579 + case 7:
11580 + if ((jjbitVec0[i2] & l2) != 0L)
11581 + jjCheckNAddTwoStates(7, 5);
11582 + break;
11583 + case 25:
11584 + if ((jjbitVec0[i2] & l2) != 0L)
11585 + jjAddStates(16, 17);
11586 + break;
11587 + default : break;
11589 + } while(i != startsAt);
11591 + if (kind != 0x7fffffff)
11593 + jjmatchedKind = kind;
11594 + jjmatchedPos = curPos;
11595 + kind = 0x7fffffff;
11597 + ++curPos;
11598 + if ((i = jjnewStateCnt) == (startsAt = 54 - (jjnewStateCnt = startsAt)))
11599 + return curPos;
11600 + try { curChar = input_stream.readChar(); }
11601 + catch(java.io.IOException e) { return curPos; }
11604 +static final int[] jjnextStates = {
11605 + 46, 47, 48, 31, 50, 51, 53, 5, 6, 8, 47, 48, 31, 20, 21, 23,
11606 + 25, 26, 32, 33, 36,
11608 +public static final String[] jjstrLiteralImages = {
11609 +"", null, null, null, null, null, null, null, null, null, null, null, null,
11610 +null, null, null, null, null, null, null, null, null, null, null, null, null, null,
11611 +"\52", null, null, null, null, null, null, null, null, null, null, null, null, null,
11612 +null, null, null, null, null, null, null, null, null, null, null, "\75", "\73",
11613 +"\50", "\51", "\54", "\173", "\175", "\53", "\55", "\57", "\56", "\77", "\72",
11614 +"\133", "\135", "\44", };
11615 +public static final String[] lexStateNames = {
11616 + "DEFAULT",
11618 +static final long[] jjtoToken = {
11619 + 0xfffec3fffffffe01L, 0xfL,
11621 +static final long[] jjtoSkip = {
11622 + 0x7eL, 0x0L,
11624 +protected SimpleCharStream input_stream;
11625 +private final int[] jjrounds = new int[54];
11626 +private final int[] jjstateSet = new int[108];
11627 +protected char curChar;
11628 +public QueryParserTokenManager(SimpleCharStream stream){
11629 + if (SimpleCharStream.staticFlag)
11630 + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
11631 + input_stream = stream;
11633 +public QueryParserTokenManager(SimpleCharStream stream, int lexState){
11634 + this(stream);
11635 + SwitchTo(lexState);
11637 +public void ReInit(SimpleCharStream stream)
11639 + jjmatchedPos = jjnewStateCnt = 0;
11640 + curLexState = defaultLexState;
11641 + input_stream = stream;
11642 + ReInitRounds();
11644 +private final void ReInitRounds()
11646 + int i;
11647 + jjround = 0x80000001;
11648 + for (i = 54; i-- > 0;)
11649 + jjrounds[i] = 0x80000000;
11651 +public void ReInit(SimpleCharStream stream, int lexState)
11653 + ReInit(stream);
11654 + SwitchTo(lexState);
11656 +public void SwitchTo(int lexState)
11658 + if (lexState >= 1 || lexState < 0)
11659 + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
11660 + else
11661 + curLexState = lexState;
11664 +protected Token jjFillToken()
11666 + Token t = Token.newToken(jjmatchedKind);
11667 + t.kind = jjmatchedKind;
11668 + String im = jjstrLiteralImages[jjmatchedKind];
11669 + t.image = (im == null) ? input_stream.GetImage() : im;
11670 + t.beginLine = input_stream.getBeginLine();
11671 + t.beginColumn = input_stream.getBeginColumn();
11672 + t.endLine = input_stream.getEndLine();
11673 + t.endColumn = input_stream.getEndColumn();
11674 + return t;
11677 +int curLexState = 0;
11678 +int defaultLexState = 0;
11679 +int jjnewStateCnt;
11680 +int jjround;
11681 +int jjmatchedPos;
11682 +int jjmatchedKind;
11684 +public Token getNextToken()
11686 + int kind;
11687 + Token specialToken = null;
11688 + Token matchedToken;
11689 + int curPos = 0;
11691 + EOFLoop :
11692 + for (;;)
11693 + {
11694 + try
11695 + {
11696 + curChar = input_stream.BeginToken();
11697 + }
11698 + catch(java.io.IOException e)
11699 + {
11700 + jjmatchedKind = 0;
11701 + matchedToken = jjFillToken();
11702 + return matchedToken;
11705 + try { input_stream.backup(0);
11706 + while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
11707 + curChar = input_stream.BeginToken();
11709 + catch (java.io.IOException e1) { continue EOFLoop; }
11710 + jjmatchedKind = 0x7fffffff;
11711 + jjmatchedPos = 0;
11712 + curPos = jjMoveStringLiteralDfa0_0();
11713 + if (jjmatchedKind != 0x7fffffff)
11715 + if (jjmatchedPos + 1 < curPos)
11716 + input_stream.backup(curPos - jjmatchedPos - 1);
11717 + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
11719 + matchedToken = jjFillToken();
11720 + return matchedToken;
11722 + else
11724 + continue EOFLoop;
11727 + int error_line = input_stream.getEndLine();
11728 + int error_column = input_stream.getEndColumn();
11729 + String error_after = null;
11730 + boolean EOFSeen = false;
11731 + try { input_stream.readChar(); input_stream.backup(1); }
11732 + catch (java.io.IOException e1) {
11733 + EOFSeen = true;
11734 + error_after = curPos <= 1 ? "" : input_stream.GetImage();
11735 + if (curChar == '\n' || curChar == '\r') {
11736 + error_line++;
11737 + error_column = 0;
11739 + else
11740 + error_column++;
11742 + if (!EOFSeen) {
11743 + input_stream.backup(1);
11744 + error_after = curPos <= 1 ? "" : input_stream.GetImage();
11746 + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
11751 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java
11752 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java 1969-12-31 19:00:00.000000000 -0500
11753 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java 2007-08-31 09:41:35.000000000 -0400
11754 @@ -0,0 +1,157 @@
11755 +/* Generated By:JJTree: Do not edit this line. /Users/trevor/Documents/School/othercode/pig-src/src/com/yahoo/pig/impl/logicalLayer/parser/QueryParserTreeConstants.java */
11757 +package com.yahoo.pig.impl.logicalLayer.parser;
11759 +public interface QueryParserTreeConstants
11761 + public int JJTPARSE = 0;
11762 + public int JJTEXPR = 1;
11763 + public int JJTNESTEDEXPR = 2;
11764 + public int JJTALIAS = 3;
11765 + public int JJTBASEEXPR = 4;
11766 + public int JJTLOADCLAUSE = 5;
11767 + public int JJTFILTERCLAUSE = 6;
11768 + public int JJTPCOND = 7;
11769 + public int JJTPORCOND = 8;
11770 + public int JJTPANDCOND = 9;
11771 + public int JJTPUNARYCOND = 10;
11772 + public int JJTPNOTCOND = 11;
11773 + public int JJTCOGROUPCLAUSE = 12;
11774 + public int JJTGROUPITEM = 13;
11775 + public int JJTGROUPBYEXPR = 14;
11776 + public int JJTGROUPBYSPEC = 15;
11777 + public int JJTCROSSCLAUSE = 16;
11778 + public int JJTUNIONCLAUSE = 17;
11779 + public int JJTFOREACHCLAUSE = 18;
11780 + public int JJTNESTEDBLOCK = 19;
11781 + public int JJTNESTEDCOMMAND = 20;
11782 + public int JJTNESTEDFILTER = 21;
11783 + public int JJTNESTEDSORTORARRANGE = 22;
11784 + public int JJTNESTEDDISTINCT = 23;
11785 + public int JJTGENERATESTATEMENT = 24;
11786 + public int JJTFLATTENEDGENERATEITEMLIST = 25;
11787 + public int JJTFLATTENEDGENERATEITEM = 26;
11788 + public int JJTGENERATEITEM = 27;
11789 + public int JJTINFIXEXPR = 28;
11790 + public int JJTADDITIVEEXPR = 29;
11791 + public int JJTMULTIPLICATIVEEXPR = 30;
11792 + public int JJTUNARYEXPR = 31;
11793 + public int JJTBASEEVALITEM = 32;
11794 + public int JJTBINCOND = 33;
11795 + public int JJTFUNCEVALITEM = 34;
11796 + public int JJTEVALARGS = 35;
11797 + public int JJTEVALARGSITEM = 36;
11798 + public int JJTASCLAUSE = 37;
11799 + public int JJTSCHEMAELEMENT = 38;
11800 + public int JJTSCHEMAFIELD = 39;
11801 + public int JJTSCHEMATUPLE = 40;
11802 + public int JJTSCHEMABAG = 41;
11803 + public int JJTPEVALSPECPIPE = 42;
11804 + public int JJTPEVALSPEC = 43;
11805 + public int JJTPFILTER = 44;
11806 + public int JJTPSAD = 45;
11807 + public int JJTPEVALITEMLIST = 46;
11808 + public int JJTPEVALITEM = 47;
11809 + public int JJTPNESTABLEEVALITEM = 48;
11810 + public int JJTEVALFUNCTIONITEM = 49;
11811 + public int JJTSERIALIZEDBINCOND = 50;
11812 + public int JJTPSERIALIZEDCOND = 51;
11813 + public int JJTPSERIALIZEDORCOND = 52;
11814 + public int JJTPSERIALIZEDANDCOND = 53;
11815 + public int JJTPSERIALIZEDUNARYCOND = 54;
11816 + public int JJTPSERIALIZEDNOTCOND = 55;
11817 + public int JJTPWINDOW = 56;
11818 + public int JJTPTIMEWINDOW = 57;
11819 + public int JJTPTUPLEWINDOW = 58;
11820 + public int JJTEVALFUNCTION = 59;
11821 + public int JJTGROUPFUNCTION = 60;
11822 + public int JJTLOADFUNCTION = 61;
11823 + public int JJTFILTERFUNCTION = 62;
11824 + public int JJTVOID = 63;
11825 + public int JJTBRACKETEDSIMPLEPROJ = 64;
11826 + public int JJTSIMPLEPROJOREMPTY = 65;
11827 + public int JJTSIMPLEPROJ = 66;
11828 + public int JJTPSIMPLEPROJITEM = 67;
11829 + public int JJTSTAR = 68;
11830 + public int JJTCONST = 69;
11831 + public int JJTPCOLEVALITEM = 70;
11832 + public int JJTDOLLARVAR = 71;
11833 + public int JJTALIASFIELD = 72;
11836 + public String[] jjtNodeName = {
11837 + "Parse",
11838 + "Expr",
11839 + "NestedExpr",
11840 + "Alias",
11841 + "BaseExpr",
11842 + "LoadClause",
11843 + "FilterClause",
11844 + "PCond",
11845 + "POrCond",
11846 + "PAndCond",
11847 + "PUnaryCond",
11848 + "PNotCond",
11849 + "CogroupClause",
11850 + "GroupItem",
11851 + "GroupByExpr",
11852 + "GroupBySpec",
11853 + "CrossClause",
11854 + "UnionClause",
11855 + "ForEachClause",
11856 + "NestedBlock",
11857 + "NestedCommand",
11858 + "NestedFilter",
11859 + "NestedSortOrArrange",
11860 + "NestedDistinct",
11861 + "GenerateStatement",
11862 + "FlattenedGenerateItemList",
11863 + "FlattenedGenerateItem",
11864 + "GenerateItem",
11865 + "InfixExpr",
11866 + "AdditiveExpr",
11867 + "MultiplicativeExpr",
11868 + "UnaryExpr",
11869 + "BaseEvalItem",
11870 + "BinCond",
11871 + "FuncEvalItem",
11872 + "EvalArgs",
11873 + "EvalArgsItem",
11874 + "AsClause",
11875 + "SchemaElement",
11876 + "SchemaField",
11877 + "SchemaTuple",
11878 + "SchemaBag",
11879 + "PEvalSpecPipe",
11880 + "PEvalSpec",
11881 + "PFilter",
11882 + "PSAD",
11883 + "PEvalItemList",
11884 + "PEvalItem",
11885 + "PNestableEvalItem",
11886 + "EvalFunctionItem",
11887 + "SerializedBinCond",
11888 + "PSerializedCond",
11889 + "PSerializedOrCond",
11890 + "PSerializedAndCond",
11891 + "PSerializedUnaryCond",
11892 + "PSerializedNotCond",
11893 + "PWindow",
11894 + "PTimeWindow",
11895 + "PTupleWindow",
11896 + "EvalFunction",
11897 + "GroupFunction",
11898 + "LoadFunction",
11899 + "FilterFunction",
11900 + "void",
11901 + "BracketedSimpleProj",
11902 + "SimpleProjOrEmpty",
11903 + "SimpleProj",
11904 + "PSimpleProjItem",
11905 + "Star",
11906 + "Const",
11907 + "PColEvalItem",
11908 + "DollarVar",
11909 + "AliasField",
11910 + };
11912 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java
11913 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java 1969-12-31 19:00:00.000000000 -0500
11914 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleCharStream.java 2007-08-31 09:41:35.000000000 -0400
11915 @@ -0,0 +1,439 @@
11916 +/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
11917 +package com.yahoo.pig.impl.logicalLayer.parser;
11919 +/**
11920 + * An implementation of interface CharStream, where the stream is assumed to
11921 + * contain only ASCII characters (without unicode processing).
11922 + */
11924 +public class SimpleCharStream
11926 + public static final boolean staticFlag = false;
11927 + int bufsize;
11928 + int available;
11929 + int tokenBegin;
11930 + public int bufpos = -1;
11931 + protected int bufline[];
11932 + protected int bufcolumn[];
11934 + protected int column = 0;
11935 + protected int line = 1;
11937 + protected boolean prevCharIsCR = false;
11938 + protected boolean prevCharIsLF = false;
11940 + protected java.io.Reader inputStream;
11942 + protected char[] buffer;
11943 + protected int maxNextCharInd = 0;
11944 + protected int inBuf = 0;
11945 + protected int tabSize = 8;
11947 + protected void setTabSize(int i) { tabSize = i; }
11948 + protected int getTabSize(int i) { return tabSize; }
11951 + protected void ExpandBuff(boolean wrapAround)
11953 + char[] newbuffer = new char[bufsize + 2048];
11954 + int newbufline[] = new int[bufsize + 2048];
11955 + int newbufcolumn[] = new int[bufsize + 2048];
11957 + try
11959 + if (wrapAround)
11961 + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
11962 + System.arraycopy(buffer, 0, newbuffer,
11963 + bufsize - tokenBegin, bufpos);
11964 + buffer = newbuffer;
11966 + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
11967 + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
11968 + bufline = newbufline;
11970 + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
11971 + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
11972 + bufcolumn = newbufcolumn;
11974 + maxNextCharInd = (bufpos += (bufsize - tokenBegin));
11976 + else
11978 + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
11979 + buffer = newbuffer;
11981 + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
11982 + bufline = newbufline;
11984 + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
11985 + bufcolumn = newbufcolumn;
11987 + maxNextCharInd = (bufpos -= tokenBegin);
11990 + catch (Throwable t)
11992 + throw new Error(t.getMessage());
11996 + bufsize += 2048;
11997 + available = bufsize;
11998 + tokenBegin = 0;
12001 + protected void FillBuff() throws java.io.IOException
12003 + if (maxNextCharInd == available)
12005 + if (available == bufsize)
12007 + if (tokenBegin > 2048)
12009 + bufpos = maxNextCharInd = 0;
12010 + available = tokenBegin;
12012 + else if (tokenBegin < 0)
12013 + bufpos = maxNextCharInd = 0;
12014 + else
12015 + ExpandBuff(false);
12017 + else if (available > tokenBegin)
12018 + available = bufsize;
12019 + else if ((tokenBegin - available) < 2048)
12020 + ExpandBuff(true);
12021 + else
12022 + available = tokenBegin;
12025 + int i;
12026 + try {
12027 + if ((i = inputStream.read(buffer, maxNextCharInd,
12028 + available - maxNextCharInd)) == -1)
12030 + inputStream.close();
12031 + throw new java.io.IOException();
12033 + else
12034 + maxNextCharInd += i;
12035 + return;
12037 + catch(java.io.IOException e) {
12038 + --bufpos;
12039 + backup(0);
12040 + if (tokenBegin == -1)
12041 + tokenBegin = bufpos;
12042 + throw e;
12046 + public char BeginToken() throws java.io.IOException
12048 + tokenBegin = -1;
12049 + char c = readChar();
12050 + tokenBegin = bufpos;
12052 + return c;
12055 + protected void UpdateLineColumn(char c)
12057 + column++;
12059 + if (prevCharIsLF)
12061 + prevCharIsLF = false;
12062 + line += (column = 1);
12064 + else if (prevCharIsCR)
12066 + prevCharIsCR = false;
12067 + if (c == '\n')
12069 + prevCharIsLF = true;
12071 + else
12072 + line += (column = 1);
12075 + switch (c)
12077 + case '\r' :
12078 + prevCharIsCR = true;
12079 + break;
12080 + case '\n' :
12081 + prevCharIsLF = true;
12082 + break;
12083 + case '\t' :
12084 + column--;
12085 + column += (tabSize - (column % tabSize));
12086 + break;
12087 + default :
12088 + break;
12091 + bufline[bufpos] = line;
12092 + bufcolumn[bufpos] = column;
12095 + public char readChar() throws java.io.IOException
12097 + if (inBuf > 0)
12099 + --inBuf;
12101 + if (++bufpos == bufsize)
12102 + bufpos = 0;
12104 + return buffer[bufpos];
12107 + if (++bufpos >= maxNextCharInd)
12108 + FillBuff();
12110 + char c = buffer[bufpos];
12112 + UpdateLineColumn(c);
12113 + return (c);
12116 + /**
12117 + * @deprecated
12118 + * @see #getEndColumn
12119 + */
12121 + public int getColumn() {
12122 + return bufcolumn[bufpos];
12125 + /**
12126 + * @deprecated
12127 + * @see #getEndLine
12128 + */
12130 + public int getLine() {
12131 + return bufline[bufpos];
12134 + public int getEndColumn() {
12135 + return bufcolumn[bufpos];
12138 + public int getEndLine() {
12139 + return bufline[bufpos];
12142 + public int getBeginColumn() {
12143 + return bufcolumn[tokenBegin];
12146 + public int getBeginLine() {
12147 + return bufline[tokenBegin];
12150 + public void backup(int amount) {
12152 + inBuf += amount;
12153 + if ((bufpos -= amount) < 0)
12154 + bufpos += bufsize;
12157 + public SimpleCharStream(java.io.Reader dstream, int startline,
12158 + int startcolumn, int buffersize)
12160 + inputStream = dstream;
12161 + line = startline;
12162 + column = startcolumn - 1;
12164 + available = bufsize = buffersize;
12165 + buffer = new char[buffersize];
12166 + bufline = new int[buffersize];
12167 + bufcolumn = new int[buffersize];
12170 + public SimpleCharStream(java.io.Reader dstream, int startline,
12171 + int startcolumn)
12173 + this(dstream, startline, startcolumn, 4096);
12176 + public SimpleCharStream(java.io.Reader dstream)
12178 + this(dstream, 1, 1, 4096);
12180 + public void ReInit(java.io.Reader dstream, int startline,
12181 + int startcolumn, int buffersize)
12183 + inputStream = dstream;
12184 + line = startline;
12185 + column = startcolumn - 1;
12187 + if (buffer == null || buffersize != buffer.length)
12189 + available = bufsize = buffersize;
12190 + buffer = new char[buffersize];
12191 + bufline = new int[buffersize];
12192 + bufcolumn = new int[buffersize];
12194 + prevCharIsLF = prevCharIsCR = false;
12195 + tokenBegin = inBuf = maxNextCharInd = 0;
12196 + bufpos = -1;
12199 + public void ReInit(java.io.Reader dstream, int startline,
12200 + int startcolumn)
12202 + ReInit(dstream, startline, startcolumn, 4096);
12205 + public void ReInit(java.io.Reader dstream)
12207 + ReInit(dstream, 1, 1, 4096);
12209 + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
12210 + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
12212 + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
12215 + public SimpleCharStream(java.io.InputStream dstream, int startline,
12216 + int startcolumn, int buffersize)
12218 + this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
12221 + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
12222 + int startcolumn) throws java.io.UnsupportedEncodingException
12224 + this(dstream, encoding, startline, startcolumn, 4096);
12227 + public SimpleCharStream(java.io.InputStream dstream, int startline,
12228 + int startcolumn)
12230 + this(dstream, startline, startcolumn, 4096);
12233 + public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
12235 + this(dstream, encoding, 1, 1, 4096);
12238 + public SimpleCharStream(java.io.InputStream dstream)
12240 + this(dstream, 1, 1, 4096);
12243 + public void ReInit(java.io.InputStream dstream, String encoding, int startline,
12244 + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
12246 + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
12249 + public void ReInit(java.io.InputStream dstream, int startline,
12250 + int startcolumn, int buffersize)
12252 + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
12255 + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
12257 + ReInit(dstream, encoding, 1, 1, 4096);
12260 + public void ReInit(java.io.InputStream dstream)
12262 + ReInit(dstream, 1, 1, 4096);
12264 + public void ReInit(java.io.InputStream dstream, String encoding, int startline,
12265 + int startcolumn) throws java.io.UnsupportedEncodingException
12267 + ReInit(dstream, encoding, startline, startcolumn, 4096);
12269 + public void ReInit(java.io.InputStream dstream, int startline,
12270 + int startcolumn)
12272 + ReInit(dstream, startline, startcolumn, 4096);
12274 + public String GetImage()
12276 + if (bufpos >= tokenBegin)
12277 + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
12278 + else
12279 + return new String(buffer, tokenBegin, bufsize - tokenBegin) +
12280 + new String(buffer, 0, bufpos + 1);
12283 + public char[] GetSuffix(int len)
12285 + char[] ret = new char[len];
12287 + if ((bufpos + 1) >= len)
12288 + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
12289 + else
12291 + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
12292 + len - bufpos - 1);
12293 + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
12296 + return ret;
12299 + public void Done()
12301 + buffer = null;
12302 + bufline = null;
12303 + bufcolumn = null;
12306 + /**
12307 + * Method to adjust line and column numbers for the start of a token.
12308 + */
12309 + public void adjustBeginLineColumn(int newLine, int newCol)
12311 + int start = tokenBegin;
12312 + int len;
12314 + if (bufpos >= tokenBegin)
12316 + len = bufpos - tokenBegin + inBuf + 1;
12318 + else
12320 + len = bufsize - tokenBegin + bufpos + 1 + inBuf;
12323 + int i = 0, j = 0, k = 0;
12324 + int nextColDiff = 0, columnDiff = 0;
12326 + while (i < len &&
12327 + bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
12329 + bufline[j] = newLine;
12330 + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
12331 + bufcolumn[j] = newCol + columnDiff;
12332 + columnDiff = nextColDiff;
12333 + i++;
12334 + }
12336 + if (i < len)
12338 + bufline[j] = newLine++;
12339 + bufcolumn[j] = newCol + columnDiff;
12341 + while (i++ < len)
12343 + if (bufline[j = start % bufsize] != bufline[++start % bufsize])
12344 + bufline[j] = newLine++;
12345 + else
12346 + bufline[j] = newLine;
12350 + line = bufline[j];
12351 + column = bufcolumn[j];
12355 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java
12356 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java 1969-12-31 19:00:00.000000000 -0500
12357 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/SimpleNode.java 2007-08-31 09:41:35.000000000 -0400
12358 @@ -0,0 +1,72 @@
12359 +/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
12361 +package com.yahoo.pig.impl.logicalLayer.parser;
12363 +public class SimpleNode implements Node {
12364 + protected Node parent;
12365 + protected Node[] children;
12366 + protected int id;
12367 + protected QueryParser parser;
12369 + public SimpleNode(int i) {
12370 + id = i;
12373 + public SimpleNode(QueryParser p, int i) {
12374 + this(i);
12375 + parser = p;
12378 + public void jjtOpen() {
12381 + public void jjtClose() {
12384 + public void jjtSetParent(Node n) { parent = n; }
12385 + public Node jjtGetParent() { return parent; }
12387 + public void jjtAddChild(Node n, int i) {
12388 + if (children == null) {
12389 + children = new Node[i + 1];
12390 + } else if (i >= children.length) {
12391 + Node c[] = new Node[i + 1];
12392 + System.arraycopy(children, 0, c, 0, children.length);
12393 + children = c;
12395 + children[i] = n;
12398 + public Node jjtGetChild(int i) {
12399 + return children[i];
12402 + public int jjtGetNumChildren() {
12403 + return (children == null) ? 0 : children.length;
12406 + /* You can override these two methods in subclasses of SimpleNode to
12407 + customize the way the node appears when the tree is dumped. If
12408 + your output uses more than one line you should override
12409 + toString(String), otherwise overriding toString() is probably all
12410 + you need to do. */
12412 + public String toString() { return QueryParserTreeConstants.jjtNodeName[id]; }
12413 + public String toString(String prefix) { return prefix + toString(); }
12415 + /* Override this method if you want to customize how the node dumps
12416 + out its children. */
12418 + public void dump(String prefix) {
12419 + System.out.println(toString(prefix));
12420 + if (children != null) {
12421 + for (int i = 0; i < children.length; ++i) {
12422 + SimpleNode n = (SimpleNode)children[i];
12423 + if (n != null) {
12424 + n.dump(prefix + " ");
12431 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java
12432 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java 1969-12-31 19:00:00.000000000 -0500
12433 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/Token.java 2007-08-31 09:41:35.000000000 -0400
12434 @@ -0,0 +1,81 @@
12435 +/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
12436 +package com.yahoo.pig.impl.logicalLayer.parser;
12438 +/**
12439 + * Describes the input token stream.
12440 + */
12442 +public class Token {
12444 + /**
12445 + * An integer that describes the kind of this token. This numbering
12446 + * system is determined by JavaCCParser, and a table of these numbers is
12447 + * stored in the file ...Constants.java.
12448 + */
12449 + public int kind;
12451 + /**
12452 + * beginLine and beginColumn describe the position of the first character
12453 + * of this token; endLine and endColumn describe the position of the
12454 + * last character of this token.
12455 + */
12456 + public int beginLine, beginColumn, endLine, endColumn;
12458 + /**
12459 + * The string image of the token.
12460 + */
12461 + public String image;
12463 + /**
12464 + * A reference to the next regular (non-special) token from the input
12465 + * stream. If this is the last token from the input stream, or if the
12466 + * token manager has not read tokens beyond this one, this field is
12467 + * set to null. This is true only if this token is also a regular
12468 + * token. Otherwise, see below for a description of the contents of
12469 + * this field.
12470 + */
12471 + public Token next;
12473 + /**
12474 + * This field is used to access special tokens that occur prior to this
12475 + * token, but after the immediately preceding regular (non-special) token.
12476 + * If there are no such special tokens, this field is set to null.
12477 + * When there are more than one such special token, this field refers
12478 + * to the last of these special tokens, which in turn refers to the next
12479 + * previous special token through its specialToken field, and so on
12480 + * until the first special token (whose specialToken field is null).
12481 + * The next fields of special tokens refer to other special tokens that
12482 + * immediately follow it (without an intervening regular token). If there
12483 + * is no such token, this field is null.
12484 + */
12485 + public Token specialToken;
12487 + /**
12488 + * Returns the image.
12489 + */
12490 + public String toString()
12492 + return image;
12495 + /**
12496 + * Returns a new Token object, by default. However, if you want, you
12497 + * can create and return subclass objects based on the value of ofKind.
12498 + * Simply add the cases to the switch for all those special cases.
12499 + * For example, if you have a subclass of Token called IDToken that
12500 + * you want to create if ofKind is ID, simlpy add something like :
12502 + * case MyParserConstants.ID : return new IDToken();
12504 + * to the following switch statement. Then you can cast matchedToken
12505 + * variable to the appropriate type and use it in your lexical actions.
12506 + */
12507 + public static final Token newToken(int ofKind)
12509 + switch(ofKind)
12511 + default : return new Token();
12516 diff -Naur pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java
12517 --- pig-original/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java 1969-12-31 19:00:00.000000000 -0500
12518 +++ pig-galago/src/com/yahoo/pig/impl/logicalLayer/parser/TokenMgrError.java 2007-08-31 09:41:35.000000000 -0400
12519 @@ -0,0 +1,133 @@
12520 +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
12521 +package com.yahoo.pig.impl.logicalLayer.parser;
12523 +public class TokenMgrError extends Error
12525 + /*
12526 + * Ordinals for various reasons why an Error of this type can be thrown.
12527 + */
12529 + /**
12530 + * Lexical error occured.
12531 + */
12532 + static final int LEXICAL_ERROR = 0;
12534 + /**
12535 + * An attempt wass made to create a second instance of a static token manager.
12536 + */
12537 + static final int STATIC_LEXER_ERROR = 1;
12539 + /**
12540 + * Tried to change to an invalid lexical state.
12541 + */
12542 + static final int INVALID_LEXICAL_STATE = 2;
12544 + /**
12545 + * Detected (and bailed out of) an infinite loop in the token manager.
12546 + */
12547 + static final int LOOP_DETECTED = 3;
12549 + /**
12550 + * Indicates the reason why the exception is thrown. It will have
12551 + * one of the above 4 values.
12552 + */
12553 + int errorCode;
12555 + /**
12556 + * Replaces unprintable characters by their espaced (or unicode escaped)
12557 + * equivalents in the given string
12558 + */
12559 + protected static final String addEscapes(String str) {
12560 + StringBuffer retval = new StringBuffer();
12561 + char ch;
12562 + for (int i = 0; i < str.length(); i++) {
12563 + switch (str.charAt(i))
12565 + case 0 :
12566 + continue;
12567 + case '\b':
12568 + retval.append("\\b");
12569 + continue;
12570 + case '\t':
12571 + retval.append("\\t");
12572 + continue;
12573 + case '\n':
12574 + retval.append("\\n");
12575 + continue;
12576 + case '\f':
12577 + retval.append("\\f");
12578 + continue;
12579 + case '\r':
12580 + retval.append("\\r");
12581 + continue;
12582 + case '\"':
12583 + retval.append("\\\"");
12584 + continue;
12585 + case '\'':
12586 + retval.append("\\\'");
12587 + continue;
12588 + case '\\':
12589 + retval.append("\\\\");
12590 + continue;
12591 + default:
12592 + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
12593 + String s = "0000" + Integer.toString(ch, 16);
12594 + retval.append("\\u" + s.substring(s.length() - 4, s.length()));
12595 + } else {
12596 + retval.append(ch);
12598 + continue;
12601 + return retval.toString();
12604 + /**
12605 + * Returns a detailed message for the Error when it is thrown by the
12606 + * token manager to indicate a lexical error.
12607 + * Parameters :
12608 + * EOFSeen : indicates if EOF caused the lexicl error
12609 + * curLexState : lexical state in which this error occured
12610 + * errorLine : line number when the error occured
12611 + * errorColumn : column number when the error occured
12612 + * errorAfter : prefix that was seen before this error occured
12613 + * curchar : the offending character
12614 + * Note: You can customize the lexical error message by modifying this method.
12615 + */
12616 + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
12617 + return("Lexical error at line " +
12618 + errorLine + ", column " +
12619 + errorColumn + ". Encountered: " +
12620 + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
12621 + "after : \"" + addEscapes(errorAfter) + "\"");
12624 + /**
12625 + * You can also modify the body of this method to customize your error messages.
12626 + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
12627 + * of end-users concern, so you can return something like :
12629 + * "Internal Error : Please file a bug report .... "
12631 + * from this method for such cases in the release version of your parser.
12632 + */
12633 + public String getMessage() {
12634 + return super.getMessage();
12637 + /*
12638 + * Constructors of various flavors follow.
12639 + */
12641 + public TokenMgrError() {
12644 + public TokenMgrError(String message, int reason) {
12645 + super(message);
12646 + errorCode = reason;
12649 + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
12650 + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
12653 diff -Naur pig-original/src/com/yahoo/pig/impl/mapreduceExec/BZip.java pig-galago/src/com/yahoo/pig/impl/mapreduceExec/BZip.java
12654 --- pig-original/src/com/yahoo/pig/impl/mapreduceExec/BZip.java 2007-04-05 11:24:35.000000000 -0400
12655 +++ pig-galago/src/com/yahoo/pig/impl/mapreduceExec/BZip.java 2007-08-31 09:55:16.000000000 -0400
12656 @@ -11,6 +11,8 @@
12657 import org.apache.hadoop.io.compress.CompressionCodec;
12658 import org.apache.hadoop.io.compress.CompressionInputStream;
12659 import org.apache.hadoop.io.compress.CompressionOutputStream;
12660 +import org.apache.hadoop.io.compress.Compressor;
12661 +import org.apache.hadoop.io.compress.Decompressor;
12662 import org.apache.tools.bzip2.CBZip2InputStream;
12663 import org.apache.tools.bzip2.CBZip2OutputStream;
12665 @@ -87,4 +89,28 @@
12666 public String getDefaultExtension() {
12667 return ".bz";
12670 + public CompressionOutputStream createOutputStream(OutputStream outputStream, Compressor compressor) throws IOException {
12671 + return null;
12674 + public Class getCompressorType() {
12675 + return null;
12678 + public Compressor createCompressor() {
12679 + return null;
12682 + public CompressionInputStream createInputStream(InputStream inputStream, Decompressor decompressor) throws IOException {
12683 + return null;
12686 + public Class getDecompressorType() {
12687 + return null;
12690 + public Decompressor createDecompressor() {
12691 + return null;
12694 diff -Naur pig-original/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java pig-galago/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java
12695 --- pig-original/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java 2007-04-05 11:40:32.000000000 -0400
12696 +++ pig-galago/src/com/yahoo/pig/impl/mapreduceExec/MapReduceLauncher.java 2007-08-31 09:54:42.000000000 -0400
12697 @@ -56,7 +56,6 @@
12698 import org.apache.hadoop.mapred.JobSubmissionProtocol;
12699 import org.apache.hadoop.mapred.JobTracker;
12700 import org.apache.hadoop.mapred.TaskReport;
12701 -import org.apache.hadoop.util.HadoopExe;
12703 import com.yahoo.pig.PigServer;
12704 import com.yahoo.pig.builtin.PigStorage;
12705 @@ -547,10 +546,6 @@
12706 } else {
12707 grunt.exec();
12709 - } else if (args[jarIndex].equals("-H")) {
12710 - String newArgs[] = new String[args.length - jarIndex-1];
12711 - System.arraycopy(args, jarIndex+1, newArgs, 0, newArgs.length);
12712 - invokeMain(HadoopExe.class, args);
12713 } else {
12714 JarFile jar = new JarFile(args[jarIndex]);
12715 Manifest m;
12716 diff -Naur pig-original/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java pig-galago/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java
12717 --- pig-original/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java 2007-04-05 11:24:35.000000000 -0400
12718 +++ pig-galago/src/com/yahoo/pig/impl/physicalLayer/IntermedResult.java 2007-09-04 10:39:26.000000000 -0400
12719 @@ -132,6 +132,10 @@
12720 public boolean compiled() {
12721 return compiled;
12724 + public void setCompiled( boolean compiled ) {
12725 + this.compiled = compiled;
12728 public boolean executed() {
12729 return executed;
12730 diff -Naur pig-original/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java pig-galago/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java
12731 --- pig-original/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java 2007-04-05 11:24:35.000000000 -0400
12732 +++ pig-galago/src/com/yahoo/pig/impl/physicalLayer/PhysicalPlan.java 2007-09-03 13:15:06.000000000 -0400
12733 @@ -4,6 +4,7 @@
12735 package com.yahoo.pig.impl.physicalLayer;
12737 +import com.yahoo.pig.impl.galago.GalagoPlanCompiler;
12738 import java.io.IOException;
12739 import java.util.Map;
12741 @@ -41,6 +42,9 @@
12742 case MAPREDUCE:
12743 root = (new MapreducePlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12744 break;
12745 + case GALAGO:
12746 + root = (new GalagoPlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12747 + break;
12748 case PIG:
12749 root = (new PigbodyPlanCompiler(lp.getPigContext())).compile(lp.root(), queryResults);
12750 default:
12751 diff -Naur pig-original/src/com/yahoo/pig/tools/grunt/Grunt.java pig-galago/src/com/yahoo/pig/tools/grunt/Grunt.java
12752 --- pig-original/src/com/yahoo/pig/tools/grunt/Grunt.java 2007-04-05 11:24:35.000000000 -0400
12753 +++ pig-galago/src/com/yahoo/pig/tools/grunt/Grunt.java 2007-09-01 16:22:28.000000000 -0400
12754 @@ -22,6 +22,7 @@
12755 import com.yahoo.pig.data.Tuple;
12756 import com.yahoo.pig.impl.logicalLayer.parser.ParseException;
12757 import com.yahoo.pig.impl.logicalLayer.parser.TokenMgrError;
12758 +import java.io.InputStreamReader;
12760 public class Grunt {
12761 BufferedReader in;
12762 @@ -39,7 +40,12 @@
12763 this.lfs = lfs;
12764 this.conf = conf;
12765 this.jobTracker = jobTracker;
12766 - this.pig = new PigServer(ExecType.MAPREDUCE);
12767 + this.pig = new PigServer(ExecType.LOCAL);
12770 + public static void main( String[] args ) {
12771 + Grunt g = new Grunt( new BufferedReader( new InputStreamReader( System.in ) ), null, null, null, null );
12772 + g.run();
12775 public void run() {