Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MIPS- +-*/ calculator Write a program that read in an input string of up to 20 characters in the following format and caluculate the result.

MIPS- +-*/ calculator

Write a program that read in an input string of up to 20 characters in the following format and caluculate the result.

" :: = Id = Int op Int"

where

- Id = 6 charatics alphabetic variable name

- Int = postive int value < 1000

- op = {+ or - or * or /}

I understand how to read in a string in MIPS, and how to perform the calculation once I have the op, Int1, and Int2. But I don't understand how to parses the string acording to the grammar, and find what is the Id/ Int1/. Int2/ op from the the string in MIPS. Can you please teach me/ write me the code on how to parses the string into Id/ Int1/ Int2/ op. Thanks!!

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

Students also viewed these Databases questions

Question

=+2 Is the decision sustainable in the long run?

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago