From: Grzegorz J. <ja...@he...> - 2003-04-23 13:26:09
|
On Mon, 14 Apr 2003, James Michael DuPont wrote: > > --- Stefan Reuther <sr...@ma...> wrote: > > Hi *.*, > > > > On Wed, Mar 19, 2003 at 01:38:26PM +0800, Grzegorz Jakacki wrote: > > > On Tue, 18 Mar 2003, Stefan Reuther wrote: > > > > I don't think it can be done much different. Ptree and Walker > > > > have to "know each other". > > > > > > I believe that it is possible to introduce a layer in between, > > > which would encapsualte the actual implementation of Ptree. > > > > Another possibility would be to put that knowledge into the > > Walker interface. Here, we have such a thing for > > PtreeDeclaration. Depending upon whether a PtreeDeclaration is a > > class declaration ("class foo;"), a name declaration ("int x;") > > or a function implementation ("void x() { }"), it nicely > > dissects the tree node and calls different functions. "Class" > > and "ClassWalker" already seem to do some other parts of this. > > > The walker has only one problem. > It does not only walk, but also has to interpret things. > It has to know how to extract the data out of the parser > > How do you propose to hide the details of the parser from the walker? I think it is possible by usage of user defined handles instead of pointers. Pointers reveal actual implementation types used in syntax tree. User-defined handles do not have to. Best regards Grzegorz > > mike > > ===== > James Michael DuPont > http://introspector.sourceforge.net/ > > __________________________________________________ > Do you Yahoo!? > Yahoo! Tax Center - File online, calculators, forms, and more > http://tax.yahoo.com > > ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |