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

Variable Index

 o keywords
Hashtable che contiene le keywords.
 o symbols
Hashtable che contiene i riferimenti ai simboli.

Constructor Index

 o SymbolTable()
Costruttore della tabella dei simboli.

Method Index

 o addKeyword(String)
Aggiunge un simbolo alla lista delle keywords.
 o addSymbol(SymbolTableItem)
Aggiunge un simbolo alla tabella dei simboli.
 o getSymbol(String)
Restituisce un elemento della tabella dei simboli.
 o symbols()
Restituisce una enumerazione dei simboli contenuti nella tabella.

Variables

 o symbols
 private Hashtable symbols
Hashtable che contiene i riferimenti ai simboli.

See Also:
Hashtable
 o keywords
 private Vector keywords
Hashtable che contiene le keywords.

See Also:
Vector

Constructors

 o SymbolTable
 public SymbolTable()
Costruttore della tabella dei simboli.

See Also:
symbols, keywords

Methods

 o 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
 o 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
 o 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
 o 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