summaryrefslogtreecommitdiff
path: root/files/practicum/RefactorX.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'files/practicum/RefactorX.dcl')
-rw-r--r--files/practicum/RefactorX.dcl18
1 files changed, 18 insertions, 0 deletions
diff --git a/files/practicum/RefactorX.dcl b/files/practicum/RefactorX.dcl
new file mode 100644
index 0000000..3ddc8a4
--- /dev/null
+++ b/files/practicum/RefactorX.dcl
@@ -0,0 +1,18 @@
+definition module RefactorX
+
+import StdEnv
+
+:: Expr = NR Int
+ | VAR Name
+ | OP Expr Operator Expr
+ | LET Name Expr Expr
+:: Name :== String
+:: Operator = PLUS | MIN | MUL | DIV
+:: Val = Result Int | Undef
+
+from StdClass import class toString
+
+instance toString Expr
+free :: Expr -> [Name]
+remove_unused_lets :: Expr -> Expr
+eval :: Expr -> Val