antlraux package
v0.2.1

antlraux.util
Interface LexInfo

All Known Implementing Classes:
ContextException, Declaration, LexInfoAST, LexInfoException, LexInfoToken

public interface LexInfo

This interface represents a class that stores lexical information, this is, a filename, a line and a column. This interface does not requiere nor guaranties "completeness" in lexical information; filename may be null, and line and column may be -1.

Author:
Enrique José García Cota

Field Summary
static int DEFAULT_COLUMN
          Provides a safe default column value (-1)
static java.lang.String DEFAULT_FILENAME
          Provides a safe default file name (null)
static int DEFAULT_LINE
          Provides a safe default line value (-1)
 
Method Summary
 void copyLexInfo(LexInfo from)
          Copies the lexical information from other LexInfo.
 int getColumn()
          Get the column for this node
 java.lang.String getFilename()
          Get the file name for this node
 java.lang.String getLexInfoString()
          Returns true if all the information (Filename:line:column) is valid; false otherwise.
 int getLine()
          Get the line for this node
 void setColumn(int column)
          Set the column for this node
 void setFilename(java.lang.String fn)
          Sets the file name for this node.
 void setLine(int line)
          Set the line for this node
 

Field Detail

DEFAULT_LINE

public static final int DEFAULT_LINE
Provides a safe default line value (-1)

See Also:
Constant Field Values

DEFAULT_COLUMN

public static final int DEFAULT_COLUMN
Provides a safe default column value (-1)

See Also:
Constant Field Values

DEFAULT_FILENAME

public static final java.lang.String DEFAULT_FILENAME
Provides a safe default file name (null)

Method Detail

getFilename

public java.lang.String getFilename()
Get the file name for this node


getColumn

public int getColumn()
Get the column for this node


getLine

public int getLine()
Get the line for this node


setFilename

public void setFilename(java.lang.String fn)
Sets the file name for this node.


setColumn

public void setColumn(int column)
Set the column for this node


setLine

public void setLine(int line)
Set the line for this node


copyLexInfo

public void copyLexInfo(LexInfo from)
Copies the lexical information from other LexInfo. WARNING: do not forget the case from==null!


getLexInfoString

public java.lang.String getLexInfoString()
Returns true if all the information (Filename:line:column) is valid; false otherwise. It will usually be implemented around a FileLineFormatter, which authomatically deals with incompleteness in the information.


antlraux package
v0.2.1

Created by Enrique José García Cota