CS241 Study Guide - Final Guide: Parse Tree, Substring, Assembly Language

316 views4 pages

Document Summary

Summary: epsilon-nfas, context-free grammars, parsing, error-checking, code generation, optimization, memory management. 1: given the following grammar, s(cid:48) (cid:96) expr (cid:97, expr term, expr expr term, term id, term (expr) Draw a parse tree for each of the following strings. 4. a) (cid:96) id - id - id (cid:97) 4. b) (cid:96) id - (id - id - id) (cid:97: in the above grammar, if rule 2 was changed to expr expr expr, it would be ambiguous. Prove that this is the case - i. e. come up with a string for which there exist multiple parse trees, and show those parse trees. 2 (cid:97) reduce 2 a b a b (cid:97) reduce 3. 4 a shift 5 a b a shift 2 (cid:97) shift 6 a q. 10 (cid:97) shift 11 reduce 4 reduce 4 a a b a (cid:97) shift 9. Each of the following wlp4 programs contains an error.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions