static GList *class_nodes = NULL;
Node *class = NULL;
-char *chunk_size = NULL;
+static char *chunk_size = NULL;
+static char *bonobo_x_class = NULL;
static GList *typestack = NULL;
static GList *funcargs = NULL;
static GList *checks = NULL;
static int has_self = FALSE;
static int vararg = FALSE;
+static Method *last_added_method = NULL;
/* destructor and initializer for variables */
static char *destructor = NULL;
node = new_method(scope, method, type, oid, gtktypes, flags,
id, funcargs, onerror, defreturn, c_cbuf, line_no,
- ccode_line, vararg, method_unique_id++);
+ ccode_line, vararg, method_unique_id++,
+ FALSE);
+
+ last_added_method = (Method *)node;
if(cbuf)
g_string_free(cbuf,
}
;
-classdec: CLASS TYPETOKEN FROM TYPETOKEN chunk {
- class = new_class($<id>2,$<id>4,chunk_size,NULL);
+classdec: CLASS TYPETOKEN FROM TYPETOKEN classflags {
+ class = new_class ($<id>2, $<id>4,
+ bonobo_x_class, chunk_size, NULL);
}
;
-chunk:
- | '(' TOKEN TOKEN ')' {
+classflags:
+ | '(' TOKEN TOKEN ')' classflags {
if(strcmp($<id>2,"chunks") == 0) {
- chunk_size = g_strdup($<id>4);
+ g_free (chunk_size);
+ chunk_size = g_strdup($<id>3);
+ } else if(strcmp($<id>2,"BonoboX") == 0) {
+ g_free (bonobo_x_class);
+ bonobo_x_class = g_strdup($<id>3);
} else {
yyerror(_("parse error"));
YYERROR;
}
}
- | '(' TOKEN NUMBER ')' {
+ | '(' TOKEN NUMBER ')' classflags {
if(strcmp($<id>2,"chunks") == 0) {
- if(atoi($<id>4) != 0)
- chunk_size = g_strdup($<id>4);
+ g_free (chunk_size);
+ if(atoi($<id>3) != 0)
+ chunk_size = g_strdup($<id>3);
+ else
+ chunk_size = NULL;
} else {
yyerror(_("parse error"));
YYERROR;
;
thing: method { ; }
+ | TOKEN method {
+ if (strcmp ($<id>1, "BonoboX") != 0) {
+ g_free($<id>1);
+ yyerror(_("parse error"));
+ YYERROR;
+ }
+ last_added_method->bonobo_x_func = TRUE;
+ }
| variable { ; }
| argument { ; }
| ';' { ; }
root, $<id>4);
} else if(strcmp($<id>5, "objectlink")==0) {
set = g_strdup_printf(
- "if(%s->%s) "
- "gtk_object_unref(GTK_OBJECT(%s->%s)); "
- "%s->%s = ARG; "
- "if(%s->%s) "
- "gtk_object_ref(GTK_OBJECT(%s->%s));",
- root, $<id>4,
- root, $<id>4,
+ "if (ARG != NULL) "
+ "gtk_object_ref (GTK_OBJECT (ARG)); "
+ "if (%s->%s != NULL) "
+ "gtk_object_unref (GTK_OBJECT (%s->%s)); "
+ "%s->%s = ARG;",
root, $<id>4,
root, $<id>4,
root, $<id>4);