adplus-dvertising
frame-decoration

Question

Given the following expression grammar:
E -> E * F | F + E | F

F -> F - F | id

Which of the following is true?

a.

* has higher precedence than +

b.

– has higher precedence than *

c.

+ and — have same precedence

d.

+ has higher precedence than *

Answer: (b).– has higher precedence than *

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Given the following expression grammar: E -> E * F | F + E | F F -> F - F | id Which of the following is true?

Similar Questions

Discover Related MCQs

Q. lanation: e.g. input is 3*4-5 rFirst ‘- ‘ is be evaluated then ‘ *’.5. Which one of the following is true at any valid state in shift-reduce parsing?

Q. Match the following:
List-I List-II

A. Lexical analysis 1. Graph colouring

B. Parsing 2. DFA minimization

C. Register allocation 3. Post-order traversal

D. Expression evaluation 4. Production tree

A B C D

Q. Consider the following grammar G.
S → F ⎪ H

F → p ⎪ c

H → d ⎪ c

Which one is true?

S1: All strings generated by G can be parsed with help of LL (1).

S2: All strings generated by G can be parsed with help of LR (1).

Q. Consider the following two sets of LR (1) items of an LR (1) grammar.
X -> c.X, c/d

X -> .cX, c/d

X -> .d, c/d

X -> c.X, $

X -> .cX, $

X -> .d, $

Which one is false?

1. Cannot be merged since look ahead’s are different.

2. Can be merged but will result in S-R conflict.

3. Can be merged but will result in R-R conflict.

4. Cannot be merged since goto on c will lead to two different sets.

Q. Lr parser are attractive because

Q. Which is the most powerful parser?

Q. How is the parsing precedence relations defined

Q. When will the relationship between ‘+’ and ‘-’ be <

Q. When will the relationship between ‘<’ and ‘>’ be <

Q. In an absolute loading scheme which loader function is accomplished by assembler

Q. Shift reduce parser are

Q. Which of these is true about LR parsing ?

Q. Which of the following is incorrect for the actions of A LR-Parser I) shift s ii) reduce A->ß iii) Accept iv) reject?