Question: Can you please modify the delete _ from _ scope ( ) and print _ scope _ table ( ofstream& outlog ) functions in the
Can you please modify the deletefromscope and printscopetableofstream& outlog functions in the scopetable class so that the output structure is as shown below:
ScopeTable #
a : ID
Variable
Type: int
b : ID
Variable
Type: float
ScopeTable #
func : ID
Function Definition
Return Type: int
Number of Parameters:
Parameter Details: int a float b
################################
Scopetable with ID removed
Funtions to be modified:
bool deletefromscopesymbolinfo symbol
int index hashfunctionsymbolgetname;
if tableindex nullptr && tableindexgetname symbolgetname
tableindex nullptr;
return true; if symbol is found in the scope
else
return false; if symbol is not found in the scope
void printscopetableofstream& outlog
outlog "ScopeTable # tostringuniqueid endl;
iterate through the current scope table and print the symbols and all relevant information
for int i ; i bucketcount; i
for symbolinfo s : tablei
outlog "Bucket no i : sgetname sgettype endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
