Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Combining importURI and importedNamespace
Combining importURI and importedNamespace [message #769566] Thu, 22 December 2011 05:47 Go to previous message
Torsten Schiefer is currently offline Torsten Schiefer
Messages: 26
Registered: December 2011
Junior Member
Hi there,

my Editor should hande two file-types.
The one with the extension .os declares a namespace like this:
using Main.C;
using Main.B;
using Main2.*;

#include "relativePath/morepath/anoNasp.osi"

namespace Main {
    B newFunctionDeclaration(C parameter) {
        ... Statements ...
        parameter = otherFunctionDeclaration(this);
        ... Statements ...
    }
}

The imported namespaces have the same form.
The UsingImport rule look in the grammar:
UsingImport : 'using' importedNamespace=QualifiedNameWithWildCard ';';

The Include rule:
Include : '#include' importURI=STRING;

The included files have the file extension osi and only can declare anonymous namespaces like this:
namespace {
    C otherFunctionDeclaration(Main parameter) {
        ... Statements ...
    }
}

My workflow contains the following lines:
            
// scoping and exporting API
fragment = scoping.ImportURIScopingFragment {}
// fragment = exporting.SimpleNamesFragment {}
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}

My question is: Which ScopeProviders I have to use to make this work?
How can I combine the two ImportUriGlobalScope and ImportedNamespaceAwareLocalScope?
Which Providers (e.g. NameProviders) I also have to individualize?
I've also written an ImportUriResolver, so the included recources can be found.
But if I call any Scope in my own OSScopeProvider or OSLinkingService, they are very empty. Why?

I know, anything should work out-of-the-box, but I don't know the right key for the box Wink
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Type Inference with XBase
Next Topic:Debugging model post processing
Goto Forum:
  


Current Time: Fri May 24 19:27:15 EDT 2013

Powered by FUDForum. Page generated in 0.01622 seconds