All Packages Class Hierarchy This Package Previous Next Index
Class it.unipi.di.compiler.symboltable.SymbolTable
java.lang.Object
|
+----it.unipi.di.compiler.symboltable.SymbolTable
- public class SymbolTable
- extends Object
Classe che realizza una tabella dei simboli. Ogni elemento
della tabella è di tipo SymbolTableItem.
Se si utilizza il metodo addKeyword per dire alla SymbolTable
questa controllerà che non possano essere utilizzate
keywords come identificatori.
- Version:
- 1.0
- Author:
- Antonio Cisternino
- See Also:
- SymbolTableItem, addKeyword
-
keywords
- Hashtable che contiene le keywords.
-
symbols
- Hashtable che contiene i riferimenti ai simboli.
-
SymbolTable()
- Costruttore della tabella dei simboli.
-
addKeyword(String)
- Aggiunge un simbolo alla lista delle keywords.
-
addSymbol(SymbolTableItem)
- Aggiunge un simbolo alla tabella dei simboli.
-
getSymbol(String)
- Restituisce un elemento della tabella dei simboli.
-
symbols()
- Restituisce una enumerazione dei simboli contenuti nella tabella.
symbols
private Hashtable symbols
- Hashtable che contiene i riferimenti ai simboli.
- See Also:
- Hashtable
keywords
private Vector keywords
- Hashtable che contiene le keywords.
- See Also:
- Vector
SymbolTable
public SymbolTable()
- Costruttore della tabella dei simboli.
- See Also:
- symbols, keywords
addSymbol
public void addSymbol(SymbolTableItem i) throws IllegalSymbolException
- Aggiunge un simbolo alla tabella dei simboli. Se il simbolo
esiste già la tabella resta invariata.
- Parameters:
- i - Elemento da aggiungere.
- Throws: IllegalSymbolException
- Il simbolo è una
parola chiave
- See Also:
- SymbolTableItem
addKeyword
public void addKeyword(String i)
- Aggiunge un simbolo alla lista delle keywords. Se il simbolo
esiste già la lista resta invariata.
- Parameters:
- i - Elemento da aggiungere.
- See Also:
- SymbolTableItem
getSymbol
public SymbolTableItem getSymbol(String name)
- Restituisce un elemento della tabella dei simboli.
- Returns:
- Se l'emento viene trovato viene restituito, altrimenti
viene restituito null.
- See Also:
- SymbolTypeItem
symbols
public Enumeration symbols()
- Restituisce una enumerazione dei simboli contenuti nella tabella.
- Returns:
- L'Enumeration dei simboli.
All Packages Class Hierarchy This Package Previous Next Index