Re: [Synopsis-changes] r1489 - SymbolLookup::Walker::visit(( PTree::Declaration *)

[email protected] (Gilles J. Seguin)
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
On Sat, 2005-05-07 at 20:41, [email protected] wrote:

that is not obvious right away, why this thing disappear ?
the thing is SymbolLookup::Walker::visit( PTree::Declaration *)
in Modified: trunk/src/Synopsis/SymbolLookup/Walker.cc

my understanding is that the current scope has surely declaration.
what i am missing.


what is the difference between Visitor and Walker ?
subclassing Visitor is no fun.
 (means the mechanism obliges the use of double pointers)

keep the answer short, just want to know if i am lost here.

> Author: stefan
> Date: 2005-05-08 00:41:25 +0000 (Sun, 08 May 2005)
> New Revision: 1489
[...]
> Log:
> * Add FunctionDefinition type.
> * Add Declaration::initializer().
> * Fix more regressions from last checkins.
> 
> 
[...]
> Modified: trunk/src/Synopsis/PTree/Visitor.cc
> ===================================================================
> --- trunk/src/Synopsis/PTree/Visitor.cc	2005-05-07 00:08:54 UTC (rev 1488)
> +++ trunk/src/Synopsis/PTree/Visitor.cc	2005-05-08 00:41:25 UTC (rev 1489)
> @@ -56,6 +56,7 @@
>  void Visitor::visit(NamespaceAlias *l) { visit(static_cast<List *>(l));}
>  void Visitor::visit(UsingDirective *l) { visit(static_cast<List *>(l));}
>  void Visitor::visit(Declaration *l) { visit(static_cast<List *>(l));}
> +void Visitor::visit(FunctionDefinition *l) { visit(static_cast<Declaration *>(l));}
>  void Visitor::visit(ParameterDeclaration *l) { visit(static_cast<List *>(l));}
>  void Visitor::visit(UsingDeclaration *l) { visit(static_cast<List *>(l));}
>  void Visitor::visit(Declarator *l) { visit(static_cast<List *>(l));}
> 
> Modified: trunk/src/Synopsis/PTree/Visitor.hh
> ===================================================================
> --- trunk/src/Synopsis/PTree/Visitor.hh	2005-05-07 00:08:54 UTC (rev 1488)
> +++ trunk/src/Synopsis/PTree/Visitor.hh	2005-05-08 00:41:25 UTC (rev 1489)
> @@ -60,6 +60,7 @@
>    class NamespaceAlias;
>    class UsingDirective;
>    class Declaration;
> +  class FunctionDefinition;
>    class ParameterDeclaration;
>    class UsingDeclaration;
>    class Declarator;
> @@ -174,13 +175,14 @@
>    //.  [ [modifiers] name [declarators] ; ]
>    //. Function prototype:
>    //.  [ [modifiers] name [declarators] ; ]
> -  //. Function impl:
> -  //.  [ [modifiers] name declarator [ { ... } ] ]
>    //. Typedef:
>    //.  ?
>    //. Class definition:
>    //.  [ [modifiers] [class foo ...] [declarators]? ; ]
>    virtual void visit(Declaration *);
> +  //. Function definition:
> +  //.  [ [modifiers] name declarator [ { ... } ] ]
> +  virtual void visit(FunctionDefinition *);
>    //. [ decl-specifier-seq ]
>    //. [ decl-specifier-seq declarator ]
>    //. [ decl-specifier-seq declarator = assignment-expression ]
> 

[...]

> Modified: trunk/src/Synopsis/SymbolLookup/Walker.cc
> ===================================================================
> --- trunk/src/Synopsis/SymbolLookup/Walker.cc	2005-05-07 00:08:54 UTC (rev 1488)
> +++ trunk/src/Synopsis/SymbolLookup/Walker.cc	2005-05-08 00:41:25 UTC (rev 1489)
> @@ -7,18 +7,21 @@
[...]
> -void Walker::visit(PTree::Declaration *decl)
> +void Walker::visit(PTree::FunctionDefinition *def)
>  {
[...]
>  } 
[...]
> Modified: trunk/src/Synopsis/SymbolLookup/Walker.hh
> ===================================================================
> --- trunk/src/Synopsis/SymbolLookup/Walker.hh	2005-05-07 00:08:54 UTC (rev 1488)
> +++ trunk/src/Synopsis/SymbolLookup/Walker.hh	2005-05-08 00:41:25 UTC (rev 1489)
> @@ -28,7 +28,7 @@
>    virtual void visit(PTree::List *);
>    virtual void visit(PTree::Block *);
>    virtual void visit(PTree::NamespaceSpec *);
> -  virtual void visit(PTree::Declaration *);
> +  virtual void visit(PTree::FunctionDefinition *);
>    virtual void visit(PTree::ClassSpec *);
>    virtual void visit(PTree::DotMemberExpr *);
>    virtual void visit(PTree::ArrowMemberExpr *);
[...]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.