The Rule enum type enables us to identify a grammar rule within C++'s
type system.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h | ||
---|---|---|
172 | I hope you mean kw_int? I'd like this to compile :-) Can you also give the example for IDENTIFIER? | |
clang-tools-extra/pseudo/lib/grammar/Grammar.cpp | ||
48 | I'm not sure exposing these from Grammar is an improvement, i think even in principle we'd only want to use these for codegen. The need for testing is real, but i guess you can add a test that uses the CXX generated grammar, assert the elements of Rule::whatever, and the name of Symbol::whatever? |
update.
clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h | ||
---|---|---|
172 | As discussed offline, we stick to the current version without kw_ prefix. Added some comments for this decision. | |
clang-tools-extra/pseudo/lib/grammar/Grammar.cpp | ||
48 | Yeah, these functions are only used in the codegen. I'm inlined to the put it into the Grammar(it also has a symbolName definition, I'd prefer to have all naming functions in a single place). |
clang-tools-extra/pseudo/lib/grammar/Grammar.cpp | ||
---|---|---|
48 | That's exactly my point though: that symbolname is general purpose and should be used everywhere, which is why it belongs on grammar. Vs the mangled name that literally nobody should be using for anything. |
I hope you mean kw_int? I'd like this to compile :-)
Can you also give the example for IDENTIFIER?