Pattern Definition

This document describes data generation engine compatible patterns.
The engine uses one pattern to generate set (or family) of values with same properties.

Any pattern is a string, i.e. a sequence of items and constant elements (letters, digits, signs, etc) without delimiters. The data generation engine copies constant elements to output without processing.

Formal Definition (BNF)

<pattern> ::= [<items>]
<items> ::= <item>[<items>]
<item> ::= <constant>|<symbol>|<block>|<block-reference>|<optional>|<column-reference>|<list>|<function-call>|<expression>
<constant> ::= <immediate-constant>|<escaped-constant>
<escaped-constant> ::= \<immediate-constant>
<immediate-constant> ::= <any-printable-character>
<symbol> ::= <single-symbol>[<repeater>]
<single-symbol> ::= a|A|N|X
<repeater> ::= {<positive-number>}|{=<positive-number>}|{<number>:<positive-number>}
<block> ::= (<pattern>)
<block-reference> ::= #
<optional> ::= [<pattern>]
<column-reference> ::= @<number>|@@<number>|@'<name>'|@@'<name>'
<list> ::= '<'<list-items>'>'
<list-items> = <pattern>[|<list-items>]
<function-call> ::= $<name>(<parameters>)
<parameters> ::= <empty-string>|<pattern>[,<parameters>]
<expression> ::= $$(<term>) 
<term> ::= (<term>)|-<term>|<number>|<date>|<time>|<string>|<function-call>|<term><add-op><term>|<term><mul-op><term>|<term><cmp-op><term>|<term><log-op><term>
<add-op> ::= +|-
<mul-op> ::= *|/
<cmp-op> ::= '>'|'<'|=|!=|>=|<=
<log-op> ::= &|AND|OR|'|'