Machine-translated by Google. Questions are authored in English.
Top

Discussion

LR parsers read their input from ............. to ............. and produce a .............. derivation.

  • A.Left, Right, Rightmost
  • B.Right, Left, Leftmost
  • C.Left, Right, Leftmost
  • D.Right, Left, Rightmost

Answer: A

LR parsers read their input from Left, Right, Rightmost: left to right, producing a rightmost derivation.

In LR, the L means the input is scanned from left to right and the R means a rightmost derivation is constructed, in reverse. The parser works bottom-up, shifting tokens and reducing handles, and the sequence of reductions is a rightmost derivation traced backwards.

A leftmost derivation from a left-to-right scan describes LL (top-down) parsers. No standard parser reads its input from right to left.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.