Skip to content
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

DOT to PseudoC converter. #35

Closed
wants to merge 2 commits into from

Conversation

maximumspatium
Copy link
Contributor

This is the first shoot at DOT->PseudoC conversion tool, see #32

Parsing of DOT files is delegated to dot_tools library to avoid unnecessary script complexity and corner cases. dot_tools requires Python 2 which is IMHO a bearable inconvenience for such a tool.

While there is still room for improvement, the tool produces correct output for two sample graphs supplied in the test_graphs directory. One of them is part of ScratchABlock test suite.

It's not clear whether any ENTRY node should be handled appropriately. For the moment being, such a node is simply ignored.

Line numbering is zero-based even if the first node is labeled as "1". This was done to support letter-based node labeling, i.e. "A, B, C, D" etc...

@pfalcon
Copy link
Owner

pfalcon commented Feb 23, 2019

Thanks for the patch!

Parsing of DOT files is delegated to dot_tools library to avoid unnecessary script complexity and corner cases.

I'm not sure if that's obvious, but I'm trying to avoid adding external dependencies. PyYAML is the only one for runtime, plus nosetests for testing. I didn't mentioned that, because I didn't think that external library would be required to parse lines with the format like A -> B -> C.

dot_tools requires Python 2 which is IMHO a bearable inconvenience for such a tool.

So, it brings dependency not just for external library, but for a whole different language version.

Anyway, that's indeed just external convenience tool. Thanks for working on that, merged.

@pfalcon pfalcon closed this Feb 23, 2019
@maximumspatium
Copy link
Contributor Author

I'm not sure if that's obvious, but I'm trying to avoid adding external dependencies. PyYAML is the only one for runtime, plus nosetests for testing. I didn't mentioned that, because I didn't think that external library would be required to parse lines with the format like A -> B -> C.

So, it brings dependency not just for external library, but for a whole different language version.

I fully agree with you. On the other side, you've requested a "pretty simple script". Reimplementing DOT parsing without external dependencies is feasible but goes beyond simple scripts. I think we should spend our time doing more important developments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants