protected @Override Token getNewToken() throws ScannerException {
		try {
			final String s = in.readLine();
			if (s == null) {
				logger.error("Unexpected end of input");
				throw new ScannerException("Unexpected end of input", this);
			}
			if ("(".equals(s))
				return BEGIN_EXP;
			if (")".equals(s))
				return END_EXP;
			if (!Token.VALID_ATOM.matcher(s).matches()) {
				logger.error("Invalid token: " + s);
				throw new ScannerException("Invalid token", this);
			}
			return new TokenImpl(s, Token.Class.ATOM);
		} catch (IOException e) {
			logger.error("I/O error while reading input");
			throw new ScannerException("I/O error while reading input", this, e);
		}
	}