Itty Bitty Programming Language Functions And Macros Assignment
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.
One can build an IBPL Abstract Syntax Tree (AST) with the following expressions:
Contents
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)
Code To Implement
Note: the syntax description below is adapted from Prof. Grossman's MUPL syntax description.
Macros
file: | src/main/racket/ibpl/functions_and_macros/macros.rkt | ![]() |
functions: | IbIfNil IbLet* IbIfEq |
IbIfNil
(define (IbIfNil exp then_body_exp else_body_exp)
(error 'not-yet-implemented))
IbLet*
(struct binding (name exp) #:transparent)
(define (IbLet* bindings body_exp)
(error 'not-yet-implemented))
IbIfEq
(define (IbIfEq left_exp right_exp then_body_exp else_body_exp)
(error 'not-yet-implemented))
Functions
file: | src/main/racket/ib-map-add-n/functions_and_macros/functions.rkt | ![]() |
functions: | ib-double ib-sum-curry ib-call-with-one ib-map ib-call-with-one |
ib-double
(define ib-double
'not-yet-implemented)
ib-sum-curry
(define ib-sum-curry
'not-yet-implemented)
ib-call-with-one
(define ib-call-with-one
'not-yet-implemented)
ib-map
(define ib-map
'not-yet-implemented)
ib-map-add-n
(define ib-map-add-n
(LetExp "map" ib-map
'not-yet-implemented-notice-map-is-now-in-IBPL-scope))
Test
file: | test_functions_and_macros.rkt | ![]() |
source folder: | src/test/racket/ibpl/functions_and_macros |
note: ensure that you have removed all printing to receive credit for any assignment.