This tutorial uses the dump json option to write a backend for
SQL queries.
It is based on the work of Min-Yih Hsu:
I hope that having the same concepts in 3 forms will allow people
to choose the style that fits them.
The main drawback here being that it's in Python. C++ can be used
in a notebook (https://github.com/jupyter-xeus/xeus-cling) but I
decided against it for a few reasons:
- Python is the default for Jupyter, no extra installs needed.
- Having the code in a second language may help people who know one or the other.
- There is no upstream example of a JSON powered backend. (and although we would be unlikely to accept one upstream, I think it's a great option for quick development before translating into C++)
I think it will be helpful to show the workflow of normal TG backend (TG parser -> C++ TG backend) and the Python TG backend we're developing here (llvm-tblgen -> JSON -> Python backend) side-by-side using one or two sentences.