at.dms.compiler.tools.common
Class TokenReference

java.lang.Object
  extended by at.dms.compiler.tools.common.TokenReference

public class TokenReference
extends Object

This class defines objets that hold a reference to a file and a position in the file.


Field Summary
static TokenReference NO_REF
           
 
Constructor Summary
TokenReference(String file, int line)
          Construct a file and line reference
 
Method Summary
static TokenReference build(String file, int line)
          Construct a line and file reference
 String getFile()
          Returns the file name of reference
 int getLine()
          Returns the line number of reference
 String getName()
          Returns the name of reference (getFile().baseName())
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_REF

public static TokenReference NO_REF
Constructor Detail

TokenReference

public TokenReference(String file,
                      int line)
Construct a file and line reference

Parameters:
file - the file name
line - the line number
Method Detail

build

public static TokenReference build(String file,
                                   int line)
Construct a line and file reference

Parameters:
file - the file name
line - the line number WARNING: DOES NOT LIKE MULTITHREADING

getFile

public final String getFile()
Returns the file name of reference


getName

public final String getName()
Returns the name of reference (getFile().baseName())


getLine

public final int getLine()
Returns the line number of reference


toString

public String toString()
Overrides:
toString in class Object