Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to draw a deterministic finite-state machine which was created from a nondeterministic finite-state machine with Graphviz. To do so, I need to have labels like "{q1, q2}". When I try to do so with DOT, I get the following error:

$ dot -Tpng dfsm.gv -o myDeterministicFiniteStateMachine.png
Error: dfsm.gv:4: syntax error near line 4
context: node [shape = doublecircle]; "{q2, >>>  f}", <<<  "{f}";

Is there any way to get curly braces in a Graphviz label?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

It would help if you showed your actual dot source code, because what you're trying to do should work fine. There are no major restrictions in Graphviz on what text you may place in a label. There's no major restriction on node names either; of course, if your node name contains more than just basic alphanumeric characters, you should enclose the node name in quotation marks. A simple example:

digraph fsm {
  node [shape=doublecircle]
  "{q2, f}"
}

Graphviz rendering

Note that the Graphviz web site has an fsm example. It does not use curly braces in its labels, but it might be useful if you need a reference for other reasons.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.