*operation* void gen_main_tcl() *traverse* *from* Demeter_in *to* Adjacency *wrapper* Adjacency (@ ofstream outFile8; outFile8.open("./main.tcl.sample", ios::out); outFile8 << "# tcl sample program generated by ISTHMUS\n\n" << "set Dem_input \"demeter-input\"\n" << "\n#------------------------------------\n" << "#Parsing an object\n" << "#------------------------------------\n" << "puts \"Parsing in object in: $Dem_input .\"\n" << "set i" << source <<"[" << source << "new:]\n" << "$i" << source << "g_parse:" << " $Dem_input\n" << "#------------------------------------\n" << "#Drawing an object\n" << "#------------------------------------\n" << "puts \"Drawing in the parsed object:\"\n" << "$i" << source << "g_draw:\n" << "#------------------------------------\n" << "#Copying an object\n" << "#------------------------------------\n" << "puts \"Copying in object.\"\n" << "set n" << source << "[$i" << source <<"g_copy:]\n" << "#------------------------------------\n" << "#Activating\n" << "#------------------------------------\n" << "puts \"Activating.\"\n" << "activate $n" << source << source << "\n" << "#------------------------------------\n" << "#Displaying the copied object as a tree\n" << "#------------------------------------\n" << "puts \"Displaying the copied object as a tree:\"\n" << "$n" << source << "g_displayAsTree:\n" << "#------------------------------------\n" << "#Comparing the two objects\n" << "#------------------------------------\n" << "puts \"Comparing the two objects\"\n" << "set result1 [$i"<< source<< "g_equal: $n"<< source << "]\n" << "if {$result1 == 1} { " << "puts \"copied and original objects are equal\"\n" << "} else {" << "puts \"copied and original objects are NOT equal\" }\n" << "#------------------------------------\n" << "#Printing an object\n" << "#Not implemented because g_print is not taking filename\n" << "#as input\n" << "#------------------------------------\n" << "puts \"Pretty printing the parsed object:\"\n" << "#$n"<< source << "g_print: notmod/tmp/demeter_tcl_output\n" << "#------------------------------------\n" << "#Your code follows after this\n" << "#------------------------------------\n" << "\n\n" << "#------------------------------------\n" << "#Deleting created objects\n" << "#------------------------------------\n" << "delete $i" << source << "\ndelete $n" << source << "\n#**** FINISHED ******\n" << endl; @) *wrapper* Adjacency_Nlist *prefix* (@ int flag = 1; @) *wrapper* ~> Adjacency_Nlist, Adjacency *prefix* (@ if( flag == 1 ) { @) *suffix* (@ } flag = 0; @)