public int getLine() { return ast != null ? ast.getLine() : -1; }
protected static String description(AST node) { return (node != null) ? " at line: " + node.getLine() + " column: " + node.getColumn() : ""; }
private static int getLineLast(ASTRuntimeException e) { final AST ast = e.getAst(); return (ast instanceof SourceInfo) ? ((SourceInfo)ast).getLineLast() : ast.getLine(); }
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 int compareTo(Object object) { if (object == null) { return 0; } if (!(object instanceof AST)) { return 0; } AST that = (AST) object; // todo - possibly check for line/col with values of 0 or less... if (this.getLine() < that.getLine()) { return -1; } if (this.getLine() > that.getLine()) { return 1; } if (this.getColumn() < that.getColumn()) { return -1; } if (this.getColumn() > that.getColumn()) { return 1; } return 0; }
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); }
Token first = cloneToken(LT(1)); if (modifiers != null) { first.setLine(modifiers.getLine()); first.setColumn(modifiers.getColumn());
Token first = cloneToken(LT(1)); AST prevCurrentClass = currentClass; if (modifiers != null) { first.setLine(modifiers.getLine()); first.setColumn(modifiers.getColumn());
Token first = cloneToken(LT(1)); if (modifiers != null) { first.setLine(modifiers.getLine()); first.setColumn(modifiers.getColumn());
Token first = cloneToken(LT(1));AST prevCurrentClass = currentClass; if (modifiers != null) { first.setLine(modifiers.getLine()); first.setColumn(modifiers.getColumn());
Token first = cloneToken(LT(1));AST prevCurrentClass = currentClass; if (modifiers != null) { first.setLine(modifiers.getLine()); first.setColumn(modifiers.getColumn());
Token first = cloneToken(LT(1)); if (mods != null) { first.setLine(mods.getLine()); first.setColumn(mods.getColumn());
public int getLine() { return ast != null ? ast.getLine() : -1; }
public int line() { return ast.getLine(); }
public int line() { return ast.getLine(); }
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(); } }
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); }