[ragel-users] How to convert [#x2070-#x218F] to Ragel grammar?

Adrian Thurston adrian.thurston at esentire.com
Fri Nov 20 19:35:32 UTC 2009


Okay, in that case then have a look at the unicode2ragel.rb script in 
the contrib directory. It can help with generating ragel defintions for you.

-Adrian

Iñaki Baz Castillo wrote:
> El Viernes, 20 de Noviembre de 2009, Adrian Thurston escribió:
>> If you wish to process a a byte at a time, this is what I would suggest.
>>
>> You may also want to do a first pass to convert to some multibyte
>> encoding and then process that. In that case you set alphtype to
>> something bigger than char.
> 
> If I understand correctly that option is not suitable for me as the 99% of the 
> grammar si "normal":
> 
> 	DIGIT                   = 0x30..0x39;
> 	ALPHA                   = 0x41..0x5a | 0x61..0x7a;
> 	att_name               = QName;
> 	att_value              = AttValue;
> 	attr_test              = "@" att_name "=" att_value;
> 	NameorAny              = QName | "*";
> 	position               = ( DIGIT )+;
> 	by_pos_attr            = NameorAny "[" position "]" "[" attr_test "]";
> 	by_attr                = NameorAny "[" attr_test "]";
> 	by_pos                 = NameorAny "[" position "]";
> 	by_name                = NameorAny;
> 	attribute_selector     = "@" att_name;
> 	namespace_selector     = "namespace::*";
> 
> and so on...
> 
> 
> 
> 
> 




More information about the ragel-users mailing list