This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7f99e1870f77: [pseudo] Add a print-grammar option in the
tool (authored by hokein).
Herald added a project: All.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120724/new/
https://reviews.llvm.org/D120724
Files:
clang/tools/clang-pseudo/ClangPseudo.cpp
Index: clang/tools/clang-pseudo/ClangPseudo.cpp
===================================================================
--- clang/tools/clang-pseudo/ClangPseudo.cpp
+++ clang/tools/clang-pseudo/ClangPseudo.cpp
@@ -24,6 +24,7 @@
static opt<std::string>
Grammar("grammar", desc("Parse and check a BNF grammar file."), init(""));
+static opt<bool> PrintGrammar("print-grammar", desc("Print the grammar."));
static opt<bool> PrintGraph("print-graph",
desc("Print the LR graph for the grammar"));
static opt<bool> PrintTable("print-table",
@@ -60,6 +61,8 @@
}
llvm::outs() << llvm::formatv("grammar file {0} is parsed successfully\n",
Grammar);
+ if (PrintGrammar)
+ llvm::outs() << G->dump();
if (PrintGraph)
llvm::outs() <<
clang::syntax::pseudo::LRGraph::buildLR0(*G).dumpForTests(
*G);
Index: clang/tools/clang-pseudo/ClangPseudo.cpp
===================================================================
--- clang/tools/clang-pseudo/ClangPseudo.cpp
+++ clang/tools/clang-pseudo/ClangPseudo.cpp
@@ -24,6 +24,7 @@
static opt<std::string>
Grammar("grammar", desc("Parse and check a BNF grammar file."), init(""));
+static opt<bool> PrintGrammar("print-grammar", desc("Print the grammar."));
static opt<bool> PrintGraph("print-graph",
desc("Print the LR graph for the grammar"));
static opt<bool> PrintTable("print-table",
@@ -60,6 +61,8 @@
}
llvm::outs() << llvm::formatv("grammar file {0} is parsed successfully\n",
Grammar);
+ if (PrintGrammar)
+ llvm::outs() << G->dump();
if (PrintGraph)
llvm::outs() << clang::syntax::pseudo::LRGraph::buildLR0(*G).dumpForTests(
*G);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits