/** * 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(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
/** * Reads the next token from the given offset and returns the start offset of the token. * @param offset The offset to start reading from. * @param ignoreComments If set, comments will be overread * @return Returns the start position of the next 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 getNextStartOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentStartOffset(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
/** * Reads the next token from the given offset and returns the start offset of the token. * @param offset The offset to start reading from. * @param ignoreComments If set, comments will be overread * @return Returns the start position of the next 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 getNextStartOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentStartOffset(); }
/** * Reads the next token from the given offset and returns the start offset of the token. * @param offset The offset to start reading from. * @param ignoreComments If set, comments will be overread * @return Returns the start position of the next 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 getNextStartOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentStartOffset(); }
/** * 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(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
/** * Reads the next token from the given offset and returns the start offset of the token. * @param offset The offset to start reading from. * @param ignoreComments If set, comments will be overread * @return Returns the start position of the next 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 getNextStartOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentStartOffset(); }
/** * 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(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
/** * Reads the next token from the given offset and returns the start offset of the token. * @param offset The offset to start reading from. * @param ignoreComments If set, comments will be overread * @return Returns the start position of the next 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 getNextStartOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentStartOffset(); }
/** * 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(); }
private void replaceOperation(int posBeforeOperation, String newOperation, TextEditGroup editGroup) { try { getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } }
private void replaceOperation(int posBeforeOperation, String newOperation, TextEditGroup editGroup) { try { getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } }
private void replaceOperation(int posBeforeOperation, String newOperation, TextEditGroup editGroup) { try { getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } }
private void replaceOperation(int posBeforeOperation, String newOperation, TextEditGroup editGroup) { try { getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } }
private void replaceOperation(int posBeforeOperation, String newOperation, TextEditGroup editGroup) { try { getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } }
private void rewriteOperation(ASTNode parent, StructuralPropertyDescriptor property, int posBeforeOperation) { RewriteEvent event= getEvent(parent, property); if (event != null && event.getChangeKind() != RewriteEvent.UNCHANGED) { try { String newOperation= event.getNewValue().toString(); TextEditGroup editGroup= getEditGroup(event); getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } } }
private void rewriteOperation(ASTNode parent, StructuralPropertyDescriptor property, int posBeforeOperation) { RewriteEvent event= getEvent(parent, property); if (event != null && event.getChangeKind() != RewriteEvent.UNCHANGED) { try { String newOperation= event.getNewValue().toString(); TextEditGroup editGroup= getEditGroup(event); getScanner().readNext(posBeforeOperation, true); doTextReplace(getScanner().getCurrentStartOffset(), getScanner().getCurrentLength(), newOperation, editGroup); } catch (CoreException e) { handleException(e); } } }