[This is preliminary documentation and is subject to change.]
Creates the productions and Elements
necessary for a choice (alternatives) section of a production.
Parameters
- choices (array<Object>[]()[][])
- a number of alternative sets of elements. Each set can be a single object in which case there is a single element in that alternative, or an array, in which case all the elements in the array are included in that alternative. The items in both cases can be any of the types of object you can supply to the Add method - Element, Production or string.
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 choice
of alternative elements.
Remarks
This method allows you to have exactly one of several supplied
sets of elements to be included in a production. This can be for any
production in the parser that this production belongs to, but is usually
used to create a choice section in this production. If you have a grammar
with a production such as LHS = .. ( E1 .. | E2 .. | .. .. | En .. ) ..
then calling this method with sets of elements E1 .. to En .. will
create the necessary productions to achieve this.