    /*
        parameters are defined as local variables of the current function,
        while counting the number of parameters. 
        At the end of a function definition head its symtab nParams fields
        holds the number of its parameters, which are represented by the
        initial nParams elements of symtab's local variables array.
    */

_partype:
    typeOfVar enterID
;

_pars:
    _pars comma _partype
|
    _partype
;

_opt_parlist:
    _pars
|
    /* empty */
;

_funvars:
    openParen _opt_parlist ')' openBrace
    {
        symtab_setFunParams(); /* the # variables so far are the parameters */
    }
;

_funid:
    IDENTIFIER
    {
        p_beginFunction();
    }
;

functionDef:
    _funid                          /* name of the function */
    _funvars                         /* returns init code */
    statements
    closeBrace
    {
        p_endFunction(&$3);
    }
;
