src/main/java/com/bazaarvoice/jless/parser/Parser.java
Rule Selector() {
        Var<SelectorSegmentNode> selectorSegmentNode = new Var<SelectorSegmentNode>();
        return Sequence(
                push(new SelectorNode()),
                // First selector segment may have a combinator (with nested rule sets)
                Optional(SymbolCombinator()),
                selectorSegmentNode.set(new SelectorSegmentNode(match())),
                SimpleSelector(selectorSegmentNode),
                selectorSegmentNode.get().setSimpleSelector(match()),
                peek().addChild(selectorSegmentNode.getAndClear()),
                // Additional selector segments must have a combinator
                ZeroOrMore(
                        Combinator(),
                        selectorSegmentNode.set(new SelectorSegmentNode(match())),
                        SimpleSelector(selectorSegmentNode),
                        selectorSegmentNode.get().setSimpleSelector(match()),
                        peek().addChild(selectorSegmentNode.getAndClear())
                )
        );
    }
Rule Selector() {
        Var<SelectorSegmentNode> selectorSegmentNode = new Var<SelectorSegmentNode>();
        return Sequence(
                push(new SelectorNode()),
                // First selector segment may have a combinator (with nested rule sets)
                Optional(SymbolCombinator()),
                selectorSegmentNode.set(new SelectorSegmentNode(match())),
                SimpleSelector(selectorSegmentNode),
                selectorSegmentNode.get().setSimpleSelector(match()),
                peek().addChild(selectorSegmentNode.getAndClear()),
                // Additional selector segments must have a combinator
                ZeroOrMore(
                        Combinator(),
                        selectorSegmentNode.set(new SelectorSegmentNode(match())),
                        SimpleSelector(selectorSegmentNode),
                        selectorSegmentNode.get().setSimpleSelector(match()),
                        peek().addChild(selectorSegmentNode.getAndClear())
                )
        );
    }
Rule Selector ( ) { Var < SelectorSegmentNode > selectorSegmentNode = new Var < SelectorSegmentNode > ( ) ; return Sequence ( push ( new SelectorNode ( ) ) , // First selector segment may have a combinator (with nested rule sets) Optional ( SymbolCombinator ( ) ) , selectorSegmentNode . set ( new SelectorSegmentNode ( match ( ) ) ) , SimpleSelector ( selectorSegmentNode ) , selectorSegmentNode . get ( ) . setSimpleSelector ( match ( ) ) , peek ( ) . addChild ( selectorSegmentNode . getAndClear ( ) ) , // Additional selector segments must have a combinator ZeroOrMore ( Combinator ( ) , selectorSegmentNode . set ( new SelectorSegmentNode ( match ( ) ) ) , SimpleSelector ( selectorSegmentNode ) , selectorSegmentNode . get ( ) . setSimpleSelector ( match ( ) ) , peek ( ) . addChild ( selectorSegmentNode . getAndClear ( ) ) ) ) ; }
SimpleSelector (Combinator SimpleSelector)*
SimpleSelector ( Combinator SimpleSelector ) *