PmCleanSystem.dcl 3.68 KB
Newer Older
1 2 3 4 5 6 7 8 9
definition module PmCleanSystem

from StdFile import ::Files
from UtilStrictLists import ::List
from PmTypes import ::CodeGenOptions,::Processor,::ApplicationOptions,::LinkMethod
from PmCompilerOptions import ::CompilerOptions,::ListTypes

import StdOverloaded
import StdPathname
10
import PmTypes
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
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

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

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

NoCompilerProcessIds :: CompilerProcessIds

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

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

InitCompilingInfo :: *CompilingInfo

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

CompilePersistent ::
57
	!String !Bool !(WindowFun *env) !(WindowFun *env) !CompileOrCheckSyntax !ModuleDirAndName
Jurrien Stutterheim's avatar
Jurrien Stutterheim committed
58
	!(List Pathname) !ProjectCompilerOptions !CompilerOptions !Pathname !*CompilingInfo !*env
59 60 61 62 63
	-> (!*CompilingInfo,!(!*env, !Pathname, !CompilerMsg))
	| FileEnv env

CompileStartCommand ::
	!String !Bool !(WindowFun *env) !CompileOrCheckSyntax !Pathname
Jurrien Stutterheim's avatar
Jurrien Stutterheim committed
64
	!(List Pathname) !Int !ProjectCompilerOptions !CompilerOptions !Pathname !CompilerProcessIds !*env
65 66 67 68 69 70 71
	-> (!Bool,!CompilerProcessIds,!*env)
	| FileEnv env

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

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

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

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