+/* ------------ classes and interfaces (body, functions) ------- */
+
+// non-vararg version
+MAYBE_PARAM_LIST: {
+ memset(&$$,0,sizeof($$));
+}
+MAYBE_PARAM_LIST: PARAM_LIST {
+ $$=$1;
+}
+
+// vararg version
+MAYBE_PARAM_LIST: "..." PARAM {
+ memset(&$$,0,sizeof($$));
+ $$.varargs=1;
+ list_append($$.list, $2);
+}
+MAYBE_PARAM_LIST: PARAM_LIST ',' "..." PARAM {
+ $$ =$1;
+ $$.varargs=1;
+ list_append($$.list, $4);
+}
+
+// non empty
+PARAM_LIST: PARAM_LIST ',' PARAM {
+ $$ = $1;
+ list_append($$.list, $3);
+}
+PARAM_LIST: PARAM {
+ memset(&$$,0,sizeof($$));
+ list_append($$.list, $1);
+}
+PARAM: T_IDENTIFIER ':' TYPE {
+ $$ = malloc(sizeof(param_t));
+ $$->name=$1->text;$$->type = $3;
+}
+PARAM: T_IDENTIFIER {
+ $$ = malloc(sizeof(param_t));
+ $$->name=$1->text;$$->type = TYPE_ANY;
+}
+