Package org.jostraca.tree.path

Source Code of org.jostraca.tree.path.PathParser

// $ANTLR 2.7.4: "path.g" -> "PathParser.java"$
package org.jostraca.tree.path;

import org.jostraca.tree.path.expr.*;
import java.util.*;

import org.jostraca.comp.antlr.TokenBuffer;
import org.jostraca.comp.antlr.TokenStreamException;
import org.jostraca.comp.antlr.TokenStreamIOException;
import org.jostraca.comp.antlr.ANTLRException;
import org.jostraca.comp.antlr.LLkParser;
import org.jostraca.comp.antlr.Token;
import org.jostraca.comp.antlr.TokenStream;
import org.jostraca.comp.antlr.RecognitionException;
import org.jostraca.comp.antlr.NoViableAltException;
import org.jostraca.comp.antlr.MismatchedTokenException;
import org.jostraca.comp.antlr.SemanticException;
import org.jostraca.comp.antlr.ParserSharedInputState;
import org.jostraca.comp.antlr.collections.impl.BitSet;

public class PathParser extends org.jostraca.comp.antlr.LLkParser       implements PathLexerTokenTypes
{

  private int SELF       = 1;
  private int CHILD      = 2;
  private int PARENT     = 3;
  private int DESCENDANT = 4;
 
  private int      axis;
  private StepPath steppath;
  private Step     step;
  private Stack<Expr>       exprstack  = new Stack<Expr>();
  private Stack<StepPath>   pathstack  = new Stack<StepPath>();
  private Stack<List<Expr>> paramstack = new Stack<List<Expr>>();
  private List<Expr>        params     = new ArrayList<Expr>()

  public StepPath getStepPath() {
    return steppath;
  }
 
 
  public void attribute( String pName ) {
  attribute( pName, null );
  }

  public void attribute( String pName, String pType ) {
  steppath.setAttribute( pName, pType );
  }


  public void element( int pAxis, String pName ) {
  element(pAxis,pName,null);
  }

  public void element( int pAxis, String pName, String pType ) {
  step =
    SELF       == pAxis ? new SelfStep() :
    CHILD      == pAxis ? new ChildStep(pName, pType) :
    PARENT     == pAxis ? new ParentStep() :
    DESCENDANT == pAxis ? new DescendantStep(pName) :
    null;
  //System.out.println("element:"+step+" onto "+steppath);
  steppath.add(step)
  }
 
 
  public void pred() {
  if( !exprstack.empty() ) {
    Expr expr = exprstack.pop();
    Predicate predicate = new Predicate(expr);
    //System.out.println("predicate:"+predicate+" on "+step);
    step.setPredicate(predicate);
  }
  }
 
 
  public void expr( Expr pExpr ) {
  System.out.println("push expr="+pExpr);
  exprstack.push(pExpr);
  }
 
 
  public void stringexpr( String pQuoted ) {
  Expr expr = StringExpr.unquote(pQuoted);
  expr(expr);
  }
 
  public void infix( String pType ) {
  Expr expr = null;
  Expr rhs = exprstack.pop();
  Expr lhs = exprstack.pop()
 
  //System.out.println("lhs="+lhs+" rhs="+rhs);

    if( "or".equals( pType ) ) {
    expr = new OrExpr(lhs,rhs)
    }
    else if( "and".equals( pType ) ) {
    expr = new AndExpr(lhs,rhs)
    }
    else if( "=".equals( pType ) ) {
    expr = new EqualsExpr(lhs,rhs)
    }
    else if( "!=".equals( pType ) ) {
    expr = new NotEqualsExpr(lhs,rhs)
    }
    else if( "<".equals( pType ) ) {
    expr = new LessThanExpr(lhs,rhs)
    }
    else if( "<=".equals( pType ) ) {
    expr = new LessThanOrEqualToExpr(lhs,rhs)
    }
    else if( ">".equals( pType ) ) {
    expr = new GreaterThanExpr(lhs,rhs)
    }
    else if( ">=".equals( pType ) ) {
    expr = new GreaterThanOrEqualToExpr(lhs,rhs)
    }
    else if( "*".equals( pType ) ) {
    expr = new MulExpr(lhs,rhs)
    }
    else if( "+".equals( pType ) ) {
    expr = new PlusExpr(lhs,rhs)
    }
    else if( "-".equals( pType ) ) {
    expr = new MinusExpr(lhs,rhs)
    }
    else if( "div".equals( pType ) ) {
    expr = new DivExpr(lhs,rhs)
    }
    else if( "mod".equals( pType ) ) {
    expr = new ModExpr(lhs,rhs)
    }
   
    if( null != expr ) {
    exprstack.push( expr );
    }
  }
 
 
  public void prefix( String pType ) {
  Expr expr = exprstack.pop();
  Expr unary = null;
 
    if( "not".equals( pType ) ) {
    unary = new NotExpr(expr)
    }
    else if( "-".equals( pType ) ) {
    expr = new UnaryMinusExpr(expr)
    }
   
    if( null == unary ) {
    throw new RuntimeException("unknown unary operator: '"+pType+"'");
  }
 
  exprstack.push( unary );
  }
 
 
  public void newpath() {
    //System.out.println("ts0:"+_tokenSet_0);
  //System.out.println("ts1:"+_tokenSet_1);
  //System.out.println("ts2:"+_tokenSet_2);
  //System.out.println("ts3:"+_tokenSet_3);
  //System.out.println("ts4:"+_tokenSet_4);
  //System.out.println("ts5:"+_tokenSet_5);
     
  if( null != steppath ) {
      pathstack.push(steppath);
    System.out.println("push:"+steppath);
    }
    steppath = new StepPath();
  }


  public void newparams() {
  if( null != params ) {
      paramstack.push(params);
    System.out.println("push params:"+params);
    }
    params = new ArrayList<Expr>();
  }
 
 
  public void param() {
    Expr param = exprstack.pop();
    params.add(param);
  }
 
 
  public void function( int pAxis, String pIden ) {
  Expr expr = null;
  if( "true".equals( pIden ) ) {
    expr = new BooleanExpr(true);
  }
  else if( "false".equals( pIden ) ) {
    expr = new BooleanExpr(false);
  }
  else if( "not".equals( pIden ) ) {
    Expr p0 = params.get(0);
    expr = new NotExpr(p0);
  }
 
  if( null != expr ) {
    exprstack.push(expr);
  }
 
  params = paramstack.pop();
  }

protected PathParser(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public PathParser(TokenBuffer tokenBuf) {
  this(tokenBuf,3);
}

protected PathParser(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public PathParser(TokenStream lexer) {
  this(lexer,3);
}

public PathParser(ParserSharedInputState state) {
  super(state,3);
  tokenNames = _tokenNames;
}

  public final void main() throws RecognitionException, TokenStreamException {
   
   
    path();
    match(Token.EOF_TYPE);
  }
 
  public final void path() throws RecognitionException, TokenStreamException {
   
    newpath(); axis=CHILD;
   
    switch ( LA(1)) {
    case AT:
    {
      attr();
      break;
    }
    case SLASH:
    case STAR:
    case DOT:
    case CHILD_AXIS:
    case DESCENDANT_AXIS:
    case IDEN:
    case LITERAL_and:
    case LITERAL_or:
    case LITERAL_div:
    case LITERAL_mod:
    case LITERAL_not:
    {
      {
      {
      switch ( LA(1)) {
      case SLASH:
      {
        sep();
        break;
      }
      case STAR:
      case DOT:
      case CHILD_AXIS:
      case DESCENDANT_AXIS:
      case IDEN:
      case LITERAL_and:
      case LITERAL_or:
      case LITERAL_div:
      case LITERAL_mod:
      case LITERAL_not:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      step();
      {
      _loop51:
      do {
        if ((LA(1)==SLASH) && (_tokenSet_0.member(LA(2))) && (_tokenSet_1.member(LA(3)))) {
          sep();
          step();
        }
        else {
          break _loop51;
        }
       
      } while (true);
      }
      {
      switch ( LA(1)) {
      case SLASH:
      {
        match(SLASH);
        attr();
        break;
      }
      case EOF:
      case STAR:
      case RS:
      case RP:
      case COMMA:
      case PLUS:
      case MINUS:
      case EQ:
      case NEQ:
      case LT:
      case LTE:
      case GT:
      case GTE:
      case LITERAL_and:
      case LITERAL_or:
      case LITERAL_div:
      case LITERAL_mod:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
 
  public final void attr() throws RecognitionException, TokenStreamException {
   
    Token  ns = null;
    Token  nsattr = null;
    Token  attr = null;
   
    if ((LA(1)==AT) && (LA(2)==IDEN) && (LA(3)==COLON)) {
      match(AT);
      ns = LT(1);
      match(IDEN);
      match(COLON);
      nsattr = LT(1);
      match(IDEN);
      if ( inputState.guessing==0 ) {
        attribute(nsattr.getText(),ns.getText());
      }
    }
    else if ((LA(1)==AT) && (LA(2)==IDEN) && (_tokenSet_2.member(LA(3)))) {
      match(AT);
      attr = LT(1);
      match(IDEN);
      if ( inputState.guessing==0 ) {
        attribute(attr.getText());
      }
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
  }
 
  public final void sep() throws RecognitionException, TokenStreamException {
   
   
    if ((LA(1)==SLASH) && (_tokenSet_3.member(LA(2)))) {
      match(SLASH);
      if ( inputState.guessing==0 ) {
        axis=CHILD;
      }
    }
    else if ((LA(1)==SLASH) && (LA(2)==SLASH)) {
      match(SLASH);
      match(SLASH);
      if ( inputState.guessing==0 ) {
        axis=DESCENDANT;
      }
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
  }
 
  public final void step() throws RecognitionException, TokenStreamException {
   
    Token  childiden = null;
    Token  desciden = null;
    Token  ns = null;
    Token  nsiden = null;
    Token  iden = null;
   
    {
    switch ( LA(1)) {
    case STAR:
    {
      match(STAR);
      if ( inputState.guessing==0 ) {
        element(CHILD,"*");
      }
      break;
    }
    case CHILD_AXIS:
    {
      match(CHILD_AXIS);
      childiden = LT(1);
      match(IDEN);
      if ( inputState.guessing==0 ) {
        element(CHILD,childiden.getText());
      }
      break;
    }
    case DESCENDANT_AXIS:
    {
      match(DESCENDANT_AXIS);
      desciden = LT(1);
      match(IDEN);
      if ( inputState.guessing==0 ) {
        element(DESCENDANT,desciden.getText());
      }
      break;
    }
    case LITERAL_and:
    {
      match(LITERAL_and);
      if ( inputState.guessing==0 ) {
        element(axis,"and");
      }
      break;
    }
    case LITERAL_or:
    {
      match(LITERAL_or);
      if ( inputState.guessing==0 ) {
        element(axis,"or");
      }
      break;
    }
    case LITERAL_div:
    {
      match(LITERAL_div);
      if ( inputState.guessing==0 ) {
        element(axis,"div");
      }
      break;
    }
    case LITERAL_mod:
    {
      match(LITERAL_mod);
      if ( inputState.guessing==0 ) {
        element(axis,"mod");
      }
      break;
    }
    case LITERAL_not:
    {
      match(LITERAL_not);
      if ( inputState.guessing==0 ) {
        element(axis,"not");
      }
      break;
    }
    default:
      boolean synPredMatched57 = false;
      if (((LA(1)==DOT) && (LA(2)==DOT))) {
        int _m57 = mark();
        synPredMatched57 = true;
        inputState.guessing++;
        try {
          {
          match(DOT);
          match(DOT);
          }
        }
        catch (RecognitionException pe) {
          synPredMatched57 = false;
        }
        rewind(_m57);
        inputState.guessing--;
      }
      if ( synPredMatched57 ) {
        match(DOT);
        match(DOT);
        if ( inputState.guessing==0 ) {
          element(PARENT,"");
        }
      }
      else if ((LA(1)==DOT) && (_tokenSet_4.member(LA(2)))) {
        match(DOT);
        if ( inputState.guessing==0 ) {
          element(SELF,"");
        }
      }
      else if ((LA(1)==IDEN) && (LA(2)==COLON)) {
        ns = LT(1);
        match(IDEN);
        match(COLON);
        nsiden = LT(1);
        match(IDEN);
        if ( inputState.guessing==0 ) {
          element(axis,nsiden.getText(),ns.getText());
        }
      }
      else if ((LA(1)==IDEN) && (_tokenSet_4.member(LA(2)))) {
        iden = LT(1);
        match(IDEN);
        if ( inputState.guessing==0 ) {
          element(axis,iden.getText());
        }
      }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LS:
    {
      predicate();
      if ( inputState.guessing==0 ) {
        pred();
      }
      break;
    }
    case EOF:
    case SLASH:
    case STAR:
    case RS:
    case RP:
    case COMMA:
    case PLUS:
    case MINUS:
    case EQ:
    case NEQ:
    case LT:
    case LTE:
    case GT:
    case GTE:
    case LITERAL_and:
    case LITERAL_or:
    case LITERAL_div:
    case LITERAL_mod:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
  }
 
  public final void predicate() throws RecognitionException, TokenStreamException {
   
   
    match(LS);
    expr();
    match(RS);
  }
 
  public final void expr() throws RecognitionException, TokenStreamException {
   
   
    or_expr();
  }
 
  public final void or_expr() throws RecognitionException, TokenStreamException {
   
   
    and_expr();
    {
    _loop64:
    do {
      if ((LA(1)==LITERAL_or)) {
        match(LITERAL_or);
        and_expr();
        if ( inputState.guessing==0 ) {
          infix("or");
        }
      }
      else {
        break _loop64;
      }
     
    } while (true);
    }
  }
 
  public final void and_expr() throws RecognitionException, TokenStreamException {
   
   
    eq_expr();
    {
    _loop67:
    do {
      if ((LA(1)==LITERAL_and)) {
        match(LITERAL_and);
        eq_expr();
        if ( inputState.guessing==0 ) {
          infix("and");
        }
      }
      else {
        break _loop67;
      }
     
    } while (true);
    }
  }
 
  public final void eq_expr() throws RecognitionException, TokenStreamException {
   
   
    neq_expr();
    {
    _loop70:
    do {
      if ((LA(1)==EQ)) {
        match(EQ);
        neq_expr();
        if ( inputState.guessing==0 ) {
          infix("=");
        }
      }
      else {
        break _loop70;
      }
     
    } while (true);
    }
  }
 
  public final void neq_expr() throws RecognitionException, TokenStreamException {
   
   
    lt_expr();
    {
    _loop73:
    do {
      if ((LA(1)==NEQ)) {
        match(NEQ);
        lt_expr();
        if ( inputState.guessing==0 ) {
          infix("!=");
        }
      }
      else {
        break _loop73;
      }
     
    } while (true);
    }
  }
 
  public final void lt_expr() throws RecognitionException, TokenStreamException {
   
   
    lte_expr();
    {
    _loop76:
    do {
      if ((LA(1)==LT)) {
        match(LT);
        lte_expr();
        if ( inputState.guessing==0 ) {
          infix("<");
        }
      }
      else {
        break _loop76;
      }
     
    } while (true);
    }
  }
 
  public final void lte_expr() throws RecognitionException, TokenStreamException {
   
   
    gt_expr();
    {
    _loop79:
    do {
      if ((LA(1)==LTE)) {
        match(LTE);
        gt_expr();
        if ( inputState.guessing==0 ) {
          infix("<=");
        }
      }
      else {
        break _loop79;
      }
     
    } while (true);
    }
  }
 
  public final void gt_expr() throws RecognitionException, TokenStreamException {
   
   
    gte_expr();
    {
    _loop82:
    do {
      if ((LA(1)==GT)) {
        match(GT);
        gte_expr();
        if ( inputState.guessing==0 ) {
          infix(">");
        }
      }
      else {
        break _loop82;
      }
     
    } while (true);
    }
  }
 
  public final void gte_expr() throws RecognitionException, TokenStreamException {
   
   
    mul_expr();
    {
    _loop85:
    do {
      if ((LA(1)==GTE)) {
        match(GTE);
        mul_expr();
        if ( inputState.guessing==0 ) {
          infix(">=");
        }
      }
      else {
        break _loop85;
      }
     
    } while (true);
    }
  }
 
  public final void mul_expr() throws RecognitionException, TokenStreamException {
   
   
    add_expr();
    {
    _loop88:
    do {
      if ((LA(1)==STAR)) {
        match(STAR);
        add_expr();
        if ( inputState.guessing==0 ) {
          infix("*");
        }
      }
      else {
        break _loop88;
      }
     
    } while (true);
    }
  }
 
  public final void add_expr() throws RecognitionException, TokenStreamException {
   
   
    div_expr();
    {
    _loop91:
    do {
      if ((LA(1)==PLUS)) {
        match(PLUS);
        div_expr();
        if ( inputState.guessing==0 ) {
          infix("+");
        }
      }
      else {
        break _loop91;
      }
     
    } while (true);
    }
  }
 
  public final void div_expr() throws RecognitionException, TokenStreamException {
   
   
    mod_expr();
    {
    _loop94:
    do {
      if ((LA(1)==LITERAL_div)) {
        match(LITERAL_div);
        mod_expr();
        if ( inputState.guessing==0 ) {
          infix("div");
        }
      }
      else {
        break _loop94;
      }
     
    } while (true);
    }
  }
 
  public final void mod_expr() throws RecognitionException, TokenStreamException {
   
   
    min_expr();
    {
    _loop97:
    do {
      if ((LA(1)==LITERAL_mod)) {
        match(LITERAL_mod);
        min_expr();
        if ( inputState.guessing==0 ) {
          infix("mod");
        }
      }
      else {
        break _loop97;
      }
     
    } while (true);
    }
  }
 
  public final void min_expr() throws RecognitionException, TokenStreamException {
   
   
    unary_expr();
    {
    _loop100:
    do {
      if ((LA(1)==MINUS)) {
        match(MINUS);
        unary_expr();
        if ( inputState.guessing==0 ) {
          infix("-");
        }
      }
      else {
        break _loop100;
      }
     
    } while (true);
    }
  }
 
  public final void unary_expr() throws RecognitionException, TokenStreamException {
   
   
    switch ( LA(1)) {
    case MINUS:
    {
      match(MINUS);
      primary_expr();
      if ( inputState.guessing==0 ) {
        prefix("-");
      }
      break;
    }
    case SLASH:
    case STAR:
    case DOT:
    case AT:
    case LP:
    case DIGIT:
    case DQSTR:
    case SQSTR:
    case CHILD_AXIS:
    case DESCENDANT_AXIS:
    case IDEN:
    case LITERAL_and:
    case LITERAL_or:
    case LITERAL_div:
    case LITERAL_mod:
    case LITERAL_not:
    {
      primary_expr();
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
 
  public final void primary_expr() throws RecognitionException, TokenStreamException {
   
    System.out.println("pexpr:A1="+LA(1)+"="+LT(1)+",A2="+LA(2)+"="+LT(2));
   
    switch ( LA(1)) {
    case LP:
    {
      match(LP);
      expr();
      match(RP);
      break;
    }
    case DQSTR:
    case SQSTR:
    {
      string();
      break;
    }
    default:
      boolean synPredMatched106 = false;
      if (((LA(1)==DIGIT) && (LA(2)==DOT||LA(2)==DIGIT) && (LA(3)==DOT||LA(3)==DIGIT))) {
        int _m106 = mark();
        synPredMatched106 = true;
        inputState.guessing++;
        try {
          {
          {
          int _cnt105=0;
          _loop105:
          do {
            if ((LA(1)==DIGIT)) {
              match(DIGIT);
            }
            else {
              if ( _cnt105>=1 ) { break _loop105; } else {throw new NoViableAltException(LT(1), getFilename());}
            }
           
            _cnt105++;
          } while (true);
          }
          match(DOT);
          }
        }
        catch (RecognitionException pe) {
          synPredMatched106 = false;
        }
        rewind(_m106);
        inputState.guessing--;
      }
      if ( synPredMatched106 ) {
        decimal();
      }
      else if ((LA(1)==DIGIT) && (_tokenSet_5.member(LA(2))) && (_tokenSet_6.member(LA(3)))) {
        integer();
      }
      else if ((LA(1)==IDEN) && (LA(2)==LP)) {
        function();
      }
      else if ((_tokenSet_7.member(LA(1))) && (_tokenSet_8.member(LA(2)))) {
        path();
        if ( inputState.guessing==0 ) {
         
              expr(new PathExpr(new Path(steppath)));
              steppath = pathstack.pop();
              step = steppath.last();
              System.out.println("pop:"+steppath+" step:"+step);
           
        }
      }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
 
  public final void string() throws RecognitionException, TokenStreamException {
   
    Token  dqstr = null;
    Token  sqstr = null;
   
    switch ( LA(1)) {
    case DQSTR:
    {
      dqstr = LT(1);
      match(DQSTR);
      if ( inputState.guessing==0 ) {
        stringexpr(dqstr.getText());
      }
      break;
    }
    case SQSTR:
    {
      sqstr = LT(1);
      match(SQSTR);
      if ( inputState.guessing==0 ) {
        stringexpr(sqstr.getText());
      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
 
  public final void decimal() throws RecognitionException, TokenStreamException {
   
    Token  integer = null;
    Token  decimal = null;
   
    {
    int _cnt110=0;
    _loop110:
    do {
      if ((LA(1)==DIGIT)) {
        integer = LT(1);
        match(DIGIT);
      }
      else {
        if ( _cnt110>=1 ) { break _loop110; } else {throw new NoViableAltException(LT(1), getFilename());}
      }
     
      _cnt110++;
    } while (true);
    }
    match(DOT);
    {
    int _cnt112=0;
    _loop112:
    do {
      if ((LA(1)==DIGIT)) {
        decimal = LT(1);
        match(DIGIT);
      }
      else {
        if ( _cnt112>=1 ) { break _loop112; } else {throw new NoViableAltException(LT(1), getFilename());}
      }
     
      _cnt112++;
    } while (true);
    }
    if ( inputState.guessing==0 ) {
      expr(new DecimalExpr( Double.parseDouble(integer.getText()+"."+decimal.getText())));
    }
  }
 
  public final void integer() throws RecognitionException, TokenStreamException {
   
    Token  integer = null;
   
    {
    int _cnt115=0;
    _loop115:
    do {
      if ((LA(1)==DIGIT)) {
        integer = LT(1);
        match(DIGIT);
      }
      else {
        if ( _cnt115>=1 ) { break _loop115; } else {throw new NoViableAltException(LT(1), getFilename());}
      }
     
      _cnt115++;
    } while (true);
    }
    if ( inputState.guessing==0 ) {
      expr(new IntegerExpr( Integer.parseInt(integer.getText())));
    }
  }
 
  public final void function() throws RecognitionException, TokenStreamException {
   
    Token  iden = null;
   
    iden = LT(1);
    match(IDEN);
    match(LP);
    if ( inputState.guessing==0 ) {
      newparams();
    }
    params();
    match(RP);
    if ( inputState.guessing==0 ) {
      function(axis,iden.getText());
    }
  }
 
  protected final void params() throws RecognitionException, TokenStreamException {
   
   
    {
    switch ( LA(1)) {
    case SLASH:
    case STAR:
    case DOT:
    case AT:
    case LP:
    case MINUS:
    case DIGIT:
    case DQSTR:
    case SQSTR:
    case CHILD_AXIS:
    case DESCENDANT_AXIS:
    case IDEN:
    case LITERAL_and:
    case LITERAL_or:
    case LITERAL_div:
    case LITERAL_mod:
    case LITERAL_not:
    {
      expr();
      if ( inputState.guessing==0 ) {
        param();
      }
      break;
    }
    case RP:
    case COMMA:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    _loop120:
    do {
      if ((LA(1)==COMMA)) {
        match(COMMA);
        expr();
        if ( inputState.guessing==0 ) {
          param();
        }
      }
      else {
        break _loop120;
      }
     
    } while (true);
    }
  }
 
  public final void bool() throws RecognitionException, TokenStreamException {
   
   
    switch ( LA(1)) {
    case 37:
    {
      match(37);
      if ( inputState.guessing==0 ) {
        expr(new BooleanExpr(true));
      }
      break;
    }
    case 38:
    {
      match(38);
      if ( inputState.guessing==0 ) {
        expr(new BooleanExpr(false));
      }
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
  }
 
 
  public static final String[] _tokenNames = {
    "<0>",
    "EOF",
    "<2>",
    "NULL_TREE_LOOKAHEAD",
    "COLON",
    "SLASH",
    "STAR",
    "DOT",
    "AT",
    "LS",
    "RS",
    "LP",
    "RP",
    "COMMA",
    "PLUS",
    "MINUS",
    "EQ",
    "NEQ",
    "LT",
    "LTE",
    "GT",
    "GTE",
    "DIGIT",
    "DQSTR",
    "DQSTR_ESC",
    "SQSTR",
    "SQSTR_ESC",
    "WS",
    "STEP",
    "CHILD_AXIS",
    "DESCENDANT_AXIS",
    "IDEN",
    "\"and\"",
    "\"or\"",
    "\"div\"",
    "\"mod\"",
    "\"not\"",
    "\"true()\"",
    "\"false()\""
  };
 
  private static final long[] mk_tokenSet_0() {
    long[] data = { 136902082784L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
  private static final long[] mk_tokenSet_1() {
    long[] data = { 136906274546L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
  private static final long[] mk_tokenSet_2() {
    long[] data = { 64428700738L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
  private static final long[] mk_tokenSet_3() {
    long[] data = { 136902082752L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
  private static final long[] mk_tokenSet_4() {
    long[] data = { 64428701282L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
  private static final long[] mk_tokenSet_5() {
    long[] data = { 64432895040L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
  private static final long[] mk_tokenSet_6() {
    long[] data = { 136952413666L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
  private static final long[] mk_tokenSet_7() {
    long[] data = { 136902083040L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
  private static final long[] mk_tokenSet_8() {
    long[] data = { 136906274544L, 0L};
    return data;
  }
  public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
 
  }
TOP

Related Classes of org.jostraca.tree.path.PathParser

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.