This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

accessing GCC's ast information


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]