I've updated the script to parser8.pl and the C code so that creating the xml structures and treeview visualization will work out of the box for all the "Beck2019" programs that Bernd has so kindly shared with the list (and probably many others). The update makes examination of the files quicker as drag and drop is enabled from the treeview to an editor (I use gvim).
In short: parser7.pl is deprecated. parser8.pl will automatically determine TypeTag for the problem, if it is hard coded into the call to Dumux::start(). If it is set by means of a preprocessor directive in the CMakeLists.txt, then it can be set with the second argument to parse8.pl (the first argument being the file from which to start the xml construction). parser8.pl will automatically determine the path for Dumux templates if the source code is located in the conventional "test" way. If not, then the path to the installed Dumux templated to be used should be specified in the first lines of parser8.pl. structure.cc has a more descriptive window title and allows drag and drop from the treeview to an editor to quickly open the file from which the row was constructed. This greatly speeds up browsing the contents of the involved templates. Please note that programs linked with gtk+ < 3.16 are not entirely compatible with those linked with gtk+ >= 3.16 with regard to DnD. Gvim works fine for me. YMMV. Enjoy -----Mensaje original----- De: Dumux [mailto:[email protected]] En nombre de Ed Scott Wilson Garcia Enviado el: viernes, 22 de febrero de 2019 02:48 p. m. Para: DuMuX User Forum Asunto: [DuMuX] typetag and property visualization app (2.12) One of the main hurdles I have had with Dumux code is figuring out where properties and typetags are defined, because this sends me opening and closing files and by the time I 've reached what I was looking for three more questions have popped up in my mind. The moment I just got plain tired of this scheme, I decided to create a parser which would gobble up all the included files and create a structure xml file of where, what and how things were constructed. This is the script "parse7.pl". I suppose there could be an xml viewer out there to view the results, but I found it much easier to construct my own app specific to the created xml. It works for me. If it works for someone else, that's great. You can download the code from github.com from https://github.com/edscott/dumux/tree/master/structure There are some screenshots there as well. Any bugreports or feature enhancement suggestions are welcome. This is the content of the README file: To build, just do a "make" Requirements, gtk3 (developer) and perl. Once built you will have two programs, the parser (parse7.pl) and the visualizer (structure). The parser's job is to create an xml file which will detail the way template headers are included, properties which are defined and typetags and their inheritance relationship. It is executed with "perl parser7.pl source.cc [problemTypeTag]" These three items, "Files", "properties" and "Typetags" are the top level elements in a gtk treeview. As the "Files" treeview is expanded, you can see the order and from where each template header is included. See Snapshot-1. When the "Properties" treeview is expanded, you can see all the properties which are defined in the included template headers, their value and location. Snapshot-2. When the "Typetags" treeview is expanded (Snapshot-3), you can see all the defined typetags. If the optional problemTypeTag is specified, then the xml will use it to create an inheritance chain and you can see the main type tag with an "emblem-important" icon. First level inheritance have a "emblem-default" icon, which by default is a green checkmark. Second level has a solid background checkmark, third level a simple checkmark and all the rest a blue dot. Whatever does not have an icon is of no use to the problemTypeTag specified. This has helped me speed up looking for what properties are defined and their values, as well as to get a general idea of the structure of a Dumux aplication. If I continue with Dumux, I will try to get a Dumux-3.0 parser running, but at the moment the future is unclear. And as usual, the code is distributed with GNU version 3 license, hoping that it be of use to others, but with no warranty nor suitability of use. feb-21-201 Enjoy. _______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux _______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
