Initial check in docu

This commit is contained in:
2026-01-03 18:31:15 +01:00
parent e2c3cbc520
commit ee130973e2
98 changed files with 9430 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
program wp;
{$APPTYPE CONSOLE}
uses
Classes,
SysUtils,
dpgRTL,
wpParser in 'wpParser.pas',
wpLexer in 'wpLexer.pas';
var
stm: TFileStream;
lex: TwpLexer;
par: TwpParser;
begin
if ParamCount <> 1 then
begin
writeln('usage: wp <filename>');
exit;
end;
stm := nil;
par := nil;
try
stm := TFileStream.Create( ParamStr(1), fmOpenRead);
lex := TwpLexer.Create( stm);
par := TwpParser.Create(lex);
par.prog;
except
on e: EdpgMismatchedChar do writeln('SyntaxError: ' + IntToStr(e.Line));
on e: EdpgMismatchedToken do writeln('SyntaxError: ' + IntToStr(e.FoundToken.TokenLine));
else writeln('Syntax error');
end;
if stm <> nil then stm.free;
if par <> nil then par.free;
end.