New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a formatter for a proper OO model #41
Comments
I thought about this for quite some time, and I think I get your idea. Because that's exactly what I have done with the graph formatter. And I came to the following conclusion: Formatters maintained in this repository must produce output which is automatically verifiable by the use of an external parser. If that's given, we can write an automated test case for this formatter which will guarantee maintainability of the formatter's code. This means for your request: If we can make this formatter compatible to the input of a tool which parses the formatter's output, I am all in for this feature. However, if we do invent our own output format, then we are just transpiling the AST into some other not standardized format. And for this I don't see any value. Also it will be almost impossible to maintain. But, if you need this custom intermediate representation without going the full step of making it compatible to some other tool (i.e. a source code generator, your own parser, ... ) . It should be easy to keep this formatter somewhere external. You can then call that custom formatter using the programmatic API. I could even implement some command line support for this. Like:
What do you think about that? I am happy to discuss and help you writing that formatter even if you need to keep it external. But I do hope that you understand my decision. Side note: The graph formatter is not automatically verifiable. It currently only serves the purpose of an example. It should be removed once we have our first external verifiable formatter. |
Hi @Enteee ! Thanks for putting so much thought into my issue and explaining your decision. I totally agree. Indeed my need is an intermediate representation and specific to what I want to achieve with it, not generic. So this formatter / intermediate representation should be located inside my project or as an external standalone library. As long as There is one aspect which might have its place in the |
When #40 is implemented:
I would say, If you need |
Ok I get it ! No loss of information between the PlantUML input and the parser output. You’re right, I’ll be handling the structure in my higher-level formatter. |
Thank you for your understanding @paduc . |
I'm using PlantUML and this great parser to describe my Typescript classes.
Could we imagine an output being a ts/js object that contains the relationships between the class objects ?
Instead of a list of
nodes
andedges
I would like to have an object I can traverse and only contains OOP concepts (not display concepts like visibility or links).I'm thinking of something a bit like this:
(The direct references would cause circularity which would prevent serialisation but that is not the point)
Would this type of formatter find a place in
plantuml-parser
?The text was updated successfully, but these errors were encountered: