forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lcompilers#1451 from Shaikh-Ubaid/ast_asr_json
AST/R: Support Json Printing
- Loading branch information
Showing
5 changed files
with
152 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
#ifndef LFORTRAN_PICKLE_H | ||
#define LFORTRAN_PICKLE_H | ||
|
||
#include <lpython/python_ast.h> | ||
#include <libasr/asr.h> | ||
#include <libasr/location.h> | ||
|
||
namespace LCompilers::LPython { | ||
|
||
// Pickle an ASR node | ||
std::string pickle_python(AST::ast_t &ast, bool colors=false, bool indent=false); | ||
std::string pickle(ASR::asr_t &asr, bool colors=false, bool indent=false, | ||
bool show_intrinsic_modules=false); | ||
std::string pickle(ASR::TranslationUnit_t &asr, bool colors=false, | ||
bool indent=false, bool show_intrinsic_modules=false); | ||
|
||
// Print the tree structure | ||
std::string pickle_tree_python(AST::ast_t &ast, bool colors=true); | ||
std::string pickle_tree(ASR::asr_t &asr, bool colors, bool show_intrinsic_modules); | ||
std::string pickle_tree(ASR::TranslationUnit_t &asr, bool colors, bool show_intrinsic_modules); | ||
|
||
std::string pickle_json(AST::ast_t &ast, LocationManager &lm); | ||
std::string pickle_json(ASR::asr_t &asr, LocationManager &lm); | ||
std::string pickle_json(ASR::TranslationUnit_t &asr, LocationManager &lm); | ||
|
||
} | ||
|
||
#endif // LFORTRAN_PICKLE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters