Package com.aptana.editor.coffee.parsing.lexer

Examples of com.aptana.editor.coffee.parsing.lexer.CoffeeSymbol


   * keep calling it, and append an invalid token at the very end.
   */
  @Override
  public Token nextToken() {
    Token token = null;
    CoffeeSymbol symbol = null;
    try {
      symbol = aptanaScanner.nextToken();
      if (symbol == null || symbol.getId() < 0) {
        logger.warn("Unexpected symbol " + symbol, new Exception());
        token = CommonToken.INVALID_TOKEN;
      }
      else if (symbol.getId() == Terminals.EOF) {
        token = CommonToken.EOF_TOKEN;
      }
      else {
        token = new BeaverToken(symbol);
        if (((CommonToken) token).getStopIndex() >= input.size()) {
View Full Code Here


   * @return the index where the assumption fails, or -1 when start locations are increasing
   */
  public static int checkTokenStarts(List<CoffeeSymbol> tokens) {
    int problemIndex = -1;
    for (int i = 1; i < tokens.size(); i++) {
      CoffeeSymbol prev = tokens.get(i-1);
      CoffeeSymbol current = tokens.get(i);
      //System.out.println(current.debugString());
      if (prev.getStart() > current.getStart()) {
        problemIndex = i;
        System.out.println("\t\t!!! at " + prev + ", " + current);
        //throw new RuntimeException("bad " + tokens);       
      }
    }
View Full Code Here

TOP

Related Classes of com.aptana.editor.coffee.parsing.lexer.CoffeeSymbol

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.