Files
bds.mr.dpg/doc/grammars/pascal/wirth/test/wpTest.dpr
T
2026-01-03 18:31:15 +01:00

39 lines
600 B
ObjectPascal

program wpTest;
{$APPTYPE CONSOLE}
uses
Classes,
SysUtils,
wpLex in '..\wpLex.pas',
wpPar in '..\wpPar.pas',
astProgram in '..\..\tools\ast\astProgram.pas',
ast in '..\..\tools\ast\ast.pas';
var
stm : TFileStream;
lex : TwpLex;
par : TwpPar;
begin
try
stm := TFileStream.Create('x.pas', fmOpenRead);
stm.Seek(0, soFromBeginning);
lex := TwpLex.Create(stm);
par := TwpPar.Create(lex);
par.prg;
stm.Free;
lex.Free;
par.Free;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.