use of com.gargoylesoftware.css.parser.Locator in project LoboEvolution by LoboEvolution.
the class CSS3Parser method mediaRule.
//
// media
// : MEDIA_SYM S* medium [ COMMA S* medium ]* '{' S* ruleset* '}' S*
// ;
//
public final void mediaRule() throws ParseException {
boolean start = false;
MediaQueryList ml = new MediaQueryList();
Locator locator;
try {
jj_consume_token(MEDIA_SYM);
locator = createLocator(token);
label_9: while (true) {
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S:
{
;
break;
}
default:
jj_la1[17] = jj_gen;
break label_9;
}
jj_consume_token(S);
}
mediaList(ml);
start = true;
handleStartMedia(ml, locator);
jj_consume_token(LBRACE);
label_10: while (true) {
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S:
{
;
break;
}
default:
jj_la1[18] = jj_gen;
break label_10;
}
jj_consume_token(S);
}
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IDENT:
case DOT:
case COLON:
case ASTERISK:
case LSQUARE:
case HASH:
case IMPORT_SYM:
case PAGE_SYM:
case MEDIA_SYM:
case ATKEYWORD:
{
mediaRuleList();
break;
}
default:
jj_la1[19] = jj_gen;
;
}
jj_consume_token(RBRACE);
} catch (CSSParseException e) {
getErrorHandler().error(e);
error_skipblock("ignoringRule", e);
} catch (ParseException e) {
CSSParseException cpe = toCSSParseException("invalidMediaRule", e);
getErrorHandler().error(cpe);
error_skipblock("ignoringRule", cpe);
} finally {
if (start) {
handleEndMedia(ml);
}
}
}
use of com.gargoylesoftware.css.parser.Locator in project LoboEvolution by LoboEvolution.
the class CSS3Parser method charsetRule.
public final void charsetRule() throws ParseException {
Token t;
Locator locator;
try {
jj_consume_token(CHARSET_SYM);
locator = createLocator(token);
jj_consume_token(S);
t = jj_consume_token(STRING);
jj_consume_token(SEMICOLON);
handleCharset(t.toString(), locator);
} catch (ParseException e) {
getErrorHandler().error(toCSSParseException("invalidCharsetRule", e));
}
}
use of com.gargoylesoftware.css.parser.Locator in project LoboEvolution by LoboEvolution.
the class CSS3Parser method unknownAtRule.
public final void unknownAtRule() throws ParseException {
String s;
Locator locator;
try {
jj_consume_token(ATKEYWORD);
locator = createLocator(token);
s = skip();
handleIgnorableAtRule(s, locator);
} catch (ParseException e) {
getErrorHandler().error(toCSSParseException("invalidUnknownRule", generateParseException()));
}
}
use of com.gargoylesoftware.css.parser.Locator in project LoboEvolution by LoboEvolution.
the class CSS3Parser method importRule.
//
// import
// : IMPORT_SYM S*
// [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
// ;
//
public final void importRule(final boolean nonImportRuleFoundBefore) throws ParseException {
Token t;
MediaQueryList ml = new MediaQueryList();
Locator locator;
try {
ParseException e = null;
if (nonImportRuleFoundBefore) {
e = generateParseException();
}
jj_consume_token(IMPORT_SYM);
locator = createLocator(token);
label_7: while (true) {
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S:
{
;
break;
}
default:
jj_la1[13] = jj_gen;
break label_7;
}
jj_consume_token(S);
}
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case STRING:
{
t = jj_consume_token(STRING);
break;
}
case URI:
{
t = jj_consume_token(URI);
break;
}
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
label_8: while (true) {
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S:
{
;
break;
}
default:
jj_la1[15] = jj_gen;
break label_8;
}
jj_consume_token(S);
}
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case NOT:
case ONLY:
case IDENT:
case LROUND:
{
mediaList(ml);
break;
}
default:
jj_la1[16] = jj_gen;
;
}
jj_consume_token(SEMICOLON);
if (nonImportRuleFoundBefore) {
getErrorHandler().error(toCSSParseException("invalidImportRuleIgnored2", e));
} else {
handleImportStyle(unescape(t.image, false), ml, null, locator);
}
} catch (CSSParseException e) {
getErrorHandler().error(e);
error_skipAtRule();
} catch (ParseException e) {
getErrorHandler().error(toCSSParseException("invalidImportRule", e));
error_skipAtRule();
}
}
use of com.gargoylesoftware.css.parser.Locator in project LoboEvolution by LoboEvolution.
the class CSS3Parser method _class.
//
// class
// : '.' IDENT
// ;
//
public final Condition _class(boolean pseudoElementFound) throws ParseException {
Token t;
Locator locator;
ParseException pe = null;
try {
if (pseudoElementFound) {
pe = generateParseException();
}
jj_consume_token(DOT);
locator = createLocator(token);
t = jj_consume_token(IDENT);
if (pseudoElementFound) {
throw pe;
}
return new ClassCondition(unescape(t.image, false), locator);
} catch (ParseException e) {
throw toCSSParseException("invalidClassSelector", e);
}
}
Aggregations