[PATCH] D119172: [pseudo] Implement LRGraph
Alex Tsao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 7 05:48:10 PST 2022
alextsao1999 added inline comments.
================
Comment at: clang/include/clang/Tooling/Syntax/Pseudo/LRGraph.h:96
+ uint8_t DotPos = 0;
+ uint8_t RuleLength = 0; // the length of rule body.
+};
----------------
hokein wrote:
> alextsao1999 wrote:
> > Can we add LookaheadSymbol here to implement LR(1)?
> we could do that. However, we don't have a plan to implement an `LR(1)` yet, we use `SLR(1)`. (though LR(1) is more powerful than SLR(1), the typical deterministic LR(1) parser cannot handle the C++ grammar, we need a "general" parser GLR which can be able to handle arbitrary context-free grammars).
Thanks for your answering! Oh, I know some `GLR` parsers are based on `LR(1)` or `LALR`, so I think our `GLR` parser is based on `LR(1)` as well. I'm trying to keep up with your train of thought :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119172/new/
https://reviews.llvm.org/D119172
More information about the cfe-commits
mailing list