; --------------------------------------------------------------------------- ; | File: parse-input.dat Sean O'Connor 6-22-89 | ; --------------------------------------------------------------------------- ; DESCRIPTION ; ; Sample sentences from the grammar of arithmetic expressions, ; ; E -> E + T | T ; T -> T * F | F ; F -> ( E ) | ID ; ; Example 4.8, page 176 of ; ; COMPILERS: PRINCIPLES, TECHNIQUES, AND TOOLS, ; Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman, ; Addison-Wesley, 1986 ; ; --------------------------------------------------------------------------- ; Correct sentences. (id + [ id * id ]) (id * id + id) ; Ungrammatical sentences. () (id + id xxx) ([ ]) (id +) (id *) (id ])