Converts AST to JSON.
Compute JSON output.