Re: Allegro Wrapper?

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Right now ... I need better tools to visualize the Euphoria source code, intermediate language, and symbol table to better understand how everything works,

Indeed, having a visual display of the parse tree proved very helpful when writing the transpiler, and to a lesser/shorter term extent the token list.
It was not particularly difficult either, while this is phix and in fact p2js-specific, the main bit of code ended up being just

            elsif what="PARSETREE" then 
                sequence tree_nodes = treeify(ast) 
                if tree_dlg=NULL then 
                    tree = IupTreeView(tree_nodes) 
                    IupSetCallback(tree, "SELECTION_CB", Icallback("selection_cb")) 
                    tree_dlg = IupDialog(tree) 
                    IupSetAttribute(tree_dlg,"TITLE","Parse Tree") 
                    IupSetCallback(tree_dlg, "CLOSE_CB", Icallback("close_sub_cb")) 
                end if 
                IupConfigDialogShow(config, tree_dlg, "ParseTree") 

The treeify() function is a fairly trivial (and very p2js-specific) munging into a more consistent structure, and
IupTreeView()/IupTreeAddNodes() were specially written for phix, but probably quite nickable.

From further back in time, ildump.txt and list.asm contain the intermediate code and symbol table respectively,
and it probably would be nicer if they could be displayed/filtered on-screen, rather than being flat text files.

new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu