summaryrefslogtreecommitdiff
path: root/files/practicum/RefactorX.dcl
blob: 3ddc8a40a69e2dfb4ce8c5b60fc4e9a75b970d04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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