Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Subject: Compiler construction (Need Answer ASAP) Q) Draw symbol table for the following code using separate chaining approach. Assume size of the table is 10.

Subject: Compiler construction (Need Answer ASAP)

Q) Draw symbol table for the following code using separate chaining approach. Assume size of the table is 10. Show how the table evolves at each statement. You can calculate hash value using the hash() function provided underneath:

  1. public class CC {
  2. int a;
  3. public void m(int a) {
  4. char c='B';
  5. {
  6. double d=0.0;
  7. }
  8. }
  9. } //end CC class

public int hash( String k ) {

int value = 0;

for( int i=0; i

value = value + (int)k.charAt( i );

}

return value % 10;

} //end HASH() function

Hint: A-Z ranges 65-90 and a-z ranges 97-122. Hence identifier A will have has value 5, B will have 6, and similarly identifier AB will have 1 and so on.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago