Core Grammar Concepts


Intuitive DSL uses a compact grammar notation to describe valid command shapes. The notation is small on purpose: a few constructs cover the full authoring model.

Write keywords as exact literals, write parameters as captured values, and use groups to express optionality, alternatives, and controlled repetition.

Keywords

A keyword is an uppercase, non-numeric literal in the grammar. At runtime, keyword matching is case-insensitive against user input.

Adjacent keywords are merged into one exact phrase for semantic purposes. This matters later for clause detection and context-sensitive binding.

WITH AGE
AS ACTIVE
DRY RUN

Parameters

A parameter is a value-capturing symbol. In practice, parameters are the grammar elements that bind user data such as names, identifiers, dates, file paths, or free-form labels.

username
user_age
run_date
roleName

A simple parameter consumes one runtime token of type WORD or STRING. If a value must stay atomic across spaces or significant punctuation, it must be quoted in the input.

Literal delimiters

Delimiters are literal punctuation tokens that must appear exactly as declared in the grammar. They are part of the command contract, not decoration.

( ) . , ; : ? ! - + / * @ [ ] { } | ...

Groups and alternatives

  • [ ... ] defines an optional group.
  • { ... } defines a required group.
  • | separates alternatives inside the current group.
CREATE USER username [ PASSWORD password ] ;
PROCESS { FILE file_path | DIRECTORY dir_path } ;

An optional group may be absent. A required group must successfully match one declared branch. Alternative order is significant: the parser tries branches in the declared order.

Repetition

Repetition is expressed with the suffix ..., applied to the immediately preceding node. It does not introduce a new standalone construct. It modifies the node that already exists.

target_user ...
{ IP ip_address | SUBNET subnet_mask } ...
[ WITH metric_name ] ...

Macros

A macro is a named placeholder whose valid runtime choices come from the host application's macro registry.

${available_tasks}
<legacyMacro>

The canonical syntax is ${macroName}. Legacy angle-bracket syntax may still be accepted in environments that preserve backward compatibility, but new grammars should prefer the canonical form.

A canonical example

PROVISION USER username
  [ WITH AGE user_age ]
  { AS ACTIVE | AS SUSPENDED }
  [ FORCE ] ;
  • PROVISION USER is an exact keyword phrase.
  • username and user_age are parameters.
  • [ WITH AGE user_age ] is optional.
  • { AS ACTIVE | AS SUSPENDED } is required and branch-ordered.
  • [ FORCE ] is an optional clause.
  • ; is a literal delimiter.

See also