[Synopsis-devel] Re: Synopsis roadmap
Stefan Seefeld stefan at fresco.orgSat Jan 21 03:48:25 UTC 2006
- Previous message: [Synopsis-devel] Re: Synopsis roadmap
- Next message: [Synopsis-devel] AST access to const modifier
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
David Abrahams wrote: > Stefan Seefeld <stefan at fresco.org> writes: > > >>What do you expect to do with the AST ? Given that you could also >>access the PTree directly (both, in C++ as well as Python), would >>you rather operate on that ? > > > I'm not clear enough on the distinction between PTree and AST in > Synopsis to answer. These terms are somewhat fluid in the world at > large. Fair enough. In the context of synopsis I use 'parse tree' to denote a data structure holding nodes that directly point into the source code, i.e. all syntactic elements have their direct mapping to terminal 'Atom' objects, while non-terminals are 'List' objects. There is thus a direct mapping between the parse tree data structure and the grammar. In conjunction with the source-code representing 'Buffer' object the parse tree can be traversed, and manipulated (modified, annotated, etc.), and then be rewritten to a file, meaning that the process is non-lossy (even the formatting is preserved !). On the other hand, the AST that synopsis may construct (as a python data structure, as it stands), has quite little relationship to actual syntax. Instead, it links various declarations to each other via type nodes, which prompted me to suggest to replace the (IMO) misleading term 'Abstract Syntax Tree' by 'Abstract Semantic Graph', as that term is used in a similar context by other tools (see for example http://swag.uwaterloo.ca/~dean/cppx/gccasgnotsource.html), and seems to be at least a little closer to synopsis' current data structure than 'AST'. Regards, Stefan
- Previous message: [Synopsis-devel] Re: Synopsis roadmap
- Next message: [Synopsis-devel] AST access to const modifier
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-devel mailing list