• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to write a dot file?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's say if I want to create a dot file that print this graph in Java, how do i go about it?


I'm starting with this:

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wikipedia has some basic information, but the authoritative source is probably http://www.graphviz.org/doc/info/lang.html. I'm not aware of an existing Java library for this.
 
H Johong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Wikipedia has some basic information, but the authoritative source is probably http://www.graphviz.org/doc/info/lang.html. I'm not aware of an existing Java library for this.




I did this:


but kept getting:
Error: <stdin>:1: syntax error near line 1
context: digraph program >>> 5 <<<

What Syntax error?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the language syntax - program 5 is not a valid ID.
 
H Johong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Check the language syntax - program 5 is not a valid ID.



I took the space between "program" and "5" out and it worked.

But we were asked to make it program 5. "The first line should state "digraph program 5". I'm not sure what to do about that.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See the language spec for what constitutes an ID - there's a way to do that.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

H Johong wrote:But we were asked to make it program 5. "The first line should state "digraph program 5". I'm not sure what to do about that.


Talk to whoever gave you the assignment and explain the problem that you get if you make the first line literally "digraph program 5". Maybe it's just a mistake in the assignment.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic