Hi, I am working on a project that would collect AST info and use it 'offline'. I wonder if it is possible to use some parts of gcc as a dynamic library, to parse the tree nodes and gimple statements. For example, I have this naive function to get a field offset: static unsigned long get_field_offset(tree field) { unsigned long ret = 0; if (DECL_FIELD_OFFSET(field)) { ret += TREE_INT_CST_LOW(DECL_FIELD_OFFSET(field)) * 8; } if (DECL_FIELD_BIT_OFFSET(field)) { ret += TREE_INT_CST_LOW(DECL_FIELD_BIT_OFFSET(field)); } return ret; } It may work well for some cases, I doubt that it can handle all cases. If I can use part of gcc as a dynamic library, it would be quite easy to parse these tree nodes and gimple statements by using the internal functions. Thanks.