Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Case sensitivity control
Case sensitivity control [message #876566] Thu, 24 May 2012 21:00 Go to next message
Dmitriy Shishkin is currently offline Dmitriy ShishkinFriend
Messages: 2
Registered: May 2012
Junior Member
From Google I found that I can make Case Insensitive Languages.
May be it is simple question, But I need control case sensitivity in my language.
For example when I define new module I can declare

defModule ID
  :case-sensitiv? TRUE

and all reference, keywords and ID's in this module should be in UpperCase.
In case :case-sensitiv? FALSE module become fully case insensitive.

I will appreciate any advice especially relating to keywords and reference including references between case sensittive and insensitive modules.
Dmitriy.
Re: Case sensitivity control [message #876969 is a reply to message #876566] Fri, 25 May 2012 15:59 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Dmitriy,

it's not possible to switch the lexer according to constructs in your
language. You'll have to use case insensitive keywords and validate the
correct notation for them explicitly.
Cross references / linking et al can be customized depending on the
state of your document.

Out of curiosity: why do you want to switch the validity of keywords in
your files?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 24.05.12 23:00, schrieb Dmitriy Shishkin:
> From Google I found that I can make Case Insensitive Languages.
> May be it is simple question, But I need control case sensitivity in my
> language.
> For example when I define new module I can declare
>
> defModule ID
> :case-sensitiv? TRUE
> and all reference, keywords and ID's in this module should be in UpperCase.
> In case :case-sensitiv? FALSE module become fully case insensitive.
>
> I will appreciate any advice especially relating to keywords and
> reference including references between case sensittive and insensitive
> modules.
> Dmitriy.
Re: Case sensitivity control [message #877070 is a reply to message #876566] Fri, 25 May 2012 20:43 Go to previous message
Dmitriy Shishkin is currently offline Dmitriy ShishkinFriend
Messages: 20
Registered: May 2012
Junior Member
Thanks a lot for answer, Sebastian.

Maybe there is some advices about validation of cross-references? Where to begin?

I try to make Eclipse editor for existing language. And in its specification says:
"If :case-sensitive? is supplied as TRUE, symbols in the module will be interned
case-sensitively, otherwise (the default), they will be converted to uppercase before
they get interned. That means that any reference from inside a case-sensitive module
to a non-case-sensitive module will have to use uppercase names for symbols in the
non-case-sensitive module."
Another words, in case insensitive module I can write the way I want case:

(DeFcoNcePt name)

where 'defconcept' is keyword. And it will be right, because system "will be converted to uppercase before
they get interned"
And in case-sensitive module I can write only:

(DEFCONCEPT name)

I tried it on console-version of this language and it works exactly as I described. Sustem says: "Undefined operator: `defconcept'" in case-sensitive module..

Thanks again,
Dmitriy.
Previous Topic:How to get access to the current project location?
Next Topic:problems with AbstractContentAssistProcessorTest
Goto Forum:
  


Current Time: Fri Apr 19 12:39:49 GMT 2024

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

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

Back to the top