package parser;

import java.io.File;

public class Parser {

    CommandFactory commandFactory = new CommandFactory();

    public Parser() {
    }
    
    
    /**
     * Accepts a file for parsing
     * 
     * @param file
     * file to parse
     */
    public void parseCommandFile(File file)  {
        
    }
    
    /**
     * Accepts a command for parsing.  Should utilize the command factory's addCommand method
     * 
     * @param command
     * command to parse
     */
    public void parseCommand(String command) {
        
    }
    
}

package parser;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import commands.*;

public class Parser {

    private CommandsFactory commandsFactory = null;
    private LogoParser logoParser;

    public Parser(CommandsFactory commandsFactory) {
        this.commandsFactory = commandsFactory;
    }
   
    public void createLogoParser() {
        logoParser = new LogoParser(System.in);
    }
    
    public ICommand parse(String input) throws Exception {
        InputStream inputStream = new ByteArrayInputStream(input.getBytes());
        logoParser.ReInit(inputStream);
        return logoParser.parse(commandsFactory);
    }
    
}

Implement parser