/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads until a token is reached, starting from the given offset. * @param tok The token to read to. * @param offset The offset to start reading from. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public void readToToken(int tok, int offset) throws CoreException { setOffset(offset); readToToken(tok); }
/** * Reads from the given offset until a token is reached and returns the start offset of the token. * @param token The token to be found. * @param startOffset The offset to start reading from. * @return Returns the start position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenStartOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentStartOffset(); }
/** * Reads from the given offset until a token is reached and returns the offset after the token. * @param token The token to be found. * @param startOffset Offset to start reading from * @return Returns the end position of the found token. * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE) * or a lexical error was detected while scanning (code LEXICAL_ERROR) */ public int getTokenEndOffset(int token, int startOffset) throws CoreException { readToToken(token, startOffset); return getCurrentEndOffset(); }
private void rewriteExtraDimensions(int oldDim, int newDim, int pos, TextEditGroup editGroup) { if (oldDim < newDim) { for (int i= oldDim; i < newDim; i++) { doTextInsert(pos, "[]", editGroup); //$NON-NLS-1$ } } else if (newDim < oldDim) { try { getScanner().setOffset(pos); for (int i= newDim; i < oldDim; i++) { getScanner().readToToken(TerminalTokens.TokenNameRBRACKET); } doTextRemove(pos, getScanner().getCurrentEndOffset() - pos, editGroup); } catch (CoreException e) { handleException(e); } } }
private void rewriteExtraDimensions(int oldDim, int newDim, int pos, TextEditGroup editGroup) { if (oldDim < newDim) { for (int i= oldDim; i < newDim; i++) { doTextInsert(pos, "[]", editGroup); //$NON-NLS-1$ } } else if (newDim < oldDim) { try { getScanner().setOffset(pos); for (int i= newDim; i < oldDim; i++) { getScanner().readToToken(TerminalTokens.TokenNameRBRACKET); } doTextRemove(pos, getScanner().getCurrentEndOffset() - pos, editGroup); } catch (CoreException e) { handleException(e); } } }