1.- The functionname (parameter,parameter...) where the (parameter,parameter...) part is optional and the number of parameters are optional
This kind of function is, lexically, an identifier and it's parsed OK.
2.- The functionname parameter parameter,parameter,... as in the following code from page 123:
Do
Cls : Wind Open Rnd(99)+1,1,1,25,5,1
Print "Window number ";Windon : Wait Key
Loop
Where "Wind Open Rnd(99)+1,1,1,25,5,1" is a function of this kind. with two identifiers, and,as the function "locate ,number" also is valid, the parameter list can have empty parameters.
I have thought that a grammar for this kind of functions could be
FUNCTION := IDENTIFIER {IDENTIFIER} {EXPRESSION {','{EXPRESSION}}*}
But, should the first parameter (the Open on the example) be treated as an expression?
Could there be more parameters before the parameter list?
I would point out that the two "function types" you show above are actually different in a very fundamental way, namely #1 returns a value and #2 does not return a value.
#1 is what would be considered a function in normal BASIC syntax. Functions are expressions. In your Wind Open example you see the function Rnd(99)--it returns a random integer value between 0 and 99. In a grammar functions would fall under expressions:
expression := {INTEGER} | {FUNCTION}
integer := [0-9]*
function := "Rnd" '(' expression ')'
#2 is not a function because it does not return a value. This means that it cannot be used in an expression. You could categorize it as a procedure or subroutine, but those are usually user defined. Language defined procedures are usually called commands. In the grammar commands are typically statements:
statement := {COMMAND} | {ASSIGNMENT} | {COMMENT}
command := "Wind Open" {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION}
In regard to Mia's comment about some commands that use a "To" token, that could look something like:
command := wind_open_command | line_command
wind_open_command := "Wind Open" {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION} ',' {EXPRESSION}
line_command := "Line" {EXPRESSION} ',' {EXPRESSION} "To" {EXPRESSION} ',' {EXPRESSION}
I've spent my share of time writing a grammar for AMOS BASIC (unfortunately for a project that never was completed) so I understand the desire to make very general grammar rules, but I've found that if the rules are too general, then the parser will spend more time later trying to match specific constructs using string compare instructions (read very slow) or other methods to disambiguate the grammar. It is often easier (and faster) to let the grammar do the disambiguation, although it does create larger grammars.
Good luck on your project!