All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geolatte.common.cql.parser.Parser Maven / Gradle / Ivy

Go to download

This GeoLatte-common library contains the transformer framework and other common classes used by other GeoLatte modules.

There is a newer version: 0.8
Show newest version
/* This file was generated by SableCC (http://www.sablecc.org/). */

package org.geolatte.common.cql.parser;

import org.geolatte.common.cql.lexer.*;
import org.geolatte.common.cql.node.*;
import org.geolatte.common.cql.analysis.*;
import java.util.*;

import java.io.DataInputStream;
import java.io.BufferedInputStream;
import java.io.IOException;

@SuppressWarnings("nls")
public class Parser
{
    public final Analysis ignoredTokens = new AnalysisAdapter();

    protected ArrayList nodeList;

    private final Lexer lexer;
    private final ListIterator stack = new LinkedList().listIterator();
    private int last_pos;
    private int last_line;
    private Token last_token;
    private final TokenIndex converter = new TokenIndex();
    private final int[] action = new int[2];

    private final static int SHIFT = 0;
    private final static int REDUCE = 1;
    private final static int ACCEPT = 2;
    private final static int ERROR = 3;

    public Parser(@SuppressWarnings("hiding") Lexer lexer)
    {
        this.lexer = lexer;
    }

    @SuppressWarnings({"unchecked","unused"})
    private void push(int numstate, ArrayList listNode) throws ParserException, LexerException, IOException
    {
        this.nodeList = listNode;

        if(!this.stack.hasNext())
        {
            this.stack.add(new State(numstate, this.nodeList));
            return;
        }

        State s = (State) this.stack.next();
        s.state = numstate;
        s.nodes = this.nodeList;
    }

    private int goTo(int index)
    {
        int state = state();
        int low = 1;
        int high = gotoTable[index].length - 1;
        int value = gotoTable[index][0][1];

        while(low <= high)
        {
            int middle = (low + high) / 2;

            if(state < gotoTable[index][middle][0])
            {
                high = middle - 1;
            }
            else if(state > gotoTable[index][middle][0])
            {
                low = middle + 1;
            }
            else
            {
                value = gotoTable[index][middle][1];
                break;
            }
        }

        return value;
    }

    private int state()
    {
        State s = (State) this.stack.previous();
        this.stack.next();
        return s.state;
    }

    private ArrayList pop()
    {
        return ((State) this.stack.previous()).nodes;
    }

    private int index(Switchable token)
    {
        this.converter.index = -1;
        token.apply(this.converter);
        return this.converter.index;
    }

    @SuppressWarnings("unchecked")
    public Start parse() throws ParserException, LexerException, IOException
    {
        push(0, null);
        List ign = null;
        while(true)
        {
            while(index(this.lexer.peek()) == -1)
            {
                if(ign == null)
                {
                    ign = new LinkedList();
                }

                ign.add(this.lexer.next());
            }

            if(ign != null)
            {
                this.ignoredTokens.setIn(this.lexer.peek(), ign);
                ign = null;
            }

            this.last_pos = this.lexer.peek().getPos();
            this.last_line = this.lexer.peek().getLine();
            this.last_token = this.lexer.peek();

            int index = index(this.lexer.peek());
            this.action[0] = Parser.actionTable[state()][0][1];
            this.action[1] = Parser.actionTable[state()][0][2];

            int low = 1;
            int high = Parser.actionTable[state()].length - 1;

            while(low <= high)
            {
                int middle = (low + high) / 2;

                if(index < Parser.actionTable[state()][middle][0])
                {
                    high = middle - 1;
                }
                else if(index > Parser.actionTable[state()][middle][0])
                {
                    low = middle + 1;
                }
                else
                {
                    this.action[0] = Parser.actionTable[state()][middle][1];
                    this.action[1] = Parser.actionTable[state()][middle][2];
                    break;
                }
            }

            switch(this.action[0])
            {
                case SHIFT:
		    {
		        ArrayList list = new ArrayList();
		        list.add(this.lexer.next());
                        push(this.action[1], list);
                    }
		    break;
                case REDUCE:
                    switch(this.action[1])
                    {
                    case 0: /* reduce ASearchCondition */
		    {
			ArrayList list = new0();
			push(goTo(0), list);
		    }
		    break;
                    case 1: /* reduce ABooleanTermBooleanValueExpression */
		    {
			ArrayList list = new1();
			push(goTo(1), list);
		    }
		    break;
                    case 2: /* reduce ABooleanValueExpressionBooleanValueExpression */
		    {
			ArrayList list = new2();
			push(goTo(1), list);
		    }
		    break;
                    case 3: /* reduce ABooleanFactor$BooleanFactor1BooleanTerm */
		    {
			ArrayList list = new3();
			push(goTo(2), list);
		    }
		    break;
                    case 4: /* reduce ABooleanFactor$BooleanFactorNot1BooleanTerm */
		    {
			ArrayList list = new4();
			push(goTo(2), list);
		    }
		    break;
                    case 5: /* reduce ABooleanTerm$BooleanFactor1BooleanTerm */
		    {
			ArrayList list = new5();
			push(goTo(2), list);
		    }
		    break;
                    case 6: /* reduce ABooleanTerm$BooleanFactorNot1BooleanTerm */
		    {
			ArrayList list = new6();
			push(goTo(2), list);
		    }
		    break;
                    case 7: /* reduce APredicateBooleanPrimary */
		    {
			ArrayList list = new7();
			push(goTo(3), list);
		    }
		    break;
                    case 8: /* reduce ARoutineInvocationBooleanPrimary */
		    {
			ArrayList list = new8();
			push(goTo(3), list);
		    }
		    break;
                    case 9: /* reduce ANestedSearchConditionBooleanPrimary */
		    {
			ArrayList list = new9();
			push(goTo(3), list);
		    }
		    break;
                    case 10: /* reduce ARoutineInvocation */
		    {
			ArrayList list = new10();
			push(goTo(4), list);
		    }
		    break;
                    case 11: /* reduce AComparisonPredicatePredicate */
		    {
			ArrayList list = new11();
			push(goTo(5), list);
		    }
		    break;
                    case 12: /* reduce ATextPredicatePredicate */
		    {
			ArrayList list = new12();
			push(goTo(5), list);
		    }
		    break;
                    case 13: /* reduce ANullPredicatePredicate */
		    {
			ArrayList list = new13();
			push(goTo(5), list);
		    }
		    break;
                    case 14: /* reduce AExistencePredicatePredicate */
		    {
			ArrayList list = new14();
			push(goTo(5), list);
		    }
		    break;
                    case 15: /* reduce ATemporalPredicatePredicate */
		    {
			ArrayList list = new15();
			push(goTo(5), list);
		    }
		    break;
                    case 16: /* reduce AEqualsComparisonPredicate */
		    {
			ArrayList list = new16();
			push(goTo(6), list);
		    }
		    break;
                    case 17: /* reduce ANotEqualsComparisonPredicate */
		    {
			ArrayList list = new17();
			push(goTo(6), list);
		    }
		    break;
                    case 18: /* reduce ALessThanComparisonPredicate */
		    {
			ArrayList list = new18();
			push(goTo(6), list);
		    }
		    break;
                    case 19: /* reduce AGreaterThanComparisonPredicate */
		    {
			ArrayList list = new19();
			push(goTo(6), list);
		    }
		    break;
                    case 20: /* reduce ALessThanOrEqualsComparisonPredicate */
		    {
			ArrayList list = new20();
			push(goTo(6), list);
		    }
		    break;
                    case 21: /* reduce AGreaterThanOrEqualsComparisonPredicate */
		    {
			ArrayList list = new21();
			push(goTo(6), list);
		    }
		    break;
                    case 22: /* reduce AIsnullNullPredicate */
		    {
			ArrayList list = new22();
			push(goTo(7), list);
		    }
		    break;
                    case 23: /* reduce AIsnotnullNullPredicate */
		    {
			ArrayList list = new23();
			push(goTo(7), list);
		    }
		    break;
                    case 24: /* reduce ALikeTextPredicate */
		    {
			ArrayList list = new24();
			push(goTo(8), list);
		    }
		    break;
                    case 25: /* reduce ANotlikeTextPredicate */
		    {
			ArrayList list = new25();
			push(goTo(8), list);
		    }
		    break;
                    case 26: /* reduce AIlikeTextPredicate */
		    {
			ArrayList list = new26();
			push(goTo(8), list);
		    }
		    break;
                    case 27: /* reduce ANotilikeTextPredicate */
		    {
			ArrayList list = new27();
			push(goTo(8), list);
		    }
		    break;
                    case 28: /* reduce AExistsExistencePredicate */
		    {
			ArrayList list = new28();
			push(goTo(9), list);
		    }
		    break;
                    case 29: /* reduce ADoesNotExistExistencePredicate */
		    {
			ArrayList list = new29();
			push(goTo(9), list);
		    }
		    break;
                    case 30: /* reduce ABeforeTemporalPredicate */
		    {
			ArrayList list = new30();
			push(goTo(10), list);
		    }
		    break;
                    case 31: /* reduce AAfterTemporalPredicate */
		    {
			ArrayList list = new31();
			push(goTo(10), list);
		    }
		    break;
                    case 32: /* reduce ADuringTemporalPredicate */
		    {
			ArrayList list = new32();
			push(goTo(10), list);
		    }
		    break;
                    case 33: /* reduce ABeforeOrDuringTemporalPredicate */
		    {
			ArrayList list = new33();
			push(goTo(10), list);
		    }
		    break;
                    case 34: /* reduce ADuringOrAfterTemporalPredicate */
		    {
			ArrayList list = new34();
			push(goTo(10), list);
		    }
		    break;
                    case 35: /* reduce ANumLiteral */
		    {
			ArrayList list = new35();
			push(goTo(11), list);
		    }
		    break;
                    case 36: /* reduce AGenLiteral */
		    {
			ArrayList list = new36();
			push(goTo(11), list);
		    }
		    break;
                    case 37: /* reduce AStringGeneralLiteral */
		    {
			ArrayList list = new37();
			push(goTo(12), list);
		    }
		    break;
                    case 38: /* reduce ADateGeneralLiteral */
		    {
			ArrayList list = new38();
			push(goTo(12), list);
		    }
		    break;
                    case 39: /* reduce ABooleanGeneralLiteral */
		    {
			ArrayList list = new39();
			push(goTo(12), list);
		    }
		    break;
                    case 40: /* reduce ANumericLiteral */
		    {
			ArrayList list = new40();
			push(goTo(13), list);
		    }
		    break;
                    case 41: /* reduce AStringLiteral */
		    {
			ArrayList list = new41();
			push(goTo(14), list);
		    }
		    break;
                    case 42: /* reduce ATrueBooleanLiteral */
		    {
			ArrayList list = new42();
			push(goTo(15), list);
		    }
		    break;
                    case 43: /* reduce AFalseBooleanLiteral */
		    {
			ArrayList list = new43();
			push(goTo(15), list);
		    }
		    break;
                    case 44: /* reduce AUnknownBooleanLiteral */
		    {
			ArrayList list = new44();
			push(goTo(15), list);
		    }
		    break;
                    case 45: /* reduce ADatetimeLiteral */
		    {
			ArrayList list = new45();
			push(goTo(16), list);
		    }
		    break;
                    case 46: /* reduce ADurationLiteral */
		    {
			ArrayList list = new46();
			push(goTo(17), list);
		    }
		    break;
                    case 47: /* reduce AFromToTimespanLiteral */
		    {
			ArrayList list = new47();
			push(goTo(18), list);
		    }
		    break;
                    case 48: /* reduce AFromDurationTimespanLiteral */
		    {
			ArrayList list = new48();
			push(goTo(18), list);
		    }
		    break;
                    case 49: /* reduce ADurationToTimespanLiteral */
		    {
			ArrayList list = new49();
			push(goTo(18), list);
		    }
		    break;
                    case 50: /* reduce APointGeometryLiteral */
		    {
			ArrayList list = new50();
			push(goTo(19), list);
		    }
		    break;
                    case 51: /* reduce ALineStringGeometryLiteral */
		    {
			ArrayList list = new51();
			push(goTo(19), list);
		    }
		    break;
                    case 52: /* reduce APolygonGeometryLiteral */
		    {
			ArrayList list = new52();
			push(goTo(19), list);
		    }
		    break;
                    case 53: /* reduce AMultiPointLiteralGeometryLiteral */
		    {
			ArrayList list = new53();
			push(goTo(19), list);
		    }
		    break;
                    case 54: /* reduce AMultiLineStringLiteralGeometryLiteral */
		    {
			ArrayList list = new54();
			push(goTo(19), list);
		    }
		    break;
                    case 55: /* reduce AMultiPolygonLiteralGeometryLiteral */
		    {
			ArrayList list = new55();
			push(goTo(19), list);
		    }
		    break;
                    case 56: /* reduce AGeometryCollectionLiteralGeometryLiteral */
		    {
			ArrayList list = new56();
			push(goTo(19), list);
		    }
		    break;
                    case 57: /* reduce ASimpleAttributeAttributeName */
		    {
			ArrayList list = new57();
			push(goTo(20), list);
		    }
		    break;
                    case 58: /* reduce ACompoundAttributeAttributeName */
		    {
			ArrayList list = new58();
			push(goTo(20), list);
		    }
		    break;
                    }
                    break;
                case ACCEPT:
                    {
                        EOF node2 = (EOF) this.lexer.next();
                        PExpr node1 = (PExpr) pop().get(0);
                        Start node = new Start(node1, node2);
                        return node;
                    }
                case ERROR:
                    throw new ParserException(this.last_token,
                        "[" + this.last_line + "," + this.last_pos + "] " +
                        Parser.errorMessages[Parser.errors[this.action[1]]]);
            }
        }
    }



    @SuppressWarnings("unchecked")
    ArrayList new0() /* reduce ASearchCondition */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new1() /* reduce ABooleanTermBooleanValueExpression */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new2() /* reduce ABooleanValueExpressionBooleanValueExpression */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PExpr pexprNode2;
        PExpr pexprNode3;
        pexprNode2 = (PExpr)nodeArrayList1.get(0);
        pexprNode3 = (PExpr)nodeArrayList3.get(0);

        pexprNode1 = new AOrExpr(pexprNode2, pexprNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new3() /* reduce ABooleanFactor$BooleanFactor1BooleanTerm */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new4() /* reduce ABooleanFactor$BooleanFactorNot1BooleanTerm */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PExpr pexprNode2;
        pexprNode2 = (PExpr)nodeArrayList2.get(0);

        pexprNode1 = new ANotExpr(pexprNode2);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new5() /* reduce ABooleanTerm$BooleanFactor1BooleanTerm */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PExpr pexprNode2;
        PExpr pexprNode3;
        pexprNode2 = (PExpr)nodeArrayList1.get(0);
        pexprNode3 = (PExpr)nodeArrayList3.get(0);

        pexprNode1 = new AAndExpr(pexprNode2, pexprNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new6() /* reduce ABooleanTerm$BooleanFactorNot1BooleanTerm */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PExpr pexprNode2;
        PExpr pexprNode3;
        pexprNode2 = (PExpr)nodeArrayList1.get(0);
        {
            // Block
        PExpr pexprNode4;
        pexprNode4 = (PExpr)nodeArrayList4.get(0);

        pexprNode3 = new ANotExpr(pexprNode4);
        }

        pexprNode1 = new AAndExpr(pexprNode2, pexprNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new7() /* reduce APredicateBooleanPrimary */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new8() /* reduce ARoutineInvocationBooleanPrimary */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new9() /* reduce ANestedSearchConditionBooleanPrimary */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList2.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new10() /* reduce ARoutineInvocation */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList6 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList5 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PGeometryLiteral pgeometryliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList3.get(0);
        pgeometryliteralNode3 = (PGeometryLiteral)nodeArrayList5.get(0);

        pexprNode1 = new AGeoEqualsExpr(pattrNode2, pgeometryliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new11() /* reduce AComparisonPredicatePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new12() /* reduce ATextPredicatePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new13() /* reduce ANullPredicatePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new14() /* reduce AExistencePredicatePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new15() /* reduce ATemporalPredicatePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        pexprNode1 = (PExpr)nodeArrayList1.get(0);
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new16() /* reduce AEqualsComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new AEqExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new17() /* reduce ANotEqualsComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ANeqExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new18() /* reduce ALessThanComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ALtExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new19() /* reduce AGreaterThanComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new AGtExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new20() /* reduce ALessThanOrEqualsComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ALteExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new21() /* reduce AGreaterThanOrEqualsComparisonPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PLiteral pliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pliteralNode3 = (PLiteral)nodeArrayList3.get(0);

        pexprNode1 = new AGteExpr(pattrNode2, pliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new22() /* reduce AIsnullNullPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);

        pexprNode1 = new AIsNullExpr(pattrNode2);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new23() /* reduce AIsnotnullNullPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);

        pexprNode1 = new AIsNotNullExpr(pattrNode2);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new24() /* reduce ALikeTextPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PStringLiteral pstringliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pstringliteralNode3 = (PStringLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ALikeExpr(pattrNode2, pstringliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new25() /* reduce ANotlikeTextPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PStringLiteral pstringliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pstringliteralNode3 = (PStringLiteral)nodeArrayList4.get(0);

        pexprNode1 = new ANotLikeExpr(pattrNode2, pstringliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new26() /* reduce AIlikeTextPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PStringLiteral pstringliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pstringliteralNode3 = (PStringLiteral)nodeArrayList3.get(0);

        pexprNode1 = new AIlikeExpr(pattrNode2, pstringliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new27() /* reduce ANotilikeTextPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PStringLiteral pstringliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pstringliteralNode3 = (PStringLiteral)nodeArrayList4.get(0);

        pexprNode1 = new ANotIlikeExpr(pattrNode2, pstringliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new28() /* reduce AExistsExistencePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);

        pexprNode1 = new AExistsExpr(pattrNode2);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new29() /* reduce ADoesNotExistExistencePredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);

        pexprNode1 = new ADoesNotExistExpr(pattrNode2);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new30() /* reduce ABeforeTemporalPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PDatetimeLiteral pdatetimeliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pdatetimeliteralNode3 = (PDatetimeLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ABeforeExpr(pattrNode2, pdatetimeliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new31() /* reduce AAfterTemporalPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PDatetimeLiteral pdatetimeliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        pdatetimeliteralNode3 = (PDatetimeLiteral)nodeArrayList3.get(0);

        pexprNode1 = new AAfterExpr(pattrNode2, pdatetimeliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new32() /* reduce ADuringTemporalPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PTimespanLiteral ptimespanliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        ptimespanliteralNode3 = (PTimespanLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ADuringExpr(pattrNode2, ptimespanliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new33() /* reduce ABeforeOrDuringTemporalPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PTimespanLiteral ptimespanliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        ptimespanliteralNode3 = (PTimespanLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ABeforeOrDuringExpr(pattrNode2, ptimespanliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new34() /* reduce ADuringOrAfterTemporalPredicate */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PExpr pexprNode1;
        {
            // Block
        PAttr pattrNode2;
        PTimespanLiteral ptimespanliteralNode3;
        pattrNode2 = (PAttr)nodeArrayList1.get(0);
        ptimespanliteralNode3 = (PTimespanLiteral)nodeArrayList3.get(0);

        pexprNode1 = new ADuringOrAfterExpr(pattrNode2, ptimespanliteralNode3);
        }
	nodeList.add(pexprNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new35() /* reduce ANumLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PLiteral pliteralNode1;
        {
            // Block
        PNumericLiteral pnumericliteralNode2;
        pnumericliteralNode2 = (PNumericLiteral)nodeArrayList1.get(0);

        pliteralNode1 = new ANumericLiteral(pnumericliteralNode2);
        }
	nodeList.add(pliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new36() /* reduce AGenLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PLiteral pliteralNode1;
        pliteralNode1 = (PLiteral)nodeArrayList1.get(0);
	nodeList.add(pliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new37() /* reduce AStringGeneralLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PLiteral pliteralNode1;
        {
            // Block
        PStringLiteral pstringliteralNode2;
        pstringliteralNode2 = (PStringLiteral)nodeArrayList1.get(0);

        pliteralNode1 = new AStringLiteral(pstringliteralNode2);
        }
	nodeList.add(pliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new38() /* reduce ADateGeneralLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PLiteral pliteralNode1;
        {
            // Block
        PDatetimeLiteral pdatetimeliteralNode2;
        pdatetimeliteralNode2 = (PDatetimeLiteral)nodeArrayList1.get(0);

        pliteralNode1 = new ADatetimeLiteral(pdatetimeliteralNode2);
        }
	nodeList.add(pliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new39() /* reduce ABooleanGeneralLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PLiteral pliteralNode1;
        {
            // Block
        PBooleanLiteral pbooleanliteralNode2;
        pbooleanliteralNode2 = (PBooleanLiteral)nodeArrayList1.get(0);

        pliteralNode1 = new ABooleanLiteral(pbooleanliteralNode2);
        }
	nodeList.add(pliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new40() /* reduce ANumericLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PNumericLiteral pnumericliteralNode1;
        {
            // Block
        TSignedNumericLiteral tsignednumericliteralNode2;
        tsignednumericliteralNode2 = (TSignedNumericLiteral)nodeArrayList1.get(0);

        pnumericliteralNode1 = new ADefaultNumericLiteral(tsignednumericliteralNode2);
        }
	nodeList.add(pnumericliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new41() /* reduce AStringLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PStringLiteral pstringliteralNode1;
        {
            // Block
        TCharacterStringLiteral tcharacterstringliteralNode2;
        tcharacterstringliteralNode2 = (TCharacterStringLiteral)nodeArrayList1.get(0);

        pstringliteralNode1 = new ADefaultStringLiteral(tcharacterstringliteralNode2);
        }
	nodeList.add(pstringliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new42() /* reduce ATrueBooleanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PBooleanLiteral pbooleanliteralNode1;
        {
            // Block

        pbooleanliteralNode1 = new ATrueBooleanLiteral();
        }
	nodeList.add(pbooleanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new43() /* reduce AFalseBooleanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PBooleanLiteral pbooleanliteralNode1;
        {
            // Block

        pbooleanliteralNode1 = new AFalseBooleanLiteral();
        }
	nodeList.add(pbooleanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new44() /* reduce AUnknownBooleanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PBooleanLiteral pbooleanliteralNode1;
        {
            // Block

        pbooleanliteralNode1 = new AUnknownBooleanLiteral();
        }
	nodeList.add(pbooleanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new45() /* reduce ADatetimeLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PDatetimeLiteral pdatetimeliteralNode1;
        {
            // Block
        TDatetime tdatetimeNode2;
        tdatetimeNode2 = (TDatetime)nodeArrayList1.get(0);

        pdatetimeliteralNode1 = new ADefaultDatetimeLiteral(tdatetimeNode2);
        }
	nodeList.add(pdatetimeliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new46() /* reduce ADurationLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList13 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList12 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList11 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList10 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList9 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList8 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList7 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList6 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList5 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList4 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PDurationLiteral pdurationliteralNode1;
        {
            // Block
        TUnsignedInteger tunsignedintegerNode2;
        TUnsignedInteger tunsignedintegerNode3;
        TUnsignedInteger tunsignedintegerNode4;
        TUnsignedInteger tunsignedintegerNode5;
        TUnsignedInteger tunsignedintegerNode6;
        TUnsignedInteger tunsignedintegerNode7;
        tunsignedintegerNode2 = (TUnsignedInteger)nodeArrayList2.get(0);
        tunsignedintegerNode3 = (TUnsignedInteger)nodeArrayList4.get(0);
        tunsignedintegerNode4 = (TUnsignedInteger)nodeArrayList6.get(0);
        tunsignedintegerNode5 = (TUnsignedInteger)nodeArrayList8.get(0);
        tunsignedintegerNode6 = (TUnsignedInteger)nodeArrayList10.get(0);
        tunsignedintegerNode7 = (TUnsignedInteger)nodeArrayList12.get(0);

        pdurationliteralNode1 = new ADefaultDurationLiteral(tunsignedintegerNode2, tunsignedintegerNode3, tunsignedintegerNode4, tunsignedintegerNode5, tunsignedintegerNode6, tunsignedintegerNode7);
        }
	nodeList.add(pdurationliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new47() /* reduce AFromToTimespanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PTimespanLiteral ptimespanliteralNode1;
        {
            // Block
        TDatetime tdatetimeNode2;
        TDatetime tdatetimeNode3;
        tdatetimeNode2 = (TDatetime)nodeArrayList1.get(0);
        tdatetimeNode3 = (TDatetime)nodeArrayList3.get(0);

        ptimespanliteralNode1 = new AFromToTimespanLiteral(tdatetimeNode2, tdatetimeNode3);
        }
	nodeList.add(ptimespanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new48() /* reduce AFromDurationTimespanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PTimespanLiteral ptimespanliteralNode1;
        {
            // Block
        TDatetime tdatetimeNode2;
        PDurationLiteral pdurationliteralNode3;
        tdatetimeNode2 = (TDatetime)nodeArrayList1.get(0);
        pdurationliteralNode3 = (PDurationLiteral)nodeArrayList3.get(0);

        ptimespanliteralNode1 = new AFromDurationTimespanLiteral(tdatetimeNode2, pdurationliteralNode3);
        }
	nodeList.add(ptimespanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new49() /* reduce ADurationToTimespanLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PTimespanLiteral ptimespanliteralNode1;
        {
            // Block
        PDurationLiteral pdurationliteralNode2;
        TDatetime tdatetimeNode3;
        pdurationliteralNode2 = (PDurationLiteral)nodeArrayList1.get(0);
        tdatetimeNode3 = (TDatetime)nodeArrayList3.get(0);

        ptimespanliteralNode1 = new ADurationToTimespanLiteral(pdurationliteralNode2, tdatetimeNode3);
        }
	nodeList.add(ptimespanliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new50() /* reduce APointGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktPointLiteral twktpointliteralNode2;
        twktpointliteralNode2 = (TWktPointLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new APointGeometryLiteral(twktpointliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new51() /* reduce ALineStringGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktLineStringLiteral twktlinestringliteralNode2;
        twktlinestringliteralNode2 = (TWktLineStringLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new ALineStringGeometryLiteral(twktlinestringliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new52() /* reduce APolygonGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktPolygonLiteral twktpolygonliteralNode2;
        twktpolygonliteralNode2 = (TWktPolygonLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new APolygonGeometryLiteral(twktpolygonliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new53() /* reduce AMultiPointLiteralGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktMultiPointLiteral twktmultipointliteralNode2;
        twktmultipointliteralNode2 = (TWktMultiPointLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new AMultiPointGeometryLiteral(twktmultipointliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new54() /* reduce AMultiLineStringLiteralGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktMultiLineStringLiteral twktmultilinestringliteralNode2;
        twktmultilinestringliteralNode2 = (TWktMultiLineStringLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new AMultiLineStringGeometryLiteral(twktmultilinestringliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new55() /* reduce AMultiPolygonLiteralGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktMultiPolygonLiteral twktmultipolygonliteralNode2;
        twktmultipolygonliteralNode2 = (TWktMultiPolygonLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new AMultiPolygonGeometryLiteral(twktmultipolygonliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new56() /* reduce AGeometryCollectionLiteralGeometryLiteral */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PGeometryLiteral pgeometryliteralNode1;
        {
            // Block
        TWktGeometryCollectionLiteral twktgeometrycollectionliteralNode2;
        twktgeometrycollectionliteralNode2 = (TWktGeometryCollectionLiteral)nodeArrayList1.get(0);

        pgeometryliteralNode1 = new AGeometryCollectionGeometryLiteral(twktgeometrycollectionliteralNode2);
        }
	nodeList.add(pgeometryliteralNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new57() /* reduce ASimpleAttributeAttributeName */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PAttr pattrNode1;
        {
            // Block
        TIdentifier tidentifierNode2;
        tidentifierNode2 = (TIdentifier)nodeArrayList1.get(0);

        pattrNode1 = new AIdAttr(tidentifierNode2);
        }
	nodeList.add(pattrNode1);
        return nodeList;
    }



    @SuppressWarnings("unchecked")
    ArrayList new58() /* reduce ACompoundAttributeAttributeName */
    {
        @SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();

        @SuppressWarnings("unused") ArrayList nodeArrayList3 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
        @SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
        PAttr pattrNode1;
        {
            // Block
        TIdentifier tidentifierNode2;
        PAttr pattrNode3;
        tidentifierNode2 = (TIdentifier)nodeArrayList1.get(0);
        pattrNode3 = (PAttr)nodeArrayList3.get(0);

        pattrNode1 = new ACompoundIdAttr(tidentifierNode2, pattrNode3);
        }
	nodeList.add(pattrNode1);
        return nodeList;
    }



    private static int[][][] actionTable;
/*      {
			{{-1, ERROR, 0}, {9, SHIFT, 1}, {20, SHIFT, 2}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, ERROR, 1}, {9, SHIFT, 1}, {20, SHIFT, 2}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, ERROR, 2}, {9, SHIFT, 1}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, ERROR, 3}, {9, SHIFT, 19}, },
			{{-1, REDUCE, 57}, {11, SHIFT, 20}, },
			{{-1, ERROR, 5}, {63, ACCEPT, -1}, },
			{{-1, REDUCE, 0}, {22, SHIFT, 21}, },
			{{-1, REDUCE, 1}, {21, SHIFT, 22}, },
			{{-1, REDUCE, 3}, },
			{{-1, REDUCE, 8}, },
			{{-1, REDUCE, 7}, },
			{{-1, REDUCE, 11}, },
			{{-1, REDUCE, 13}, },
			{{-1, REDUCE, 12}, },
			{{-1, REDUCE, 14}, },
			{{-1, REDUCE, 15}, },
			{{-1, ERROR, 16}, {14, SHIFT, 23}, {15, SHIFT, 24}, {16, SHIFT, 25}, {17, SHIFT, 26}, {18, SHIFT, 27}, {19, SHIFT, 28}, {20, SHIFT, 29}, {23, SHIFT, 30}, {24, SHIFT, 31}, {25, SHIFT, 32}, {26, SHIFT, 33}, {27, SHIFT, 34}, {28, SHIFT, 35}, {29, SHIFT, 36}, {30, SHIFT, 37}, {31, SHIFT, 38}, {32, SHIFT, 39}, },
			{{-1, ERROR, 17}, {10, SHIFT, 40}, },
			{{-1, REDUCE, 4}, },
			{{-1, ERROR, 19}, {52, SHIFT, 4}, },
			{{-1, ERROR, 20}, {52, SHIFT, 4}, },
			{{-1, ERROR, 21}, {9, SHIFT, 1}, {20, SHIFT, 2}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, ERROR, 22}, {9, SHIFT, 1}, {20, SHIFT, 44}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, ERROR, 23}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 24}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 25}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 26}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 27}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 28}, {45, SHIFT, 46}, {46, SHIFT, 47}, {47, SHIFT, 48}, {49, SHIFT, 49}, {51, SHIFT, 50}, {56, SHIFT, 51}, },
			{{-1, ERROR, 29}, {23, SHIFT, 63}, {24, SHIFT, 64}, },
			{{-1, ERROR, 30}, {51, SHIFT, 50}, },
			{{-1, ERROR, 31}, {51, SHIFT, 50}, },
			{{-1, REDUCE, 28}, },
			{{-1, REDUCE, 29}, },
			{{-1, ERROR, 34}, {56, SHIFT, 51}, },
			{{-1, ERROR, 35}, {54, SHIFT, 68}, {56, SHIFT, 69}, },
			{{-1, ERROR, 36}, {54, SHIFT, 68}, {56, SHIFT, 69}, },
			{{-1, ERROR, 37}, {54, SHIFT, 68}, {56, SHIFT, 69}, },
			{{-1, ERROR, 38}, {56, SHIFT, 51}, },
			{{-1, ERROR, 39}, {33, SHIFT, 75}, {48, SHIFT, 76}, },
			{{-1, REDUCE, 9}, },
			{{-1, ERROR, 41}, {13, SHIFT, 77}, },
			{{-1, REDUCE, 58}, },
			{{-1, REDUCE, 2}, {21, SHIFT, 22}, },
			{{-1, ERROR, 44}, {9, SHIFT, 1}, {34, SHIFT, 3}, {52, SHIFT, 4}, },
			{{-1, REDUCE, 5}, },
			{{-1, REDUCE, 42}, },
			{{-1, REDUCE, 43}, },
			{{-1, REDUCE, 44}, },
			{{-1, REDUCE, 40}, },
			{{-1, REDUCE, 41}, },
			{{-1, REDUCE, 45}, },
			{{-1, REDUCE, 18}, },
			{{-1, REDUCE, 36}, },
			{{-1, REDUCE, 35}, },
			{{-1, REDUCE, 37}, },
			{{-1, REDUCE, 39}, },
			{{-1, REDUCE, 38}, },
			{{-1, REDUCE, 16}, },
			{{-1, REDUCE, 19}, },
			{{-1, REDUCE, 17}, },
			{{-1, REDUCE, 21}, },
			{{-1, REDUCE, 20}, },
			{{-1, ERROR, 63}, {51, SHIFT, 50}, },
			{{-1, ERROR, 64}, {51, SHIFT, 50}, },
			{{-1, REDUCE, 24}, },
			{{-1, REDUCE, 26}, },
			{{-1, REDUCE, 30}, },
			{{-1, ERROR, 68}, {50, SHIFT, 81}, },
			{{-1, ERROR, 69}, {55, SHIFT, 82}, },
			{{-1, ERROR, 70}, {55, SHIFT, 83}, },
			{{-1, REDUCE, 33}, },
			{{-1, REDUCE, 32}, },
			{{-1, REDUCE, 34}, },
			{{-1, REDUCE, 31}, },
			{{-1, ERROR, 75}, {48, SHIFT, 84}, },
			{{-1, REDUCE, 22}, },
			{{-1, ERROR, 77}, {0, SHIFT, 85}, {1, SHIFT, 86}, {2, SHIFT, 87}, {3, SHIFT, 88}, {4, SHIFT, 89}, {5, SHIFT, 90}, {6, SHIFT, 91}, },
			{{-1, REDUCE, 6}, },
			{{-1, REDUCE, 25}, },
			{{-1, REDUCE, 27}, },
			{{-1, ERROR, 81}, {59, SHIFT, 93}, },
			{{-1, ERROR, 82}, {54, SHIFT, 68}, {56, SHIFT, 94}, },
			{{-1, ERROR, 83}, {56, SHIFT, 96}, },
			{{-1, REDUCE, 23}, },
			{{-1, REDUCE, 50}, },
			{{-1, REDUCE, 51}, },
			{{-1, REDUCE, 52}, },
			{{-1, REDUCE, 53}, },
			{{-1, REDUCE, 54}, },
			{{-1, REDUCE, 55}, },
			{{-1, REDUCE, 56}, },
			{{-1, ERROR, 92}, {10, SHIFT, 97}, },
			{{-1, ERROR, 93}, {50, SHIFT, 98}, },
			{{-1, REDUCE, 47}, },
			{{-1, REDUCE, 48}, },
			{{-1, REDUCE, 49}, },
			{{-1, REDUCE, 10}, },
			{{-1, ERROR, 98}, {58, SHIFT, 99}, },
			{{-1, ERROR, 99}, {50, SHIFT, 100}, },
			{{-1, ERROR, 100}, {57, SHIFT, 101}, },
			{{-1, ERROR, 101}, {50, SHIFT, 102}, },
			{{-1, ERROR, 102}, {62, SHIFT, 103}, },
			{{-1, ERROR, 103}, {50, SHIFT, 104}, },
			{{-1, ERROR, 104}, {61, SHIFT, 105}, },
			{{-1, ERROR, 105}, {50, SHIFT, 106}, },
			{{-1, ERROR, 106}, {60, SHIFT, 107}, },
			{{-1, REDUCE, 46}, },
        };*/
    private static int[][][] gotoTable;
/*      {
			{{-1, 5}, {1, 17}, },
			{{-1, 6}, },
			{{-1, 7}, {21, 43}, },
			{{-1, 8}, {2, 18}, {22, 45}, {44, 78}, },
			{{-1, 9}, },
			{{-1, 10}, },
			{{-1, 11}, },
			{{-1, 12}, },
			{{-1, 13}, },
			{{-1, 14}, },
			{{-1, 15}, },
			{{-1, 52}, {24, 58}, {25, 59}, {26, 60}, {27, 61}, {28, 62}, },
			{{-1, 53}, },
			{{-1, 54}, },
			{{-1, 55}, {30, 65}, {31, 66}, {63, 79}, {64, 80}, },
			{{-1, 56}, },
			{{-1, 57}, {34, 67}, {38, 74}, },
			{{-1, 70}, {82, 95}, },
			{{-1, 71}, {36, 72}, {37, 73}, },
			{{-1, 92}, },
			{{-1, 16}, {19, 41}, {20, 42}, },
        };*/
    private static String[] errorMessages;
/*      {
			"expecting: '(', boolean not operator, geo equals operator, identifier",
			"expecting: '(', geo equals operator, identifier",
			"expecting: '('",
			"expecting: '.', comma, '<', '=', '>', '<>', '>=', '<=', boolean not operator, text like operator, text ilike operator, exists operator, doesnotexist operator, temporal before operator, temporal beforeorduring operator, temporal during operator, temporal duringorafter operator, temporal after operator, null is operator",
			"expecting: EOF",
			"expecting: ')', boolean or operator, EOF",
			"expecting: ')', boolean and operator, boolean or operator, EOF",
			"expecting: '<', '=', '>', '<>', '>=', '<=', boolean not operator, text like operator, text ilike operator, exists operator, doesnotexist operator, temporal before operator, temporal beforeorduring operator, temporal during operator, temporal duringorafter operator, temporal after operator, null is operator",
			"expecting: ')'",
			"expecting: identifier",
			"expecting: boolean true, boolean false, boolean unknown, signed numeric literal, character string literal, datetime",
			"expecting: text like operator, text ilike operator",
			"expecting: character string literal",
			"expecting: datetime",
			"expecting: duration symbol, datetime",
			"expecting: null not operator, null constant",
			"expecting: comma",
			"expecting: comma, '<', '=', '>', '<>', '>=', '<=', boolean not operator, text like operator, text ilike operator, exists operator, doesnotexist operator, temporal before operator, temporal beforeorduring operator, temporal during operator, temporal duringorafter operator, temporal after operator, null is operator",
			"expecting: unsigned integer",
			"expecting: time span separator",
			"expecting: null constant",
			"expecting: wkt point literal, wkt line string literal, wkt polygon literal, wkt multi point literal, wkt multi line string literal, wkt multi polygon literal, wkt geometry collection literal",
			"expecting: 'Y'",
			"expecting: 'M'",
			"expecting: 'D'",
			"expecting: 'H'",
			"expecting: 'S'",
			"expecting: ')', boolean and operator, boolean or operator, time span separator, EOF",
        };*/
    private static int[] errors;
/*      {
			0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 6, 9, 9, 0, 0, 10, 10, 10, 10, 10, 10, 11, 12, 12, 6, 6, 13, 14, 14, 14, 13, 15, 6, 16, 17, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 12, 12, 6, 6, 6, 18, 19, 19, 6, 6, 6, 6, 20, 6, 21, 6, 6, 6, 22, 14, 13, 6, 8, 8, 8, 8, 8, 8, 8, 8, 18, 6, 6, 6, 6, 23, 18, 24, 18, 25, 18, 23, 18, 26, 27, 
        };*/

    static 
    {
        try
        {
            DataInputStream s = new DataInputStream(
                new BufferedInputStream(
                Parser.class.getResourceAsStream("parser.dat")));

            // read actionTable
            int length = s.readInt();
            Parser.actionTable = new int[length][][];
            for(int i = 0; i < Parser.actionTable.length; i++)
            {
                length = s.readInt();
                Parser.actionTable[i] = new int[length][3];
                for(int j = 0; j < Parser.actionTable[i].length; j++)
                {
                for(int k = 0; k < 3; k++)
                {
                    Parser.actionTable[i][j][k] = s.readInt();
                }
                }
            }

            // read gotoTable
            length = s.readInt();
            gotoTable = new int[length][][];
            for(int i = 0; i < gotoTable.length; i++)
            {
                length = s.readInt();
                gotoTable[i] = new int[length][2];
                for(int j = 0; j < gotoTable[i].length; j++)
                {
                for(int k = 0; k < 2; k++)
                {
                    gotoTable[i][j][k] = s.readInt();
                }
                }
            }

            // read errorMessages
            length = s.readInt();
            errorMessages = new String[length];
            for(int i = 0; i < errorMessages.length; i++)
            {
                length = s.readInt();
                StringBuffer buffer = new StringBuffer();

                for(int j = 0; j < length; j++)
                {
                buffer.append(s.readChar());
                }
                errorMessages[i] = buffer.toString();
            }

            // read errors
            length = s.readInt();
            errors = new int[length];
            for(int i = 0; i < errors.length; i++)
            {
                errors[i] = s.readInt();
            }

            s.close();
        }
        catch(Exception e)
        {
            throw new RuntimeException("The file \"parser.dat\" is either missing or corrupted.");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy