11 self
.counter
= self
.counter
+ 1
13 def reset_counter(self
):
16 def add_to_global(self
, key
, value
):
17 if key
in self
.global_table
:
19 self
.global_table
[key
] = value
22 def add_to_local(self
, key
, value
):
23 if key
in self
.local_table
:
25 self
.local_table
[key
] = value
29 def reset_local(self
):
30 self
.local_table
.clear()
32 # return the value of 'key' (if present) from the tables
33 def return_value(self
, key
, structure
= False):
35 # find in global table
36 if key
in self
.global_table
:
37 return self
.global_table
[key
]
40 elif key
in self
.local_table
:
41 return self
.local_table
[key
]
44 elif structure
!= False and key
in structure
.in_members(key
):
45 return structure
.get_member(key
)
48 print "id '" + key
+ "' not defined"