// LBRACE S* [ declaration ';' S* ]* '}' S*
// ;
private void ruleset(RulesetContainer container) throws IOException {
//System.out.println("ruleset()");
try {
Ruleset ruleset = new Ruleset(container.getOrigin());
selector(ruleset);
Token t;
while (true) {
t = la();
if (t == Token.TK_COMMA) {
next();
skip_whitespace();
selector(ruleset);
} else {
break;
}
}
t = next();
if (t == Token.TK_LBRACE) {
skip_whitespace();
declaration_list(ruleset, false, false, false);
t = next();
if (t == Token.TK_RBRACE) {
skip_whitespace();
} else {
push(t);
throw new CSSParseException(t, Token.TK_RBRACE, getCurrentLine());
}
} else {
push(t);
throw new CSSParseException(
t, new Token[] { Token.TK_COMMA, Token.TK_LBRACE }, getCurrentLine());
}
if (ruleset.getPropertyDeclarations().size() > 0) {
container.addContent(ruleset);
}
} catch (CSSParseException e) {
error(e, "ruleset", true);
recover(true, false);