com.unitesk.atp.tree.tool.antlr
Class PositionFactory

java.lang.Object
  extended by com.unitesk.atp.tree.tool.antlr.PositionFactory

public abstract class PositionFactory
extends Object

Create positions from token.

Since:
3.6.1
Version:
$Id: PositionFactory.java,v 1.2 2006/02/13 15:04:04 all-x Exp $
Author:
Alexey Demakov

Constructor Summary
PositionFactory()
           
 
Method Summary
static Position getEndPosition(antlr.Token t)
          Get end position of one-line token.
static OffsetPosition getOffsetPosition(antlr.Token t)
          Get offset position.
static Position getPosition(antlr.Token t)
          Get position of token.
static OffsetRange getRange(antlr.Token t)
          Get range of the given one-line token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionFactory

public PositionFactory()
Method Detail

getPosition

public static Position getPosition(antlr.Token t)
Get position of token.

Parameters:
t - Token to get position.
Returns:
Position of given token.

getEndPosition

public static Position getEndPosition(antlr.Token t)
Get end position of one-line token. Column of end position points after token, not at the last char.

Parameters:
t - Token to get end position.
Returns:
End position of given token.

getOffsetPosition

public static OffsetPosition getOffsetPosition(antlr.Token t)
Get offset position.

Parameters:
t - must be of type OffsetToken
Returns:
offset position of the given token.
Throws:
ClassCastException - if t is not of type OffsetPosition
Since:
3.6.4, 4.0.1

getRange

public static OffsetRange getRange(antlr.Token t)
Get range of the given one-line token.

Parameters:
t - offset token
Returns:
range
Throws:
ClassCastException - if t is not of type OffsetPosition
Since:
3.6.4, 4.0.1


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.