|Re: Leveraging importURI mechanism to include imported objects in model [message #704085 is a reply to message #703977]
||Thu, 28 July 2011 09:02
| Mirko Raner
Registered: July 2009
Location: New York City, NY
Thanks for your comments, Alex!|
We're talking more about something similar to #include in the C preprocessor here; I understand that this mechanism is very different from Java imports.
I'm really interested in obtaining a fully linked ECore model, not so much in editor features like F3. I need to traverse the complete object graph to collect certain information, and it seemed that importURI already provides the mechanism for locating the files, so I wanted to take this a step further, so that a linked model gets built at the same time. I was hoping importURI could somehow be leveraged for that.
I guess the custom scope provider is the way to go then, though it is pretty tricky because I need to process relative URIs like "../../folder/file.h" and I don't want to change the lexical structure of the language, if I can avoid it. If '..', '/', etc. are lexed as separate tokens, it is possible to create a scope provider that is populated from the file system or workspace, but it would mean that I cannot use the STRING rule from common.Terminals and have to use custom terminals that drill down into strings.
Anyway, I realize it was a long shot to hope for leveraging importURI for this. I'll try putting together a custom scope provider, possibly with custom lexing.
Powered by FUDForum
. Page generated in 0.02347 seconds