definition module Sil.Compile

from StdFile import class <<<
from StdOverloaded import class toString

from Data.Error import :: MaybeError

from ABC.Assembler import :: Assembler, :: Statement, instance <<< Assembler

from Sil.Syntax import :: Program, :: Name, :: Expression
from Sil.Types import :: Type, :: TypeError

:: CompileError
	= UndefinedName Name
	| VariableLabel
	| FunctionOnStack
	| TypeError TypeError Expression
	| CouldNotDeduceType Expression
	| TypeMisMatch Type Expression
	| UnknownError

instance toString CompileError

compile :: Program -> MaybeError CompileError Assembler