public class SymbolsTable extends Object
| Constructor and Description |
|---|
SymbolsTable()
Make a new table of symbols for a script.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
declare(String label,
BtrpOperand t)
Declare a new variable.
|
boolean |
declareImmutable(String label,
BtrpOperand t)
Declare an immutable variable.
|
BtrpOperand |
getSymbol(String label)
Get the content associated to a variable label.
|
boolean |
isDeclared(String label)
Check wether a variable is declared.
|
boolean |
isImmutable(String label)
Check if one variable is immutable.
|
boolean |
popTable()
Pop the table.
|
void |
pushTable()
Push the table.
|
boolean |
remove(String label)
Remove a symbol from the table.
|
String |
toString()
Textual representation of the table of symbol.
|
public static final String ME
public boolean declareImmutable(String label, BtrpOperand t)
label - the identifier of the variablet - the operand associated to the identifiertrue if the variable as been declared. false otherwisepublic boolean remove(String label)
label - the symbol to removetrue if the symbol was present then removed. false otherwisepublic boolean isImmutable(String label)
label - the identifier of the variabletrue if the variable is immutablepublic final boolean declare(String label, BtrpOperand t)
label - the label of the variablet - the content of the variabletrue if the declaration succeeds, false otherwisepublic BtrpOperand getSymbol(String label)
label - the label of the variablenull otherwisepublic boolean isDeclared(String label)
label - the label of the variabletrue if the variable is already declared, false otherwisepublic String toString()
public void pushTable()
public boolean popTable()
true if the table has been popped successfully. false otherwiseCopyright © 2016 University of Nice-Sophia Antipolis. All Rights Reserved.