/* Generated By:JJTree&JavaCC: Do not edit this line. ExpressionParser.java */
package com.tibbo.aggregate.common.expression.parser;

public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeConstants, ExpressionParserConstants {/*@bgen(jjtree)*/
  protected JJTExpressionParserState jjtree = new JJTExpressionParserState();

  String skip_to_matching_brace() throws ParseException {
      String res = "";
      Token tok;
      int nesting = 1;
      while (true) {
        tok = getToken(1);
        if (tok.kind == EOF) break;
        if (tok.kind == LBRACE) nesting++;
        if (tok.kind == RBRACE) {
          nesting--;
          if (nesting == 0) break;
        }
        if (tok.kind == STRING_LITERAL) {
          res += tok.image.replace("\u005c\u005c\u005c\u005c", "\u005c\u005c");
        }
        else
        {
          res += tok.image;
        }
        tok = getNextToken();
      }

      return res;
  }

  final public ASTStart Start() throws ParseException {
                           /*@bgen(jjtree) Start */
  ASTStart jjtn000 = new ASTStart(JJTSTART);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case NOT:
      case BITWISE_NOT:
      case TRUE:
      case FALSE:
      case NULL:
      case INTEGER_LITERAL:
      case FLOATING_POINT_LITERAL:
      case STRING_LITERAL:
      case MINUS:
      case LBRAKET:
      case LBRACE:
      case IDENTIFIER:
        Expression();
        break;
      default:
        jj_la1[0] = jj_gen;
        ;
      }
      jj_consume_token(0);
    jjtree.closeNodeScope(jjtn000, true);
    jjtc000 = false;
    jjtn000.jjtSetLastToken(getToken(0));
    {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
    throw new Error("Missing return statement in function");
  }

  final public void Expression() throws ParseException {
    ConditionalExpression();
  }

  final public void ConditionalExpression() throws ParseException {
    LogicalOrExpression();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case QUESTION:
      jj_consume_token(QUESTION);
      LogicalOrExpression();
      jj_consume_token(COLON);
                                                                     ASTConditionalNode jjtn001 = new ASTConditionalNode(JJTCONDITIONALNODE);
                                                                     boolean jjtc001 = true;
                                                                     jjtree.openNodeScope(jjtn001);
                                                                     jjtn001.jjtSetFirstToken(getToken(1));
      try {
        ConditionalExpression();
      } catch (Throwable jjte001) {
                                                                     if (jjtc001) {
                                                                       jjtree.clearNodeScope(jjtn001);
                                                                       jjtc001 = false;
                                                                     } else {
                                                                       jjtree.popNode();
                                                                     }
                                                                     if (jjte001 instanceof RuntimeException) {
                                                                       {if (true) throw (RuntimeException)jjte001;}
                                                                     }
                                                                     if (jjte001 instanceof ParseException) {
                                                                       {if (true) throw (ParseException)jjte001;}
                                                                     }
                                                                     {if (true) throw (Error)jjte001;}
      } finally {
                                                                     if (jjtc001) {
                                                                       jjtree.closeNodeScope(jjtn001,  3);
                                                                       jjtn001.jjtSetLastToken(getToken(0));
                                                                     }
      }
      break;
    default:
      jj_la1[1] = jj_gen;
      ;
    }
  }

  final public void LogicalOrExpression() throws ParseException {
    LogicalAndExpression();
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case OR:
        ;
        break;
      default:
        jj_la1[2] = jj_gen;
        break label_1;
      }
      jj_consume_token(OR);
                                  ASTLogicalOrNode jjtn001 = new ASTLogicalOrNode(JJTLOGICALORNODE);
                                  boolean jjtc001 = true;
                                  jjtree.openNodeScope(jjtn001);
                                  jjtn001.jjtSetFirstToken(getToken(1));
      try {
        LogicalAndExpression();
      } catch (Throwable jjte001) {
                                  if (jjtc001) {
                                    jjtree.clearNodeScope(jjtn001);
                                    jjtc001 = false;
                                  } else {
                                    jjtree.popNode();
                                  }
                                  if (jjte001 instanceof RuntimeException) {
                                    {if (true) throw (RuntimeException)jjte001;}
                                  }
                                  if (jjte001 instanceof ParseException) {
                                    {if (true) throw (ParseException)jjte001;}
                                  }
                                  {if (true) throw (Error)jjte001;}
      } finally {
                                  if (jjtc001) {
                                    jjtree.closeNodeScope(jjtn001,  2);
                                    jjtn001.jjtSetLastToken(getToken(0));
                                  }
      }
    }
  }

  final public void LogicalAndExpression() throws ParseException {
    BitwiseOrExpression();
    label_2:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case AND:
        ;
        break;
      default:
        jj_la1[3] = jj_gen;
        break label_2;
      }
      jj_consume_token(AND);
                                  ASTLogicalAndNode jjtn001 = new ASTLogicalAndNode(JJTLOGICALANDNODE);
                                  boolean jjtc001 = true;
                                  jjtree.openNodeScope(jjtn001);
                                  jjtn001.jjtSetFirstToken(getToken(1));
      try {
        BitwiseOrExpression();
      } catch (Throwable jjte001) {
                                  if (jjtc001) {
                                    jjtree.clearNodeScope(jjtn001);
                                    jjtc001 = false;
                                  } else {
                                    jjtree.popNode();
                                  }
                                  if (jjte001 instanceof RuntimeException) {
                                    {if (true) throw (RuntimeException)jjte001;}
                                  }
                                  if (jjte001 instanceof ParseException) {
                                    {if (true) throw (ParseException)jjte001;}
                                  }
                                  {if (true) throw (Error)jjte001;}
      } finally {
                                  if (jjtc001) {
                                    jjtree.closeNodeScope(jjtn001,  2);
                                    jjtn001.jjtSetLastToken(getToken(0));
                                  }
      }
    }
  }

  final public void BitwiseOrExpression() throws ParseException {
    BitwiseXorExpression();
    label_3:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case BITWISE_OR:
        ;
        break;
      default:
        jj_la1[4] = jj_gen;
        break label_3;
      }
      jj_consume_token(BITWISE_OR);
                                          ASTBitwiseOrNode jjtn001 = new ASTBitwiseOrNode(JJTBITWISEORNODE);
                                          boolean jjtc001 = true;
                                          jjtree.openNodeScope(jjtn001);
                                          jjtn001.jjtSetFirstToken(getToken(1));
      try {
        BitwiseXorExpression();
      } catch (Throwable jjte001) {
                                          if (jjtc001) {
                                            jjtree.clearNodeScope(jjtn001);
                                            jjtc001 = false;
                                          } else {
                                            jjtree.popNode();
                                          }
                                          if (jjte001 instanceof RuntimeException) {
                                            {if (true) throw (RuntimeException)jjte001;}
                                          }
                                          if (jjte001 instanceof ParseException) {
                                            {if (true) throw (ParseException)jjte001;}
                                          }
                                          {if (true) throw (Error)jjte001;}
      } finally {
                                          if (jjtc001) {
                                            jjtree.closeNodeScope(jjtn001,  2);
                                            jjtn001.jjtSetLastToken(getToken(0));
                                          }
      }
    }
  }

  final public void BitwiseXorExpression() throws ParseException {
    BitwiseAndExpression();
    label_4:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case BITWISE_XOR:
        ;
        break;
      default:
        jj_la1[5] = jj_gen;
        break label_4;
      }
      jj_consume_token(BITWISE_XOR);
                                           ASTBitwiseXorNode jjtn001 = new ASTBitwiseXorNode(JJTBITWISEXORNODE);
                                           boolean jjtc001 = true;
                                           jjtree.openNodeScope(jjtn001);
                                           jjtn001.jjtSetFirstToken(getToken(1));
      try {
        BitwiseAndExpression();
      } catch (Throwable jjte001) {
                                           if (jjtc001) {
                                             jjtree.clearNodeScope(jjtn001);
                                             jjtc001 = false;
                                           } else {
                                             jjtree.popNode();
                                           }
                                           if (jjte001 instanceof RuntimeException) {
                                             {if (true) throw (RuntimeException)jjte001;}
                                           }
                                           if (jjte001 instanceof ParseException) {
                                             {if (true) throw (ParseException)jjte001;}
                                           }
                                           {if (true) throw (Error)jjte001;}
      } finally {
                                           if (jjtc001) {
                                             jjtree.closeNodeScope(jjtn001,  2);
                                             jjtn001.jjtSetLastToken(getToken(0));
                                           }
      }
    }
  }

  final public void BitwiseAndExpression() throws ParseException {
    EqualityExpression();
    label_5:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case BITWISE_AND:
        ;
        break;
      default:
        jj_la1[6] = jj_gen;
        break label_5;
      }
      jj_consume_token(BITWISE_AND);
                                         ASTBitwiseAndNode jjtn001 = new ASTBitwiseAndNode(JJTBITWISEANDNODE);
                                         boolean jjtc001 = true;
                                         jjtree.openNodeScope(jjtn001);
                                         jjtn001.jjtSetFirstToken(getToken(1));
      try {
        EqualityExpression();
      } catch (Throwable jjte001) {
                                         if (jjtc001) {
                                           jjtree.clearNodeScope(jjtn001);
                                           jjtc001 = false;
                                         } else {
                                           jjtree.popNode();
                                         }
                                         if (jjte001 instanceof RuntimeException) {
                                           {if (true) throw (RuntimeException)jjte001;}
                                         }
                                         if (jjte001 instanceof ParseException) {
                                           {if (true) throw (ParseException)jjte001;}
                                         }
                                         {if (true) throw (Error)jjte001;}
      } finally {
                                         if (jjtc001) {
                                           jjtree.closeNodeScope(jjtn001,  2);
                                           jjtn001.jjtSetLastToken(getToken(0));
                                         }
      }
    }
  }

  final public void EqualityExpression() throws ParseException {
    RelationalExpression();
    label_6:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case EQ:
      case NE:
      case MATCH:
        ;
        break;
      default:
        jj_la1[7] = jj_gen;
        break label_6;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case EQ:
        jj_consume_token(EQ);
            ASTEQNode jjtn001 = new ASTEQNode(JJTEQNODE);
            boolean jjtc001 = true;
            jjtree.openNodeScope(jjtn001);
            jjtn001.jjtSetFirstToken(getToken(1));
        try {
          RelationalExpression();
        } catch (Throwable jjte001) {
            if (jjtc001) {
              jjtree.clearNodeScope(jjtn001);
              jjtc001 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte001 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte001;}
            }
            if (jjte001 instanceof ParseException) {
              {if (true) throw (ParseException)jjte001;}
            }
            {if (true) throw (Error)jjte001;}
        } finally {
            if (jjtc001) {
              jjtree.closeNodeScope(jjtn001,  2);
              jjtn001.jjtSetLastToken(getToken(0));
            }
        }
        break;
      case NE:
        jj_consume_token(NE);
            ASTNENode jjtn002 = new ASTNENode(JJTNENODE);
            boolean jjtc002 = true;
            jjtree.openNodeScope(jjtn002);
            jjtn002.jjtSetFirstToken(getToken(1));
        try {
          RelationalExpression();
        } catch (Throwable jjte002) {
            if (jjtc002) {
              jjtree.clearNodeScope(jjtn002);
              jjtc002 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte002 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte002;}
            }
            if (jjte002 instanceof ParseException) {
              {if (true) throw (ParseException)jjte002;}
            }
            {if (true) throw (Error)jjte002;}
        } finally {
            if (jjtc002) {
              jjtree.closeNodeScope(jjtn002,  2);
              jjtn002.jjtSetLastToken(getToken(0));
            }
        }
        break;
      case MATCH:
        jj_consume_token(MATCH);
               ASTRegexMatchNode jjtn003 = new ASTRegexMatchNode(JJTREGEXMATCHNODE);
               boolean jjtc003 = true;
               jjtree.openNodeScope(jjtn003);
               jjtn003.jjtSetFirstToken(getToken(1));
        try {
          RelationalExpression();
        } catch (Throwable jjte003) {
               if (jjtc003) {
                 jjtree.clearNodeScope(jjtn003);
                 jjtc003 = false;
               } else {
                 jjtree.popNode();
               }
               if (jjte003 instanceof RuntimeException) {
                 {if (true) throw (RuntimeException)jjte003;}
               }
               if (jjte003 instanceof ParseException) {
                 {if (true) throw (ParseException)jjte003;}
               }
               {if (true) throw (Error)jjte003;}
        } finally {
               if (jjtc003) {
                 jjtree.closeNodeScope(jjtn003,  2);
                 jjtn003.jjtSetLastToken(getToken(0));
               }
        }
        break;
      default:
        jj_la1[8] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public void RelationalExpression() throws ParseException {
    ShiftExpression();
    label_7:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LT:
      case GT:
      case LTE:
      case GTE:
        ;
        break;
      default:
        jj_la1[9] = jj_gen;
        break label_7;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LT:
        jj_consume_token(LT);
           ASTLTNode jjtn001 = new ASTLTNode(JJTLTNODE);
           boolean jjtc001 = true;
           jjtree.openNodeScope(jjtn001);
           jjtn001.jjtSetFirstToken(getToken(1));
        try {
          ShiftExpression();
        } catch (Throwable jjte001) {
           if (jjtc001) {
             jjtree.clearNodeScope(jjtn001);
             jjtc001 = false;
           } else {
             jjtree.popNode();
           }
           if (jjte001 instanceof RuntimeException) {
             {if (true) throw (RuntimeException)jjte001;}
           }
           if (jjte001 instanceof ParseException) {
             {if (true) throw (ParseException)jjte001;}
           }
           {if (true) throw (Error)jjte001;}
        } finally {
           if (jjtc001) {
             jjtree.closeNodeScope(jjtn001,  2);
             jjtn001.jjtSetLastToken(getToken(0));
           }
        }
        break;
      case GT:
        jj_consume_token(GT);
           ASTGTNode jjtn002 = new ASTGTNode(JJTGTNODE);
           boolean jjtc002 = true;
           jjtree.openNodeScope(jjtn002);
           jjtn002.jjtSetFirstToken(getToken(1));
        try {
          ShiftExpression();
        } catch (Throwable jjte002) {
           if (jjtc002) {
             jjtree.clearNodeScope(jjtn002);
             jjtc002 = false;
           } else {
             jjtree.popNode();
           }
           if (jjte002 instanceof RuntimeException) {
             {if (true) throw (RuntimeException)jjte002;}
           }
           if (jjte002 instanceof ParseException) {
             {if (true) throw (ParseException)jjte002;}
           }
           {if (true) throw (Error)jjte002;}
        } finally {
           if (jjtc002) {
             jjtree.closeNodeScope(jjtn002,  2);
             jjtn002.jjtSetLastToken(getToken(0));
           }
        }
        break;
      case LTE:
        jj_consume_token(LTE);
            ASTLENode jjtn003 = new ASTLENode(JJTLENODE);
            boolean jjtc003 = true;
            jjtree.openNodeScope(jjtn003);
            jjtn003.jjtSetFirstToken(getToken(1));
        try {
          ShiftExpression();
        } catch (Throwable jjte003) {
            if (jjtc003) {
              jjtree.clearNodeScope(jjtn003);
              jjtc003 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte003 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte003;}
            }
            if (jjte003 instanceof ParseException) {
              {if (true) throw (ParseException)jjte003;}
            }
            {if (true) throw (Error)jjte003;}
        } finally {
            if (jjtc003) {
              jjtree.closeNodeScope(jjtn003,  2);
              jjtn003.jjtSetLastToken(getToken(0));
            }
        }
        break;
      case GTE:
        jj_consume_token(GTE);
            ASTGENode jjtn004 = new ASTGENode(JJTGENODE);
            boolean jjtc004 = true;
            jjtree.openNodeScope(jjtn004);
            jjtn004.jjtSetFirstToken(getToken(1));
        try {
          ShiftExpression();
        } catch (Throwable jjte004) {
            if (jjtc004) {
              jjtree.clearNodeScope(jjtn004);
              jjtc004 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte004 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte004;}
            }
            if (jjte004 instanceof ParseException) {
              {if (true) throw (ParseException)jjte004;}
            }
            {if (true) throw (Error)jjte004;}
        } finally {
            if (jjtc004) {
              jjtree.closeNodeScope(jjtn004,  2);
              jjtn004.jjtSetLastToken(getToken(0));
            }
        }
        break;
      default:
        jj_la1[10] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public void ShiftExpression() throws ParseException {
    AdditiveExpression();
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case RIGHT_SHIFT:
      case URIGHT_SHIFT:
      case LEFT_SHIFT:
        ;
        break;
      default:
        jj_la1[11] = jj_gen;
        break label_8;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case RIGHT_SHIFT:
        jj_consume_token(RIGHT_SHIFT);
                    ASTRightShiftNode jjtn001 = new ASTRightShiftNode(JJTRIGHTSHIFTNODE);
                    boolean jjtc001 = true;
                    jjtree.openNodeScope(jjtn001);
                    jjtn001.jjtSetFirstToken(getToken(1));
        try {
          AdditiveExpression();
        } catch (Throwable jjte001) {
                    if (jjtc001) {
                      jjtree.clearNodeScope(jjtn001);
                      jjtc001 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte001 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte001;}
                    }
                    if (jjte001 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte001;}
                    }
                    {if (true) throw (Error)jjte001;}
        } finally {
                    if (jjtc001) {
                      jjtree.closeNodeScope(jjtn001,  2);
                      jjtn001.jjtSetLastToken(getToken(0));
                    }
        }
        break;
      case URIGHT_SHIFT:
        jj_consume_token(URIGHT_SHIFT);
                     ASTUnsignedRightShiftNode jjtn002 = new ASTUnsignedRightShiftNode(JJTUNSIGNEDRIGHTSHIFTNODE);
                     boolean jjtc002 = true;
                     jjtree.openNodeScope(jjtn002);
                     jjtn002.jjtSetFirstToken(getToken(1));
        try {
          AdditiveExpression();
        } catch (Throwable jjte002) {
                     if (jjtc002) {
                       jjtree.clearNodeScope(jjtn002);
                       jjtc002 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte002 instanceof RuntimeException) {
                       {if (true) throw (RuntimeException)jjte002;}
                     }
                     if (jjte002 instanceof ParseException) {
                       {if (true) throw (ParseException)jjte002;}
                     }
                     {if (true) throw (Error)jjte002;}
        } finally {
                     if (jjtc002) {
                       jjtree.closeNodeScope(jjtn002,  2);
                       jjtn002.jjtSetLastToken(getToken(0));
                     }
        }
        break;
      case LEFT_SHIFT:
        jj_consume_token(LEFT_SHIFT);
                   ASTLeftShiftNode jjtn003 = new ASTLeftShiftNode(JJTLEFTSHIFTNODE);
                   boolean jjtc003 = true;
                   jjtree.openNodeScope(jjtn003);
                   jjtn003.jjtSetFirstToken(getToken(1));
        try {
          AdditiveExpression();
        } catch (Throwable jjte003) {
                   if (jjtc003) {
                     jjtree.clearNodeScope(jjtn003);
                     jjtc003 = false;
                   } else {
                     jjtree.popNode();
                   }
                   if (jjte003 instanceof RuntimeException) {
                     {if (true) throw (RuntimeException)jjte003;}
                   }
                   if (jjte003 instanceof ParseException) {
                     {if (true) throw (ParseException)jjte003;}
                   }
                   {if (true) throw (Error)jjte003;}
        } finally {
                   if (jjtc003) {
                     jjtree.closeNodeScope(jjtn003,  2);
                     jjtn003.jjtSetLastToken(getToken(0));
                   }
        }
        break;
      default:
        jj_la1[12] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public void AdditiveExpression() throws ParseException {
    MultiplicativeExpression();
    label_9:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
      case MINUS:
        ;
        break;
      default:
        jj_la1[13] = jj_gen;
        break label_9;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
        jj_consume_token(PLUS);
             ASTAddNode jjtn001 = new ASTAddNode(JJTADDNODE);
             boolean jjtc001 = true;
             jjtree.openNodeScope(jjtn001);
             jjtn001.jjtSetFirstToken(getToken(1));
        try {
          MultiplicativeExpression();
        } catch (Throwable jjte001) {
             if (jjtc001) {
               jjtree.clearNodeScope(jjtn001);
               jjtc001 = false;
             } else {
               jjtree.popNode();
             }
             if (jjte001 instanceof RuntimeException) {
               {if (true) throw (RuntimeException)jjte001;}
             }
             if (jjte001 instanceof ParseException) {
               {if (true) throw (ParseException)jjte001;}
             }
             {if (true) throw (Error)jjte001;}
        } finally {
             if (jjtc001) {
               jjtree.closeNodeScope(jjtn001,  2);
               jjtn001.jjtSetLastToken(getToken(0));
             }
        }
        break;
      case MINUS:
        jj_consume_token(MINUS);
              ASTSubtractNode jjtn002 = new ASTSubtractNode(JJTSUBTRACTNODE);
              boolean jjtc002 = true;
              jjtree.openNodeScope(jjtn002);
              jjtn002.jjtSetFirstToken(getToken(1));
        try {
          MultiplicativeExpression();
        } catch (Throwable jjte002) {
              if (jjtc002) {
                jjtree.clearNodeScope(jjtn002);
                jjtc002 = false;
              } else {
                jjtree.popNode();
              }
              if (jjte002 instanceof RuntimeException) {
                {if (true) throw (RuntimeException)jjte002;}
              }
              if (jjte002 instanceof ParseException) {
                {if (true) throw (ParseException)jjte002;}
              }
              {if (true) throw (Error)jjte002;}
        } finally {
              if (jjtc002) {
                jjtree.closeNodeScope(jjtn002,  2);
                jjtn002.jjtSetLastToken(getToken(0));
              }
        }
        break;
      default:
        jj_la1[14] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public void MultiplicativeExpression() throws ParseException {
    UnaryExpression();
    label_10:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MUL:
      case DIV:
      case MOD:
        ;
        break;
      default:
        jj_la1[15] = jj_gen;
        break label_10;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MUL:
        jj_consume_token(MUL);
            ASTMulNode jjtn001 = new ASTMulNode(JJTMULNODE);
            boolean jjtc001 = true;
            jjtree.openNodeScope(jjtn001);
            jjtn001.jjtSetFirstToken(getToken(1));
        try {
          UnaryExpression();
        } catch (Throwable jjte001) {
            if (jjtc001) {
              jjtree.clearNodeScope(jjtn001);
              jjtc001 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte001 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte001;}
            }
            if (jjte001 instanceof ParseException) {
              {if (true) throw (ParseException)jjte001;}
            }
            {if (true) throw (Error)jjte001;}
        } finally {
            if (jjtc001) {
              jjtree.closeNodeScope(jjtn001,  2);
              jjtn001.jjtSetLastToken(getToken(0));
            }
        }
        break;
      case DIV:
        jj_consume_token(DIV);
            ASTDivNode jjtn002 = new ASTDivNode(JJTDIVNODE);
            boolean jjtc002 = true;
            jjtree.openNodeScope(jjtn002);
            jjtn002.jjtSetFirstToken(getToken(1));
        try {
          UnaryExpression();
        } catch (Throwable jjte002) {
            if (jjtc002) {
              jjtree.clearNodeScope(jjtn002);
              jjtc002 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte002 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte002;}
            }
            if (jjte002 instanceof ParseException) {
              {if (true) throw (ParseException)jjte002;}
            }
            {if (true) throw (Error)jjte002;}
        } finally {
            if (jjtc002) {
              jjtree.closeNodeScope(jjtn002,  2);
              jjtn002.jjtSetLastToken(getToken(0));
            }
        }
        break;
      case MOD:
        jj_consume_token(MOD);
            ASTModNode jjtn003 = new ASTModNode(JJTMODNODE);
            boolean jjtc003 = true;
            jjtree.openNodeScope(jjtn003);
            jjtn003.jjtSetFirstToken(getToken(1));
        try {
          UnaryExpression();
        } catch (Throwable jjte003) {
            if (jjtc003) {
              jjtree.clearNodeScope(jjtn003);
              jjtc003 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte003 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte003;}
            }
            if (jjte003 instanceof ParseException) {
              {if (true) throw (ParseException)jjte003;}
            }
            {if (true) throw (Error)jjte003;}
        } finally {
            if (jjtc003) {
              jjtree.closeNodeScope(jjtn003,  2);
              jjtn003.jjtSetLastToken(getToken(0));
            }
        }
        break;
      default:
        jj_la1[16] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public void UnaryExpression() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case MINUS:
      jj_consume_token(MINUS);
            ASTUnaryNode jjtn001 = new ASTUnaryNode(JJTUNARYNODE);
            boolean jjtc001 = true;
            jjtree.openNodeScope(jjtn001);
            jjtn001.jjtSetFirstToken(getToken(1));
      try {
        LogicalNotExpression();
      } catch (Throwable jjte001) {
            if (jjtc001) {
              jjtree.clearNodeScope(jjtn001);
              jjtc001 = false;
            } else {
              jjtree.popNode();
            }
            if (jjte001 instanceof RuntimeException) {
              {if (true) throw (RuntimeException)jjte001;}
            }
            if (jjte001 instanceof ParseException) {
              {if (true) throw (ParseException)jjte001;}
            }
            {if (true) throw (Error)jjte001;}
      } finally {
            if (jjtc001) {
              jjtree.closeNodeScope(jjtn001,  1);
              jjtn001.jjtSetLastToken(getToken(0));
            }
      }
      break;
    case NOT:
    case BITWISE_NOT:
    case TRUE:
    case FALSE:
    case NULL:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case LBRAKET:
    case LBRACE:
    case IDENTIFIER:
      LogicalNotExpression();
      break;
    default:
      jj_la1[17] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void LogicalNotExpression() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case NOT:
      jj_consume_token(NOT);
          ASTLogicalNotNode jjtn001 = new ASTLogicalNotNode(JJTLOGICALNOTNODE);
          boolean jjtc001 = true;
          jjtree.openNodeScope(jjtn001);
          jjtn001.jjtSetFirstToken(getToken(1));
      try {
        LogicalNotExpression();
      } catch (Throwable jjte001) {
          if (jjtc001) {
            jjtree.clearNodeScope(jjtn001);
            jjtc001 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte001 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte001;}
          }
          if (jjte001 instanceof ParseException) {
            {if (true) throw (ParseException)jjte001;}
          }
          {if (true) throw (Error)jjte001;}
      } finally {
          if (jjtc001) {
            jjtree.closeNodeScope(jjtn001,  1);
            jjtn001.jjtSetLastToken(getToken(0));
          }
      }
      break;
    case BITWISE_NOT:
    case TRUE:
    case FALSE:
    case NULL:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case LBRAKET:
    case LBRACE:
    case IDENTIFIER:
      BitwiseNotExpression();
      break;
    default:
      jj_la1[18] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void BitwiseNotExpression() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case BITWISE_NOT:
      jj_consume_token(BITWISE_NOT);
                  ASTBitwiseNotNode jjtn001 = new ASTBitwiseNotNode(JJTBITWISENOTNODE);
                  boolean jjtc001 = true;
                  jjtree.openNodeScope(jjtn001);
                  jjtn001.jjtSetFirstToken(getToken(1));
      try {
        BitwiseNotExpression();
      } catch (Throwable jjte001) {
                  if (jjtc001) {
                    jjtree.clearNodeScope(jjtn001);
                    jjtc001 = false;
                  } else {
                    jjtree.popNode();
                  }
                  if (jjte001 instanceof RuntimeException) {
                    {if (true) throw (RuntimeException)jjte001;}
                  }
                  if (jjte001 instanceof ParseException) {
                    {if (true) throw (ParseException)jjte001;}
                  }
                  {if (true) throw (Error)jjte001;}
      } finally {
                  if (jjtc001) {
                    jjtree.closeNodeScope(jjtn001,  1);
                    jjtn001.jjtSetLastToken(getToken(0));
                  }
      }
      break;
    case TRUE:
    case FALSE:
    case NULL:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case LBRAKET:
    case LBRACE:
    case IDENTIFIER:
      PrimaryExpression();
      break;
    default:
      jj_la1[19] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void PrimaryExpression() throws ParseException {
   String name;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LBRACE:
      jj_consume_token(LBRACE);
      ValueReference();
      jj_consume_token(RBRACE);
      break;
    case TRUE:
    case FALSE:
    case NULL:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
      Literal();
      break;
    case IDENTIFIER:
      Function();
      break;
    case LBRAKET:
      jj_consume_token(LBRAKET);
      Expression();
      jj_consume_token(RBRAKET);
      break;
    default:
      jj_la1[20] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void Function() throws ParseException {
 /*@bgen(jjtree) FunctionNode */
   ASTFunctionNode jjtn000 = new ASTFunctionNode(JJTFUNCTIONNODE);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   jjtn000.jjtSetFirstToken(getToken(1));Token t;
    try {
      t = jj_consume_token(IDENTIFIER);
      Arguments();
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
      jjtn000.jjtSetLastToken(getToken(0));
       jjtn000.name = t.image;
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void Arguments() throws ParseException {
    jj_consume_token(LBRAKET);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case NOT:
    case BITWISE_NOT:
    case TRUE:
    case FALSE:
    case NULL:
    case INTEGER_LITERAL:
    case FLOATING_POINT_LITERAL:
    case STRING_LITERAL:
    case MINUS:
    case LBRAKET:
    case LBRACE:
    case IDENTIFIER:
      ArgumentList();
      break;
    default:
      jj_la1[21] = jj_gen;
      ;
    }
    jj_consume_token(RBRAKET);
  }

  final public void ArgumentList() throws ParseException {
    Expression();
    label_11:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case COMMA:
        ;
        break;
      default:
        jj_la1[22] = jj_gen;
        break label_11;
      }
      jj_consume_token(COMMA);
      Expression();
    }
  }

  final public void ValueReference() throws ParseException {
 /*@bgen(jjtree) ValueReferenceNode */
   ASTValueReferenceNode jjtn000 = new ASTValueReferenceNode(JJTVALUEREFERENCENODE);
   boolean jjtc000 = true;
   jjtree.openNodeScope(jjtn000);
   jjtn000.jjtSetFirstToken(getToken(1));Token t;
    try {
      jjtn000.uriImage = skip_to_matching_brace();
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void Literal() throws ParseException {
   Token t;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INTEGER_LITERAL:
   ASTLongConstNode jjtn001 = new ASTLongConstNode(JJTLONGCONSTNODE);
   boolean jjtc001 = true;
   jjtree.openNodeScope(jjtn001);
   jjtn001.jjtSetFirstToken(getToken(1));
      try {
        t = jj_consume_token(INTEGER_LITERAL);
      jjtree.closeNodeScope(jjtn001, true);
      jjtc001 = false;
      jjtn001.jjtSetLastToken(getToken(0));
       if (t.image.startsWith("0x") || t.image.startsWith("0X"))
       {
         jjtn001.val = Long.parseLong(t.image.substring(2, t.image.length()), 16);
       }
       else if (t.image.startsWith("0b") || t.image.startsWith("0B"))
       {
         jjtn001.val = Long.parseLong(t.image.substring(2, t.image.length()), 2);
       }
       else if (t.image.startsWith("0") && t.image.length() > 1)
       {
         jjtn001.val = Long.parseLong(t.image.substring(1, t.image.length()), 8);
       }
       else
       {
         jjtn001.val = Long.parseLong(t.image);
       }
      } finally {
   if (jjtc001) {
     jjtree.closeNodeScope(jjtn001, true);
     jjtn001.jjtSetLastToken(getToken(0));
   }
      }
      break;
    case FLOATING_POINT_LITERAL:
   ASTFloatConstNode jjtn002 = new ASTFloatConstNode(JJTFLOATCONSTNODE);
   boolean jjtc002 = true;
   jjtree.openNodeScope(jjtn002);
   jjtn002.jjtSetFirstToken(getToken(1));
      try {
        t = jj_consume_token(FLOATING_POINT_LITERAL);
      jjtree.closeNodeScope(jjtn002, true);
      jjtc002 = false;
      jjtn002.jjtSetLastToken(getToken(0));
       if (t.image.endsWith("f"))
       {
         jjtn002.floatVal = Float.parseFloat(t.image);
       }
       else
       {
         jjtn002.doubleVal = Double.parseDouble(t.image);
       }
      } finally {
   if (jjtc002) {
     jjtree.closeNodeScope(jjtn002, true);
     jjtn002.jjtSetLastToken(getToken(0));
   }
      }
      break;
    case STRING_LITERAL:
   ASTStringConstNode jjtn003 = new ASTStringConstNode(JJTSTRINGCONSTNODE);
   boolean jjtc003 = true;
   jjtree.openNodeScope(jjtn003);
   jjtn003.jjtSetFirstToken(getToken(1));
      try {
        t = jj_consume_token(STRING_LITERAL);
      jjtree.closeNodeScope(jjtn003, true);
      jjtc003 = false;
      jjtn003.jjtSetLastToken(getToken(0));
       jjtn003.val = t.image.substring(1, t.image.length() - 1);

       jjtn003.val = org.apache.commons.lang3.StringEscapeUtils.unescapeJava(jjtn003.val);
      } finally {
   if (jjtc003) {
     jjtree.closeNodeScope(jjtn003, true);
     jjtn003.jjtSetLastToken(getToken(0));
   }
      }
      break;
    case TRUE:
    case FALSE:
      BooleanLiteral();
      break;
    case NULL:
    ASTNullNode jjtn004 = new ASTNullNode(JJTNULLNODE);
    boolean jjtc004 = true;
    jjtree.openNodeScope(jjtn004);
    jjtn004.jjtSetFirstToken(getToken(1));
      try {
        jj_consume_token(NULL);
      } finally {
    if (jjtc004) {
      jjtree.closeNodeScope(jjtn004, true);
      jjtn004.jjtSetLastToken(getToken(0));
    }
      }
      break;
    default:
      jj_la1[23] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void BooleanLiteral() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case TRUE:
    ASTTrueNode jjtn001 = new ASTTrueNode(JJTTRUENODE);
    boolean jjtc001 = true;
    jjtree.openNodeScope(jjtn001);
    jjtn001.jjtSetFirstToken(getToken(1));
      try {
        jj_consume_token(TRUE);
      } finally {
    if (jjtc001) {
      jjtree.closeNodeScope(jjtn001, true);
      jjtn001.jjtSetLastToken(getToken(0));
    }
      }
      break;
    case FALSE:
    ASTFalseNode jjtn002 = new ASTFalseNode(JJTFALSENODE);
    boolean jjtc002 = true;
    jjtree.openNodeScope(jjtn002);
    jjtn002.jjtSetFirstToken(getToken(1));
      try {
        jj_consume_token(FALSE);
      } finally {
    if (jjtc002) {
      jjtree.closeNodeScope(jjtn002, true);
      jjtn002.jjtSetLastToken(getToken(0));
    }
      }
      break;
    default:
      jj_la1[24] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  /** Generated Token Manager. */
  public ExpressionParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  /** Current token. */
  public Token token;
  /** Next token. */
  public Token jj_nt;
  private int jj_ntk;
  private int jj_gen;
  final private int[] jj_la1 = new int[25];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
      jj_la1_init_0();
      jj_la1_init_1();
   }
   private static void jj_la1_init_0() {
      jj_la1_0 = new int[] {0x543e2000,0x0,0x800,0x1000,0x4000,0x8000,0x10000,0x0,0x0,0x0,0x0,0x0,0x0,0x60000000,0x60000000,0x80000000,0x80000000,0x543e2000,0x143e2000,0x143e0000,0x143c0000,0x543e2000,0x0,0x143c0000,0xc0000,};
   }
   private static void jj_la1_init_1() {
      jj_la1_1 = new int[] {0x85000,0x4,0x0,0x0,0x0,0x0,0x0,0xe0,0xe0,0xf00,0xf00,0x70000,0x70000,0x0,0x0,0x3,0x3,0x85000,0x85000,0x85000,0x85000,0x85000,0x10,0x0,0x0,};
   }

  /** Constructor with InputStream. */
  public ExpressionParser(java.io.InputStream stream) {
     this(stream, null);
  }
  /** Constructor with InputStream and supplied encoding */
  public ExpressionParser(java.io.InputStream stream, String encoding) {
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new ExpressionParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream) {
     ReInit(stream, null);
  }
  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  /** Constructor. */
  public ExpressionParser(java.io.Reader stream) {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new ExpressionParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  /** Constructor with generated Token Manager. */
  public ExpressionParser(ExpressionParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(ExpressionParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 25; i++) jj_la1[i] = -1;
  }

  private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
      jj_gen++;
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }


/** Get the next Token. */
  final public Token getNextToken() {
    if (token.next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    jj_gen++;
    return token;
  }

/** Get the specific Token. */
  final public Token getToken(int index) {
    Token t = token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  private int jj_ntk() {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    else
      return (jj_ntk = jj_nt.kind);
  }

  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
  private int[] jj_expentry;
  private int jj_kind = -1;

  /** Generate ParseException. */
  public ParseException generateParseException() {
    jj_expentries.clear();
    boolean[] la1tokens = new boolean[55];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 25; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1<<j)) != 0) {
            la1tokens[j] = true;
          }
          if ((jj_la1_1[i] & (1<<j)) != 0) {
            la1tokens[32+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 55; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.add(jj_expentry);
      }
    }
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = jj_expentries.get(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  /** Enable tracing. */
  final public void enable_tracing() {
  }

  /** Disable tracing. */
  final public void disable_tracing() {
  }

}
