Start a Modula-2 experiment

This commit is contained in:
2024-02-15 15:13:47 +01:00
parent 0d3453e7a9
commit fdc6f665df
28 changed files with 716 additions and 3134 deletions

24
boot/Compiler.mod Normal file
View File

@@ -0,0 +1,24 @@
MODULE Compiler;
FROM Terminal IMPORT WriteString, WriteLn;
FROM FIO IMPORT Close, File, IsNoError, OpenToRead;
FROM SYSTEM IMPORT ADR;
FROM Lexer IMPORT Lexer, LexerDestroy, LexerInitialize, LexerLex;
VAR
SourceFile: File;
ALexer: Lexer;
BEGIN
SourceFile := OpenToRead('boot/Compiler.mod');
IF IsNoError(SourceFile) THEN
LexerInitialize(ADR(ALexer), SourceFile);
LexerLex(ADR(ALexer));
LexerDestroy(ADR(ALexer));
Close(SourceFile)
END;
END Compiler.