Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Matching Unicode characters in the grammar
Matching Unicode characters in the grammar [message #51957] Wed, 17 June 2009 01:28 Go to next message
Bruno Fischel is currently offline Bruno FischelFriend
Messages: 6
Registered: July 2009
Junior Member
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 07:01 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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!
>
Previous Topic:[Announce] TMF XTEXT 0.7.0RC5 is available
Next Topic:An invalid XML character
Goto Forum:
  


Current Time: Wed Jul 17 08:59:48 GMT 2024

Powered by FUDForum. Page generated in 0.03751 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top