-method: SIGNAL LAST sigtype type TOKEN '(' funcargs ')' onerror '{' CCODE {
- if(!has_this) {
- yyerror(_("signal without 'this' as "
- "first parameter"));
- YYERROR;
- }
- push_function(SIGNAL_LAST_METHOD,NULL,
- $<id>5, $<id>9, $<cbuf>11,$<line>1);
- }
- | SIGNAL LAST sigtype type TOKEN '(' funcargs ')' onerror ';' {
- if(!has_this) {
- yyerror(_("signal without 'this' as "
- "first parameter"));
- YYERROR;
- }
- push_function(SIGNAL_LAST_METHOD, NULL,
- $<id>5, $<id>9, NULL,$<line>1);
- }
- | SIGNAL FIRST sigtype type TOKEN '(' funcargs ')' onerror '{' CCODE {
- if(!has_this) {
- yyerror(_("signal without 'this' as "
- "first parameter"));
+method: SIGNAL TOKEN sigtype type TOKEN '(' funcargs ')' onerror codenocode {
+ int sigtype = SIGNAL_LAST_METHOD;
+ if(strcmp($<id>2,"first")==0)
+ sigtype = SIGNAL_FIRST_METHOD;
+ else if(strcmp($<id>2,"last")==0)
+ sigtype = SIGNAL_LAST_METHOD;
+ else {
+ yyerror(_("signal must be 'first' or 'last'"));
+ g_free($<id>2);