[PATCH] D90659: [Syntax] Tablegen Sequence classes. NFC
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 4 03:16:44 PST 2020
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/include/clang/Tooling/Syntax/Nodes.td:123
+ Role<"CloseParen", Token<"r_paren">>,
+ ];
+}
----------------
The reason why in my prototype the grammar rules are separate is to allow expressing rules that depend on each other in a circular fashion. Seems like you avoided the problem right now by removing the need for Expression to refer to all subclasses, but it would come back, in, for example, LambdaExpression -- which is an expression that needs to refer to CompoundStatement that is defined later in this file, while CompoundStatement will need to refer to Expression. Maybe there is also a way to break circularity there by careful ordering -- but we would be mixing the order of expressions and statements.
================
Comment at: clang/include/clang/Tooling/Syntax/Syntax.td:70
+//
+// Each child is characterized by a unique role and an allowed base type.
+// The role sequence and role/type match are enforced invariants of the class.
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90659/new/
https://reviews.llvm.org/D90659
More information about the cfe-commits
mailing list