Start a Modula-2 experiment
This commit is contained in:
24
boot/Compiler.mod
Normal file
24
boot/Compiler.mod
Normal 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.
|
Reference in New Issue
Block a user