/** * Reads the next token from the given offset and returns the offset after 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 getNextEndOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentEndOffset(); }
/** * 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 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(); }
/** * @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 offset after 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 getNextEndOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentEndOffset(); }
/** * 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 the next token from the given offset and returns the offset after 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 getNextEndOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentEndOffset(); }
/** * @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 offset after 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 getNextEndOffset(int offset, boolean ignoreComments) throws CoreException { readNext(offset, ignoreComments); return getCurrentEndOffset(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
/** * @return Returns the length of the current token */ public int getCurrentLength() { return getCurrentEndOffset() - getCurrentStartOffset(); }
private int getPosAfterToken(int pos, int token) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == token) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; } /*
private int getPosAfterToken(int pos, int token) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == token) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; } /*
private int getPosAfterLeftBrace(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNameLBRACE) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterTry(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNametry) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterLeftBrace(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNameLBRACE) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterTry(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNametry) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterLeftBrace(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNameLBRACE) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterTry(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNametry) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }
private int getPosAfterLeftBrace(int pos) { try { int nextToken= getScanner().readNext(pos, true); if (nextToken == TerminalTokens.TokenNameLBRACE) { return getScanner().getCurrentEndOffset(); } } catch (CoreException e) { handleException(e); } return pos; }