CS 3304: Comparative Languages |
Semantics |
[ Course Documents ] : [ Semantics ] | ||||||||
|
Me(<expr>, s) =
case <expr> of <dec_num> => Mdec(<dec_num>) <var> => VARMAP(<var>, s) <binary_expr> => if (<binary_expr>.<operator> = ‘+') then Me(<binary_expr>.<left_expr>, s) + Me(<binary_expr>.<right_expr>, s) else Me(<binary_expr>.<left_expr>, s) x Me(<binary_expr>.<right_expr>, s)