Class Parser

java.lang.Object
cs350s22.component.ui.parser.Parser

public class Parser extends Object
The main parser class used to interpret commands.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
    private final cs350s22.component.ui.parser.A_ParserHelper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Parser(cs350s22.component.ui.parser.A_ParserHelper parserHelper, String commandText)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Parse the first one or two commands/arguments passed by the calling object (set via the constructor), then initialize and execute the appropriate subParser.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • commandText

      private final String commandText
    • parserHelper

      private final cs350s22.component.ui.parser.A_ParserHelper parserHelper
  • Constructor Details

    • Parser

      public Parser(cs350s22.component.ui.parser.A_ParserHelper parserHelper, String commandText)
      Constructor.
      Parameters:
      parserHelper - Object to be used be each sub parser.
      commandText - The string of commands to be parsed.
  • Method Details

    • parse

      public void parse() throws IOException
      Parse the first one or two commands/arguments passed by the calling object (set via the constructor), then initialize and execute the appropriate subParser.
      Throws:
      IOException - Invalid input.