package worldofzuul;

import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * @author  Michael Kolling and David J. Barnes
 * @version 2006.03.30
 */
public class Parser {
    private CommandWords commands;
    private Scanner reader;

    public Parser() {
        commands = new CommandWords();
        reader = new Scanner(System.in);
    }

    public Command getCommand() {
        String inputLine;
        String word1 = null;
        String word2 = null;

        System.out.print("> ");

        inputLine = reader.nextLine();

        Scanner tokenizer = new Scanner(inputLine);
        if(tokenizer.hasNext()) {
            word1 = tokenizer.next();
            if(tokenizer.hasNext()) {
                word2 = tokenizer.next();
            }
        }

        return new Command(commands.getCommandWord(word1), word2);
    }

    public void showCommands() {
        commands.showAll();
    }
}

@@ -45,47 +45,18 @@
 er;%0A
-import java.util.StringTokenizer;
 %0A%0A/**%0A
+ * %0A
  * @
@@ -66,266 +66,584 @@
 hor 
- Michael Kolling and David J. Barnes%0A * @version 2006.03.30%0A */%0Apublic class Parser %7B%0A    private CommandWords commands;%0A    private Scanner reader;%0A%0A    public Parser() %7B%0A        commands = new CommandWords();%0A        reader = new Scanner(System.in);%0A    %7D%0A
+ViktoriaNadarajah%0A */%0Apublic class Parser %7B%0A    /**%0A     * It is a list of CommandWords%0A     */%0A    private CommandWords commands;%0A    /**%0A     * The Scanner reads the commands%0A     */%0A    private Scanner reader;%0A%0A    /**%0A     * The reader reads new commands if any%0A     */%0A    public Parser() %7B%0A        commands = new CommandWords();%0A        reader = new Scanner(System.in);%0A    %7D%0A    /**%0A    * It reads word1 and makes a new Scanner to make a inputLine. %0A    * Tokenizer is a instance variable of the type Scanner. It returns new commands%0A    * @return command object%0A    */
 %0A   
@@ -830,16 +830,33 @@
 Line();%0A
+        %0A        
 %0A       
@@ -1146,24 +1146,67 @@
 rd2);%0A    %7D%0A
+    /**%0A    * Shows all the commands%0A    */
 %0A    public 

add javadoc parser (#4)