Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Implement C/C++ style #include the DLTK way...(Our script language has include '<path>' and include_once '<path>', how should these be implemented?)
Implement C/C++ style #include the DLTK way... [message #646437] Fri, 24 December 2010 07:51 Go to next message
Carl Knight is currently offline Carl Knight
Messages: 13
Registered: December 2010
Junior Member
This is something of a request for advice before I roll my own mechanism for implementing include and include_once style behaviour. The statements simply take a string that is the path to another script file.

I've found things in the DLTK like ImportInfo. It can be populated and passed to the acceptImport method of the implementor of ISourceElementRequestor in SourceElementRequestVisitor.

However, the include/include_once behaviour is that the source or at least the resulting AST is available for the unit the include/include_once statement is found in. This is necessary for symbol lookup, etc.

I can't imagine I'm the first to have to do this. My question is what is the correct way using the DLTK before I go much further.

Searching for include on the forum yields oodles of hits, as does import which is not quite the same thing. If you know of a post that answers this question, I won't be insulted if you direct me there with a slap for not searching hard enough! Smile

Thanks.

- Carl.
Re: Implement C/C++ style #include the DLTK way... [message #694579 is a reply to message #646437] Fri, 08 July 2011 22:01 Go to previous message
Timothy Wall is currently offline Timothy Wall
Messages: 21
Registered: July 2009
Junior Member
My target language has a similar construct, where the "import" results in population of the AST. For the moment, I'm putting the stuff in a TypeDeclaration with the module modifier set so the code outline will display them, but ideally they'd go in their own box, perhaps within the "interpreter libraries" folder or a custom folder at the project level.
Previous Topic:Debugging JRuby in Java container with dltk
Next Topic:From ASTNode to IModelElement
Goto Forum:
  


Current Time: Wed Oct 22 23:14:44 GMT 2014

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

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