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

Discussion

A bottom up parser evaluates an S-attributed definition using

  • A.an explicit annotated parse tree built during the parse
  • B.a separate traversal performed after parsing has finished
  • C.a value stack kept parallel to the parsing stack
  • D.a dependency graph constructed before parsing begins

Answer: C

Each grammar symbol pushed has a corresponding value. A reduction pops the values of the right side, computes the value of the left side and pushes it, which realises the definition directly. The two stacks move in step, which keeps the implementation straightforward.

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

Post your comment

Please log in or register to post a comment.