17bool PrettyPrint =
false;
22void parseArgs(
int Argc,
const char *Argv[]) {
23 for (
int I = 0; I < Argc; I++) {
24 if (std::string_view(Argv[I]) ==
"--pretty-print")
26 else if (std::string_view(Argv[I]) ==
"--variable-lookup")
33int main(
int Argc,
const char *Argv[]) {
34 parseArgs(Argc, Argv);
35 std::ostringstream Inputs;
36 Inputs << std::cin.rdbuf();
37 std::string Src = Inputs.str();
39 std::vector<nixf::Diagnostic> Diags;
40 std::shared_ptr<nixf::Node> AST =
nixf::parse(Src, Diags);
52 std::cout << std::setw(4);
53 std::cout << V <<
"\n";
Provide jsonified diagnostic, for other languages/structured output.
Lookup variable names, from it's parent scope.
void runOnAST(const Node &Root)
Perform variable lookup analysis (def-use) on AST.
void to_json(nlohmann::json &R, const LexerCursor &LC)
std::shared_ptr< Node > parse(std::string_view Src, std::vector< Diagnostic > &Diags)
Parse a string.
int main(int Argc, const char *Argv[])