Package net.hydromatic.morel.ast
Class Pos
java.lang.Object
net.hydromatic.morel.ast.Pos
Position of a parse-tree node.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribeTo(StringBuilder buf) booleaninthashCode()private static org.apache.calcite.util.mapping.IntPairReturns the 1-based line.static PosCreates a Pos from two offsets.Creates a Pos from a filename and a string with a delimiter character.static <E> Posstatic PosCombines an iterable of parser positions to create a position which spans from the beginning of the first to the end of the last.private static PosComputes the parser position which is the sum of an array of parser positions and of a parser position represented by (line, column, endLine, endColumn).static Posprivate static PosCombines a list of parser positions to create a position which spans from the beginning of the first to the end of the last.toString()
-
Field Details
-
ZERO
-
file
-
startLine
public final int startLine -
startColumn
public final int startColumn -
endLine
public final int endLine -
endColumn
public final int endColumn
-
-
Constructor Details
-
Pos
Creates a Pos.
-
-
Method Details
-
of
Creates a Pos from two offsets. -
split
Creates a Pos from a filename and a string with a delimiter character. The delimiter must occur exactly twice in the string. -
hashCode
public int hashCode() -
equals
-
toString
-
describeTo
-
sum
Combines an iterable of parser positions to create a position which spans from the beginning of the first to the end of the last. -
sum
-
sum
-
sum_
Combines a list of parser positions to create a position which spans from the beginning of the first to the end of the last. -
sum
Computes the parser position which is the sum of an array of parser positions and of a parser position represented by (line, column, endLine, endColumn).- Parameters:
poses- Array of parser positionsline- Start linecolumn- Start columnendLine- End lineendColumn- End column- Returns:
- Sum of parser positions
-
plus
-
plusAll
-
plusAll
-
lineCol
Returns the 1-based line.
-