(kimwitu has generated the fdotprint_expr routine from the input phylum definition)
expr e = Times( Plus( Const( 1 ), Const( 1 )), Plus( Const( 1 ), Const( 1 )) ); fdotprint_expr( stdout, e, "(1+1)*(1+1)", 0, 0, True, True, True );
and run dot (or run WebDot) on the output, which gives a result like the following: (edge numbers indicate a depth-first left-to-right treewalk):
If we put the above lines of C code in a main routine, and build an
executable of it with name build_expr
, then we can show
the above tree with a Unix shell command line of:
$ build_expr | dot -Tps | ghostview -