PmCleanSystem.dcl 3.65 KB
Newer Older
1 2 3 4
definition module PmCleanSystem

from StdFile import ::Files
from UtilStrictLists import ::List
5
from PmTypes import ::CodeGenOptions,::Processor,::ApplicationOptions,::LinkMethod,::ModuleDirAndName
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
from PmCompilerOptions import ::CompilerOptions,::ListTypes

import StdOverloaded
import StdPathname
import PmCallBack

:: CompilerProcessIds

::	CompileOrCheckSyntax	= SyntaxCheck | Compilation
:: StartedCodeGenerator
:: CompilePollCompletedResult = NoFinishedCompiler | UnknownFinishedCompiler | FinishedCompiler !Int !Int
::	CodeGenerateAsmOrCode	= AsmGeneration | CodeGeneration
:: CompilingInfo
::	CompilerMsg
	= 	CompilerOK
	| 	SyntaxError
	| 	Patherror Pathname

::	WindowFun env :== ([String]) -> env -> env

26 27 28 29 30
:: ProjectCompilerOptions = {
	pco_memory_profiling :: !Bool,
	pco_time_profiling :: !Bool,
	pco_desc_exl :: !Bool,
	pco_dynamics :: !Bool,
31
	pco_generic_fusion :: !Bool,
32 33 34
	pco_link_dynamic :: !Bool
   }

35 36 37 38 39 40 41 42 43
instance == CompileOrCheckSyntax
instance == CodeGenerateAsmOrCode

NoCompilerProcessIds :: CompilerProcessIds

standardStaticLibraries :: !Processor !LinkMethod -> List String
standardObjectFiles :: !Bool !Bool !Processor !Bool -> List String
getLibs :: ![String] !*Files -> (!(![String],![String]),!*Files)

44
CompileHandleExitCode :: !Int !String !String !Int !(WindowFun *env) !(WindowFun *env) !ModuleDirAndName
45 46 47 48
				!ListTypes !*env -> (!Pathname,!CompilerMsg,!*env) | FileEnv env

InitCompilingInfo :: *CompilingInfo

49
Compile :: !String !Bool !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName !Pathname
50
	!(List Pathname) !ProjectCompilerOptions !CompilerOptions !Pathname !CompilerProcessIds !*env
51 52 53 54
	-> (!Pathname,!CompilerMsg,!CompilerProcessIds,!*env)
	| FileEnv env

CompilePersistent ::
55
	!String !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName
56
	!(List Pathname) !ProjectCompilerOptions !CompilerOptions !Pathname !*CompilingInfo !*env
57 58 59 60 61
	-> (!*CompilingInfo,!(!*env, !Pathname, !CompilerMsg))
	| FileEnv env

CompileStartCommand ::
	!String !Bool !(WindowFun *env) !CompileOrCheckSyntax !Pathname
62
	!(List Pathname) !Int !ProjectCompilerOptions !CompilerOptions !Pathname !CompilerProcessIds !*env
63 64 65 66 67 68 69
	-> (!Bool,!CompilerProcessIds,!*env)
	| FileEnv env

ExitCleanCompiler :: !*(!*CompilingInfo,*env) -> *(!*CompilingInfo,*env)

QuitCleanCompiler :: !Bool !CompilerProcessIds !*World -> *World

70
CodeGen	::	!String !Bool !(WindowFun *GeneralSt) !CodeGenerateAsmOrCode !Pathname !Pathname !Bool
71 72 73 74 75 76 77 78 79 80 81
			!CodeGenOptions !Processor !ApplicationOptions !Pathname !CompilerProcessIds !*GeneralSt
			-> (!Pathname,!Bool,!CompilerProcessIds,!*GeneralSt)

start_code_generator ::	!String !(WindowFun *GeneralSt) !Pathname !Int !Bool !CodeGenOptions !Processor !Pathname !*GeneralSt
						-> (!Bool,!Int/*HANDLE*/,!StartedCodeGenerator,!*GeneralSt)

wait_for_finished_code_generator :: !{#Int} !*GeneralSt -> (!Int,!Int,!*GeneralSt)

finish_code_generator :: !Int/*HANDLE*/ !StartedCodeGenerator !Int !(WindowFun *GeneralSt) !*GeneralSt -> (!Bool,!*GeneralSt)

Link ::	!String !(WindowFun *GeneralSt) !Pathname !ApplicationOptions
82
		!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Bool !Bool !Bool !Bool !String
83 84 85 86 87 88 89 90 91 92 93 94
		!Bool !String !Pathname !String !Processor !Bool !*GeneralSt
		 -> (!*GeneralSt,!Bool)

DelayEventLoop :: !.ps -> .ps

CompilePollCompleted :: !CompilerProcessIds !*env -> (!CompilePollCompletedResult, !*env) | FileEnv env

ClearCompilerCache :: .a
ClearCompilerCaches :: .a
SendRepeatResult :: .a
StartCodeGenerator :: .a
Execute` :: .a
95 96

RunExternalCommand :: !String ![String] !String !*GeneralSt -> *(!Int, ![String], !*GeneralSt)