Class WoolCommandParser


  • public class WoolCommandParser
    extends Object
    • Method Detail

      • readCommandName

        public String readCommandName​(CurrentIterator<WoolBodyToken> tokens)
                               throws LineNumberParseException
        Reads the command name from the start of a command. The specified iterator should be positioned at the command start token. When this method returns, it will be positioned at the token with the command name. This method does not validate the command name.
        Parameters:
        tokens - the tokens
        Returns:
        the command name
        Throws:
        LineNumberParseException - if a parsing error occurs
      • parseFromStart

        public WoolCommand parseFromStart​(CurrentIterator<WoolBodyToken> tokens)
                                   throws LineNumberParseException
        Parses a command from the start token. The specified iterator should be positioned at the command start token. When this method returns it will be positioned after the command end token. This method cannot be called after readCommandName(). This method validates the command name.
        Parameters:
        tokens - the tokens
        Returns:
        the command
        Throws:
        LineNumberParseException - if a parsing error occurs