in reply to Convert stack-based code to "conventional" (was Re: Graphing SQLite's VDBE)
in thread Graphing SQLite's VDBE

You don't show the stack-based code for the graph shown, so it's not as easy as one would like to see how they tie together
Actually, most of the operations do something to the stack, sometimes conditionally, and the textual description is the only source of information. I suppose that I could add some notation like "-2" for something that pops two items. I'll think about your suggestion.

Thanks for the conversion code, I thought that I'd be bumping into the Halting Problem but maybe your technique would work for most or even all of the VDBE code encountered in practice. There are loops, conditionals and off-stack state used by the opcodes so I think the Halting Problem is lurking there somewhere.

create table tape (cur_state, scanned, write, move, next_state);
  • Comment on Re: Convert stack-based code to "conventional" (was Re: Graphing SQLite's VDBE)
  • Download Code