bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
private void parseELExpression(Node parent, String typeEL)
            throws JasperException {
        start = reader.mark();
        boolean singleQuoted = false, doubleQuoted = false;
        int curl = 0;
        int currentChar;
        do {
            // XXX could move this logic to JspReader
            currentChar = reader.nextChar();
            if (currentChar == '\\' && (singleQuoted || doubleQuoted)) {
                // skip character following '\' within quotes
                reader.nextChar();
                currentChar = reader.nextChar();
            }
            if (currentChar == -1)
                err.jspError(start, "jsp.error.unterminated", typeEL);
            if (currentChar == '"')
                doubleQuoted = !doubleQuoted;
            else if (currentChar == '\'')
                singleQuoted = !singleQuoted;
            else if (currentChar == '{')
                curl++;
            else if (currentChar == '}')
                curl--;
        } while (currentChar != '}' || curl >= 0 || singleQuoted || doubleQuoted);

        String text = typeEL + reader.getText(start, reader.mark());
        new Node.ELExpression(text, start, parent);
    }
private void parseELExpression(Node parent, String typeEL)
            throws JasperException {
        start = reader.mark();
        boolean singleQuoted = false, doubleQuoted = false;
        int curl = 0;
        int currentChar;
        do {
            // XXX could move this logic to JspReader
            currentChar = reader.nextChar();
            if (currentChar == '\\' && (singleQuoted || doubleQuoted)) {
                // skip character following '\' within quotes
                reader.nextChar();
                currentChar = reader.nextChar();
            }
            if (currentChar == -1)
                err.jspError(start, "jsp.error.unterminated", typeEL);
            if (currentChar == '"')
                doubleQuoted = !doubleQuoted;
            else if (currentChar == '\'')
                singleQuoted = !singleQuoted;
            else if (currentChar == '{')
                curl++;
            else if (currentChar == '}')
                curl--;
        } while (currentChar != '}' || curl >= 0 || singleQuoted || doubleQuoted);

        String text = typeEL + reader.getText(start, reader.mark());
        new Node.ELExpression(text, start, parent);
    }
/*
ELExpressionBody
(following "${" or "#{"to first unquoted "}")
// XXX add formal production and confirm implementation against it,
//     once it's decided