Thursday, October 27, 2016

Replicating a block structure

We want to solve a problem.  We have this syntax:

top(left_pane((entrybox,ok_button),sourcetext,lower_pane(menu1menu2)))

If I got my block markers right.  What do we want to do? Read it left to right and duplicate it as a formal block structure.
Then we an call top.traverse(drawe,drawdict)

In other words, run the graph with the draw method. Well, convert the syntax above into a block structure of pointers to widgets. The syntax is block nested in design. So just read it, count blocks, and do the appropriate calls to and create and enclose. Your operator has the token and dictionary, it can transpose the text into some object pointer for the array.  We would like nested block structure to be a built_in, to get it ground down to  binary efficiency.

What is the trick?

You have to stay one step behind in unfolding your text, that cdreates at least one forward traversal on the output graph, you won't get booted by end of graph.

No comments: