Hi all,

I want to generate a .dot file (to graphwiz) from well formed paretheses, but haven't figured yet how can I convert them.
example:
Qt Code:
  1. 1 2 3 4 5 6
  2. ( ( ) ( ) )
  3. 1 1 0 1 0 0
  4.  
  5. 1
  6. / \
  7. 2 *7
  8. / \
  9. *3 4
  10. / \
  11. *5 *6
To copy to clipboard, switch view to plain text mode 
So the '('s mean 1s and they are nodes. ')' mean 0s and they are leaves. The order is preorder, if i am not wrong.
My question is, how create from 1100100 to 1--2, 2--*3, 2--4, 4--*5, 4--*6, 1--*7.
I see the left connections but not the right ones. Left (i,i+1), if i==1.