|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.nlp.Parsing.SymTabEntry
public class SymTabEntry
This class denotes one entry per user-defined symbol in the Symbol Table.
$Id: SymTabEntry.java,v 1.13 2008/01/03 03:21:57 mokhov Exp $
Field Summary | |
---|---|
protected boolean |
bDeclared
A flag indicating that the symbol was (true) or was not (false) resolved. |
protected boolean |
bMultilplyDefined
A flag indicating that the symbol was (true) or was not (false) multiply defined. |
protected boolean |
bReserved
A flag indicating that the symbol was (true) or was not (false) reserved. |
static int |
CLASS
Class Entry Type. |
static int |
FUNCTION
Function entry type. |
int |
iEntryType
Current Entry type. |
protected int |
iID
Numeric ID of the entry. |
protected SymDataType |
oDataType
Data type of this symbol (e.g. |
protected java.util.Vector |
oGenCodeLocations
Locations in generated code (point, x - base, y - offset). |
protected SymbolTable |
oLocalSymTab
Local scope symbol table (if applicable). |
protected java.util.Vector |
oLocationsList
List of locations where the given ID appears in the source code. |
protected Token |
oUID
Entry symbol, encapsulated as Token. |
protected java.lang.String |
strName
Name of the symbol table entry, must be unique. |
static int |
VARIABLE
Variable entry type. |
Constructor Summary | |
---|---|
SymTabEntry()
Default Constructor. |
|
SymTabEntry(java.lang.String pstrName)
Constructs object with the name of the symbol table entry. |
|
SymTabEntry(Token poUID)
Constructs object with the entry symbol, encapsulated as Token. |
|
SymTabEntry(Token poUID,
boolean pbDeclared)
Constructs object with the entry symbol, encapsulated as Token, and a flag to indicate whether the symbol was resolved. |
|
SymTabEntry(Token poUID,
SymDataType poSymDataType)
Constructs object with the entry symbol, encapsulated as Token, and entry symbol's data type; set the symbol as resolved. |
Method Summary | |
---|---|
void |
addLocation(java.awt.Point poPosition)
Adds location to every occurrence of a token in the source code. |
SymDataType |
getDataType()
Allows querying current data type of the entry. |
int |
getID()
Gets Numeric ID of the entry. |
SymbolTable |
getLocalSymTab()
Allows querying for the local scope symbol table (if applicable). |
java.util.Vector |
getLocationsList()
Get list of occurrences of this token entry. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
Token |
getUID()
Returns UID. |
boolean |
isDeclared()
Determines if the resolved property is true. |
boolean |
isMultiplyDefined()
Determines if the MultiplyDefined property is true. |
void |
setDeclared(boolean pbDeclared)
Sets the value of the declared property. |
void |
setID(int piID)
Sets numeric ID of the entry. |
void |
setMultiplyDefined()
Sets the value of the MultilplyDefined property as true. |
void |
setMultiplyDefined(boolean pbFlag)
Sets the value of the MultilplyDefined property. |
void |
setUID(Token poToken)
Sets UID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VARIABLE
public static final int FUNCTION
public static final int CLASS
protected int iID
protected boolean bDeclared
protected boolean bReserved
protected boolean bMultilplyDefined
protected Token oUID
protected SymDataType oDataType
protected java.util.Vector oLocationsList
protected java.util.Vector oGenCodeLocations
protected SymbolTable oLocalSymTab
public int iEntryType
protected java.lang.String strName
Constructor Detail |
---|
public SymTabEntry()
public SymTabEntry(java.lang.String pstrName)
pstrName
- name of the scopepublic SymTabEntry(Token poUID)
poUID
- entry symbol, encapsulated as Tokenpublic SymTabEntry(Token poUID, boolean pbDeclared)
poUID
- entry symbol, encapsulated as TokenpbDeclared
- a flag indicating whether the symbol was resolved.public SymTabEntry(Token poUID, SymDataType poSymDataType)
poUID
- entry symbol, encapsulated as TokenpoSymDataType
- data type of the symbol.Method Detail |
---|
public SymDataType getDataType()
public void addLocation(java.awt.Point poPosition)
poPosition
- position (line and column) of the symbol's occurencepublic java.util.Vector getLocationsList()
public Token getUID()
public void setUID(Token poToken)
poToken
- entry symbol encapsulated as Tokenpublic boolean isDeclared()
true if the Resolved property is true
public void setDeclared(boolean pbDeclared)
pbDeclared
- the new value of the Declared propertypublic boolean isMultiplyDefined()
true if the MultilplyDefined property is true
public void setMultiplyDefined(boolean pbFlag)
pbFlag
- the new value of the MultilplyDefined propertypublic void setMultiplyDefined()
public SymbolTable getLocalSymTab()
public int getID()
public void setID(int piID)
piID
- the new value of the symbol table entry's IDpublic static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |