Closed abulka closed 5 years ago
Relative search paths are wrong since ParserDemo has been moved to a subfolder. There are also a few other things that didn't work with FPC for quite a while. I made it work again (see #290).
It's important to checkout submodules when you want to compile it with FPC. Otherwise the compiler can't find generics.collections and stringbuilder. Use this command in order to get the submodules:
git submodule update --init --recursive
Thanks so much - the new version plus the fancy git command resulted in a successful compile on Windows 10.
I then pushed my luck and tried to compile it on Mac.
Windows
in uMainForm.pas
(hmm, does that mean Lazarus form files are not compatible across os's?). Diagnostics
because DelphiAST/Source/FreePascalSupport/Diagnostics.pas
had numerous compile errors on Mac for some reason - it was easy enough to remove the use of the diagnostics stopwatch feature from uMainForm.pas
. Then the demo ran OK on Mac too!
This project claims to be Lazarus compatible and offers a Lazarus project file
DelphiAST\Demo\Parser\ParserDemo.lpi
yet I cannot get it to compile. Here are the numerous obstacles I've encountered:Had to move the
DelphiAST\Source
dir into theDelphiAST\Demo
dir.Had to abandon the Mac version, because
Windows
is not defined.Had to copy https://github.com/maciej-izak/generics.collections into the
DelphiAST\Demo\Source\FreePascalSupport
directorySimilarly, had to copy https://github.com/Wosi/FPC_StringBuilder into the
DelphiAST\Demo\Source\FreePascalSupport
directory and had to use the https://github.com/Wosi/FPC_StringBuilder fork not the original https://github.com/hinst/FPC_StringBuilerHad to add
to the top of
SimplParser.Lexer
though I don't think the values are correct for my version of Lazarus v2.0.6 but I had to define those constants in order to compile. Any suggestions for correct values welcome.Got a compilation error
str := UTF8ToUnicodeString(u8);
inDelphiAST.Serialize.Binary.pas
- isn'tUTF8ToUnicodeString
a Delphi only concept? In frustration I simply wrapped it inand the compilation moved on, presumably because UNICODE is not defined? Anyway...
Currently I cannot get past the "error: Illegal qualifier" in DelphiAST.Writer.pas 79
and am stuck.