Unformatted text preview: ned data,
the structure of the program should be patterned after the structure
of the data.
Write one procedure for each nonterminal in the grammar. The procedure
will be responsible for handling the data corresponding to that nonterminal. § ¤ In each procedure, you will have one
line for each production corresponding to that nonterminal. You may have additional case structure, but
this will get you started on the right foot.
§©§ and Output: a list similar to
. , and an list but with all occurrences of ¤ ¤ Input: Two symbols: !
Procedure replaced by instances 2¡
But wait: need to be more precise about what kind of lists are possible inputs.
Let’s write a grammar to describe these nested lists of symbols:
Deﬁnition 7 (s-list, s-exp) ¥ ¤ £¢ S-exp
Symbol S-list ::
S-exp :: S-list An s-list is a list of s-exps, and an s-exp is either an s-list or...
View Full Document
- Fall '09
- Data Structures, eopl, ¡§ £¡, Dr. Wand