public String[] lex(String t) throws LexingException {
        this.target = t.replaceAll("\\s+", "");
        ArrayList<String> result = new ArrayList<String>();
        int l = 0;
        int r = 0;
        boolean f;
        while (r < target.length()) {
            ++r;
            f = true;
            String temp = target.substring(l, r);
            for (Lexeme lex : Lexeme.values()) {
                if (temp.equals(lex.s)) {
                    result.add(temp);
                    l = r;
                    f = false;
                    break;
                }
            }
            if (f && isVariable(temp)) {
                while (r < target.length() && isVariable(target.substring(l, r + 1))) {
                    ++r;
                }
                temp = target.substring(l, r);
                result.add(temp);
                l = r;
            }
        }
        if (l - r > 0) throw new LexingException();
        return result.toArray(new String[result.size()]);
    }