Matching Unicode characters in the grammar [message #51957] |
Tue, 16 June 2009 21:28  |
Eclipse User |
|
|
|
Hi,
Is it possible to create rules that match unicode characters?
For example, can I create a datatype rule that matches a range of Unicode
characters.
E.g.
MyRule : '\\u20'->'\\u60';
Or better, a datatype/terminal rule that matches a a unicode charater
class (similar to what can be done in regular expression, using the
Unicode class charater matchers: \p{Lu} to match all Unicode upper case
letters).
Thanks you!
|
|
|
Re: Matching Unicode characters in the grammar [message #52010 is a reply to message #51957] |
Wed, 17 June 2009 03:01  |
Eclipse User |
|
|
|
Hi Bruno,
please find my answer inline.
Am 17.06.2009 2:28 Uhr, schrieb Bruno Fischel:
> Hi,
>
> Is it possible to create rules that match unicode characters?
> For example, can I create a datatype rule that matches a range of
> Unicode characters.
> E.g.
> MyRule : '\\u20'->'\\u60';
I looked into the code and it seems like Xtext does not accept \u#### as
part of a string. I think there is a bugzilla missing.
We should allow to write something like this:
terminal MyRule: '\u20' .. '\u60';
>
> Or better, a datatype/terminal rule that matches a a unicode charater
> class (similar to what can be done in regular expression, using the
> Unicode class charater matchers: \p{Lu} to match all Unicode upper case
> letters).
I'm afraid this is not yet possible. Please file an enhancement request.
Regards,
Sebastian
>
> Thanks you!
>
|
|
|
Powered by
FUDForum. Page generated in 0.04213 seconds