Examples of TokenMgrError


Examples of lupos.sparql1_1.TokenMgrError

  }

  protected boolean dealWithThrowableFromQueryParser(final Throwable e,
      final EvaluationMode mode, final boolean queryOrRif) {
    if (e instanceof TokenMgrError) {
      final TokenMgrError tme = (TokenMgrError) e;
      this.displayErrorMessage(tme.getMessage(), false, queryOrRif);

      // create the pattern to match
      // and create a matcher against the string
      final Pattern pattern = Pattern
          .compile("line (\\d+), column (\\d+)");
      final Matcher matcher = pattern.matcher(tme.getMessage());

      // try to find the pattern in the message...
      if (matcher.find() == true) {
        // get matches...
        final int line = Integer.parseInt(matcher.group(1));
        final int column = Integer.parseInt(matcher.group(2));

        this.setErrorPosition(line, column, queryOrRif);
      }
      if (mode == EvaluationMode.DEMO) {
        this.enableOrDisableButtons(queryOrRif);
      }
      return true;
    } else  if (e instanceof lupos.rif.generated.parser.TokenMgrError) {
      final lupos.rif.generated.parser.TokenMgrError tme = (lupos.rif.generated.parser.TokenMgrError) e;
      this.displayErrorMessage(tme.getMessage(), false, queryOrRif);

      // create the pattern to match
      // and create a matcher against the string
      final Pattern pattern = Pattern
          .compile("line (\\d+), column (\\d+)");
      final Matcher matcher = pattern.matcher(tme.getMessage());

      // try to find the pattern in the message...
      if (matcher.find() == true) {
        // get matches...
        final int line = Integer.parseInt(matcher.group(1));
View Full Code Here

Examples of lupos.sparql1_1.TokenMgrError

        line = pe.currentToken.next.beginLine;
        column = pe.currentToken.next.beginColumn;
      }
    }
    else if(t instanceof TokenMgrError) {
      TokenMgrError tme = (TokenMgrError) t;

      // create the pattern to match and create a matcher against the
      // string
      Pattern pattern = Pattern.compile("line (\\d+), column (\\d+)");
      Matcher matcher = pattern.matcher(tme.getMessage());

      if(matcher.find() == true) { // try to find the pattern in the
        // message...
        // get matches...
        line = Integer.parseInt(matcher.group(1));
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

   SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
   if (lexState >= 19 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
   }
  }
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

   SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
   if (lexState >= 19 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
   }
  }
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

   SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
   if (lexState >= 21 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
   }
  }
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

   SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
   if (lexState >= 21 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}
View Full Code Here

Examples of org.apache.derby.impl.sql.compile.TokenMgrError

     }
     if (!EOFSeen) {
        input_stream.backup(1);
        error_after = curPos <= 1 ? "" : input_stream.GetImage();
     }
     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
   }
  }
}
View Full Code Here
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.