Package org.allspice.util

Examples of org.allspice.util.Position


  public ParserStackEntry<StackObject> translate(ParserState state,final Rule rule) throws SyntaxError {
    ParserStackEntry<StackObject> r = state.reductions ;
    for(int i = 0; i < rule.rhs.size(); i++) {
      r = r.tail ;
    }
    Position end = currTokenPositionRange.end ;
    Position start = rule.rhs.isEmpty() ? end : state.reductions.head.range.start ;
    PositionRange range = new PositionRange(start,end);
    Object obj = parseTable.reduce(rule,this,state,range) ;
    r = new ParserStackEntry<StackObject>(new StackObject(obj,range),r) ;
    return r ;
  }
View Full Code Here


  /**
   * Advance the token.
   * @throws SyntaxError
   */
  protected void advanceToken() throws SyntaxError {
    Position start = tokens.getPosition() ;
    currToken = tokens.next();
    Position end = tokens.getPosition() ;
    currTokenPositionRange = new PositionRange(start,end) ;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.allspice.parser.parsetable.TokenStream#getPosition()
   */
  @Override
  public Position getPosition() {
    return new Position(0,0) ;
  }
View Full Code Here

        "%type"
      )) ;

  @Override
  public Position getPosition() {
    return new Position(lineno,posinline) ;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.allspice.parser.parsetable.TokenStream#getPosition()
   */
  @Override
  public Position getPosition() {
    return new Position(lineno,posinline) ;
  }
View Full Code Here

      currChar = -1 ;
    }
  }
  @Override
  public Position getPosition() {
    return new Position(lineno,posinline) ;
  }
View Full Code Here

TOP

Related Classes of org.allspice.util.Position

Copyright © 2018 www.massapicom. 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.