Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Import...As(Generating a Grammar that allows an import to be renamed)
Import...As [message #894223] Sat, 07 July 2012 21:06 Go to next message
Kokongi Nei is currently offline Kokongi NeiFriend
Messages: 5
Registered: July 2012
Junior Member
I have this rule in my grammar:

Import: 'import' importedNamespace = QualifiedNameWithWildCard;

But, in using the editor for the generated grammar, I would like to be able to rename the import, e.g.:

import this.is.a.qualified.package as p

I have tried modified the grammar as follows, but it doesn't do the trick:

Import: 'import' importedNamespace = QualifiedNameWithWildCard ('as' name=ID)?;

Thanks in advance for any assistance.

Re: Import...As [message #894224 is a reply to message #894223] Sat, 07 July 2012 21:19 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13468
Registered: July 2009
Senior Member
Hi,

since this is no out of the box functionality you have to care yourself.
dig into ImportedNamespaceAwareLocalScopeProvider/ImportNormalizer/ImportScope

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Possible Unicode Bug - Greek Polytonic
Next Topic:Mixing grammars
Goto Forum:
  


Current Time: Thu May 28 02:36:50 GMT 2020

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

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

Back to the top