The inpattern supplied for the main Class can include named sub-patterns. The format in the .cdb requires two CDB entries, one with just the name, and one with the name, plus 'names':
|
|
The number of tokens in the sub-pattern must match the number of names supplied for it.
On ingestion via the CDB processing, when a <somekey> token is seen in the main inpattern, the <somekey> in the main pattern will be directly replaced by the somekey sub-pattern. The list of innames for the inpattern should contain a token, which will be inserted into the sub-pattern names as a mark. Given
|
|
The end result is the same, as for following pattern being processed:
|
|
The use case for this is the ability to use sub-patterns that pop up often (key name/group/spec for example), and also the ability to +duplicate+ sub-patterns in the same main pattern:
|
|