This is the mail archive of the 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]
Other format: [Raw text]

The AST tree modification. Edited.

Hi everybody!
It is necessary to implement a plug-in for GCC designed to collect the
information on types of translation unit, and generate static const
array of types rtti_ex _ on its base;
enum class type_ {
   char_, uchar_, short_, ushort_, int_, uint_, long_, ulong_,
   int64_, uint64_, array_, pointer_, double_, long_double_, float_,

struct rtti_ex_ { // <<<<<<<<<<<<<<<<<<<<<<<<<
   const char* name;
   const type_ type;
   const size_t size;
   const size_t align;
   const size_t offset;

// generated from plugin.
static const rtti_ex_ rtti_ex_array_[] = {

There aren't any problems with information collection from AST. There
is a complexity with AST modification:
1. How to declare a variable?
2. How to declare the typedef?
3. How to declare a structure?
4. How to declare an array of structures?
I suppose that there should be a function like: tree make_subtree
(const char* source); which result I could insert in the corresponding
node. But I haven't found it.

Please, give me some links on this subject. It is very desirable, if
you could give some links with examples.


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