Grammars & Language Support
Two ANTLR grammars and the editor built on top of them: a templating language for monitor notifications where the conditionals decide who gets paged, and the boolean expression that composes monitors out of each other.
The notification body is markdown with a template layer over it. Values interpolate โ the threshold, the observed value, whichever attributes the monitor groups by โ and conditional sections come in positive and inverted forms, nest freely, and two of them take quoted arguments for exact and substring matching against a named variable.
The detail that set the correctness bar: a recipient written inside a conditional block is only notified when that condition holds. The template does not just decide what the message says, it decides who receives it โ so the parse tree drives delivery, and getting it wrong pages the wrong team at three in the morning.
The second grammar is smaller and less forgiving. Constituent monitors bind to single letters and compose with AND, OR, a unary negation and arbitrary parenthesised nesting, in one free-text field that a non-engineer is expected to fill in correctly. Precedence and grouping in a field that small want a real parser and real error reporting rather than a regular expression.
The editor was built as a component rather than a feature, so the markdown half could be lifted away from the templating half. It shipped again as a dashboard widget for free-form notes and instructions, carrying the same authoring surface without the conditionals.