+
+/* this never sets the_scope */
+simplesigtype: TOKEN sigtype {
+ if(strcmp($<id>1,"first")==0)
+ $<sigtype>$ = SIGNAL_FIRST_METHOD;
+ else if(strcmp($<id>1,"last")==0)
+ $<sigtype>$ = SIGNAL_LAST_METHOD;
+ else {
+ yyerror(_("signal must be 'first' or 'last'"));
+ g_free($<id>1);
+ YYERROR;
+ }
+ g_free($<id>1);
+ }
+ | sigtype {
+ $<sigtype>$ = SIGNAL_LAST_METHOD;
+ }
+ ;
+
+/* this always sets the_scope */
+fullsigtype: scope TOKEN sigtype {
+ 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);
+ YYERROR;
+ }
+ g_free($<id>2);
+ }
+ | TOKEN scope sigtype {
+ if(strcmp($<id>1,"first")==0)
+ $<sigtype>$ = SIGNAL_FIRST_METHOD;
+ else if(strcmp($<id>1,"last")==0)
+ $<sigtype>$ = SIGNAL_LAST_METHOD;
+ else {
+ yyerror(_("signal must be 'first' or 'last'"));
+ g_free($<id>1);
+ YYERROR;
+ }
+ g_free($<id>1);
+ }
+ | scope sigtype {
+ $<sigtype>$ = SIGNAL_LAST_METHOD;
+ }
+ | simplesigtype {
+ /* the_scope was default thus public */
+ the_scope = PUBLIC_SCOPE;
+ }
+ ;