private boolean evaluate(ArrayList<Object> al) throws SyntaxErrorException {
		for (char c : operator) {
			if (al.size() == 1)
				return (Boolean) (al.get(0));
			for (int i = 0; i < al.size(); i++) {
				Boolean arg1, arg2;
				Object object = al.get(i);
				String op;
				if (object instanceof String)
					op = (String) object;
				else
					continue;
				if (op.equalsIgnoreCase(String.valueOf(c))) {
					try {
						switch (c) {
						case '!':
							if (al.size() < i + 2)
								throw new SyntaxErrorException();
							arg1 = (Boolean) al.get(i + 1);
							if (arg1)
								al.add(i, false);
							else
								al.add(i, true);
							al.remove(i + 1);
							al.remove(i + 1);
							i--;
							break;
						case '*':
							arg1 = (Boolean) al.get(i - 1);
							arg2 = (Boolean) al.get(i + 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.add(i - 1, arg1 && arg2);
							i--;
							break;
						case '+':
							arg1 = (Boolean) al.get(i - 1);
							arg2 = (Boolean) al.get(i + 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.add(i - 1, arg1 || arg2);
							i--;
							break;
						case '^':
							arg1 = (Boolean) al.get(i - 1);
							arg2 = (Boolean) al.get(i + 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.add((arg1 && !arg2) || (!arg1 && arg2));
							i--;
							break;
						case '|':
							arg1 = (Boolean) al.get(i - 1);
							arg2 = (Boolean) al.get(i + 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.add(!(arg1 && arg2));
							i--;
							break;
						case '/':
							arg1 = (Boolean) al.get(i - 1);
							arg2 = (Boolean) al.get(i + 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.remove(i - 1);
							al.add(!(arg1 || arg2));
							i--;
							break;
						}
					} catch (Exception e) {
						throw new SyntaxErrorException();
					}
				}
			}

		}
		if (al.size() != 1 || !(al.get(0) instanceof Boolean))
			throw new SyntaxErrorException();
		return (boolean) (al.get(0));
	}