Package org.w3c.css.sac

Examples of org.w3c.css.sac.CSSParseException


        }
    }

    private void reportWarningSkipText(Locator l, String text) {
        if (errorHandler != null && text != null) {
            errorHandler.warning(new CSSParseException("Skipping: " + text, l));
        }
    }
View Full Code Here


            String s = ":" + convertIdent(n.image);
            if (isPseudoElement) {
                if (pseudoElt != null) {
                    {
                        if (true) {
                            throw new CSSParseException(
                                    "duplicate pseudo element definition " + s,
                                    getLocator());
                        }
                    }
                } else {
View Full Code Here

            documentHandler.variable(name, exp, guarded);
        } catch (JumpException e) {
            skipAfterExpression();
        } catch (NumberFormatException e) {
            if (errorHandler != null) {
                errorHandler.error(new CSSParseException("Invalid number "
                        + e.getMessage(), getLocator(), e));
            }
            reportWarningSkipText(getLocator(), skipAfterExpression());
        } catch (ParseException e) {
            if (errorHandler != null) {
View Full Code Here

                list += s.substring(1, s.length()).substring(0, s.length() - 2);

            } else if (t.kind == LPARAN) {
                nesting++;
                if (nesting > nest + 1) {
                    throw new CSSParseException(
                            "Only one ( ) pair per parameter allowed",
                            getLocator());
                }
            } else if (t.kind == RPARAN) {
                nesting--;
                if (nesting == 0) {
                    return list;
                }
            } else if (t.kind == COMMA) {
                if (nesting == nest) {
                    return list;
                } else {
                    list += ",";
                }

            } else if (t.kind == S) {
                list += " ";
            } else if (t.kind == LBRACE) {
                throw new CSSParseException("Invalid token,'{' found",
                        getLocator());
            }

            getNextToken();
        }
View Full Code Here

            skipAfterExpression();
            // reportWarningSkipText(getLocator(), skipAfterExpression());

        } catch (NumberFormatException e) {
            if (errorHandler != null) {
                errorHandler.error(new CSSParseException("Invalid number "
                        + e.getMessage(), getLocator(), e));
            }
            reportWarningSkipText(getLocator(), skipAfterExpression());
        } catch (ParseException e) {
            if (errorHandler != null) {
View Full Code Here

            skipAfterExpression();
            // reportWarningSkipText(getLocator(), skipAfterExpression());

        } catch (NumberFormatException e) {
            if (errorHandler != null) {
                errorHandler.error(new CSSParseException("Invalid number "
                        + e.getMessage(), getLocator(), e));
            }
            reportWarningSkipText(getLocator(), skipAfterExpression());
        } catch (ParseException e) {
            if (errorHandler != null) {
View Full Code Here

        }
        jj_consume_token(RPARAN);
        if (operator != ' ') {
            {
                if (true) {
                    throw new CSSParseException(
                            "invalid operator before a function.", getLocator());
                }
            }
        }
        String f = convertIdent(n.image);
        LexicalUnitImpl l = (LexicalUnitImpl) params;
        boolean loop = true;
        if ("rgb(".equals(f)) {
            // this is a RGB declaration (e.g. rgb(255, 50%, 0) )
            int i = 0;
            while (loop && l != null && i < 5) {
                switch (i) {
                case 0:
                case 2:
                case 4:
                    if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
                            && (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) {
                        loop = false;
                    }
                    break;
                case 1:
                case 3:
                    if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
                        loop = false;
                    }
                    break;
                default: {
                    if (true) {
                        throw new ParseException("implementation error");
                    }
                }
                }
                if (loop) {
                    l = l.getNextLexicalUnit();
                    i++;
                }
            }
            if ((i == 5) && loop && (l == null)) {
                {
                    if (true) {
                        return LexicalUnitImpl.createRGBColor(n.beginLine,
                                n.beginColumn, prev, params);
                    }
                }
            } else {
                if (errorHandler != null) {
                    String errorText;
                    Locator loc;
                    if (i < 5) {
                        if (params == null) {
                            loc = new LocatorImpl(this, n.beginLine,
                                    n.beginColumn - 1);
                            errorText = "not enough parameters.";
                        } else if (l == null) {
                            loc = new LocatorImpl(this, n.beginLine,
                                    n.beginColumn - 1);
                            errorText = "not enough parameters: "
                                    + params.toString();
                        } else {
                            loc = new LocatorImpl(this, l.getLineNumber(),
                                    l.getColumnNumber());
                            errorText = "invalid parameter: " + l.toString();
                        }
                    } else {
                        loc = new LocatorImpl(this, l.getLineNumber(),
                                l.getColumnNumber());
                        errorText = "too many parameters: " + l.toString();
                    }
                    errorHandler.error(new CSSParseException(errorText, loc));
                }

                {
                    if (true) {
                        throw new JumpException();
View Full Code Here

        if (s.length() != 3 && s.length() != 6) {
            first = null;
            {
                if (true) {
                    throw new CSSParseException(
                            "invalid hexadecimal notation for RGB: " + s,
                            getLocator());
                }
            }
        }
View Full Code Here

                        break;
                    default:
                        buf.append(c);
                    }
                } else {
                    throw new CSSParseException("invalid string " + s,
                            getLocator());
                }
            } else {
                buf.append(c);
            }
View Full Code Here

            if (ret.charAt(0) == '@') {
                documentHandler.unrecognizedRule(ret);
            } else {
                {
                    if (true) {
                        throw new CSSParseException("unrecognize rule: " + ret,
                                getLocator());
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.w3c.css.sac.CSSParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.