Closed johnyf closed 9 years ago
Hi johnyf, I will integrate your change request by modifying the current version of the explicit-state strategy writer -- the most clean way is to add a template parameter, so that every compiled of slugs version includes both the json output and the non-json output.
Hi johnyf, you will see that the latest version of slugs includes json output for explicit strategies. This is basically copy&paste from your pull request, with minor modifications to allow json output to be turned on (and off) without recompiling. There is a new parameter "--jsonOutput" that you can supply to slugs. Thanks a lot for your contribution! I am closing this pull request as the functionality has been added.
Thank you, @progirep, for implementing the new option for json
output.
Add output of explicit strategies to the
json
format described here, because writing a custom parser (or one based on a parser generator) for thejtlv
output format everywhere that a strategy needs to be loaded can be avoided. Otherwise, importing an existing parser is tempting, leading to unnecessary dependencies.If in
python
thestdout
ofslugs
is stored in variableout
, then constructing anetworkx
graph from thejson
output is simple and succinct:The only thing that is missing is a command line option to switch between
json
andjtlv
, for backwards compatibility. Preprocessor conditionals have been used for now inextensions/ExtractExplicitStrategy.hpp
, because I am not sure what is the best way to add the argument to the existing mechanism of parsing arguments.Also, the extensions have been relocated in their own directory, to emphasize what the core sources are, and make it easier to navigate them.