Repetition and Delimiters
Repetition and punctuation look deceptively simple in Intuitive DSL, but they carry strict semantics. The engine deliberately fixes the repetition model so grammars stay predictable and testable.
The only repetition operator is
.... A standalone.is never repetition. It is only a literal delimiter.
The repetition contract
The suffix ... applies to the node immediately before it. That node may be a parameter, a keyword phrase, a macro, a delimiter, a required group, or an optional group.
parameter ...means one or more parameter matches.keyword ...means one or more occurrences of the keyword phrase.macro ...means one or more macro matches.required_group ...means one or more successful group matches.optional_group ...behaves effectively as zero or more, because the repeated unit may already match as absent.
Literal dots and other punctuation
The dot character keeps its ordinary role as literal punctuation whenever it appears by itself. This is important for dates, version strings, segmented identifiers, and domain-specific punctuation.
SET DATE day . month . year ;
SET VERSION major . minor . patch ;
Because the lexer recognizes ... before ., the ellipsis is tokenized as one delimiter token, while a standalone dot remains a separate literal delimiter token.
Runtime matching behavior
Repetition is not blindly greedy. The parser must preserve the rest of the grammar. It therefore prefers the smallest number of repetitions that still lets the remaining siblings match successfully.
GRANT ACCESS TO target_user ... ON system_name ;
If the input is GRANT ACCESS TO alice bob ON payroll ;, the repeated parameter must stop before ON so the outer continuation can still match.
Repeatable node
↓
Try 1 occurrence
↓
Can the remaining grammar still match?
↓
Yes → keep it
No → backtrack and adjust
Canonical examples
GRANT ACCESS TO target_user ... ;
BLOCK TRAFFIC FROM { IP ip_address | SUBNET subnet_mask } ... ;
GENERATE REPORT [ WITH metric_name ] ... ;
SET DATE day . month . year ;
Frequent mistakes
- Using
.as if it were a shorthand repetition marker. - Writing
...without a preceding node. - Assuming repetition expresses arbitrary numeric ranges. It does not.
- Forgetting that repeated optional groups can legally match zero times.
- Designing a repeatable free-form parameter that accidentally consumes tokens intended for a later clause.
Authoring guidance
Use repetition when the domain truly wants repeated grammar units. Do not rely on it as a catch-all escape hatch for ambiguous free text.
When punctuation is part of the language contract, write it explicitly as literal delimiters. This makes both parsing and diagnostics much clearer.