|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.lexer.yacc.SourcePosition
Position within a source. This could have column as well, but it currently does not. A normal ruby intrepretter does not use this information in error/warning information. An IDE using this may need it though. This is trivially added if need be.
ISourcePosition
,
Serialized FormConstructor Summary | |
SourcePosition()
Creates a default source position - required for serialization. |
|
SourcePosition(java.lang.String file,
int startLine,
int endLine)
Creates a new source position. |
|
SourcePosition(java.lang.String file,
int startLine,
int endLine,
int startOffset,
int endOffset)
Creates a new source position. |
Method Summary | |
void |
adjustStartOffset(int relativeValue)
Modify startOffset by a relativeValue. |
static SourcePosition |
combinePosition(ISourcePosition firstPos,
ISourcePosition secondPos)
Not used in interpreter Creates a new position the encloses both parameter positions. |
boolean |
equals(java.lang.Object object)
|
int |
getEndLine()
Which is the last(end) line that this source position occurs on (zero-based) |
int |
getEndOffset()
Not used in interpreter |
java.lang.String |
getFile()
Which file does this source position live in? |
int |
getStartLine()
Not used in interpreter |
int |
getStartOffset()
Not used in interpreter |
int |
hashCode()
Something we can use for identity in hashing, etc... |
java.lang.String |
toString()
|
ISourcePosition |
union(ISourcePosition other)
Calculates the logical union of the two positions and creates a new resulting position |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SourcePosition()
public SourcePosition(java.lang.String file, int startLine, int endLine)
file
- location of the source (must not be null)endLine
- what line within the sourcepublic SourcePosition(java.lang.String file, int startLine, int endLine, int startOffset, int endOffset)
file
- location of the source (must not be null)Method Detail |
public java.lang.String getFile()
ISourcePosition
getFile
in interface ISourcePosition
ISourcePosition.getFile()
public int getStartLine()
getStartLine
in interface ISourcePosition
ISourcePosition.getStartLine()
public int getEndLine()
ISourcePosition
getEndLine
in interface ISourcePosition
ISourcePosition.getEndLine()
public boolean equals(java.lang.Object object)
object
- the object which should be compared
public int hashCode()
Object.hashCode()
public java.lang.String toString()
Object.toString()
public void adjustStartOffset(int relativeValue)
ISourcePosition
adjustStartOffset
in interface ISourcePosition
relativeValue
- to nudge startOffset up or downISourcePosition.adjustStartOffset(int)
public int getStartOffset()
getStartOffset
in interface ISourcePosition
ISourcePosition.getStartOffset()
public int getEndOffset()
getEndOffset
in interface ISourcePosition
ISourcePosition.getEndOffset()
public ISourcePosition union(ISourcePosition other)
ISourcePosition
union
in interface ISourcePosition
other
- to be unioned against this position
ISourcePosition.union(ISourcePosition)
public static SourcePosition combinePosition(ISourcePosition firstPos, ISourcePosition secondPos)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |