Package org.apache.groovy.parser.antlr4
Class PositionInfo
java.lang.Object
org.apache.groovy.parser.antlr4.PositionInfo
Line and column attached to a parser syntax error.
toString()
renders @ line N, column M, or an empty string when either
coordinate is -1.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PositionInfo
public PositionInfo(int line, int column) Stores a source location. Coordinates are the caret position used by the syntax error, including any offset the caller already applied.- Parameters:
line- 1-based line, or-1when the location is omittedcolumn- 1-based column, or-1when the location is omitted
-
-
Method Details
-
getLine
public int getLine()Returns the stored line.- Returns:
- the 1-based line, or
-1when omitted
-
setLine
public void setLine(int line) Replaces the stored line.- Parameters:
line- 1-based line, or-1to omit the location
-
getColumn
public int getColumn()Returns the stored column.- Returns:
- the 1-based column, or
-1when omitted
-
setColumn
public void setColumn(int column) Replaces the stored column.- Parameters:
column- 1-based column, or-1to omit the location
-
equals
-
hashCode
public int hashCode() -
toString
-