<groupcomp>

The <groupcomp> element groups a set of pieces of syntax as a single unit.

Each syntax group is a logical set of pieces of syntax that go together. The group composite means that the items that make up the syntax diagram will be rendered close together rather than being separated by a horizontal or vertical line, which is the usual formatting method.

The <groupcomp> element is specialized from <figgroup>. It is defined in the syntax-diagram domain module, which is a specialization of the programming domain module.

<title>?, <repsep>?, (<delim> | <fragref> | <groupchoice> | <groupcomp> | <groupseq> | <kwd> | <oper> | <sep> | <synnote> | <synnoteref> | <var>)*

Contained by

<fragment>, <groupchoice>, <groupcomp>, <groupseq>, <synblk>, <syntaxdiagram>

Contained by

+ topic/figgroup pr-d/figgroup syntaxdiagram-d/groupcomp

The <groupcomp> element is specialized from <figgroup>. It is defined in the syntaxdiagram-domain module.

The following attributes are available on this element: universal attributes.

For this element, the @importance attribute indicates whether this item in a syntax diagram is optional, required, or used by default. The attribute value is limited to optional, required, default, or -dita-use-conref-target.

The following attributes are available on this element: universal attributes and the attributes defined below.

@importance
For this element, the @importance attribute indicates whether this item in a syntax diagram is optional, required, or used by default. The attribute value is limited to optional, required, default, or -dita-use-conref-target.

Example

This section is non-normative.

The following code sample shows how the <groupcomp> element can be used to indicate how pieces of syntax are grouped together. Two composite groups represent two alternate ways to specify an input file to a command line program, using either -i:program-name.py or --input=program-name.ph.

<syntaxdiagram>
  <title>Syntax for runprogram command</title>
  <groupseq>
    <kwd>runprogram</kwd>
    <groupchoice>
      <groupcomp><oper>-</oper><kwd>i</kwd><sep>:</sep><var>program-name.py</var></groupcomp>
      <groupcomp><oper>--</oper><kwd>input</kwd><sep>=</sep><var>program-name.py</var></groupcomp>
    </groupchoice>
  </groupseq>
</syntaxdiagram>