Re: Synopsis - tutorials
Stefan Seefeld <[email protected]> Thu, 26 Apr 2007 16:46:09 -0400
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
Roman Yakovenko wrote:
> Thanks. I built the documentation and I am reading it now. One more
> question what tree I need to travel, in order to extract all
> declarations: ast or parse tree?
That's a good question, and answering it requires more context.
My goal is to make the parse tree (as well as related representations,
such as a symbol table, type repository, etc.) ready to become a public
API. However, I'm not there yet, i.e. it still keeps evolving.
The parse tree is translated into an 'AST' (a pure python representation),
which is stable and used in different contexts. Thus, you may look at
that first. However, depending on your needs you may find that it doesn't
provide enough informmation for your purpose (code generation). In that
case, we either need to fill the holes by adding more attributes to the AST,
or try to get the parse tree into a state which is usable by you (and
others).
I do have some (experimental) code to expose the parse tree (etc.) to
python using boost.python, and so I very much welcome any additional
motivation to move further in that direction.
Any help would be highly appreciated.
Regards,
Stefan
--
...ich hab' noch einen Koffer in Berlin...