This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
accessing GCC's ast information
- To: gcc at gcc dot gnu dot org
- Subject: accessing GCC's ast information
- From: Dan Gohman <gohmandj at mrs dot umn dot edu>
- Date: Sun, 7 Oct 2001 17:51:01 -0500
I'm working on a program to do source analysis and would like to be able to
use GCC to parse the source code.
The output from -fdump-translation-unit provides most of the information I
want, however the formating isn't quite suitable for parsing. Things like
string literals (string_cst) are printed without escaping, so there's no
way to know where the string ends.
I'm thinking about making a modified version that does simple escaping of
strings, however I'm not sure this is the best way to proceded.
Is parsing the .tu file (and/or the .class file from -fdump-class-hierarchy)
a good idea, or should I be looking at some other way of accessing this
information?
Dan
--
Dan Gohman
gohmandj@mrs.umn.edu