in Compiler Design
465 views
1 vote
1 vote

Consider the grammar:

$G_{2}$:

  • Para $\rightarrow$ Sentence RP | Sentence
  • RP $\rightarrow$ b Sentence RP | b Sentence
  • Sentence $\rightarrow$ Word b Sentence | Word
  • Word $\rightarrow$ letter * word | letter
  • letter $\rightarrow$ id

where $id,’*’$ and $’b’$ are terminals

  1. Convert the grammar $G_2$ to an operator grammar.
  2. Define precedence relations among the terminals and show how to use a stack algorithm to parse the following string$$id*id\;b\; id * id$$

The parse should generate a rightmost derivation.

in Compiler Design
465 views

1 comment

please answer this question how to change a right recursive grammer to operator precedence grammer
0
0

Please log in or register to answer this question.

Related questions