[This is preliminary documentation and is subject to change.]
Creates the productions and Elements
necessary for an optional section of a production.
Parameters
- optionalElements (array<Object>[]()[][])
- The elements to be optionally included in a production. These can be any of the types of object that you can supply to the Add method - Element, Production, string or an array containing any of these.
Return Value
A non terminal Element referencing the LHS of the productions
created. You add this to the RHS of a production where you want the
optional elements.
Remarks
This method allows you to have the supplied elements to be either
included or not in a production. It can be any production in the parser
that this production belongs to, but is usually used to create an optional
section in this production. If you have a grammar with a production such
as LHS = .. [ E1 E2 .. En ] .. then calling this method with
elements E1 to En will create the necessary productions to achieve this.