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 Tree Generation throws exception #10

Closed
xxx opened this issue Jan 10, 2011 · 3 comments
Closed

DOT Tree Generation throws exception #10

xxx opened this issue Jan 10, 2011 · 3 comments

Comments

@xxx
Copy link

xxx commented Jan 10, 2011

Hi,

I'm trying to generate a graph of the AST, but I get an exception. The grammar I'm using is just one of the sample grammars: https://github.com/ohboyohboyohboy/antlr3/blob/master/samples/SearchExpression.g.

The script to generate the tree and exception I'm getting are at https://gist.github.com/772368

Am I just doing it wrong?

@ohboyohboyohboy
Copy link
Owner

Hey there,

I'm sorry, but the DOT Generator library is a library that I ported from the Python binding early on in this project without writing extensive test code for it. I suppose I kind of forgot about it while I was expanding the project over time, as I just reviewed that utility and found out that it was horrifically broken.

Fortunately, it's a pretty simple class, so I was able to patch it up and get it working again, at least for the purposes of the simple script you cited. I just pushed this new version (1.8.8), and I tested it against the code you gave. It should work for you now. Thanks for reporting that. Let me know if you have any questions.

@xxx
Copy link
Author

xxx commented Jan 10, 2011

Thanks for the quick fix!

I can confirm the previous error is gone, but the DOT files are being generated with a syntax error - There is no name on the digraph being generated, so it's not parsing. i.e.:

digraph {

should be

digraph G {

or something.

After doing that, the graphs work fine for me.

Thanks again.

@xxx
Copy link
Author

xxx commented Jan 11, 2011

Hmm, only the dotty tool complains about the lack of an ID on a graph. Everything works fine when converting to an image file, and I do see now the ID is optional per the DOT grammar. ¯(°_o)/¯

This issue was closed.
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

No branches or pull requests

2 participants