Integrate JDI2 with the compiler

Reporter: JoshDreamland  |  Status: open  |  Last Modified: February 11, 2020, 10:54:41 PM
JustDefineIt, ENIGMA's C++ definitions parser, has recently been retooled with a new lexer. This greatly improved the accuracy of its tokenization, which reduces errors parsing various C++ libraries.

However, ENIGMA depended on its old, text-based macro replacement mechanism (A proper C++ lexer is actually token-based, and so the new JDI lexer is).

This task begins with a couple of obvious pieces:

  1. Integrate JDI2 into ENIGMA, working with the new API to implement the functionality needed by the parser.
  2. Properly decouple ENIGMA's compiler infrastructure from JDI internals.

From there, this project can branch out on a couple different paths:

  1. Continue development of JDI. JDI has poor support for C++11 constructs (and is actually not quite fully on its feet with the new lexer). The meatiest individual task is extending the AST generation to include statements instead of just expressions (prior to constexpr, parsing function blocks was not required to understand C++, and so JDI doesn't). Smaller, better-contained tasks include support for parameter packs, constexpr fields, and auto.
  2. Extend ENIGMA's syntax checker to replace its old compiler logic. ENIGMA started off as a very thin layer between the frontend language (EDL) and the final emitted languge (C++), and left most of the work to g++. Since then, a proper parsing layer was written and is now being used as the syntax checker, while the rest of the compiler relies on more arcane methods of code translation. Delete the old translation mechanism and replace it with a code emitter visitor for the syntax checker's AST.
  3. <
Please sign in to post comments, or you can view this issue on GitHub.