debug dot file generator

Issue #54 resolved
Anonymous created an issue

Hello.
There is an issue with the generated dot file. Specifically if terminals/productions have symbols like " or .
The thing is viewer doesn't recognize labels like this:
state114 -> state31 [label="\"]; -> error. Should be state114 -> state31 [label="\"];
state0 -> state1 [label="""]; -> error. Should be state0 -> state1 [label="\""];

In short symbols like " or \ should be escaped in labels. Looks like this is trivial to fix.

Comments (9)

  1. Alexey Smirnov

    The initial issue was fixed (at least it looks like so). But for some reason i still can't get correct DOT file after generation. It is attached for reference.
    The error from online dot to swg generator is "error on line 1 at column 1: Document is empty". I tried multiple ones to be totally sure. I don't know how to debug this further :(

  2. Laurent Wouters

    It looks like the document contains some BOM at the beginning, which trips some graphviz implementations. BOM won't normally appear in text editors so it can be tricky. For example, on my system:

    dot -Tpng sysvcDFA.dot -o result.png
    

    indeed gets me the error: Error: sysvcDFA.dot: syntax error in line 1 near 'digraph'.

    Removing the BOM fixes the issue. I also have tried the content of your document on some online graphviz services and unsurprisingly they all gave up due to the graph's size.

    I don't know if the BOM has been inserted by Hime. I''ll look into it and fix it if that is the case.

    Does removing the BOM fixes the issue on your end?

  3. Log in to comment