MCPcopy Create free account
hub / github.com/devosoft/avida / InteractiveLoadCommandList

Method InteractiveLoadCommandList

avida-core/source/analyze/cAnalyze.cc:10972–11006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10970}
10971
10972void cAnalyze::InteractiveLoadCommandList(tList<cAnalyzeCommand> & clist)
10973{
10974 interactive_depth++;
10975 char text_input[2048];
10976 while (true) {
10977 for (int i = 0; i <= interactive_depth; i++) {
10978 cout << ">>";
10979 }
10980 cout << " ";
10981 cout.flush();
10982 cin.getline(text_input, 2048);
10983 cString cur_input(text_input);
10984 cString command = cur_input.PopWord();
10985
10986 cAnalyzeCommand * cur_command;
10987 cAnalyzeCommandDefBase * command_def = FindAnalyzeCommandDef(command);
10988
10989 if (command == "END") {
10990 // We are done with this section of code; break out...
10991 break;
10992 }
10993 else if (command_def != NULL && command_def->IsFlowCommand() == true) {
10994 // This code has a body to it... fill it out!
10995 cur_command = new cAnalyzeFlowCommand(command, cur_input);
10996 InteractiveLoadCommandList(*(cur_command->GetCommandList()));
10997 }
10998 else {
10999 // This is a normal command...
11000 cur_command = new cAnalyzeCommand(command, cur_input);
11001 }
11002
11003 clist.PushRear(cur_command);
11004 }
11005 interactive_depth--;
11006}
11007
11008void cAnalyze::PreProcessArgs(cString & args)
11009{

Callers

nothing calls this directly

Calls 4

PopWordMethod · 0.80
IsFlowCommandMethod · 0.45
GetCommandListMethod · 0.45
PushRearMethod · 0.45

Tested by

no test coverage detected