X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/f31590988781d77ff5249987801d03a986368ca2..6d0fe9d5f8c513045bf064ea256c822beac19037:/src/parse.y diff --git a/src/parse.y b/src/parse.y index b5d9f10..4cdb6a0 100644 --- a/src/parse.y +++ b/src/parse.y @@ -223,6 +223,11 @@ class: classdec '{' classcode '}' { class_nodes = NULL; nodes = g_list_append(nodes,class); } + | classdec '{' '}' { + ((Class *)class)->nodes = NULL; + class_nodes = NULL; + nodes = g_list_append(nodes,class); + } ; classdec: CLASS TYPETOKEN FROM TYPETOKEN { @@ -410,6 +415,10 @@ stars: '*' stars { stars++; } | '*' { stars++; } ; +optpublic: { ; } + | PUBLIC { ; } + ; + fullsigtype: PRIVATE TOKEN sigtype { if(strcmp($2,"first")==0) $$ = PRIVATE_SIGNAL_FIRST_METHOD; @@ -437,7 +446,31 @@ fullsigtype: PRIVATE TOKEN sigtype { | PRIVATE sigtype { $$ = PRIVATE_SIGNAL_LAST_METHOD; } - | TOKEN sigtype { + | TOKEN sigtype { + if(strcmp($1,"first")==0) + $$ = SIGNAL_FIRST_METHOD; + else if(strcmp($1,"last")==0) + $$ = SIGNAL_LAST_METHOD; + else { + yyerror(_("signal must be 'first' or 'last'")); + g_free($1); + YYERROR; + } + g_free($1); + } + | PUBLIC TOKEN sigtype { + if(strcmp($2,"first")==0) + $$ = SIGNAL_FIRST_METHOD; + else if(strcmp($2,"last")==0) + $$ = SIGNAL_LAST_METHOD; + else { + yyerror(_("signal must be 'first' or 'last'")); + g_free($2); + YYERROR; + } + g_free($2); + } + | TOKEN PUBLIC sigtype { if(strcmp($1,"first")==0) $$ = SIGNAL_FIRST_METHOD; else if(strcmp($1,"last")==0) @@ -449,6 +482,9 @@ fullsigtype: PRIVATE TOKEN sigtype { } g_free($1); } + | PUBLIC sigtype { + $$ = SIGNAL_LAST_METHOD; + } | sigtype { $$ = SIGNAL_LAST_METHOD; } @@ -492,14 +528,14 @@ method: SIGNAL fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { $8, $9,$1, ccode_line,vararg); } - | VIRTUAL type TOKEN '(' funcargs ')' onerror codenocode { + | VIRTUAL optpublic type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { yyerror(_("virtual method without 'self' as " "first parameter")); YYERROR; } - push_function(VIRTUAL_METHOD, NULL, $3, - $7, $8,$1, + push_function(VIRTUAL_METHOD, NULL, $4, + $8, $9,$1, ccode_line,vararg); } | OVERRIDE '(' TYPETOKEN ')' type TOKEN '(' funcargs ')' onerror '{' CCODE {