Hello all,

Here is an ats3 compiler extension that I have been working on called 
"xjsonize", see https://github.com/sparverius/xjsonize

Brief overview, 

   - written in ats2 
   - similar to xinterp, links the ats3 compiler library (libxatsopt)
   - exports the AST at any level of compilation as json
   - provides a library libxjsonize 
      - link other extensions with -lxjsonize
      - for example, https://github.com/sparverius/xatscc,
         -  this example links both libxatsopt and libxjsonize to xinterp 
         for jsonizing the the tree of the interpreter
      
Later versions can suite specific needs however, for now the jsonized 
output is currently meant to be as verbose as possible with the exception 
of location information (coming soon!). Also, the labify branch 
<https://github.com/sparverius/xjsonize/tree/labify> provides a flatter 
representation than the master branch. 


Some examples of the exported json can be found HERE 
<https://github.com/sparverius/xatscc/tree/master/doc/example/map>.


Possible use cases:

   - Learn about each translation phase of the ats3 compiler
   - Export AST to write extensions in any programming language you wish. 
   (some examples soon!)
   - Something else you think ofentirely??
   
Personally, reading through the AST in json form has helped me tremendously 
with understanding the compilation phases of ats3. I hope you find it 
useful as well!


Cheers!

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/7f012a74-7e12-4532-a03b-f6000bb25b7a%40googlegroups.com.

Reply via email to