Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment # 3: Compiler Construction Q1: Create a Programming language grammar which contains the following syntax: 1: Program block (like, main ()) 2: Variable

image text in transcribedimage text in transcribed

Assignment # 3: Compiler Construction Q1: Create a Programming language grammar which contains the following syntax: 1: Program block (like, main ()) 2: Variable declaration statement (at least accepts any four data types with arrays) 3: At least one looping statement 4: At least one decision statement 5: Expression Statement 6: Function declaration and definition Q2: Create CLR machine for the developed grammar Q3: Use any sample code according to the developed grammar and generate a stack table to validate the code. a. For the following C++ code: int LimSquare (x) int y; { } Compiler Construction /* returns y squared, but never more than 100 */ return (y = 10) ? 100: y*y; 1. List all lexemes and tokens 2. List all tokens that will have entries in the Symbol Table b. Complete the following grammar written for deceleration statements in C programming language, only for VarDeclare, so it can derive similar strings like the following input (Note: x can be any valid identifier): float x; 1. prog 2. stmts 3. stmt stmts stmt; | stmts stmt; | { stmts} DeclareStmts 4. DeclareStmts VarDeclare | FunDeclare

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

Cambridge International AS & A Level Computer Science

Authors: David Watson, Helen Williams

1st Edition

1510457593, 978-1510457591

More Books

Students also viewed these Programming questions

Question

Who do you consider family?

Answered: 1 week ago