objectionary / ideas

Here we keep ideas for future research in EO programming language and Polystat static analyzer
https://www.eolang.org
7 stars 0 forks source link

eox: fast EO to XMIR(XML) translator #31

Open yegor256 opened 1 year ago

yegor256 commented 1 year ago

Now we have a translator from EO to XMIR (XML), which is written in Java as an ANTLR4 parser with a collection of XSL stylesheets. It works, but very slowly. It takes a minute or so to translate a single .eo file to .xmir file. We can make a much faster alternative, written in Rust. It should use the existing Program.g4 grammar (not re-writing it!) and existing XSL stylesheets (again, not making copies of them, but using them!). It should work as a command line tool (installable by Cargo):

$ cargo install eox
$ eox -o hello.xmir hello.eo

It should be possible to configure the behavior of it, for example by removing certain stylesheets from the train:

$ eox -o hello.xmir --skip:add-refs hello.eo

Also, should be possible to append additional stylesheets to the train:

$ eox -o sodg.xml --append:sodg --append:sodg-to-text hello.eo