From: Grzegorz J. <ja...@he...> - 2004-03-22 02:35:20
|
Asen, First, thanks for your contribution! On Fri, 19 Mar 2004, Asen Kovachev wrote: > I have imported my changes to enable it running under MSVC 7.1. > These are only the changes done to the OpenC++. I made some minor changes to the GC library as well. What did you have to change in GC? What if instead of modifying GC you substitute the latest stable version? Will that work? > The tag name is <sandbox_asen_kovachev_msvc> > > Also I would like to discuss some features I want to add. > I made it so that you can call a function to retrieve the name of the file being processed. > As well as the folder. Why do we need two functions (filename and folder)? Client can separate filename from folder name on his/her own. The fewer functions we have in the API, the easier it is to maintain. I would suggest one function that returns the full path. Is it doable? > We are generating .cpp AND .h files from a meta > header .hxx and need to know the folder where we should do the extra > work. Do you think that is a feature you guys might appreciate added > to the code? Perhaps yes, but I would like to keep the APIs clean, so let me first see where you have added this code. Could you commit into your branch? > Since I intend to use OpenC++ not as a preprocessor step only but more > like a tool to transform the source code. I think it would be nice if it > collected the information about the include files, but kept the original > source structure (as opposed to placing #line, etc.) That's my dream, but it is not so straightforward. What if the translation process changes the included code? In such situation you *have* to expand included file. Moreover, if the same include file is included multiple times, you cannot create e.g. "./translated/stdlib.h" and have all includers reference this file instead of original, because there is no guarantee that all inclusions of the same header will be translated in the same way. It perhaps can be tackled with adding new syntax node representing "#include". OpenC++ already has a mechanism of keeping original syntax subtree if there are no changes within it. The same could be applied to includes, e.g. if the content does not change, OpenC++ would output original "#include" directive; if the content changes, OpenC++ would expand it (and use "#line"). This mechanism will not be able to handle all cases, e.g.: char* msgs[] = { # include "msgs.h" }; but should be enough for all reasonable headers. Is it what you have in mind? Thanks again Grzegorz PS: Adding new syntax node directly has an effect of breaking backward compatibility :-( but I think we can somehow find a way around it. PPS: I have seen you added a fix commented as "MSVC fix for 'throw(...)'" whatever that means. Could you send me the simplest possible input file that exercises this fix along with the correct output file? I will make them into a testcase to make sure that your fix will not get broken. ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2004 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |