use of org.codehaus.groovy.antlr.LineColumn in project groovy-core by groovy.
the class LineColumnChecker method visitDefault.
public void visitDefault(GroovySourceAST t, int visit) {
if (visit == OPENING_VISIT) {
System.out.println("[" + tokenNames[t.getType()] + "]");
int line = t.getLine();
int column = t.getColumn();
int lineLast = t.getLineLast();
int columnLast = t.getColumnLast();
System.out.println("" + line + " / " + column + " - " + lineLast + " / " + columnLast);
if (line > 0 && column > 0 && lineLast > 0 && columnLast > 0) {
System.out.println("" + sourceBuffer.getSnippet(new LineColumn(line, column), new LineColumn(lineLast, columnLast)));
} else {
System.out.println("ZERO");
}
} else if (visit == CLOSING_VISIT) {
System.out.println();
}
}
Aggregations