Difference between revisions of "Itty Bitty Programming Language List Converter Assignment"
Jump to navigation
Jump to search
(Created page with "In a series of assignments, we will build the Itty Bitty Programming Language (IBPL). The inspiration for these assignments is MUPL by Dan Grossman and his team at UW. On ca...") |
|||
Line 19: | Line 19: | ||
For this exercise, we will focus on IntExp, NilExp, and ConsExp. | For this exercise, we will focus on IntExp, NilExp, and ConsExp. | ||
+ | |||
+ | =Code To Implement= | ||
+ | {{RacketToImplement|list_converter|racket-integers->ib-IntExps<br>ib-IntExps->racket-integers|ibpl/list_converter}} | ||
+ | ==racket-integers->ib-IntExps== | ||
+ | |||
+ | ==ib-IntExps->racket-integers== |
Revision as of 19:59, 30 October 2023
In a series of assignments, we will build the Itty Bitty Programming Language (IBPL). The inspiration for these assignments is MUPL by Dan Grossman and his team at UW.
On can build an IBPL Abstract Syntax Tree (AST) with the following expressions:
(struct IdentifierExp (name) #:transparent)
(struct IntExp (value) #:transparent)
(struct AddExp (left_exp right_exp) #:transparent)
(struct IfGreaterExp (left_exp right_exp then_body_exp else_body_exp) #:transparent)
(struct NilExp () #:transparent)
(struct IsNilExp (exp) #:transparent)
(struct ConsExp (car_exp cdr_exp) #:transparent)
(struct CarOfConsExp (cons_exp) #:transparent)
(struct CdrOfConsExp (cons_exp) #:transparent)
(struct LetExp (binding_name binding_exp body_exp) #:transparent)
(struct FunctionExp (name_option parameter_name body_exp) #:transparent)
(struct CallExp (function_exp argument_exp) #:transparent)
For this exercise, we will focus on IntExp, NilExp, and ConsExp.
Code To Implement
file: | src/main/racket/ibpl/list_converter/list_converter.rkt | ![]() |
functions: | racket-integers->ib-IntExps ib-IntExps->racket-integers |