case 'D': token.setType(PRIMITIVE_TYPE); token.setText(str.substring(typeStartIndex, typeStartIndex+1)); token.setStopIndex(baseToken.getStartIndex() + typeStartIndex); while (str.charAt(++i) != ';'); token.setType(CLASS_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i + 1)); token.setStopIndex(baseToken.getStartIndex() + i); while (str.charAt(++i) == '['); token.setType(ARRAY_TYPE_PREFIX); token.setText(str.substring(typeStartIndex, i)); token.setStopIndex(baseToken.getStartIndex() + i - 1);
/** * Create a new token from the given prototype. Any argument besides the prototype is optional and * will be ignored if its value is <code>null</code>. */ protected CommonToken createToken(CommonToken prototype, String text, Integer charPosInLine, Integer channel, Integer start, Integer stop, Integer type) { if (prototype == null) throw new IllegalArgumentException("Prototype may not be null."); CommonToken result = new CommonToken(prototype); if (text != null) result.setText(text); if (charPosInLine != null) result.setCharPositionInLine(charPosInLine.intValue()); if (channel != null) result.setChannel(channel.intValue()); if (start != null) result.setStartIndex(start.intValue()); if (stop != null) result.setStopIndex(stop.intValue()); if (type != null) result.setType(type.intValue()); return result; }
case 'D': token.setType(PRIMITIVE_TYPE); token.setText(str.substring(typeStartIndex, typeStartIndex+1)); token.setStopIndex(baseToken.getStartIndex() + typeStartIndex); while (str.charAt(++i) != ';'); token.setType(CLASS_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i + 1)); token.setStopIndex(baseToken.getStartIndex() + i); token.setType(ARRAY_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i)); token.setStopIndex(baseToken.getStartIndex() + i - 1);
case 'D': token.setType(PRIMITIVE_TYPE); token.setText(str.substring(typeStartIndex, typeStartIndex+1)); token.setStopIndex(baseToken.getStartIndex() + typeStartIndex); while (str.charAt(++i) != ';'); token.setType(CLASS_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i + 1)); token.setStopIndex(baseToken.getStartIndex() + i); token.setType(ARRAY_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i)); token.setStopIndex(baseToken.getStartIndex() + i - 1);
case 'D': token.setType(PRIMITIVE_TYPE); token.setText(str.substring(typeStartIndex, typeStartIndex+1)); token.setStopIndex(baseToken.getStartIndex() + typeStartIndex); while (str.charAt(++i) != ';'); token.setType(CLASS_DESCRIPTOR); token.setText(str.substring(typeStartIndex, i + 1)); token.setStopIndex(baseToken.getStartIndex() + i); while (str.charAt(++i) == '['); token.setType(ARRAY_TYPE_PREFIX); token.setText(str.substring(typeStartIndex, i)); token.setStopIndex(baseToken.getStartIndex() + i - 1);
protected Token skipDuplicateNLTokens(Token nextToken) { // skip duplicate NL tokens while (nextToken != Token.EOF_TOKEN && isNLToken(nextToken) && isNLToken(prevToken) // undo changes from the commit 93725b66fab92aa25922161929983aa6fd131d8f // to enable code-assist for included properties ZEN-1413 && shouldSkipNewLines(nextToken)) { CommonToken skipToken = new CommonToken(prevToken); skipToken.setType(getWSTokenType()); nextTokens.accept(skipToken); prevToken = nextToken; nextToken = delegate.nextToken(); } return nextToken; }