In CSS, a selector is (roughly) a sequence of simple selectors joined by a 
combinator. http://www.antlr.org/grammar/1240941192304/css21.g has the 
following rules which correspond to this. 

combinator
        : PLUS
        | GREATER
        |
        ;
        
selector
        : simpleSelector (combinator simpleSelector)*
        ;

The issue I'm having is how to handle the combinator which is a space in the 
selector rule. Specifically, I should be able to parse 
        
        A .b

as two simple selectors: A and .b. However, since whitespace is ignored, this 
is getting parsed as one selector. The following parses as desired: 

        A *.b

Using the universal selector as part of the second simple selector is a 
workaround that I shouldn't have to employ. 

How can I parse "A<space>.b" such that the space is recognized as a combinator? 
Thanks in advance for any help!
David Grieve 
Sun Microsystems, Inc.





List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.


Reply via email to