retagged by
592 views

1 Answer

Best answer
3 votes
3 votes

from the given SDT we conclude some rules

i)' *'  is least priority and left associative.

ii)'-' is 2nd highest priority and left associative

iii) '/' is highest priority and right associative.

1)    8/4*2-6*4

=2*2-6*4 (8/4=2)

=2*-4*4 (2-6=-4)

=-2*4 (2*-4=-2  addition property for *)

a1=2

2) 6*2/1-2*3

=6*2-2*3

=6*0*3

=6*3

a2=9.

so a1-a2=2-9=-7

selected by
Answer:

Related questions

4 votes
4 votes
2 answers
1
0 votes
0 votes
3 answers
2
0 votes
0 votes
1 answer
3
saumya mishra asked Jun 11, 2018
207 views
How to make a parse tree for the expression$a+b*c/b*c*f?$
0 votes
0 votes
1 answer
4
saumya mishra asked Jun 5, 2018
767 views
Consider the following grammar$S \rightarrow SS/Sa/aS/a$Construct Parse Tree for $w=aaaa$ as many as possible? How many parse trees are possible?