[gircompiler] Clean up parsing

We never actually include multiple modules in the compiler,
so just nuke that.  Also rather than passing around GIrModule
consistently pass around a GIrTypelibBuild structure which
has various things.

This lets us maintain a stack there which we can walk for
better error messages.

Also, fix up the node lookup in giroffsets.c; previously
it didn't really handle includes correctly.  We really need to
switch to always using Foo.Bar (i.e. GIName) names internally...
This commit is contained in:
Colin Walters
2010-07-26 16:26:46 -04:00
parent 9b1bb64e83
commit 62f1b65cc8
7 changed files with 243 additions and 216 deletions

View File

@@ -25,6 +25,8 @@
G_BEGIN_DECLS
#include "girmodule.h"
typedef struct _GIrParser GIrParser;
GIrParser *g_ir_parser_new (void);
@@ -32,15 +34,15 @@ void g_ir_parser_free (GIrParser *parser);
void g_ir_parser_set_includes (GIrParser *parser,
const gchar *const *includes);
GList *g_ir_parser_parse_string (GIrParser *parser,
const gchar *namespace,
const gchar *filename,
const gchar *buffer,
gssize length,
GError **error);
GList *g_ir_parser_parse_file (GIrParser *parser,
const gchar *filename,
GError **error);
GIrModule *g_ir_parser_parse_string (GIrParser *parser,
const gchar *namespace,
const gchar *filename,
const gchar *buffer,
gssize length,
GError **error);
GIrModule *g_ir_parser_parse_file (GIrParser *parser,
const gchar *filename,
GError **error);
G_END_DECLS