You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(9) |
Oct
(16) |
Nov
(14) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(14) |
Feb
(57) |
Mar
(72) |
Apr
(37) |
May
(21) |
Jun
(12) |
Jul
(16) |
Aug
(33) |
Sep
(24) |
Oct
|
Nov
(10) |
Dec
(8) |
2004 |
Jan
(6) |
Feb
(14) |
Mar
(47) |
Apr
(41) |
May
(16) |
Jun
(31) |
Jul
(78) |
Aug
(62) |
Sep
(99) |
Oct
(43) |
Nov
(35) |
Dec
(9) |
2005 |
Jan
(19) |
Feb
(22) |
Mar
(7) |
Apr
|
May
(5) |
Jun
(4) |
Jul
(2) |
Aug
(9) |
Sep
(15) |
Oct
(23) |
Nov
(2) |
Dec
(20) |
2006 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
|
May
|
Jun
(8) |
Jul
(15) |
Aug
(1) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Grzegorz J. <ja...@he...> - 2004-04-15 00:55:26
|
On Tue, 13 Apr 2004, [koi8-r] "Valery A.Khamenya[koi8-r] " wrote: > Hi all, > > > Hm, maybe you did not notice, Grzegorz is currently the main developer of > > OpenC++ :) > > oops, sorry, I thought OpenC++ originates from Japan team, but name > Grzegorz sounds like Polish for me :) > > > > If you don't give more details about what you're thinking about, as > > Grzegorz has asked already, you're unlinkely to get any feedback, as you're > > probably still the only one knowing the details... > > Do you mean that we should not discuss why JITing is > important for Computational Reflection and OpenC++ in > particular? Valery, IMO your reply is slightly agressive. Yann does not imply that you should not discuss any particular subject, he is asking for more details. If you think JIT is imporant for OpenC++ project, please explain why. > It would be quite logical first to get sure > that OpenC++ team is motivated to reach this goal > and only then discuss how to do it. To make sure people are motivated you need to explain your idea first, and motivate people next. > I expected to have this discussion in openc++ maillist. > > > Anyway, there are two general ways how to do it. I am sorry, I am unfamiliar with LLVM and JIT. Perhaps you could give a brief intro? > 1. via C++: > > the OpenC++ sources are translated into C++ > (in run-time too) and then the C++ front-end > compiler from LLVM team is involved to > compile C++ code into LLVM assembler or a byte code. > > > 2. via LLVM assembler or byte-code: > > the OpenC++ sources are translated into LLVM > assembler. This work is expected to be quite > similar to the job done by Chris team over gcc. > > maybe there are other smart ways how to connect > Environment, Ptree and other OpenC++ entities to > LLVM, but at least two ways above seem to be > technically feasible. > > any comments? A question: I can see you have an idea, but do you also have resources to implement it? We (at least myself) can guide you through OpenC++ architecture, help with infrastructure, but that's it. In particular, do you want to contribute your time into implementation of your idea? It takes lots of advocacy work to make other people implement your ideas. Unless you are a university professor, of course :-) BR Grzegorz PS: I am not posting this e-mail to llvm dev list, as I find it to be OT there. > > P.S. sorry if you receive draft of this mail as well. > It was much more in details though :) > > -- > Valery > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Lev A. <LAs...@al...> - 2004-04-14 14:28:20
|
Hi all! Could you please tell me how could I analyze function body? Thanks in advance! ---- Lev Assinovsky Aelita Software Corporation=20 (now is a part of Quest Software) O&S InTrust Framework Division, Team Leader ICQ# 165072909 |
From: <kha...@ma...> - 2004-04-12 21:15:45
|
Hi all, > Hm, maybe you did not notice, Grzegorz is currently the main developer of > OpenC++ :) oops, sorry, I thought OpenC++ originates from Japan team, but name Grzegorz sounds like Polish for me :) > If you don't give more details about what you're thinking about, as > Grzegorz has asked already, you're unlinkely to get any feedback, as you're > probably still the only one knowing the details... Do you mean that we should not discuss why JITing is important for Computational Reflection and OpenC++ in particular? It would be quite logical first to get sure that OpenC++ team is motivated to reach this goal and only then discuss how to do it. I expected to have this discussion in openc++ maillist. Anyway, there are two general ways how to do it. 1. via C++: the OpenC++ sources are translated into C++ (in run-time too) and then the C++ front-end compiler from LLVM team is involved to compile C++ code into LLVM assembler or a byte code. 2. via LLVM assembler or byte-code: the OpenC++ sources are translated into LLVM assembler. This work is expected to be quite similar to the job done by Chris team over gcc. maybe there are other smart ways how to connect Environment, Ptree and other OpenC++ entities to LLVM, but at least two ways above seem to be technically feasible. any comments? P.S. sorry if you receive draft of this mail as well. It was much more in details though :) -- Valery |
From: Yann D. <yd...@us...> - 2004-04-10 14:31:20
|
On Sat, Apr 10, 2004 at 03:35:36AM +0400, "Valery A.Khamenya" wrote: > Hi Grzegorz, > > > Hard to say. What is "second breath"? Are you proposing a solution that > > integrates OpenC++ with LLVM? Please elaborate. > > let's separate "what" and "how". > > I do not speak abot "how" right now, because it is rather > a second step (if any). > > I do believe that reflections without interpreter or JITing > can't be any powerfull. When it is clear, we could speak > about "how". > > It's a pity, but OpenC++ guys are not replying... Hm, maybe you did not notice, Grzegorz is currently the main developer of OpenC++ :) If you don't give more details about what you're thinking about, as Grzegorz has asked already, you're unlinkely to get any feedback, as you're probably still the only one knowing the details... Regards, -- Yann Dirson <yd...@al...> | Why make M$-Bill richer & richer ? Debian-related: <di...@de...> | Support Debian GNU/Linux: Pro: <yan...@fr...> | Freedom, Power, Stability, Gratuity http://ydirson.free.fr/ | Check <http://www.debian.org/> |
From: <kha...@ma...> - 2004-04-09 23:35:40
|
Hi Grzegorz, > Hard to say. What is "second breath"? Are you proposing a solution that > integrates OpenC++ with LLVM? Please elaborate. let's separate "what" and "how". I do not speak abot "how" right now, because it is rather a second step (if any). I do believe that reflections without interpreter or JITing can't be any powerfull. When it is clear, we could speak about "how". It's a pity, but OpenC++ guys are not replying... -- Valery. |
From: Grzegorz J. <ja...@he...> - 2004-04-08 01:50:30
|
On Wed, 7 Apr 2004, [koi8-r] "Valery A.Khamenya[koi8-r] " wrote: > Hi OpenC++ developers, > > IMHO, the LLVM project (http://llvm.cs.uiuc.edu/) could give > a second breath to OpenC++ project. Indeed, the implementations > of reflection become quite restricted if the just-in-time (JIT) > compiling is not available. > > Am i wrong? Hard to say. What is "second breath"? Are you proposing a solution that integrates OpenC++ with LLVM? Please elaborate. BR Grzegorz > > --- > Valery A.Khamenya > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: <kha...@ma...> - 2004-04-07 22:41:26
|
Hi OpenC++ developers, IMHO, the LLVM project (http://llvm.cs.uiuc.edu/) could give a second breath to OpenC++ project. Indeed, the implementations of reflection become quite restricted if the just-in-time (JIT) compiling is not available. Am i wrong? --- Valery A.Khamenya |
From: SF M. E. <el...@us...> - 2004-04-07 20:02:44
|
> [...] > On an unrelated note: as you know I'm quite interested into the efford > to separate the different opencxx layers. > As I don't have any theoretical background in compiler / parser techniques, > I'm wondering about the nature of all the ptree related business: > As far as I understand only the very first steps are related to a > parse tree proper. Already the construction of things like 'PtreeNamespaceAlias' > nodes belongs into the 'syntax tree' domain, right ? > [...] Should the following key words be discussed? 1. Abstract syntax tree (AST) 2. Language syntax tree (LST) 3. Semantic resolution tree (RST) 4. Interpretation syntax tree (IST) 5. Code generation syntax tree (CST) 6. Symbol table 7. http://en.wikipedia.org/wiki/Parser |
From: <kha...@ma...> - 2004-04-07 08:27:30
|
Hi OpenC++ developers, IMHO, the LLVM project (http://llvm.cs.uiuc.edu/) could give a second breath to OpenC++ project. Indeed, the implementations of reflection become quite restricted if the just-in-time (JIT) compiling is not available. Am i wrong? --- Valery A.Khamenya |
From: Stefan S. <se...@sy...> - 2004-04-07 02:35:06
|
Hi Grzegorz, Grzegorz Jakacki wrote: >>(I'm also getting a couple of failures in the test suite >> run on my RH9 machine where the parser has problems with >> GNU extensions (I believe), in this case the line is >> >> extern "C" __typeof(uselocale) __uselocale; >>) > > > This is high priority, however before I get down to it I need to separate > parser, because testing the whole monolith adds huge burden and slows down > anything I do to parser. I am working on the separation now. I just realize that the synopsis port of opencxx already contains a change to deal with this GNU extension. May be we should try to merge the appropriate parts back into 'mainline' ? Let me know if I can help... On an unrelated note: as you know I'm quite interested into the efford to separate the different opencxx layers. As I don't have any theoretical background in compiler / parser techniques, I'm wondering about the nature of all the ptree related business: As far as I understand only the very first steps are related to a parse tree proper. Already the construction of things like 'PtreeNamespaceAlias' nodes belongs into the 'syntax tree' domain, right ? I'm asking because I have some difficulties drawing a clear line as to what the AST I use in synopsis should look like. Right now I only manipulate declarations, but I can imagine at some point to be more flexible and provide scripting access to the parsed source code and thus similar to opencxx's goals provide some means to do meta programming. Any thoughts ? Regards, Stefan PS: for those who don't know what I'm talking about: http://synopsis.fresco.org |
From: Stefan S. <se...@sy...> - 2004-04-06 05:28:48
|
Grzegorz Jakacki wrote: > Hi Stefan, > > On Sun, 4 Apr 2004, Stefan Seefeld wrote: > > >>there are some valid C++ expressions openC++ doesn't >>yet understand. >> >>I'v just run into a fairly simple one: >> >>namespace Foo = Bar; >> >>that creates a namespace alias. Is there any chance >>that the parser gets fixed to recognize this ? > > > Yes, however parser is not self-healing system. AFAIK I am the only person heh :-) > doing anything to the code at the moment. I don't have resources to fix it > now. > > You hacked OpenC++ already, perhaps you could invest some time in this > fix. Please contact me for arrangements if you decide to do so. Fair enough. Attached is a patch that: * adds a new token ('ntNamespaceAlias'...luckily there are still some slots available ;-) * adds a new Ptree subclass 'PtreeNamespaceAlias' * adds a 'rNamespaceAlias' method to the parser that generates such a ptree * adds a dummy 'TranslateNamespaceAlias' to the Walker base class What should the parse tree for this declaration look like ? As I don't know any better, I just generate a simple list [ 'namespace' <alias> '=' <scoped.name> ';' ] (where scoped.name can be a list if it's not a simple identifier) The Walker::TranslateNamespaceAlias() method does nothing (yet), but should probably register the new alias to the environment. I'll let others fill that out :-) Regards, Stefan |
From: Grzegorz J. <ja...@he...> - 2004-04-05 21:36:44
|
Hi Stefan, On Sun, 4 Apr 2004, Stefan Seefeld wrote: > there are some valid C++ expressions openC++ doesn't > yet understand. > > I'v just run into a fairly simple one: > > namespace Foo = Bar; > > that creates a namespace alias. Is there any chance > that the parser gets fixed to recognize this ? Yes, however parser is not self-healing system. AFAIK I am the only person doing anything to the code at the moment. I don't have resources to fix it now. You hacked OpenC++ already, perhaps you could invest some time in this fix. Please contact me for arrangements if you decide to do so. > (I'm also getting a couple of failures in the test suite > run on my RH9 machine where the parser has problems with > GNU extensions (I believe), in this case the line is > > extern "C" __typeof(uselocale) __uselocale; > ) This is high priority, however before I get down to it I need to separate parser, because testing the whole monolith adds huge burden and slows down anything I do to parser. I am working on the separation now. Thanks GJ ################################################################## # 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. # ################################################################## |
From: Grzegorz J. <ja...@he...> - 2004-04-05 19:23:33
|
On Sat, 3 Apr 2004, Jean-Sebastien Mouret wrote: > Grzegorz Jakacki <ja...@he...> writes: > > [...] > >> > >> Sure :) Anyway, it would be better to have a proper or builtin way of > >> doing this. It looks to me just like an ugly hack that shouldn't be > >> promoted. > > > > Could you compose a small example with Makefile and post here? > > > > Here it is... Thanks, I will include it in ./samples BR Grzegorz ################################################################## # 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. # ################################################################## |
From: Stefan S. <se...@sy...> - 2004-04-04 19:08:11
|
hi there, there are some valid C++ expressions openC++ doesn't yet understand. I'v just run into a fairly simple one: namespace Foo = Bar; that creates a namespace alias. Is there any chance that the parser gets fixed to recognize this ? (I'm also getting a couple of failures in the test suite run on my RH9 machine where the parser has problems with GNU extensions (I believe), in this case the line is extern "C" __typeof(uselocale) __uselocale; ) Thanks, Stefan |
From: Grzegorz J. <ja...@he...> - 2004-04-02 14:12:33
|
On Mon, 29 Mar 2004, Raphael Yokoingawa de Camargo wrote: > Hi, > > I am new openc++ user and I'm using it in my doctoral research. I'm encountering > some difficulties. > > 1) Is there a way for me to access the entire program PTree instead of only the > PTree relative to classes. I need this functionality because I will also use > openc++ to manipulate C code (that don't have classes) and I need to know about > all the function definitions in the code. Look at ParseOpencxx(). > 2) Is there a way to only include some selected source files in the AST tree? > The generated source trees are to big because they include all the system header > files. It also makes much more difficult for me to analize the code, since I don > know wich code is from the applications. Asen Kovachev had some new ideas on that, but he is busy now and this subproject stopped. He proposed a callback that you could register with OpenC++ to tell it if header should be analyzed. > Maybe some of these question was already responded in the list, but since its > archives are not working I don't have access to them. Aren't they working at all or just now? BR Grzegorz > Any help will be appreciated. > > thanks, Raphael. > > Raphael Yokoingawa de Camargo <rca...@im...> > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Grzegorz J. <ja...@he...> - 2004-04-02 14:10:49
|
On Mon, 29 Mar 2004, Maarten de Boer wrote: > Hello, > > I am looking for an application that can parse c++, store it in a AST, > and regenerate the original c++ code. Obviously, the interesting part > would be to apply some modification to the AST before regenerating. > > For example, I want to remove all constructors that match a certain > pattern (first argument is of type Foo), from classes that are derived > from class Bar. > > Or, another example, I have a header and source file for each class, and > for each header, I want to move all included headers to the > corresponding source file, and use forward declarations instead, if the > classes from the headers included are only used by reference. > > Someone pointed me to OpenC++, and at a first glance, it seems to > contain the code to do just the thing, though it is not clear to me if > it would actually be able to regenerate the code... This is a recurring subject, Asen Kovachev had some ideas on that recently. The main problem is that you have to deal somehow with preprocessor expansion. In fact you want to keep as much as possible unexpanded, yet in most cases you want the parser to be able to "see through" the preprocessor symbols. Asen and myself came up with an idea to add new AST nodes that would represent macro expansions and #include expansions. This is not enough to incorporate any usage of macros (e.g. expansions of '#define LBR [' or swines like that), but is close enough to be usable. OpenC++ does not implement it now, hopefully we can get it to work soon. If you would like to help to make it happen, please contact me off-line. > Could you please help me out? Would OpenC++ indeed be suitable for such > a task, is there some example code available that I could work upon, or > maybe you can suggest some other project that would be (more) suitable? I don't think it is easy to find tools that would understand the syntax and preserve preprocessor. Eclipse's CDT does some attempt at refactoring C++, which obviously means regenerating sources without preprocessor expansion, but AFAIK they are not there yet. It is free, you can try it. (Please post the results here.) Microsoft had something called Intensional Programming Tool and I am told it can parse and unparse C++ without trashing preprocessor constructs, but I have never seen it. Perhaps it was spinned-off from Microsoft with Simonyi. There is a company www.semdesigns.com, they have heavy-weight multi-language refactoring tool, perhaps it does what you need (but I doubt it does it out-of-the-box). I would also ask this question at comp.compilers, if you have not done it already. In any case I would be very much interested in your findings, I would appreciate if you could e-mail me with results of you search. Thanks Grzegorz > Kind regards, > > Maarten > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Grzegorz J. <ja...@he...> - 2004-04-02 14:09:44
|
Smart. GJ On Mon, 29 Mar 2004, Jean-Sebastien Mouret wrote: > Raphael Yokoingawa de Camargo <rca...@im...> writes: > > > Hi, > > > > I am new openc++ user and I'm using it in my doctoral research. I'm encountering > > some difficulties. > > > > 1) Is there a way for me to access the entire program PTree instead of only the > > PTree relative to classes. I need this functionality because I will also use > > openc++ to manipulate C code (that don't have classes) and I need to know about > > all the function definitions in the code. > > have a look in the documentation appendix. > > > > > 2) Is there a way to only include some selected source files in the AST tree? > > The generated source trees are to big because they include all the system header > > files. It also makes much more difficult for me to analize the code, since I don > > know wich code is from the applications. > > To do this, I use a special include directive for everything I don't > want openc++ to parse. The technic is rather gory and I'd like to know if > there is a nicer way to do it. > > for example, in your occ file just do: > > #include <common.hh> > // and then > include("iostream") > > > the common.hh contains something like: > > metaclass Tools internal_Tools; > struct internal_Tools {}; > # define include(FILE) void internal_Tools::include() { FILE; } > > > then in your openc++ compiler: > > struct Tools : public Class > { > static bool Initialize(); > void TranslateMemberFunction(Environment* env, Member& m); > void TranslateClass(Environment* env); > }; > > bool Tools::Initialize() > { > return Class::Initialize(); > } > > void Tools::TranslateClass(Environment* env) > { > RemoveClass(); > return Class::TranslateClass(env); > } > > void Tools::TranslateMemberFunction(Environment* env, Member& m) > { > if (Ptree::Match(m.Name(),"include")) > { > //FIXME: delete the member instead of commenting out > InsertBeforeToplevel(env,Ptree::Make("/*")); > AppendAfterToplevel(env,Ptree::Make("*/")); > > for(PtreeIter i = m.FunctionBody()->Rest()->First(); !i.Empty(); i++) > AppendAfterToplevel(env,Ptree::Make("\n#include %p",(*i)->First())); > } > } > > > Hope this helps > > > -- > js > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Grzegorz J. <ja...@he...> - 2004-04-02 12:51:35
|
On Tue, 30 Mar 2004, Jean-Sebastien Mouret wrote: > Yann Dirson <yd...@al...> writes: > > > On Mon, Mar 29, 2004 at 05:57:42PM +0200, Jean-Sebastien Mouret wrote: > >> > 2) Is there a way to only include some selected source files in the AST tree? > >> > The generated source trees are to big because they include all the system header > >> > files. It also makes much more difficult for me to analize the code, since I don > >> > know wich code is from the applications. > >> > >> To do this, I use a special include directive for everything I don't > >> want openc++ to parse. The technic is rather gory and I'd like to know if > >> there is a nicer way to do it. > > > > This looks like an interesting example of using occ to do non-standard > > things. Maybe it would be worth to include it as example in the official > > distribution ? Would you be OK for this ? > > > > Sure :) Anyway, it would be better to have a proper or builtin way of > doing this. It looks to me just like an ugly hack that shouldn't be > promoted. Could you compose a small example with Makefile and post here? BR GJ > > By the way, note that the -P option (`Preprocess again after > translation') is useful in this case. > > > -- > js > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Grzegorz J. <ja...@he...> - 2004-04-02 12:49:59
|
On Mon, 29 Mar 2004, Raphael Yokoingawa de Camargo wrote: > Thanks very much for the fast help. > > Actually, I hadn't notice the documentation appendix page. Maybe if there was a > link from the official openc++ page it would be easier to find... The appendix should me merged with main docs, that would eliminate the problem. Any takers? > I hadn't say that in the first question but I still have a problem in finding > global variables declarations. By what I've seen, It doesn't seems to be a > simple way of finding them. Maybe I'll have to look at the source code... OpenC++ is not one thing, but two: * metacompiler framework --- you feed it with metaclass definitions, it does the rest, * frontend library --- you can call it to parse code, it returns typed source tree and program object model (representation of classes, methods, etc.) You have to decide which model you want to use. Metacompiler has complete documentation, frontend library has not. Metacompiler constraints you in some ways (because it is a framework), library gives you more freedom. Using OpenC++ as library requires tweaking source code. I am working on separation of this functionality, but it is not ready yet. Also OpenC++'s main purpose was to explore OO-side of C++ programs, consequently its obect model does not represents e.g. toplevel functions. You can have your code called back when such function is translated, but OpenC++ itself does not create a metaobject for function, the way it creates metaobjects for classes or methods. > I hadn't say that in the first question but I still have a problem in finding > global variables declarations. Create new empty Environment and create a Walker out of it. Run the Walker on your parse tree, after it is done you will find the global variables in the Environment (at least I believe so...). See Walker::TranslateDeclarators() to see how the variables get stored there. > By what I've seen, It doesn't seems to be a > simple way of finding them. I think it is not straightforward if you use "metacompiler framework" model. I suggest switching to "frontend library" model. > Maybe I'll have to look at the source code... Definitely... :-) BR Grzegorz > > thanks, > Raphael > > Citando Jean-Sebastien Mouret <js_...@us...>: > > > Raphael Yokoingawa de Camargo <rca...@im...> writes: > > > > > Hi, > > > > > > I am new openc++ user and I'm using it in my doctoral research. I'm > > encountering > > > some difficulties. > > > > > > 1) Is there a way for me to access the entire program PTree instead of only > > the > > > PTree relative to classes. I need this functionality because I will also > > use > > > openc++ to manipulate C code (that don't have classes) and I need to know > > about > > > all the function definitions in the code. > > > > have a look in the documentation appendix. > > > > > > > > 2) Is there a way to only include some selected source files in the AST > > tree? > > > The generated source trees are to big because they include all the system > > header > > > files. It also makes much more difficult for me to analize the code, since > > I don > > > know wich code is from the applications. > > > > To do this, I use a special include directive for everything I don't > > want openc++ to parse. The technic is rather gory and I'd like to know if > > there is a nicer way to do it. > > > > for example, in your occ file just do: > > > > #include <common.hh> > > // and then > > include("iostream") > > > > > > the common.hh contains something like: > > > > metaclass Tools internal_Tools; > > struct internal_Tools {}; > > # define include(FILE) void internal_Tools::include() { FILE; } > > > > > > then in your openc++ compiler: > > > > struct Tools : public Class > > { > > static bool Initialize(); > > void TranslateMemberFunction(Environment* env, Member& m); > > void TranslateClass(Environment* env); > > }; > > > > bool Tools::Initialize() > > { > > return Class::Initialize(); > > } > > > > void Tools::TranslateClass(Environment* env) > > { > > RemoveClass(); > > return Class::TranslateClass(env); > > } > > > > void Tools::TranslateMemberFunction(Environment* env, Member& m) > > { > > if (Ptree::Match(m.Name(),"include")) > > { > > //FIXME: delete the member instead of commenting out > > InsertBeforeToplevel(env,Ptree::Make("/*")); > > AppendAfterToplevel(env,Ptree::Make("*/")); > > > > for(PtreeIter i = m.FunctionBody()->Rest()->First(); !i.Empty(); i++) > > AppendAfterToplevel(env,Ptree::Make("\n#include > > %p",(*i)->First())); > > } > > } > > > > > > Hope this helps > > > > > > -- > > js > > > > Raphael Yokoingawa de Camargo <rca...@im...> > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > ################################################################## # 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. # ################################################################## |
From: Jean-Sebastien M. <js_...@us...> - 2004-03-29 22:12:30
|
Yann Dirson <yd...@al...> writes: > On Mon, Mar 29, 2004 at 05:57:42PM +0200, Jean-Sebastien Mouret wrote: >> > 2) Is there a way to only include some selected source files in the AST tree? >> > The generated source trees are to big because they include all the system header >> > files. It also makes much more difficult for me to analize the code, since I don >> > know wich code is from the applications. >> >> To do this, I use a special include directive for everything I don't >> want openc++ to parse. The technic is rather gory and I'd like to know if >> there is a nicer way to do it. > > This looks like an interesting example of using occ to do non-standard > things. Maybe it would be worth to include it as example in the official > distribution ? Would you be OK for this ? > Sure :) Anyway, it would be better to have a proper or builtin way of doing this. It looks to me just like an ugly hack that shouldn't be promoted. By the way, note that the -P option (`Preprocess again after translation') is useful in this case. -- js |
From: Raphael Y. de C. <rca...@im...> - 2004-03-29 21:53:08
|
Thanks very much for the fast help. Actually, I hadn't notice the documentation appendix page. Maybe if there was a link from the official openc++ page it would be easier to find... I hadn't say that in the first question but I still have a problem in finding global variables declarations. By what I've seen, It doesn't seems to be a simple way of finding them. Maybe I'll have to look at the source code... thanks, Raphael Citando Jean-Sebastien Mouret <js_...@us...>: > Raphael Yokoingawa de Camargo <rca...@im...> writes: > > > Hi, > > > > I am new openc++ user and I'm using it in my doctoral research. I'm > encountering > > some difficulties. > > > > 1) Is there a way for me to access the entire program PTree instead of only > the > > PTree relative to classes. I need this functionality because I will also > use > > openc++ to manipulate C code (that don't have classes) and I need to know > about > > all the function definitions in the code. > > have a look in the documentation appendix. > > > > > 2) Is there a way to only include some selected source files in the AST > tree? > > The generated source trees are to big because they include all the system > header > > files. It also makes much more difficult for me to analize the code, since > I don > > know wich code is from the applications. > > To do this, I use a special include directive for everything I don't > want openc++ to parse. The technic is rather gory and I'd like to know if > there is a nicer way to do it. > > for example, in your occ file just do: > > #include <common.hh> > // and then > include("iostream") > > > the common.hh contains something like: > > metaclass Tools internal_Tools; > struct internal_Tools {}; > # define include(FILE) void internal_Tools::include() { FILE; } > > > then in your openc++ compiler: > > struct Tools : public Class > { > static bool Initialize(); > void TranslateMemberFunction(Environment* env, Member& m); > void TranslateClass(Environment* env); > }; > > bool Tools::Initialize() > { > return Class::Initialize(); > } > > void Tools::TranslateClass(Environment* env) > { > RemoveClass(); > return Class::TranslateClass(env); > } > > void Tools::TranslateMemberFunction(Environment* env, Member& m) > { > if (Ptree::Match(m.Name(),"include")) > { > //FIXME: delete the member instead of commenting out > InsertBeforeToplevel(env,Ptree::Make("/*")); > AppendAfterToplevel(env,Ptree::Make("*/")); > > for(PtreeIter i = m.FunctionBody()->Rest()->First(); !i.Empty(); i++) > AppendAfterToplevel(env,Ptree::Make("\n#include > %p",(*i)->First())); > } > } > > > Hope this helps > > > -- > js > Raphael Yokoingawa de Camargo <rca...@im...> |
From: Yann D. <yd...@al...> - 2004-03-29 18:54:40
|
On Mon, Mar 29, 2004 at 05:57:42PM +0200, Jean-Sebastien Mouret wrote: > > 2) Is there a way to only include some selected source files in the AST tree? > > The generated source trees are to big because they include all the system header > > files. It also makes much more difficult for me to analize the code, since I don > > know wich code is from the applications. > > To do this, I use a special include directive for everything I don't > want openc++ to parse. The technic is rather gory and I'd like to know if > there is a nicer way to do it. This looks like an interesting example of using occ to do non-standard things. Maybe it would be worth to include it as example in the official distribution ? Would you be OK for this ? Best regards, -- Yann Dirson <yd...@al...> | Why make M$-Bill richer & richer ? Debian-related: <di...@de...> | Support Debian GNU/Linux: Pro: <yan...@fr...> | Freedom, Power, Stability, Gratuity http://ydirson.free.fr/ | Check <http://www.debian.org/> |
From: Jean-Sebastien M. <js_...@us...> - 2004-03-29 16:19:54
|
Raphael Yokoingawa de Camargo <rca...@im...> writes: > Hi, > > I am new openc++ user and I'm using it in my doctoral research. I'm encountering > some difficulties. > > 1) Is there a way for me to access the entire program PTree instead of only the > PTree relative to classes. I need this functionality because I will also use > openc++ to manipulate C code (that don't have classes) and I need to know about > all the function definitions in the code. have a look in the documentation appendix. > > 2) Is there a way to only include some selected source files in the AST tree? > The generated source trees are to big because they include all the system header > files. It also makes much more difficult for me to analize the code, since I don > know wich code is from the applications. To do this, I use a special include directive for everything I don't want openc++ to parse. The technic is rather gory and I'd like to know if there is a nicer way to do it. for example, in your occ file just do: #include <common.hh> // and then include("iostream") the common.hh contains something like: metaclass Tools internal_Tools; struct internal_Tools {}; # define include(FILE) void internal_Tools::include() { FILE; } then in your openc++ compiler: struct Tools : public Class { static bool Initialize(); void TranslateMemberFunction(Environment* env, Member& m); void TranslateClass(Environment* env); }; bool Tools::Initialize() { return Class::Initialize(); } void Tools::TranslateClass(Environment* env) { RemoveClass(); return Class::TranslateClass(env); } void Tools::TranslateMemberFunction(Environment* env, Member& m) { if (Ptree::Match(m.Name(),"include")) { //FIXME: delete the member instead of commenting out InsertBeforeToplevel(env,Ptree::Make("/*")); AppendAfterToplevel(env,Ptree::Make("*/")); for(PtreeIter i = m.FunctionBody()->Rest()->First(); !i.Empty(); i++) AppendAfterToplevel(env,Ptree::Make("\n#include %p",(*i)->First())); } } Hope this helps -- js |
From: Maarten de B. <md...@iu...> - 2004-03-29 16:17:16
|
Hello, I am looking for an application that can parse c++, store it in a AST, and regenerate the original c++ code. Obviously, the interesting part would be to apply some modification to the AST before regenerating. For example, I want to remove all constructors that match a certain pattern (first argument is of type Foo), from classes that are derived from class Bar. Or, another example, I have a header and source file for each class, and for each header, I want to move all included headers to the corresponding source file, and use forward declarations instead, if the classes from the headers included are only used by reference. Someone pointed me to OpenC++, and at a first glance, it seems to contain the code to do just the thing, though it is not clear to me if it would actually be able to regenerate the code... Could you please help me out? Would OpenC++ indeed be suitable for such a task, is there some example code available that I could work upon, or maybe you can suggest some other project that would be (more) suitable? Kind regards, Maarten |
From: Raphael Y. de C. <rca...@im...> - 2004-03-29 15:11:20
|
Hi, I am new openc++ user and I'm using it in my doctoral research. I'm encountering some difficulties. 1) Is there a way for me to access the entire program PTree instead of only the PTree relative to classes. I need this functionality because I will also use openc++ to manipulate C code (that don't have classes) and I need to know about all the function definitions in the code. 2) Is there a way to only include some selected source files in the AST tree? The generated source trees are to big because they include all the system header files. It also makes much more difficult for me to analize the code, since I don know wich code is from the applications. Maybe some of these question was already responded in the list, but since its archives are not working I don't have access to them. Any help will be appreciated. thanks, Raphael. Raphael Yokoingawa de Camargo <rca...@im...> |