PmCleanSystem.dcl 3.69 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
:: ProjectCompilerOptions = {
	pco_memory_profiling :: !Bool,
	pco_time_profiling :: !Bool,
29
	pco_callgraph_profiling :: !Bool,
30 31
	pco_desc_exl :: !Bool,
	pco_dynamics :: !Bool,
32
	pco_generic_fusion :: !Bool,
33 34 35
	pco_link_dynamic :: !Bool
   }

36 37 38 39 40 41
instance == CompileOrCheckSyntax
instance == CodeGenerateAsmOrCode

NoCompilerProcessIds :: CompilerProcessIds

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

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

InitCompilingInfo :: *CompilingInfo

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

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

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

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

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

71
CodeGen	::	!String !Bool !(WindowFun *GeneralSt) !CodeGenerateAsmOrCode !Pathname !Pathname !Bool
72 73 74 75 76 77 78 79 80 81 82
			!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
83
		!Pathname !(List Pathname) !(List Pathname) !(List Pathname) !Bool !Bool !Bool !Bool !Bool !String
84 85 86 87 88 89 90 91 92 93 94 95
		!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
96 97

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