I built a DelphiAST -> source engine. Feel free to check it out at: https://github.com/JBontes/DelphiAST_Source.

I built a DelphiAST -> source engine. Feel free to check it out at: https://github.com/JBontes/DelphiAST_Source.

It does not add any new syntax, yet, but it does take every file I've tried and reproduces the original source code from the abstract syntax tree.
Feel free to report any files that do not get processed correctly, I'll post any fixes needed to Roman Yankovsky DelphiAST project. The fixes used to get to this point have already been submitted there.

I have not released the source code yet, because I plan to make an IDE extension that expands the Object Pascal language.
A few simple constructs like a += 1; already work (in my test version, which is a bit more advanced) and a few more, like operator overloading for interfaces, still need some work on the symbol table engine.
https://github.com/JBontes/DelphiAST_Source

Comments

  1. Andreas Hausladen Wow that's cool, does this also allow you to go to another unit {$LINE 'OtherUnit.pas'}?

    ReplyDelete
  2. Johan Bontes The line number is mandatory. The filename is optional. The file name can even be an EXE file, but the editor will choke up when it tries to show its content.
    The debugger will think... Actually, the compiler just generates "fake" debug information for all following source lines until a new $LINE changes it again.

    ReplyDelete
  3. Andreas Hausladen Thanks, that's one problem solved then.

    ReplyDelete

Post a Comment