private LexicalElement createMQOElement(StringBuffer buf) {

        String word = buf.toString().trim();
        LexicalElement element = null;

        search:
        for (LexicalElement e : LexicalElement.values()) {
            if (e.equals(word)) {
                element = e;
                break search;
            }
        }

        if (null == element) {
            String regex = "\"(.*)\"";
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(word);
            if (m.find()) {
                element = LexicalElement.STRING;
                element.setValue(m.group(1));
            }
        }

        if (null == element) {
            String regex = "^[-]?[0-9]+$";
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(word);
            if (m.find()) {
                element = LexicalElement.INT;
                element.setValue(word);
            }
        }

        if (null == element) {
            String regex = "^[-]?[0-9]*.[0-9]*$";
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(word);
            if (m.find()) {
                element = LexicalElement.FLOAT;
                element.setValue(word);
            }
        }

        if (null == element) {
            element = LexicalElement.BYTE_ARRAY;
            element.setValue(word);
        }

        return element;
    }