[ragel-users] Re: [newbie] parsing CSS style

Adrian Thurston thurs... at cs.queensu.ca
Thu Oct 18 16:14:08 UTC 2007


Sounds to me that Ragel is not the right tool for you. Ragel is designed
for single-pass parsing where actions are executed as you move over the
data. Perhaps a more traditional approach where you build the parse tree
first, then walk it would be more appropriate in your case. Something
like ANTLR or Lex+YACC might be better.

Adrian

Mat| wrote:
> Hello,
> 
> First of all thanks for the quick answer!!!
> 
> On Oct 18, 4:13 pm, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
>>> - I have got a problem (maybe more than one but I could only
>>> detect one !) with my machines, indeed in my expressions I always
>>> have a terminating ";" character but for some reason the style_item
>>> action is executed even if there is no terminating ";". For example,
>>> if I use "background: green" as an input string, the style_item is
>>> going to be executed but it should not because there is no ";" at
>>> the end.
>> Do you mean style_item_value action? The style_item action will get
>> executed when leaving the name portion, in this case on the colon.
>>
> 
> I am talking about the style_item action. I want it to be executed
> only
> when it's "complete", for me it means that everything has been
> processed up to a ";". For the moment as your are pointing out it
> is executed on the colon even if there is no ";" at the end (when
> there
> is no ";" the style machine should raise an error).
> 
> How can I change the .rl file to obey to this behaviour ?
> I am a bit lost.
> 
> Cheers
> 
> 
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "ragel-users" group.
> To post to this group, send email to ragel-users at googlegroups.com
> To unsubscribe from this group, send email to ragel-users-unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ragel-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20071018/26c8ca13/attachment-0001.sig>


More information about the ragel-users mailing list