Piethon
1.0
A Python-like interpreter using flex and bison.
symbolTable.cpp
Go to the documentation of this file.
1
#include "
exception.h
"
2
#include "
symbolTable.h
"
3
4
Number
SymbolTable::operator[]
(
const
string
& ident)
const
{
5
// ensure variable is defined
6
if
(symTable.count(ident) == 0) {
7
throw
UnboundIdentifier
();
8
}
9
// return value
10
return
symTable.find(ident)->second;
11
}
12
13
Number
&
SymbolTable::operator[]
(
const
string
& ident) {
14
// return reference to entry in symTable
15
return
symTable[ident];
16
}
17
exception.h
UnboundIdentifier
Definition:
exception.h:50
symbolTable.h
SymbolTable::operator[]
Number operator[](const string &) const
Definition:
symbolTable.cpp:4
Number
Definition:
number.h:21
Generated on Tue Jan 19 2021 23:43:11 for Piethon by
1.8.13