public @Override void processCommands(final Module module, final TokenFeed tokenFeed) throws CommandException {
		assert (module != null): "Supplied data module is null";
		assert (tokenFeed != null): "Supplied token feed is null";
		final Map<String, Command> commandMap = new HashMap();
		// init command map for module and feed
		commandMap.put("def", new DefinitionCommand(module, tokenFeed));
		commandMap.put("kindbind", new KindbindCommand(module, tokenFeed));
		commandMap.put("var", new VariableCommand(module, tokenFeed));
		if (module.isProofModule()) {
			// proof module only commands
			commandMap.put("export", new ExportCommand(module, tokenFeed));
			commandMap.put("import", new ImportCommand(module, tokenFeed));
			commandMap.put("thm", new TheoremCommand(module, tokenFeed));
		} else {
			// interface module only commands
			commandMap.put("kind", new KindCommand(module, tokenFeed));
			commandMap.put("param", new ParameterCommand(module, tokenFeed));
			commandMap.put("stmt", new StatementCommand(module, tokenFeed));
			commandMap.put("term", new TermCommand(module, tokenFeed));
		}
		// process commands
		try {
			for (;;) {
				final Token token = tokenFeed.getToken();
				if (token == null)
					return;
				final String command = token.getTokenString();
				if (!commandMap.containsKey(command)) {
					tokenFeed.reject("Command " + command + " unknown");
					throw new CommandException("Command unknown");
				}
				tokenFeed.confirmKeyword();
				commandMap.get(command).execute();
			}
		} catch (ScannerException e) {
			throw new CommandException(e.getScanner().getContextString() + "Feed failure: " + e.getMessage(), e);
		} catch (CommandException e) {
			final Throwable t = e.getCause();
			String erradd;
			if (t == null) {
				erradd = "(cause unknown)";
			} else {
				erradd = t.getMessage();
			}
			throw new CommandException(tokenFeed.getContextString() + " " + e.getMessage() + ": " + erradd, e);
		}
	}