Skip to main content



      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 17:06 Go to next message
Eclipse UserFriend
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 17:19 Go to previous message
Eclipse UserFriend
Hi,

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

~Christian
Previous Topic:Possible Unicode Bug - Greek Polytonic
Next Topic:Mixing grammars
Goto Forum:
  


Current Time: Sun Jul 06 01:47:56 EDT 2025

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

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

Back to the top