Lead and last in compiler design

lead

  • 1st element in RHS of production and the accompanying non-terminal(where non-terminal  end in terminal that symbol)
  • X-a
  • X-sH
  • H-e
  • here lead of X: a,s,e.
  • we only write terminal in lead of grammer.
  • here H was non terminal so its end terminal was taken


last


  • last element in RHS of production and the following non-terminal(where it end in terminal that symbol)
  • X-.....a
  • X-......sH
  • H-.....e
  • here last of X: a,s,e.
  • we only write terminal in last of  grammar.

No comments:

Post a Comment