39 lines
600 B
ObjectPascal
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.
|