Hi Guys,

The attached grammar is supposed to parse CSS files. I used this as an
initial version:

http://www.antlr.org/grammar/1214945003224/csst3.g

First I tried to add a functionality to prevent "_" chars for property
names, so I created a new lexer rule "CSSPROPERTYNAME" to ensure this. The
"declaration" rule has been updated accordingly. The funny thing is that now
the "selector" rule fails to recognize tag selectors like:

.class_selector img {
  property: value;
  ...
}

Since my update should only affect property names and not selectors, I
really do not understand what the problem is. I tried to define lexer rules
as both fragments and literal values, no luck.

I used ANTLRWorks to debug this and have noticed that in the "selector" rule
"selectorOperation" is ignored:

selector
  : elem selectorOperation* attrib* pseudo? ->  elem selectorOperation*
attrib* pseudo*
  ;

Any ideas?

Thanks.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Attachment: css.g
Description: Binary data

-- 
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