[PATCH] D61015: [LibTooing] Change Transformer's TextGenerator to a partial function.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 04:50:35 PDT 2019


ilya-biryukov added a comment.

In D61015#1478886 <https://reviews.llvm.org/D61015#1478886>, @ymandel wrote:

> The problem is that validation can't* be done in the abstract.  It has to be done with respect to a specific match result. Unfortunately, the server won't be layered directly on top of the call to the TextGenerator -- the rewrite rule is interposed between them.  That is, the client of the TG is the rewriterule and that's where the validation has to happen, but the TG is opaque to the rewrite rule, so it can't hardcode that validation logic. So, we'd need to change `TextGenerator` to bundle a validation function and string generator.  Is it still worth it in that case?
>
> *"can't" is a bit strong. I could imagine a design which allows full analysis and validation of rewrite rules before they are executed, but it would be far more sophisticated than the current design.


Could you provide more details into how the server app is layered? Specifically, what are the user inputs and how do they get translated into the transformer library calls?
I imagine their should be a syntax for textual representation of the generator, the representation should allow referring to the named match results. While parsing this representation, it should be possible to collect all matches of named nodes and make sure there are corresponding binding in the rewrite rule.

If the setup is different, I may be missing where the complexity comes from and I would love to learn about it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61015/new/

https://reviews.llvm.org/D61015





More information about the cfe-commits mailing list