hw07.pdf - CS320 Programming Languages Homework#7 KXCFAE Due 13 November 2019 The goal of Homework#7 is to implement the interpreter of KXCFAE which is

hw07.pdf - CS320 Programming Languages Homework#7 KXCFAE...

This preview shows page 1 out of 1 page.

CS320 Programming Languages Homework #7: KXCFAE Due: 13 November 2019 The goal of Homework #7 is to implement the interpreter of KXCFAE , which is the extended version of KCFAE with multiple arguments and e X ceptions. 1 Multiple Arguments Implement the interpreter to support multiple or zero arguments to a function, and multiple or zero arguments in a function call: <KXCFAE> ::= ... | {fun {<id> * } <KXCFAE>} | {<KXCFAE> <KXCFAE> * } As usual, your interpreter should detect the mismatch between the numbers of function parameter and arguments at function calls and report an error that includes the words "wrong arity" . Note that, the function run takes an string, parses it, interprets it with an empty substitution, and produces a number string, a string "function" for closures or a string "continuation" for continuations. Assume that each argument <id> is distinct for a fun expression. All continuations still accept a single argument. Example: test(run( "{{fun {x y} {- y x}} 10 12}"
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Summer '10
  • KXCFAE

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes