class StringNode extends LeafNode<String> {

    public static String unescapeQuotedString(String string) {
        StringBuilder sb = new StringBuilder(string);
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i) == '\\') {
                sb.deleteCharAt(i);
                if (i == sb.length()) {
                    throw new IllegalArgumentException("Parse error" + string);
                }
                switch (sb.charAt(i)) {
                    case'n':
                        sb.setCharAt(i, '\n');
                        break;
                    case'r':
                        sb.setCharAt(i, '\r');
                        break;
                    case't':
                        sb.setCharAt(i, '\t');
                        break;
                    case'f':
                        sb.setCharAt(i, '\f');
                        break;
                    case'x':
                        if (i + 2 >= sb.length()) {
                            throw new IllegalArgumentException
                                    ("Could not parse hex value " + string);
                        }
                        sb.setCharAt(i, (char) Integer.parseInt
                                (sb.substring(i + 1, i + 3), 16));
                        sb.delete(i + 1, i + 3);
                        break;
                    case'\\':
                        sb.setCharAt(i, '\\');
                        break;
                }
            }
        }

        if (sb.length() > 0 && (sb.charAt(0) == '"') && sb.charAt(sb.length() - 1) == '"') {
            sb.deleteCharAt(sb.length() - 1);//remove last quote
            if (sb.length() > 0) {
                sb.deleteCharAt(0);  //remove first quote
            }
        }
        return sb.toString();
    }

    public  StringNode();
    public  StringNode(String value);

}