Refine search
txt = "<no text>"; return "[@"+t.getTokenIndex()+","+ct.getStartIndex()+":"+ct.getStopIndex()+"='"+txt+"',<"+tokenNames[t.getType()]+">"+channelStr+","+t.getLine()+":"+t.getCharPositionInLine()+"]";
private void throwRecognitionException(Token t) throws RecognitionException { RecognitionException e = new RecognitionException(); e.token = t; e.line = t.getLine(); e.charPositionInLine = t.getCharPositionInLine(); e.input = input; throw e; }
private void throwRecognitionException(Token t) throws RecognitionException { RecognitionException e = new RecognitionException(); e.token = t; e.line = t.getLine(); e.charPositionInLine = t.getCharPositionInLine(); e.input = input; throw e; }
/** * Checks that the specified token is valid. * * @param token the token to check * @return <code>true</code> if it is considered as valid, <code>false</code> otherwise. */ private static boolean isTokenValid(Token token) { return token.getLine() > 0 && token.getCharPositionInLine() >= 0; }
/** * Checks that the specified token is valid. * * @param token the token to check * @return <code>true</code> if it is considered as valid, <code>false</code> otherwise. */ private static boolean isTokenValid(Token token) { return token.getLine() > 0 && token.getCharPositionInLine() >= 0; }
/** * Checks that the specified token is valid. * * @param token the token to check * @return <code>true</code> if it is considered as valid, <code>false</code> otherwise. */ private static boolean isTokenValid(Token token) { return token.getLine() > 0 && token.getCharPositionInLine() >= 0; }
SemanticException(IntStream input, Token token, String errorMessage, Object... messageArguments) { super(); this.input = input; this.token = token; this.index = ((CommonToken)token).getStartIndex(); this.line = token.getLine(); this.charPositionInLine = token.getCharPositionInLine(); this.errorMessage = String.format(errorMessage, messageArguments); }
private static String toEndLocation(Token token) { return token.getLine() + ":" + (token.getCharPositionInLine() + token.getText().length()-1); }
private void throwRecognitionException(Token t) throws RecognitionException { RecognitionException e = new RecognitionException(); e.token = t; e.line = t.getLine(); e.charPositionInLine = t.getCharPositionInLine(); e.input = input; throw e; }
SemanticException(IntStream input, Token token, String errorMessage, Object... messageArguments) { super(); this.input = input; this.token = token; this.index = ((CommonToken)token).getStartIndex(); this.line = token.getLine(); this.charPositionInLine = token.getCharPositionInLine(); this.errorMessage = String.format(errorMessage, messageArguments); }
private void isIdentifier( Token name ){ String nameString = name.getText(); if( ! namePat.matcher( nameString ).matches() ){ errors.add(new ParserError( "invalid variable identifier " + nameString, name.getLine(), name.getCharPositionInLine() ) ); } }
SemanticException(IntStream input, CommonTree tree, String errorMessage, Object... messageArguments) { super(); this.input = input; this.token = tree.getToken(); this.index = tree.getTokenStartIndex(); this.line = token.getLine(); this.charPositionInLine = token.getCharPositionInLine(); this.errorMessage = String.format(errorMessage, messageArguments); }
SemanticException(IntStream input, CommonTree tree, String errorMessage, Object... messageArguments) { super(); this.input = input; this.token = tree.getToken(); this.index = tree.getTokenStartIndex(); this.line = token.getLine(); this.charPositionInLine = token.getCharPositionInLine(); this.errorMessage = String.format(errorMessage, messageArguments); }
protected String serializeToken(Token t) { StringBuffer buf = new StringBuffer(50); buf.append(t.getTokenIndex()); buf.append('\t'); buf.append(t.getType()); buf.append('\t'); buf.append(t.getChannel()); buf.append('\t'); buf.append(t.getLine()); buf.append('\t'); buf.append(t.getCharPositionInLine()); serializeText(buf, t.getText()); return buf.toString(); }
protected String serializeToken(Token t) { StringBuffer buf = new StringBuffer(50); buf.append(t.getTokenIndex()); buf.append('\t'); buf.append(t.getType()); buf.append('\t'); buf.append(t.getChannel()); buf.append('\t'); buf.append(t.getLine()); buf.append('\t'); buf.append(t.getCharPositionInLine()); serializeText(buf, t.getText()); return buf.toString(); }
protected String serializeToken(Token t) { StringBuffer buf = new StringBuffer(50); buf.append(t.getTokenIndex()); buf.append('\t'); buf.append(t.getType()); buf.append('\t'); buf.append(t.getChannel()); buf.append('\t'); buf.append(t.getLine()); buf.append('\t'); buf.append(t.getCharPositionInLine()); serializeText(buf, t.getText()); return buf.toString(); }
protected String serializeToken(Token t) { StringBuffer buf = new StringBuffer(50); buf.append(t.getTokenIndex()); buf.append('\t'); buf.append(t.getType()); buf.append('\t'); buf.append(t.getChannel()); buf.append('\t'); buf.append(t.getLine()); buf.append('\t'); buf.append(t.getCharPositionInLine()); serializeText(buf, t.getText()); return buf.toString(); }
protected String serializeToken(Token t) { StringBuffer buf = new StringBuffer(50); buf.append(t.getTokenIndex()); buf.append('\t'); buf.append(t.getType()); buf.append('\t'); buf.append(t.getChannel()); buf.append('\t'); buf.append(t.getLine()); buf.append('\t'); buf.append(t.getCharPositionInLine()); serializeText(buf, t.getText()); return buf.toString(); }
private String checkFieldName(Token token) { final String text = token.getText(); if (StringUtils.isBlank(text)) { reportError(JqlParseErrorMessages.emptyFieldName(token.getLine(), token.getCharPositionInLine()), null); } return text; }
private String checkFunctionName(Token token) { final String text = token.getText(); if (StringUtils.isBlank(text)) { reportError(JqlParseErrorMessages.emptyFunctionName(token.getLine(), token.getCharPositionInLine()), null); } return text; }