Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1)What is the grammar accepted by these two interpreters? Write as EBNF form 2)How can the bison program evaluate the input, e.g., print out the

1)What is the grammar accepted by these two interpreters? Write as EBNF form

2)How can the bison program evaluate the input, e.g., print out the result

Note: both take in 0-9, +, -, /, *, but does not take negative numbers .

a)

image text in transcribed

b)

image text in transcribed

[02/12/19]seed@VM$ cd cps352s19/labs/labl/calcl [02/12/19] seed@VM:-/.../calcl$ ls build calcl.l calcl.y [02/12/19] seed@VM:-1.../calcl$ ./build calcl.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr] [02/12/19]seed@VM:-/.../calcl$ ls build calc1. ex . yy . .tab . .tab.o calcl calci.y lex.yy.o y.tab.h [02/12/19]seed@VM:-/.../calc1$ ./calcl 1+3-2 2 6-3-2 syntax error [02/12/19]seed@vM:-/.../calc1$ I 300 *calco.l (/cps352s19/labs/lab1) gedit )1:40AM Terminal [02/12/19]seed@VM:-/.../calc2$ ls build calc2.1 cale2.y [02/12/19]seed@VM:-/.../calc2$ build [02/12/19] seed@VM:-/.../calc2$ ls build calc2 calc2.y lex.yy.o y.tab.h [02/12/19]seed@VM:-/.../calc2$ ./calc2 S calc2.1 . yy . .tab . .tab.o a=10 a+i 15 b-a-i Lex Tab Width: 8 Ln27, Col2 INS

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

Students also viewed these Databases questions

Question

g. Is the value of b equal to 0.5? Pg45

Answered: 1 week ago

Question

1.Which are projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

What are the classifications of Bank?

Answered: 1 week ago