Class Parser

java.lang.Object
com.bdtripp.hauntedhouse.engine.Parser

public class Parser extends Object
Parses raw player input into structured commands. The Parser tokenizes input from either the CLI or web client, extracts up to three command words, and produces a Command object for processing.
Author:
Michael Kölling, David J. Barnes, and Brian Tripp
  • Constructor Details

    • Parser

      public Parser(String string)
      For the Web application
      Parameters:
      string - the input to tokenize
    • Parser

      public Parser(InputStream inputStream)
      For the CLI application
      Parameters:
      inputStream - the input stream to tokenize
  • Method Details

    • getCommand

      public Command getCommand()
      Returns a tokenized version of the command that was entered by the player
      Returns:
      the command