[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] tolua++ 1.0.6 and lua_qt4 0.0.2a
- From: Lisa Parratt <lisa@...>
- Date: Thu, 08 Sep 2005 17:16:38 +0100
Antero Vipunen wrote:
Ahm. I don't think so. At least my old 3.2.3 gcc doesn't do that. But
thank you for the idea.
It doesn't contain the code as source - it contains it as a decorated
abstract syntax tree, as produced by the parser.
If you walk this tree you will find first definition nodes, which define
things. These are chained together using the "chan" key value pair.
There are various types of node:
identifier_node, string_cst, integer_cst and const_decl all define
constants of one sort or another. Their key/value pairs will describe
the constant, i.e. it's name, what the constant is, what type it is (if
type_decl, void_type, integer_type, real_type, boolean_type,
enumeral_type, pointer_type, reference_type, array_type, record_type,
union_type, function_type and method_type define types. Their key/value
pairs will indicate their name, size, width, alignment, what type they
point/refer/are an array of, a link to a tree_list of their member types
and positions, &c.
var_decl defines a variable, primarily it's name and type.
namespace_decl defines a namespace.
A function_decl node may have a function body attached. This will be
full of nodes with names ending in _expr. For the purposes of generating
glue code, this is unneccessary. As such, you'll want to throw them away
to save memory.
http://www.delorie.com/gnu/docs/gcc/gccint_31.html may help - it's a
guide to the nodes from the inside, where they're macros, rather than
from the outside, where they're entries in a file.