at.dms.compiler
Class TokenReference
java.lang.Object
|
+--at.dms.compiler.TokenReference
- public class TokenReference
- extends java.lang.Object
A reference to a file and a position in the file.
Field Summary |
static TokenReference |
NO_REF
Special reference to use when no reference is available or possible. |
Constructor Summary |
TokenReference(java.lang.String file,
int line)
Construct a file and line reference. |
Method Summary |
static TokenReference |
build(java.lang.String file,
int line)
Construct a line and file reference |
java.lang.String |
getFile()
Returns the file name of reference. |
int |
getLine()
Returns the line number of reference |
java.lang.String |
getName()
Returns the name of reference (getFile().baseName()) |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NO_REF
public static TokenReference NO_REF
- Special reference to use when no reference is available or possible.
TokenReference
public TokenReference(java.lang.String file,
int line)
- Construct a file and line reference.
- Parameters:
file
- the file nameline
- the line number
build
public static TokenReference build(java.lang.String file,
int line)
- Construct a line and file reference
- Parameters:
file
- the file nameline
- the line number
WARNING: DOES NOT LIKE MULTITHREADING
getFile
public final java.lang.String getFile()
- Returns the file name of reference.
getName
public final java.lang.String getName()
- Returns the name of reference (getFile().baseName())
getLine
public final int getLine()
- Returns the line number of reference
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object