Class Parser

java.lang.Object
amadeus.perception.Parser

public class Parser extends Object
Handles the parsing of user input into executable commands.

This class interprets the user's input and maps it to the appropriate Command object, which can then be executed to perform the desired action. It supports a variety of commands, including adding tasks, marking tasks as complete, searching for tasks, and more.

  • Field Details

  • Constructor Details

    • Parser

      public Parser()
  • Method Details

    • parse

      public static Command parse(String input) throws AmadeusException
      Parses the user's input and returns the corresponding Command object.

      The input is split into a command and an optional argument. The command is then matched against predefined constants to determine the appropriate action.

      Parameters:
      input - the full command input provided by the user; must not be null.
      Returns:
      the corresponding Command object.
      Throws:
      AmadeusException - if the command is invalid or the input cannot be parsed.