Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

compiler I need the code in C program : For this assignment, you will use FLex or Lex for the lexical part of the task

compiler
I need the code in C program :
image text in transcribed
For this assignment, you will use FLex or Lex for the lexical part of the task and Yacc or Bison for writing a parser for a simple language described as: Consider the CFG that defines a simple expression. E int +E int * E(E) int We want to read expressions and generate codes for this language using the MIPS processor's assembly language, assuming a stack evaluation model. For example, the generated code for the expression 5+7 should be li $a05 sw $a00($sp) addiu $sp$sp4 li $a07 Iw $t14($sp) add $a0t1$a0 addiu \$sp \$sp -4 Your work results in a C program that can take expressions written in the above language and produce the relevant code. For example, for input 5+7, it generates the above MIPS code. You will use FLex to capture the tokens of the language. And Yacc or Bison to parse and generate code for valid expressions

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

Students also viewed these Databases questions

Question

How does auditor independence facilitate professional skepticism?

Answered: 1 week ago

Question

Assess three steps in the selection process.

Answered: 1 week ago

Question

Identify the steps in job analysis.

Answered: 1 week ago