forked from harrisonpartch/spasim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNCompiler.Mod
More file actions
executable file
·42 lines (37 loc) · 1.16 KB
/
NCompiler.Mod
File metadata and controls
executable file
·42 lines (37 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
MODULE NCompiler;
IMPORT Files, Texts, TextUtilities, Diagnostics, CompilerInterface, Commands;
PROCEDURE ncompile*(context : Commands.Context);
VAR
e : Files.Enumerator;
w: Files.Writer;
compiler: CompilerInterface.Compiler;
text: Texts.Text;
diagnostics: Diagnostics.Diagnostics;
error:BOOLEAN;
format,res: LONGINT;
name : ARRAY 256 OF CHAR; flags : SET; time, date, size : LONGINT;
BEGIN
NEW(e);
e.Open("./N*Mod", {});
compiler:=CompilerInterface.GetCompilerByName("Fox");
context.out.String("compiling all N*Mod ");
context.out.Ln;
IF compiler#NIL THEN
WHILE e.HasMoreEntries() DO
IF e.GetEntry(name, flags, time, date, size) THEN
context.out.String(name);
context.out.String(" ");
NEW(text);
TextUtilities.LoadAuto(text,name,format,res);
compiler.CompileText(text,"",0,"","",w,diagnostics,error);
IF error THEN context.out.String("compile error ") END;
context.out.Ln;
END
END
ELSE
context.out.String(" compiler not found ");
context.out.Ln;
END;
END ncompile;
END NCompiler.ncompile ~
SystemTools.Free NCompiler ~