final PositionalParameterSpecification paramSpec = new PositionalParameterSpecification( delimiterNode.getLine(), delimiterNode.getColumn(), label, queryParamtersPosition
@Override protected AST generateNamedParameter(AST delimiterNode, AST nameNode) throws SemanticException { if ( getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() && positionalParameters != null ) { throw new SemanticException( "Cannot mix positional and named parameters: " + queryTranslatorImpl.getQueryString() ); } final String name = nameNode.getText(); trackNamedParameterPositions( name ); // create the node initially with the param name so that it shows // appropriately in the "original text" attribute final ParameterNode parameter = (ParameterNode) astFactory.create( NAMED_PARAM, name ); parameter.setText( "?" ); final NamedParameterSpecification paramSpec = new NamedParameterSpecification( delimiterNode.getLine(), delimiterNode.getColumn(), name ); parameter.setHqlParameterSpecification( paramSpec ); parameterSpecs.add( paramSpec ); return parameter; }
public int getColumn() { return ast != null ? ast.getColumn() : -1; }
public int getColumn() { return ast != null ? ast.getColumn() : -1; }
public MismatchedTokenException(String[] tokenNames_, AST node_, int expecting_, boolean matchNot) { super("Mismatched Token", "<AST>", node_==null? -1:node_.getLine(), node_==null? -1:node_.getColumn()); tokenNames = tokenNames_; node = node_; if (node_ == null) { tokenText = "<empty tree>"; } else { tokenText = node_.toString(); } mismatchType = matchNot ? NOT_TOKEN : TOKEN; expecting = expecting_; }
public MismatchedTokenException(String[] tokenNames_, AST node_, BitSet set_, boolean matchNot) { super("Mismatched Token", "<AST>", node_==null? -1:node_.getLine(), node_==null? -1:node_.getColumn()); tokenNames = tokenNames_; node = node_; if (node_ == null) { tokenText = "<empty tree>"; } else { tokenText = node_.toString(); } mismatchType = matchNot ? NOT_SET : SET; set = set_; }
public NoViableAltException(AST t) { super("NoViableAlt", "<AST>", t.getLine(), t.getColumn()); node = t; }
protected static String description(AST node) { return (node != null) ? " at line: " + node.getLine() + " column: " + node.getColumn() : ""; }
public MismatchedTokenException(String[] tokenNames_, AST node_, int lower, int upper_, boolean matchNot) { super("Mismatched Token", "<AST>", node_==null? -1:node_.getLine(), node_==null? -1:node_.getColumn()); tokenNames = tokenNames_; node = node_; if (node_ == null) { tokenText = "<empty tree>"; } else { tokenText = node_.toString(); } mismatchType = matchNot ? NOT_RANGE : RANGE; expecting = lower; upper = upper_; }
protected static String description(AST node) { return (node != null) ? " at line: " + node.getLine() + " column: " + node.getColumn() : ""; }
public int getColumn() { int col=0; if ( token!=null ) { col = token.getColumn(); } if ( col==0 ) { AST child = getFirstChild(); if ( child!=null ) { col = child.getColumn(); } } return col; }
public int getColumn() { int col=0; if ( token!=null ) { col = token.getColumn(); } if ( col==0 ) { AST child = getFirstChild(); if ( child!=null ) { col = child.getColumn(); } } return col; }
protected static Token makeToken(int typeCode, AST node) { return Token.newSymbol(typeCode, node.getLine(), node.getColumn()); }
protected static Token makeToken(int typeCode, AST node) { return Token.newSymbol(typeCode, node.getLine(), node.getColumn()); }
public void initialize(AST ast) { super.initialize(ast); line = ast.getLine(); col = ast.getColumn(); if (ast instanceof GroovySourceAST) { GroovySourceAST node = (GroovySourceAST)ast; lineLast = node.getLineLast(); colLast = node.getColumnLast(); } }
public void initialize(AST ast) { super.initialize(ast); line = ast.getLine(); col = ast.getColumn(); if (ast instanceof GroovySourceAST) { GroovySourceAST node = (GroovySourceAST)ast; lineLast = node.getLineLast(); colLast = node.getColumnLast(); } }
public void initialize(AST ast) { super.initialize(ast); line = ast.getLine(); col = ast.getColumn(); if (ast instanceof GroovySourceAST) { GroovySourceAST node = (GroovySourceAST)ast; lineLast = node.getLineLast(); colLast = node.getColumnLast(); } }
protected void configureAST(ASTNode node, AST ast) { if (ast==null) throw new ASTRuntimeException(ast, "PARSER BUG: Tried to configure "+node.getClass().getName()+" with null Node"); node.setColumnNumber(ast.getColumn()); node.setLineNumber(ast.getLine()); if (ast instanceof GroovySourceAST) { node.setLastColumnNumber(((GroovySourceAST)ast).getColumnLast()); node.setLastLineNumber(((GroovySourceAST)ast).getLineLast()); } // TODO we could one day store the Antlr AST on the Groovy AST // node.setCSTNode(ast); }
protected void configureAST(ASTNode node, AST ast) { if (ast==null) throw new ASTRuntimeException(ast, "PARSER BUG: Tried to configure "+node.getClass().getName()+" with null Node"); node.setColumnNumber(ast.getColumn()); node.setLineNumber(ast.getLine()); if (ast instanceof GroovySourceAST) { node.setLastColumnNumber(((GroovySourceAST)ast).getColumnLast()); node.setLastLineNumber(((GroovySourceAST)ast).getLineLast()); } // TODO we could one day store the Antlr AST on the Groovy AST // node.setCSTNode(ast); }
protected void configureAST(ASTNode node, AST ast) { if (ast == null) throw new ASTRuntimeException(ast, "PARSER BUG: Tried to configure " + node.getClass().getName() + " with null Node"); node.setColumnNumber(ast.getColumn()); node.setLineNumber(ast.getLine()); if (ast instanceof GroovySourceAST) { node.setLastColumnNumber(((GroovySourceAST) ast).getColumnLast()); node.setLastLineNumber(((GroovySourceAST) ast).getLineLast()); } // TODO we could one day store the Antlr AST on the Groovy AST // node.setCSTNode(ast); }