nslj.src.system
Class NslInterpreter

java.lang.Object
  |
  +--nslj.src.system.NslInterpreter

public class NslInterpreter
extends java.lang.Object


Field Summary
 Executive executive
           
 
Constructor Summary
NslInterpreter(NslSystem sys)
          Constructor
 
Method Summary
 void execute()
          Receive user input.
 void execute(java.lang.String cin)
          Parse non-null command string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executive

public Executive executive
Constructor Detail

NslInterpreter

public NslInterpreter(NslSystem sys)
Constructor
Parameters:
sys - the main simulation system
Method Detail

execute

public void execute()
Receive user input. If the input is not null, it calls execute(String) to do parsing. This method also prints out nsl> prompt to console output.

execute

public void execute(java.lang.String cin)
Parse non-null command string. Get the user command from the first word of the command string. If the corresponding command is not found in the command list, it prompts "Bad command". Otherwise, it tokenize the command string and pass it to the command for execution
Parameters:
cin - - command string