node *PRTdoPrint( node *syntaxtree) { info *info; DBUG_ENTER("PRTdoPrint"); DBUG_ASSERT( (syntaxtree!= NULL), "PRTdoPrint called with empty syntaxtree"); printf( "\n\n------------------------------\n\n"); info = MakeInfo(); TRAVpush( TR_prt); syntaxtree = TRAVdo( syntaxtree, info); TRAVpop(); info = FreeInfo(info); printf( "\n\n------------------------------\n\n"); DBUG_RETURN( syntaxtree); }
node *OSdoOptSub( node *syntaxtree) { DBUG_ENTER("OSdoOptSub"); TRAVpush( TR_os); syntaxtree = TRAVdo( syntaxtree, NULL); TRAVpop(); DBUG_RETURN( syntaxtree); }
node *MERRCODEdoPropagate(node *syntax_tree) { info *inf; DBUG_ENTER("MERRCODEdoPropagate"); DBUG_ASSERT((syntax_tree != NULL), " MERRCODEdoPropagate with empty syntaxtree"); TRAVpush(TR_merrcode); inf = infoMake(); syntax_tree = TRAVdo(syntax_tree, inf); inf = infoFree(inf); TRAVpop(); DBUG_RETURN(syntax_tree); }
//start traversal node *CTchecktypes( node *syntaxtree){ DBUG_ENTER("CTchecktypes"); info *arg_info; TRAVpush( TR_ct); // Push traversal "link" as defined in ast.xml arg_info = MakeInfo(); syntaxtree = TRAVdo( syntaxtree, arg_info); // Initiate ast traversal TRAVpop(); // Pop current traversal arg_info = FreeInfo(arg_info); DBUG_RETURN( syntaxtree); }
node *COPdoCountOperators( node *syntaxtree) { info *arg_info; DBUG_ENTER("COPdoCountOperators"); arg_info = MakeInfo(); TRAVpush( TR_cop); syntaxtree = TRAVdo( syntaxtree, arg_info); TRAVpop(); arg_info = FreeInfo( arg_info); DBUG_RETURN( syntaxtree); }
node *COPYdoCopy( node *arg_node) { node *result = NULL; info *info = NULL; DBUG_ENTER("COPYdoCopy"); if (arg_node != NULL) { info = MakeInfo(); TRAVpush( TR_copy); result = TRAVdo( arg_node, info); TRAVpop(); info = FreeInfo( info); } DBUG_RETURN( result); }
node *PREPdoTypeCheck(node *syntax_tree) { info *inf; DBUG_ENTER("PREPdoTypeCheck"); DBUG_ASSERT((syntax_tree!= NULL), "PREPdoTypeCheck called with empty syntaxtree"); inf = infoMake(); TRAVpush(TR_preptcheck); syntax_tree = TRAVdo(syntax_tree, inf); TRAVpop(); infoFree(inf); DBUG_RETURN(syntax_tree); }
node *PPdoLocate(node *syntax_tree) { info *inf; DBUG_ENTER("PPdoLocate"); DBUG_ASSERT((syntax_tree != NULL), "PPdoLocate called with empty syntaxtree"); inf = infoMake(); TRAVpush(TR_pploc); syntax_tree = TRAVdo(syntax_tree, inf); TRAVpop(); infoFree(inf); DBUG_RETURN(syntax_tree); }
node *MDdoUnpack(node *syntax_tree) { info *inf; DBUG_ENTER("MDdoUnpack"); DBUG_ASSERT((syntax_tree != NULL), "MDdoUnpack called with empty syntaxtree"); TRAVpush(TR_mdunpack); inf = infoMake(); syntax_tree = TRAVdo(syntax_tree, inf); inf = infoFree(inf); TRAVpop(); DBUG_RETURN(syntax_tree); }
node * FREEdoFreeTree (node * free_node) { info *arg_info; DBUG_ENTER ("FREEfreeTree"); // printf("it is here in Free now\n"); arg_info = MakeInfo (); INFO_FREE_FLAG (arg_info) = NULL; TRAVpush (TR_free); free_node = TRAVdo (free_node, arg_info); TRAVpop (TR_free); arg_info = FreeInfo (arg_info); DBUG_RETURN (free_node); }
node *CALCCONSTdoConstCalc( node *syntaxtree) { DBUG_ENTER("CALCCONSTdoConstCalc"); DBUG_ASSERT( (syntaxtree!= NULL), "CALCCONSTdoConstCalc called with empty syntaxtree"); TRAVpush( TR_calcconst); syntaxtree = TRAVdo( syntaxtree, NULL); TRAVpop(); DBUG_RETURN( syntaxtree); }
node * FREEdoFreeNode (node * free_node) { info *arg_info; DBUG_ENTER ("FREEfreeNode"); arg_info = MakeInfo (); INFO_FREE_FLAG (arg_info) = free_node; TRAVpush (TR_free); free_node = TRAVdo (free_node, arg_info); TRAVpop (); arg_info = FreeInfo (arg_info); DBUG_RETURN (free_node); }
TYPvrectype *TGVdoGetVRecUC(node *syntax_tree, bool collectUTs, bool collectCTs) { info *inf; DBUG_ENTER("TGVdoGetVRec"); inf = infoMake(collectUTs, collectCTs); TRAVpush(TR_tgv); if (syntax_tree != NULL) { syntax_tree = TRAVdo(syntax_tree, inf); } TRAVpop(); TYPvrectype *out = INFO_VRECTYPE(inf); infoFree(inf); DBUG_RETURN(out); }
node *CTPdoLinkVar(node *syntaxtree) { info *info; DBUG_ENTER("CTPdoLinkVar"); DBUG_ASSERT( ( syntaxtree != NULL), "CTPdoLink called with empty syntaxtree"); info = MakeInfo(); TRAVpush(TR_lvar); syntaxtree = TRAVdo( syntaxtree, info); //report_unlinked_identifiers(info); TRAVpop(); info = FreeInfo( info); DBUG_RETURN( syntaxtree); }