A: Create a variable declaration grammar that accepts: single/multiple declaration of variables (e.g int x, y; float a, char s), single/multiple dimensional of arrays (e.g float d[12][3], char p[10]),...



Course: Compiler Construction


PS: I solved this question but I have no idea that it is correct or not. Need your help teacher Kindly help me out with this question TIA.


A: Create a variable declaration grammar that accepts: single/multiple declaration of variables (e.g<br>int x, y; float a, char s), single/multiple dimensional of arrays (e.g float d[12][3], char p[10]),<br>pointer type variables (e.g. int *ptr) and record (e.g. STRUCT type) type variables.<br>B: Now consider that the integer takes 5 bytes, float takes 10 bytes and char takes 1 byte. Create<br>an SDD that generate the total bytes allocated by any declaration statement. (e.g int s[10][3]<br>allocates 150 bytes in memory).<br>C: Create dependency graph for the input string using the grammar developed in the above PART<br>А.<br>record {int x; float y[10];} data[5];<br>D: Now convert the developed SDD into an equivalent SDT.<br>

Extracted text: A: Create a variable declaration grammar that accepts: single/multiple declaration of variables (e.g int x, y; float a, char s), single/multiple dimensional of arrays (e.g float d[12][3], char p[10]), pointer type variables (e.g. int *ptr) and record (e.g. STRUCT type) type variables. B: Now consider that the integer takes 5 bytes, float takes 10 bytes and char takes 1 byte. Create an SDD that generate the total bytes allocated by any declaration statement. (e.g int s[10][3] allocates 150 bytes in memory). C: Create dependency graph for the input string using the grammar developed in the above PART А. record {int x; float y[10];} data[5]; D: Now convert the developed SDD into an equivalent SDT.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here