When is it useful to eliminate left-recursion from a grammar and why?

Describe the costs and benefits of performing inline expansion of functions during compilation
March 21, 2023
Define the following terms used when discussing a grammar
March 21, 2023

When is it useful to eliminate left-recursion from a grammar and why?

COMPUTER SCIENCE TRIPOS Part IB – 2013 – Paper 3
Compiler Construction (TGG)
(a) When is it useful to eliminate left-recursion from a grammar and why?
[2 marks]
(b) Write a recursive descent parser for the language generated by the following
grammar.
E ::= E + F
| E – F
| F
F ::= NUM
| ID
| ( E )
[6 marks]
(c) This section deals with how object-oriented classes are typically implemented
by a compiler when only simple inheritance (each class has exactly one parent)
is supported.
(i) Describe in detail how objects are represented in memory and how this
representation captures inheritance of attributes. [6 marks]
(ii) Discuss how virtual methods can be implemented. [6 marks]