Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.daisy.pipeline.css.sass.impl.SassPostProcessParser Maven / Gradle / Ivy
// $ANTLR 3.5.2 org/daisy/pipeline/css/sass/impl/SassPostProcess.g 2024-10-11 18:54:39
package org.daisy.pipeline.css.sass.impl;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
/**
* In order to fully support stacked pseudo-elements and
* pseudo-classes on pseudo-elements (also in combination
* with @extend), we have previously pre-processed the SASS before it
* was compiled to CSS, and now a CSS post-processing step is
* required.
*
* Before the SASS was compiled, pseudo-elements were replaced with a
* child selector followed by a pseudo-class. E.g. `::after' became
* `>:after`. This needs to be reverted now.
*
* This simple parser does not fully parse the CSS. It only parses the
* selectors in order to be able to modify them. Everything else
* (declarations, at-rules, etc.) is left intact and unparsed.
*/
@SuppressWarnings("all")
public class SassPostProcessParser extends Parser {
public static final String[] tokenNames = new String[] {
"", "", "", "", "ANY", "APOS", "ASTERISK", "AT",
"BAR", "COLON", "COMMA", "COMMENT", "COMMENT_MACR", "ESCAPE_CHAR", "GREATER",
"HAS", "HASH", "IDENT", "IDENT_START", "LBRACE", "LCURLY", "LPAREN", "MEDIA",
"NAME", "NAME_CHAR", "NEWLINE_CHAR", "NON_ASCII", "NOT", "PERIOD", "PLUS",
"QUOT", "RBRACE", "RCURLY", "RPAREN", "SEMICOLON", "SPACE", "SPACE_CHAR",
"STRING", "STRING_CHAR", "STRING_MACR", "TILDE", "XML_COMMENT_CLOSE",
"XML_COMMENT_OPEN"
};
public static final int EOF=-1;
public static final int ANY=4;
public static final int APOS=5;
public static final int ASTERISK=6;
public static final int AT=7;
public static final int BAR=8;
public static final int COLON=9;
public static final int COMMA=10;
public static final int COMMENT=11;
public static final int COMMENT_MACR=12;
public static final int ESCAPE_CHAR=13;
public static final int GREATER=14;
public static final int HAS=15;
public static final int HASH=16;
public static final int IDENT=17;
public static final int IDENT_START=18;
public static final int LBRACE=19;
public static final int LCURLY=20;
public static final int LPAREN=21;
public static final int MEDIA=22;
public static final int NAME=23;
public static final int NAME_CHAR=24;
public static final int NEWLINE_CHAR=25;
public static final int NON_ASCII=26;
public static final int NOT=27;
public static final int PERIOD=28;
public static final int PLUS=29;
public static final int QUOT=30;
public static final int RBRACE=31;
public static final int RCURLY=32;
public static final int RPAREN=33;
public static final int SEMICOLON=34;
public static final int SPACE=35;
public static final int SPACE_CHAR=36;
public static final int STRING=37;
public static final int STRING_CHAR=38;
public static final int STRING_MACR=39;
public static final int TILDE=40;
public static final int XML_COMMENT_CLOSE=41;
public static final int XML_COMMENT_OPEN=42;
// delegates
public Parser[] getDelegates() {
return new Parser[] {};
}
// delegators
public SassPostProcessParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public SassPostProcessParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
@Override public String[] getTokenNames() { return SassPostProcessParser.tokenNames; }
@Override public String getGrammarFileName() { return "org/daisy/pipeline/css/sass/impl/SassPostProcess.g"; }
private static class StringBuilder {
protected java.lang.StringBuilder sb = new java.lang.StringBuilder();
protected java.util.List list = new java.util.ArrayList<>();
public void append(Token token) {
append(token.getText());
list.add(token);
}
public void append(Object o) {
sb.append(o);
list.add(o);
}
@Override
public String toString() {
return sb.toString();
}
}
private static class SelectorRule extends StringBuilder {
private boolean hasSelector = false;
public void append(SelectorGroup selector) {
if (!selector.invalid()) {
hasSelector = true;
super.append(selector);
}
}
public void append(Object o) {
if (hasSelector)
super.append(o);
}
public boolean invalid() {
return !hasSelector;
}
}
private static class SelectorGroup extends StringBuilder {
private String pendingSeparator = null;
private boolean skipSeparator = true;
public void append(Token separator) {
if (!skipSeparator) {
if (pendingSeparator == null)
pendingSeparator = separator.getText();
else
pendingSeparator += separator.getText();
}
}
public void append(Selector selector) {
if (!selector.invalid()) {
if (pendingSeparator != null)
append(pendingSeparator);
super.append(selector);
skipSeparator = false;
}
pendingSeparator = null;
}
public boolean invalid() {
return sb.length() == 0;
}
}
private static class Selector extends StringBuilder {
private boolean invalid = false;
protected Combinator lastCombinator = null;
public void append(Combinator combinator) {
lastCombinator = combinator;
}
public void append(SimpleSelector selector) {
invalid |= selector.invalid();
// drop the child combinator that should always preceed a pseudo-element
if (selector.isPseudoElement()) {
if (lastCombinator == null || lastCombinator.type != Combinator.CHILD)
invalid = true;
else
// remove trailing space from previous simple selector
sb = new java.lang.StringBuilder(sb.toString().replaceAll("\\s+$", ""));
} else if (lastCombinator != null)
super.append(lastCombinator);
lastCombinator = null;
super.append(selector);
}
public boolean invalid() {
return invalid || sb.length() == 0;
}
}
private static class RelativeSelector extends Selector {
public void append(Selector selector) {
for (Object o : selector.list)
if (o instanceof Combinator)
append((Combinator)o);
else if (o instanceof SimpleSelector)
append((SimpleSelector)o);
}
}
private static class Combinator extends StringBuilder {
public static final int CHILD = GREATER;
public static final int DESCENDANT = SPACE;
public static final int ADJACENT = PLUS;
public static final int SIBLING = TILDE;
public final int type;
public Combinator(int type) {
this.type = type;
}
public Combinator(Token token) {
this(token.getType());
append(token);
}
}
private static class SimpleSelector extends StringBuilder {
private int size = 0;
private PseudoElement pseudoElement = null;
private boolean hasEmptyNegationSelector = false;
private boolean hasOnlyPseudoClasses = true;
private boolean invalid = false;
public void append(SelectorPart selector) {
// an empty negation pseudo class will always match
if (selector instanceof NegationSelector
&& ((NegationSelector)selector).invalid())
hasEmptyNegationSelector = true;
else if (selector instanceof RelationalSelector
&& ((RelationalSelector)selector).invalid())
invalid = true;
else {
size++;
// if a selector contains a pseudo-element there may
// be only one and if other parts are present they
// must be pseudo classes
if (selector instanceof PseudoElement) {
invalid |= !hasOnlyPseudoClasses;
pseudoElement = (PseudoElement)selector;
} else if (!(selector instanceof PseudoClass)) {
hasOnlyPseudoClasses = false;
invalid |= (pseudoElement != null);
}
super.append(selector);
}
}
public boolean invalid() {
return invalid || (size == 0 && !hasEmptyNegationSelector);
}
public boolean isPseudoElement() {
return !invalid && pseudoElement != null;
}
@Override
public String toString() {
if (size == 0 && !invalid())
return "*";
else if (pseudoElement == null || size == 1)
return super.toString();
else {
// SASS may switch order of pseudo element and pseudo
// classes; move pseudo element to the beginning
String s = pseudoElement.toString();
for (Object o : list)
if (o instanceof PseudoClass)
s += o.toString();
else if (o instanceof Token)
// SPACE
s += ((Token)o).getText();
return s;
}
}
}
private static class NegationSelector extends PseudoClass {
private SelectorGroup selector = null;
public void append(SimpleSelector ss) {
if (selector == null)
selector = new SelectorGroup();
Selector s = new Selector();
s.append(ss);
selector.append(s);
}
public void append(Token t) {
if (selector == null)
// NOT SPACE?
super.append(t);
else if (t.getType() == RPAREN)
; // RPAREN
else
// COMMA SPACE?
selector.append(t);
}
public boolean invalid() {
return selector != null ? selector.invalid() : true;
}
@Override
public String toString() {
String s = super.toString();
if (selector != null) {
s += selector.toString();
s += ")";
}
return s;
}
}
private static class RelationalSelector extends PseudoClass {
private SelectorGroup selector = null;
public void append(RelativeSelector s) {
if (selector == null)
selector = new SelectorGroup();
selector.append(s);
}
public void append(Token t) {
if (selector == null)
// HAS SPACE?
super.append(t);
else if (t.getType() == RPAREN)
; // RPAREN
else
// COMMA SPACE?
selector.append(t);
}
public boolean invalid() {
return selector != null ? selector.invalid() : true;
}
@Override
public String toString() {
String s = super.toString();
if (selector != null) {
s += selector.toString();
s += ")";
}
return s;
}
}
private static class SelectorPart extends StringBuilder {}
private static class PseudoElement extends SelectorPart {}
private static class PseudoClass extends SelectorPart {}
// $ANTLR start "start"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:256:1: start : stylesheet ;
public final void start() throws RecognitionException {
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:256:7: ( stylesheet )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:256:9: stylesheet
{
pushFollow(FOLLOW_stylesheet_in_start48);
stylesheet();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "start"
protected static class stylesheet_scope {
StringBuilder sb;
}
protected Stack stylesheet_stack = new Stack();
// $ANTLR start "stylesheet"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:258:1: stylesheet returns [String str] : (t= ( SPACE | XML_COMMENT_OPEN | XML_COMMENT_CLOSE ) |t= COMMENT | media_rule | at_rule | (r= selector_rule ) )* ;
public final String stylesheet() throws RecognitionException {
stylesheet_stack.push(new stylesheet_scope());
String str = null;
Token t=null;
SelectorRule r =null;
stylesheet_stack.peek().sb = new StringBuilder();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:268:5: ( (t= ( SPACE | XML_COMMENT_OPEN | XML_COMMENT_CLOSE ) |t= COMMENT | media_rule | at_rule | (r= selector_rule ) )* )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:268:7: (t= ( SPACE | XML_COMMENT_OPEN | XML_COMMENT_CLOSE ) |t= COMMENT | media_rule | at_rule | (r= selector_rule ) )*
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:268:7: (t= ( SPACE | XML_COMMENT_OPEN | XML_COMMENT_CLOSE ) |t= COMMENT | media_rule | at_rule | (r= selector_rule ) )*
loop1:
while (true) {
int alt1=6;
switch ( input.LA(1) ) {
case SPACE:
case XML_COMMENT_CLOSE:
case XML_COMMENT_OPEN:
{
alt1=1;
}
break;
case COMMENT:
{
alt1=2;
}
break;
case MEDIA:
{
alt1=3;
}
break;
case AT:
{
alt1=4;
}
break;
case ASTERISK:
case BAR:
case COLON:
case HAS:
case HASH:
case IDENT:
case LBRACE:
case NOT:
case PERIOD:
{
alt1=5;
}
break;
}
switch (alt1) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:268:9: t= ( SPACE | XML_COMMENT_OPEN | XML_COMMENT_CLOSE )
{
t=input.LT(1);
if ( input.LA(1)==SPACE||(input.LA(1) >= XML_COMMENT_CLOSE && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
stylesheet_stack.peek().sb.append(t);
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:271:9: t= COMMENT
{
t=(Token)match(input,COMMENT,FOLLOW_COMMENT_in_stylesheet126);
stylesheet_stack.peek().sb.append(t);
}
break;
case 3 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:272:9: media_rule
{
pushFollow(FOLLOW_media_rule_in_stylesheet150);
media_rule();
state._fsp--;
}
break;
case 4 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:273:9: at_rule
{
pushFollow(FOLLOW_at_rule_in_stylesheet160);
at_rule();
state._fsp--;
}
break;
case 5 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:274:9: (r= selector_rule )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:274:9: (r= selector_rule )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:274:11: r= selector_rule
{
pushFollow(FOLLOW_selector_rule_in_stylesheet174);
r=selector_rule();
state._fsp--;
if (!r.invalid())
stylesheet_stack.peek().sb.append(r);
}
}
break;
default :
break loop1;
}
}
}
str = stylesheet_stack.peek().sb.toString();
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
stylesheet_stack.pop();
}
return str;
}
// $ANTLR end "stylesheet"
// $ANTLR start "at_rule"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:279:1: at_rule : (t= AT ) (t= (~ ( LCURLY | SEMICOLON ) ) )+ ( (t= SEMICOLON ) | (t= LCURLY ) ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )* (t= RCURLY ) ) ;
public final void at_rule() throws RecognitionException {
Token t=null;
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:280:5: ( (t= AT ) (t= (~ ( LCURLY | SEMICOLON ) ) )+ ( (t= SEMICOLON ) | (t= LCURLY ) ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )* (t= RCURLY ) ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:280:7: (t= AT ) (t= (~ ( LCURLY | SEMICOLON ) ) )+ ( (t= SEMICOLON ) | (t= LCURLY ) ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )* (t= RCURLY ) )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:280:7: (t= AT )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:280:9: t= AT
{
t=(Token)match(input,AT,FOLLOW_AT_in_at_rule212);
stylesheet_stack.peek().sb.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:281:7: (t= (~ ( LCURLY | SEMICOLON ) ) )+
int cnt2=0;
loop2:
while (true) {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= ANY && LA2_0 <= LBRACE)||(LA2_0 >= LPAREN && LA2_0 <= RPAREN)||(LA2_0 >= SPACE && LA2_0 <= XML_COMMENT_OPEN)) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:281:9: t= (~ ( LCURLY | SEMICOLON ) )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= LBRACE)||(input.LA(1) >= LPAREN && input.LA(1) <= RPAREN)||(input.LA(1) >= SPACE && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
stylesheet_stack.peek().sb.append(t);
}
break;
default :
if ( cnt2 >= 1 ) break loop2;
EarlyExitException eee = new EarlyExitException(2, input);
throw eee;
}
cnt2++;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:283:7: ( (t= SEMICOLON ) | (t= LCURLY ) ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )* (t= RCURLY ) )
int alt4=2;
int LA4_0 = input.LA(1);
if ( (LA4_0==SEMICOLON) ) {
alt4=1;
}
else if ( (LA4_0==LCURLY) ) {
alt4=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 4, 0, input);
throw nvae;
}
switch (alt4) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:283:9: (t= SEMICOLON )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:283:9: (t= SEMICOLON )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:283:11: t= SEMICOLON
{
t=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_at_rule291);
stylesheet_stack.peek().sb.append(t);
}
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:284:9: (t= LCURLY ) ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )* (t= RCURLY )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:284:9: (t= LCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:284:11: t= LCURLY
{
t=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_at_rule318);
stylesheet_stack.peek().sb.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:285:9: ( at_rule | (t= (~ ( AT | RCURLY ) ) ) )*
loop3:
while (true) {
int alt3=3;
int LA3_0 = input.LA(1);
if ( (LA3_0==AT) ) {
alt3=1;
}
else if ( ((LA3_0 >= ANY && LA3_0 <= ASTERISK)||(LA3_0 >= BAR && LA3_0 <= RBRACE)||(LA3_0 >= RPAREN && LA3_0 <= XML_COMMENT_OPEN)) ) {
alt3=2;
}
switch (alt3) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:285:11: at_rule
{
pushFollow(FOLLOW_at_rule_in_at_rule346);
at_rule();
state._fsp--;
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:286:11: (t= (~ ( AT | RCURLY ) ) )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:286:11: (t= (~ ( AT | RCURLY ) ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:286:13: t= (~ ( AT | RCURLY ) )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= ASTERISK)||(input.LA(1) >= BAR && input.LA(1) <= RBRACE)||(input.LA(1) >= RPAREN && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
stylesheet_stack.peek().sb.append(t);
}
}
break;
default :
break loop3;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:289:9: (t= RCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:289:11: t= RCURLY
{
t=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_at_rule420);
stylesheet_stack.peek().sb.append(t);
}
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "at_rule"
// $ANTLR start "media_rule"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:293:1: media_rule : (t= MEDIA ) (t= (~ LCURLY ) )+ (t= LCURLY ) (s= stylesheet ) (t= RCURLY ) ;
public final void media_rule() throws RecognitionException {
Token t=null;
String s =null;
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:294:6: ( (t= MEDIA ) (t= (~ LCURLY ) )+ (t= LCURLY ) (s= stylesheet ) (t= RCURLY ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:294:8: (t= MEDIA ) (t= (~ LCURLY ) )+ (t= LCURLY ) (s= stylesheet ) (t= RCURLY )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:294:8: (t= MEDIA )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:294:10: t= MEDIA
{
t=(Token)match(input,MEDIA,FOLLOW_MEDIA_in_media_rule466);
stylesheet_stack.peek().sb.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:295:8: (t= (~ LCURLY ) )+
int cnt5=0;
loop5:
while (true) {
int alt5=2;
int LA5_0 = input.LA(1);
if ( ((LA5_0 >= ANY && LA5_0 <= LBRACE)||(LA5_0 >= LPAREN && LA5_0 <= XML_COMMENT_OPEN)) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:295:10: t= (~ LCURLY )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= LBRACE)||(input.LA(1) >= LPAREN && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
stylesheet_stack.peek().sb.append(t);
}
break;
default :
if ( cnt5 >= 1 ) break loop5;
EarlyExitException eee = new EarlyExitException(5, input);
throw eee;
}
cnt5++;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:296:8: (t= LCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:296:10: t= LCURLY
{
t=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_media_rule528);
stylesheet_stack.peek().sb.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:297:8: (s= stylesheet )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:297:10: s= stylesheet
{
pushFollow(FOLLOW_stylesheet_in_media_rule558);
s=stylesheet();
state._fsp--;
stylesheet_stack.peek().sb.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:298:8: (t= RCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:298:10: t= RCURLY
{
t=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_media_rule584);
stylesheet_stack.peek().sb.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
}
// $ANTLR end "media_rule"
// $ANTLR start "selector_rule"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:301:1: selector_rule returns [SelectorRule rule] : (s= selector_group ) (t= LCURLY ) (t= (~ RCURLY ) )* (t= RCURLY ) ;
public final SelectorRule selector_rule() throws RecognitionException {
SelectorRule rule = null;
Token t=null;
SelectorGroup s =null;
rule = new SelectorRule();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:305:5: ( (s= selector_group ) (t= LCURLY ) (t= (~ RCURLY ) )* (t= RCURLY ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:305:7: (s= selector_group ) (t= LCURLY ) (t= (~ RCURLY ) )* (t= RCURLY )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:305:7: (s= selector_group )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:305:9: s= selector_group
{
pushFollow(FOLLOW_selector_group_in_selector_rule631);
s=selector_group();
state._fsp--;
rule.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:306:7: (t= LCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:306:9: t= LCURLY
{
t=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_selector_rule651);
rule.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:307:7: (t= (~ RCURLY ) )*
loop6:
while (true) {
int alt6=2;
int LA6_0 = input.LA(1);
if ( ((LA6_0 >= ANY && LA6_0 <= RBRACE)||(LA6_0 >= RPAREN && LA6_0 <= XML_COMMENT_OPEN)) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:307:9: t= (~ RCURLY )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= RBRACE)||(input.LA(1) >= RPAREN && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
rule.append(t);
}
break;
default :
break loop6;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:308:7: (t= RCURLY )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:308:9: t= RCURLY
{
t=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_selector_rule708);
rule.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return rule;
}
// $ANTLR end "selector_rule"
// $ANTLR start "selector_group"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:311:1: selector_group returns [SelectorGroup sel] : (s= selector ) ( (t= COMMA ) (t= SPACE )? (s= selector ) )* ;
public final SelectorGroup selector_group() throws RecognitionException {
SelectorGroup sel = null;
Token t=null;
Selector s =null;
sel = new SelectorGroup();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:315:5: ( (s= selector ) ( (t= COMMA ) (t= SPACE )? (s= selector ) )* )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:315:7: (s= selector ) ( (t= COMMA ) (t= SPACE )? (s= selector ) )*
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:315:7: (s= selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:315:9: s= selector
{
pushFollow(FOLLOW_selector_in_selector_group754);
s=selector();
state._fsp--;
sel.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:316:7: ( (t= COMMA ) (t= SPACE )? (s= selector ) )*
loop8:
while (true) {
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==COMMA) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:316:9: (t= COMMA ) (t= SPACE )? (s= selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:316:9: (t= COMMA )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:316:11: t= COMMA
{
t=(Token)match(input,COMMA,FOLLOW_COMMA_in_selector_group782);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:317:9: (t= SPACE )?
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==SPACE) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:317:11: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_selector_group811);
sel.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:318:9: (s= selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:318:11: s= selector
{
pushFollow(FOLLOW_selector_in_selector_group841);
s=selector();
state._fsp--;
sel.append(s);
}
}
break;
default :
break loop8;
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "selector_group"
// $ANTLR start "selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:322:1: selector returns [Selector sel] : (s= simple_selector ) ( (c= combinator ) (s= simple_selector ) )* ;
public final Selector selector() throws RecognitionException {
Selector sel = null;
SimpleSelector s =null;
Combinator c =null;
sel = new Selector();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:326:5: ( (s= simple_selector ) ( (c= combinator ) (s= simple_selector ) )* )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:326:7: (s= simple_selector ) ( (c= combinator ) (s= simple_selector ) )*
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:326:7: (s= simple_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:326:9: s= simple_selector
{
pushFollow(FOLLOW_simple_selector_in_selector894);
s=simple_selector();
state._fsp--;
sel.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:327:7: ( (c= combinator ) (s= simple_selector ) )*
loop9:
while (true) {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==GREATER||LA9_0==PLUS||LA9_0==SPACE||LA9_0==TILDE) ) {
alt9=1;
}
switch (alt9) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:327:9: (c= combinator ) (s= simple_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:327:9: (c= combinator )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:327:11: c= combinator
{
pushFollow(FOLLOW_combinator_in_selector915);
c=combinator();
state._fsp--;
sel.append(c);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:328:9: (s= simple_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:328:11: s= simple_selector
{
pushFollow(FOLLOW_simple_selector_in_selector939);
s=simple_selector();
state._fsp--;
sel.append(s);
}
}
break;
default :
break loop9;
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "selector"
// $ANTLR start "combinator"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:332:1: combinator returns [Combinator c] : ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? | (t= SPACE ) );
public final Combinator combinator() throws RecognitionException {
Combinator c = null;
Token t=null;
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:333:5: ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? | (t= SPACE ) )
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==GREATER||LA11_0==PLUS||LA11_0==TILDE) ) {
alt11=1;
}
else if ( (LA11_0==SPACE) ) {
alt11=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 11, 0, input);
throw nvae;
}
switch (alt11) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:333:7: (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )?
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:333:7: (t= ( GREATER | PLUS | TILDE ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:333:9: t= ( GREATER | PLUS | TILDE )
{
t=input.LT(1);
if ( input.LA(1)==GREATER||input.LA(1)==PLUS||input.LA(1)==TILDE ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
c = new Combinator(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:336:7: (t= SPACE )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==SPACE) ) {
alt10=1;
}
switch (alt10) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:336:9: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_combinator1035);
c.append(t);
}
break;
}
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:337:7: (t= SPACE )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:337:7: (t= SPACE )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:337:9: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_combinator1065);
c = new Combinator(t);
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return c;
}
// $ANTLR end "combinator"
// $ANTLR start "relative_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:340:1: relative_selector returns [RelativeSelector sel] : ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? )? (s= selector ) ;
public final RelativeSelector relative_selector() throws RecognitionException {
RelativeSelector sel = null;
Token t=null;
Selector s =null;
sel = new RelativeSelector();
Combinator c = null;
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:5: ( ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? )? (s= selector ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:7: ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? )? (s= selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:7: ( (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )? )?
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==GREATER||LA13_0==PLUS||LA13_0==TILDE) ) {
alt13=1;
}
switch (alt13) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:9: (t= ( GREATER | PLUS | TILDE ) ) (t= SPACE )?
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:9: (t= ( GREATER | PLUS | TILDE ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:345:11: t= ( GREATER | PLUS | TILDE )
{
t=input.LT(1);
if ( input.LA(1)==GREATER||input.LA(1)==PLUS||input.LA(1)==TILDE ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
c = new Combinator(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:348:9: (t= SPACE )?
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==SPACE) ) {
alt12=1;
}
switch (alt12) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:348:11: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_relative_selector1173);
c.append(t);
}
break;
}
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:350:7: (s= selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:350:9: s= selector
{
pushFollow(FOLLOW_selector_in_relative_selector1212);
s=selector();
state._fsp--;
if (c == null)
c = new Combinator(SPACE);
sel.append(c);
sel.append(s);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "relative_selector"
// $ANTLR start "simple_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:356:1: simple_selector returns [SimpleSelector sel] : ( (s= type_selector ) (s= selector_part )* | (s= selector_part )+ ) (t= SPACE )? ;
public final SimpleSelector simple_selector() throws RecognitionException {
SimpleSelector sel = null;
Token t=null;
SelectorPart s =null;
sel = new SimpleSelector();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:5: ( ( (s= type_selector ) (s= selector_part )* | (s= selector_part )+ ) (t= SPACE )? )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:7: ( (s= type_selector ) (s= selector_part )* | (s= selector_part )+ ) (t= SPACE )?
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:7: ( (s= type_selector ) (s= selector_part )* | (s= selector_part )+ )
int alt16=2;
int LA16_0 = input.LA(1);
if ( (LA16_0==ASTERISK||LA16_0==BAR||LA16_0==IDENT) ) {
alt16=1;
}
else if ( (LA16_0==COLON||(LA16_0 >= HAS && LA16_0 <= HASH)||LA16_0==LBRACE||(LA16_0 >= NOT && LA16_0 <= PERIOD)) ) {
alt16=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:9: (s= type_selector ) (s= selector_part )*
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:9: (s= type_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:360:11: s= type_selector
{
pushFollow(FOLLOW_type_selector_in_simple_selector1258);
s=type_selector();
state._fsp--;
sel.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:361:9: (s= selector_part )*
loop14:
while (true) {
int alt14=2;
int LA14_0 = input.LA(1);
if ( (LA14_0==COLON||(LA14_0 >= HAS && LA14_0 <= HASH)||LA14_0==LBRACE||(LA14_0 >= NOT && LA14_0 <= PERIOD)) ) {
alt14=1;
}
switch (alt14) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:361:11: s= selector_part
{
pushFollow(FOLLOW_selector_part_in_simple_selector1279);
s=selector_part();
state._fsp--;
sel.append(s);
}
break;
default :
break loop14;
}
}
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:362:9: (s= selector_part )+
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:362:9: (s= selector_part )+
int cnt15=0;
loop15:
while (true) {
int alt15=2;
int LA15_0 = input.LA(1);
if ( (LA15_0==COLON||(LA15_0 >= HAS && LA15_0 <= HASH)||LA15_0==LBRACE||(LA15_0 >= NOT && LA15_0 <= PERIOD)) ) {
alt15=1;
}
switch (alt15) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:362:11: s= selector_part
{
pushFollow(FOLLOW_selector_part_in_simple_selector1301);
s=selector_part();
state._fsp--;
sel.append(s);
}
break;
default :
if ( cnt15 >= 1 ) break loop15;
EarlyExitException eee = new EarlyExitException(15, input);
throw eee;
}
cnt15++;
}
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:364:7: (t= SPACE )?
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==SPACE) ) {
int LA17_1 = input.LA(2);
if ( (LA17_1==COMMA||LA17_1==GREATER||LA17_1==LCURLY||LA17_1==PLUS||LA17_1==RPAREN||LA17_1==SPACE||LA17_1==TILDE) ) {
alt17=1;
}
}
switch (alt17) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:364:9: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_simple_selector1329);
sel.append(t);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "simple_selector"
// $ANTLR start "selector_part"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:367:1: selector_part returns [SelectorPart sel] : ( (s= id_selector ) | (s= class_selector ) | (s= attribute_selector ) | (s= pseudo_element ) | (s= pseudo_class ) );
public final SelectorPart selector_part() throws RecognitionException {
SelectorPart sel = null;
SelectorPart s =null;
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:368:5: ( (s= id_selector ) | (s= class_selector ) | (s= attribute_selector ) | (s= pseudo_element ) | (s= pseudo_class ) )
int alt18=5;
switch ( input.LA(1) ) {
case HASH:
{
alt18=1;
}
break;
case PERIOD:
{
alt18=2;
}
break;
case LBRACE:
{
alt18=3;
}
break;
case COLON:
{
int LA18_4 = input.LA(2);
if ( (LA18_4==COLON) ) {
alt18=4;
}
else if ( (LA18_4==IDENT||LA18_4==NAME) ) {
alt18=5;
}
else {
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 18, 4, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
break;
case HAS:
case NOT:
{
alt18=5;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 18, 0, input);
throw nvae;
}
switch (alt18) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:368:7: (s= id_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:368:7: (s= id_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:368:9: s= id_selector
{
pushFollow(FOLLOW_id_selector_in_selector_part1372);
s=id_selector();
state._fsp--;
sel = s;
}
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:369:7: (s= class_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:369:7: (s= class_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:369:9: s= class_selector
{
pushFollow(FOLLOW_class_selector_in_selector_part1395);
s=class_selector();
state._fsp--;
sel = s;
}
}
break;
case 3 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:370:7: (s= attribute_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:370:7: (s= attribute_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:370:9: s= attribute_selector
{
pushFollow(FOLLOW_attribute_selector_in_selector_part1415);
s=attribute_selector();
state._fsp--;
sel = s;
}
}
break;
case 4 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:371:7: (s= pseudo_element )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:371:7: (s= pseudo_element )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:371:9: s= pseudo_element
{
pushFollow(FOLLOW_pseudo_element_in_selector_part1431);
s=pseudo_element();
state._fsp--;
sel = s;
}
}
break;
case 5 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:372:7: (s= pseudo_class )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:372:7: (s= pseudo_class )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:372:9: s= pseudo_class
{
pushFollow(FOLLOW_pseudo_class_in_selector_part1451);
s=pseudo_class();
state._fsp--;
sel = s;
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "selector_part"
// $ANTLR start "type_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:375:1: type_selector returns [SelectorPart sel] : ( prefix )? (t= ( IDENT | ASTERISK ) ) ;
public final SelectorPart type_selector() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
sel = new SelectorPart();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:5: ( ( prefix )? (t= ( IDENT | ASTERISK ) ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:7: ( prefix )? (t= ( IDENT | ASTERISK ) )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:7: ( prefix )?
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==ASTERISK||LA19_0==IDENT) ) {
int LA19_1 = input.LA(2);
if ( (LA19_1==BAR) ) {
alt19=1;
}
}
else if ( (LA19_0==BAR) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:7: prefix
{
pushFollow(FOLLOW_prefix_in_type_selector1487);
prefix();
state._fsp--;
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:15: (t= ( IDENT | ASTERISK ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:379:17: t= ( IDENT | ASTERISK )
{
t=input.LT(1);
if ( input.LA(1)==ASTERISK||input.LA(1)==IDENT ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "type_selector"
// $ANTLR start "prefix"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:383:1: prefix returns [String str] : (t= ( IDENT | ASTERISK ) )? (t= BAR ) ;
public final String prefix() throws RecognitionException {
String str = null;
Token t=null;
StringBuilder sb = new StringBuilder();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:390:5: ( (t= ( IDENT | ASTERISK ) )? (t= BAR ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:390:7: (t= ( IDENT | ASTERISK ) )? (t= BAR )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:390:7: (t= ( IDENT | ASTERISK ) )?
int alt20=2;
int LA20_0 = input.LA(1);
if ( (LA20_0==ASTERISK||LA20_0==IDENT) ) {
alt20=1;
}
switch (alt20) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:390:9: t= ( IDENT | ASTERISK )
{
t=input.LT(1);
if ( input.LA(1)==ASTERISK||input.LA(1)==IDENT ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sb.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:392:7: (t= BAR )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:392:9: t= BAR
{
t=(Token)match(input,BAR,FOLLOW_BAR_in_prefix1595);
sb.append(t);
}
}
str = sb.toString();
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return str;
}
// $ANTLR end "prefix"
// $ANTLR start "id_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:395:1: id_selector returns [SelectorPart sel] : (t= HASH ) (t= ( IDENT | NAME ) ) ;
public final SelectorPart id_selector() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
sel = new SelectorPart();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:399:5: ( (t= HASH ) (t= ( IDENT | NAME ) ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:399:7: (t= HASH ) (t= ( IDENT | NAME ) )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:399:7: (t= HASH )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:399:9: t= HASH
{
t=(Token)match(input,HASH,FOLLOW_HASH_in_id_selector1643);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:400:7: (t= ( IDENT | NAME ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:400:9: t= ( IDENT | NAME )
{
t=input.LT(1);
if ( input.LA(1)==IDENT||input.LA(1)==NAME ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "id_selector"
// $ANTLR start "class_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:403:1: class_selector returns [SelectorPart sel] : (t= PERIOD ) (t= IDENT ) ;
public final SelectorPart class_selector() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
sel = new SelectorPart();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:407:5: ( (t= PERIOD ) (t= IDENT ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:407:7: (t= PERIOD ) (t= IDENT )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:407:7: (t= PERIOD )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:407:9: t= PERIOD
{
t=(Token)match(input,PERIOD,FOLLOW_PERIOD_in_class_selector1715);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:408:7: (t= IDENT )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:408:9: t= IDENT
{
t=(Token)match(input,IDENT,FOLLOW_IDENT_in_class_selector1742);
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "class_selector"
// $ANTLR start "attribute_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:411:1: attribute_selector returns [SelectorPart sel] : (t= LBRACE ) (t= (~ RBRACE ) )+ (t= RBRACE ) ;
public final SelectorPart attribute_selector() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
sel = new SelectorPart();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:415:5: ( (t= LBRACE ) (t= (~ RBRACE ) )+ (t= RBRACE ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:415:7: (t= LBRACE ) (t= (~ RBRACE ) )+ (t= RBRACE )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:415:7: (t= LBRACE )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:415:9: t= LBRACE
{
t=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_attribute_selector1788);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:416:7: (t= (~ RBRACE ) )+
int cnt21=0;
loop21:
while (true) {
int alt21=2;
int LA21_0 = input.LA(1);
if ( ((LA21_0 >= ANY && LA21_0 <= QUOT)||(LA21_0 >= RCURLY && LA21_0 <= XML_COMMENT_OPEN)) ) {
alt21=1;
}
switch (alt21) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:416:9: t= (~ RBRACE )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= QUOT)||(input.LA(1) >= RCURLY && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
break;
default :
if ( cnt21 >= 1 ) break loop21;
EarlyExitException eee = new EarlyExitException(21, input);
throw eee;
}
cnt21++;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:417:7: (t= RBRACE )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:417:9: t= RBRACE
{
t=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_attribute_selector1843);
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "attribute_selector"
// $ANTLR start "pseudo_element"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:420:1: pseudo_element returns [SelectorPart sel] : (t= COLON ) (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )? ;
public final SelectorPart pseudo_element() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
sel = new PseudoElement();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:424:5: ( (t= COLON ) (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )? )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:424:7: (t= COLON ) (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )?
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:424:7: (t= COLON )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:424:9: t= COLON
{
t=(Token)match(input,COLON,FOLLOW_COLON_in_pseudo_element1888);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:425:7: (t= COLON )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:425:9: t= COLON
{
t=(Token)match(input,COLON,FOLLOW_COLON_in_pseudo_element1916);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:426:7: (t= ( IDENT | NAME ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:426:9: t= ( IDENT | NAME )
{
t=input.LT(1);
if ( input.LA(1)==IDENT||input.LA(1)==NAME ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:427:7: ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )?
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==LPAREN) ) {
alt23=1;
}
switch (alt23) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:427:9: (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:427:9: (t= LPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:427:11: t= LPAREN
{
t=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_pseudo_element1971);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:428:9: (t= (~ RPAREN ) )*
loop22:
while (true) {
int alt22=2;
int LA22_0 = input.LA(1);
if ( ((LA22_0 >= ANY && LA22_0 <= RCURLY)||(LA22_0 >= SEMICOLON && LA22_0 <= XML_COMMENT_OPEN)) ) {
alt22=1;
}
switch (alt22) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:428:11: t= (~ RPAREN )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= RCURLY)||(input.LA(1) >= SEMICOLON && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
break;
default :
break loop22;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:429:9: (t= RPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:429:11: t= RPAREN
{
t=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_pseudo_element2026);
sel.append(t);
}
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "pseudo_element"
// $ANTLR start "pseudo_class"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:433:1: pseudo_class returns [SelectorPart sel] : ( (ns= negation_selector ) | (rs= relational_selector ) | (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )? );
public final SelectorPart pseudo_class() throws RecognitionException {
SelectorPart sel = null;
Token t=null;
NegationSelector ns =null;
RelationalSelector rs =null;
sel = new PseudoClass();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:437:5: ( (ns= negation_selector ) | (rs= relational_selector ) | (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )? )
int alt26=3;
switch ( input.LA(1) ) {
case NOT:
{
alt26=1;
}
break;
case HAS:
{
alt26=2;
}
break;
case COLON:
{
alt26=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 26, 0, input);
throw nvae;
}
switch (alt26) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:437:7: (ns= negation_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:437:7: (ns= negation_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:437:9: ns= negation_selector
{
pushFollow(FOLLOW_negation_selector_in_pseudo_class2080);
ns=negation_selector();
state._fsp--;
sel = ns;
}
}
break;
case 2 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:438:7: (rs= relational_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:438:7: (rs= relational_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:438:9: rs= relational_selector
{
pushFollow(FOLLOW_relational_selector_in_pseudo_class2099);
rs=relational_selector();
state._fsp--;
sel = rs;
}
}
break;
case 3 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:439:7: (t= COLON ) (t= ( IDENT | NAME ) ) ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )?
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:439:7: (t= COLON )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:439:9: t= COLON
{
t=(Token)match(input,COLON,FOLLOW_COLON_in_pseudo_class2116);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:440:7: (t= ( IDENT | NAME ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:440:9: t= ( IDENT | NAME )
{
t=input.LT(1);
if ( input.LA(1)==IDENT||input.LA(1)==NAME ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:441:7: ( (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN ) )?
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==LPAREN) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:441:9: (t= LPAREN ) (t= (~ RPAREN ) )* (t= RPAREN )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:441:9: (t= LPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:441:11: t= LPAREN
{
t=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_pseudo_class2179);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:442:9: (t= (~ RPAREN ) )*
loop24:
while (true) {
int alt24=2;
int LA24_0 = input.LA(1);
if ( ((LA24_0 >= ANY && LA24_0 <= RCURLY)||(LA24_0 >= SEMICOLON && LA24_0 <= XML_COMMENT_OPEN)) ) {
alt24=1;
}
switch (alt24) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:442:11: t= (~ RPAREN )
{
t=input.LT(1);
if ( (input.LA(1) >= ANY && input.LA(1) <= RCURLY)||(input.LA(1) >= SEMICOLON && input.LA(1) <= XML_COMMENT_OPEN) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
sel.append(t);
}
break;
default :
break loop24;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:443:9: (t= RPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:443:11: t= RPAREN
{
t=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_pseudo_class2242);
sel.append(t);
}
}
break;
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "pseudo_class"
// $ANTLR start "negation_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:447:1: negation_selector returns [NegationSelector sel] : (t= NOT ) (t= SPACE )? (s= simple_selector ) ( (t= COMMA ) (t= SPACE )? (s= simple_selector ) )* (t= RPAREN ) ;
public final NegationSelector negation_selector() throws RecognitionException {
NegationSelector sel = null;
Token t=null;
SimpleSelector s =null;
sel = new NegationSelector();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:451:5: ( (t= NOT ) (t= SPACE )? (s= simple_selector ) ( (t= COMMA ) (t= SPACE )? (s= simple_selector ) )* (t= RPAREN ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:451:7: (t= NOT ) (t= SPACE )? (s= simple_selector ) ( (t= COMMA ) (t= SPACE )? (s= simple_selector ) )* (t= RPAREN )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:451:7: (t= NOT )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:451:9: t= NOT
{
t=(Token)match(input,NOT,FOLLOW_NOT_in_negation_selector2300);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:452:7: (t= SPACE )?
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==SPACE) ) {
alt27=1;
}
switch (alt27) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:452:9: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_negation_selector2332);
sel.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:453:7: (s= simple_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:453:9: s= simple_selector
{
pushFollow(FOLLOW_simple_selector_in_negation_selector2363);
s=simple_selector();
state._fsp--;
sel.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:454:7: ( (t= COMMA ) (t= SPACE )? (s= simple_selector ) )*
loop29:
while (true) {
int alt29=2;
int LA29_0 = input.LA(1);
if ( (LA29_0==COMMA) ) {
alt29=1;
}
switch (alt29) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:454:9: (t= COMMA ) (t= SPACE )? (s= simple_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:454:9: (t= COMMA )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:454:11: t= COMMA
{
t=(Token)match(input,COMMA,FOLLOW_COMMA_in_negation_selector2385);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:455:9: (t= SPACE )?
int alt28=2;
int LA28_0 = input.LA(1);
if ( (LA28_0==SPACE) ) {
alt28=1;
}
switch (alt28) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:455:11: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_negation_selector2415);
sel.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:456:9: (s= simple_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:456:11: s= simple_selector
{
pushFollow(FOLLOW_simple_selector_in_negation_selector2446);
s=simple_selector();
state._fsp--;
sel.append(s);
}
}
break;
default :
break loop29;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:458:7: (t= RPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:458:9: t= RPAREN
{
t=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_negation_selector2475);
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "negation_selector"
// $ANTLR start "relational_selector"
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:461:1: relational_selector returns [RelationalSelector sel] : (t= HAS ) (t= SPACE )? (s= relative_selector ) ( (t= COMMA ) (t= SPACE )? (s= relative_selector ) )* (t= RPAREN ) ;
public final RelationalSelector relational_selector() throws RecognitionException {
RelationalSelector sel = null;
Token t=null;
RelativeSelector s =null;
sel = new RelationalSelector();
try {
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:465:5: ( (t= HAS ) (t= SPACE )? (s= relative_selector ) ( (t= COMMA ) (t= SPACE )? (s= relative_selector ) )* (t= RPAREN ) )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:465:7: (t= HAS ) (t= SPACE )? (s= relative_selector ) ( (t= COMMA ) (t= SPACE )? (s= relative_selector ) )* (t= RPAREN )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:465:7: (t= HAS )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:465:9: t= HAS
{
t=(Token)match(input,HAS,FOLLOW_HAS_in_relational_selector2522);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:466:7: (t= SPACE )?
int alt30=2;
int LA30_0 = input.LA(1);
if ( (LA30_0==SPACE) ) {
alt30=1;
}
switch (alt30) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:466:9: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_relational_selector2554);
sel.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:467:7: (s= relative_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:467:9: s= relative_selector
{
pushFollow(FOLLOW_relative_selector_in_relational_selector2585);
s=relative_selector();
state._fsp--;
sel.append(s);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:468:7: ( (t= COMMA ) (t= SPACE )? (s= relative_selector ) )*
loop32:
while (true) {
int alt32=2;
int LA32_0 = input.LA(1);
if ( (LA32_0==COMMA) ) {
alt32=1;
}
switch (alt32) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:468:9: (t= COMMA ) (t= SPACE )? (s= relative_selector )
{
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:468:9: (t= COMMA )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:468:11: t= COMMA
{
t=(Token)match(input,COMMA,FOLLOW_COMMA_in_relational_selector2605);
sel.append(t);
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:469:9: (t= SPACE )?
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0==SPACE) ) {
alt31=1;
}
switch (alt31) {
case 1 :
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:469:11: t= SPACE
{
t=(Token)match(input,SPACE,FOLLOW_SPACE_in_relational_selector2635);
sel.append(t);
}
break;
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:470:9: (s= relative_selector )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:470:11: s= relative_selector
{
pushFollow(FOLLOW_relative_selector_in_relational_selector2666);
s=relative_selector();
state._fsp--;
sel.append(s);
}
}
break;
default :
break loop32;
}
}
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:472:7: (t= RPAREN )
// org/daisy/pipeline/css/sass/impl/SassPostProcess.g:472:9: t= RPAREN
{
t=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_relational_selector2693);
sel.append(t);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return sel;
}
// $ANTLR end "relational_selector"
// Delegated rules
public static final BitSet FOLLOW_stylesheet_in_start48 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_stylesheet84 = new BitSet(new long[]{0x00000608184B8BC2L});
public static final BitSet FOLLOW_COMMENT_in_stylesheet126 = new BitSet(new long[]{0x00000608184B8BC2L});
public static final BitSet FOLLOW_media_rule_in_stylesheet150 = new BitSet(new long[]{0x00000608184B8BC2L});
public static final BitSet FOLLOW_at_rule_in_stylesheet160 = new BitSet(new long[]{0x00000608184B8BC2L});
public static final BitSet FOLLOW_selector_rule_in_stylesheet174 = new BitSet(new long[]{0x00000608184B8BC2L});
public static final BitSet FOLLOW_AT_in_at_rule212 = new BitSet(new long[]{0x000007FBFFEFFFF0L});
public static final BitSet FOLLOW_set_in_at_rule246 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_SEMICOLON_in_at_rule291 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LCURLY_in_at_rule318 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_at_rule_in_at_rule346 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_set_in_at_rule362 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_RCURLY_in_at_rule420 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_MEDIA_in_media_rule466 = new BitSet(new long[]{0x000007FFFFEFFFF0L});
public static final BitSet FOLLOW_set_in_media_rule497 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_LCURLY_in_media_rule528 = new BitSet(new long[]{0x00000609184B8BC0L});
public static final BitSet FOLLOW_stylesheet_in_media_rule558 = new BitSet(new long[]{0x0000000100000000L});
public static final BitSet FOLLOW_RCURLY_in_media_rule584 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_selector_group_in_selector_rule631 = new BitSet(new long[]{0x0000000000100000L});
public static final BitSet FOLLOW_LCURLY_in_selector_rule651 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_set_in_selector_rule679 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_RCURLY_in_selector_rule708 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_selector_in_selector_group754 = new BitSet(new long[]{0x0000000000000402L});
public static final BitSet FOLLOW_COMMA_in_selector_group782 = new BitSet(new long[]{0x00000008180B8340L});
public static final BitSet FOLLOW_SPACE_in_selector_group811 = new BitSet(new long[]{0x00000000180B8340L});
public static final BitSet FOLLOW_selector_in_selector_group841 = new BitSet(new long[]{0x0000000000000402L});
public static final BitSet FOLLOW_simple_selector_in_selector894 = new BitSet(new long[]{0x0000010820004002L});
public static final BitSet FOLLOW_combinator_in_selector915 = new BitSet(new long[]{0x00000000180B8340L});
public static final BitSet FOLLOW_simple_selector_in_selector939 = new BitSet(new long[]{0x0000010820004002L});
public static final BitSet FOLLOW_set_in_combinator980 = new BitSet(new long[]{0x0000000800000002L});
public static final BitSet FOLLOW_SPACE_in_combinator1035 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SPACE_in_combinator1065 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_relative_selector1114 = new BitSet(new long[]{0x00000008180B8340L});
public static final BitSet FOLLOW_SPACE_in_relative_selector1173 = new BitSet(new long[]{0x00000000180B8340L});
public static final BitSet FOLLOW_selector_in_relative_selector1212 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_type_selector_in_simple_selector1258 = new BitSet(new long[]{0x0000000818098202L});
public static final BitSet FOLLOW_selector_part_in_simple_selector1279 = new BitSet(new long[]{0x0000000818098202L});
public static final BitSet FOLLOW_selector_part_in_simple_selector1301 = new BitSet(new long[]{0x0000000818098202L});
public static final BitSet FOLLOW_SPACE_in_simple_selector1329 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_id_selector_in_selector_part1372 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_class_selector_in_selector_part1395 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_attribute_selector_in_selector_part1415 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_pseudo_element_in_selector_part1431 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_pseudo_class_in_selector_part1451 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_prefix_in_type_selector1487 = new BitSet(new long[]{0x0000000000020040L});
public static final BitSet FOLLOW_set_in_type_selector1494 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_prefix1556 = new BitSet(new long[]{0x0000000000000100L});
public static final BitSet FOLLOW_BAR_in_prefix1595 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HASH_in_id_selector1643 = new BitSet(new long[]{0x0000000000820000L});
public static final BitSet FOLLOW_set_in_id_selector1672 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PERIOD_in_class_selector1715 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_IDENT_in_class_selector1742 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LBRACE_in_attribute_selector1788 = new BitSet(new long[]{0x000007FF7FFFFFF0L});
public static final BitSet FOLLOW_set_in_attribute_selector1815 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_RBRACE_in_attribute_selector1843 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_COLON_in_pseudo_element1888 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_COLON_in_pseudo_element1916 = new BitSet(new long[]{0x0000000000820000L});
public static final BitSet FOLLOW_set_in_pseudo_element1944 = new BitSet(new long[]{0x0000000000200002L});
public static final BitSet FOLLOW_LPAREN_in_pseudo_element1971 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_set_in_pseudo_element1998 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_RPAREN_in_pseudo_element2026 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_negation_selector_in_pseudo_class2080 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_relational_selector_in_pseudo_class2099 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_COLON_in_pseudo_class2116 = new BitSet(new long[]{0x0000000000820000L});
public static final BitSet FOLLOW_set_in_pseudo_class2148 = new BitSet(new long[]{0x0000000000200002L});
public static final BitSet FOLLOW_LPAREN_in_pseudo_class2179 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_set_in_pseudo_class2210 = new BitSet(new long[]{0x000007FFFFFFFFF0L});
public static final BitSet FOLLOW_RPAREN_in_pseudo_class2242 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_NOT_in_negation_selector2300 = new BitSet(new long[]{0x00000008180B8340L});
public static final BitSet FOLLOW_SPACE_in_negation_selector2332 = new BitSet(new long[]{0x00000000180B8340L});
public static final BitSet FOLLOW_simple_selector_in_negation_selector2363 = new BitSet(new long[]{0x0000000200000400L});
public static final BitSet FOLLOW_COMMA_in_negation_selector2385 = new BitSet(new long[]{0x00000008180B8340L});
public static final BitSet FOLLOW_SPACE_in_negation_selector2415 = new BitSet(new long[]{0x00000000180B8340L});
public static final BitSet FOLLOW_simple_selector_in_negation_selector2446 = new BitSet(new long[]{0x0000000200000400L});
public static final BitSet FOLLOW_RPAREN_in_negation_selector2475 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_HAS_in_relational_selector2522 = new BitSet(new long[]{0x00000108380BC340L});
public static final BitSet FOLLOW_SPACE_in_relational_selector2554 = new BitSet(new long[]{0x00000100380BC340L});
public static final BitSet FOLLOW_relative_selector_in_relational_selector2585 = new BitSet(new long[]{0x0000000200000400L});
public static final BitSet FOLLOW_COMMA_in_relational_selector2605 = new BitSet(new long[]{0x00000108380BC340L});
public static final BitSet FOLLOW_SPACE_in_relational_selector2635 = new BitSet(new long[]{0x00000100380BC340L});
public static final BitSet FOLLOW_relative_selector_in_relational_selector2666 = new BitSet(new long[]{0x0000000200000400L});
public static final BitSet FOLLOW_RPAREN_in_relational_selector2693 = new BitSet(new long[]{0x0000000000000002L});
}