Grammar and syntax engine of Symp
Symbolmatch defines the form of valid input.
Itβs a PEG-like parser expressed in S-expressions.
Each grammar is a collection of rule definitions written entirely in symbolic notation.
Where other systems hide parsing inside compilers, Symbolmatch makes it an explicit, inspectable data structure.
<start> := (RULES <rule>+)
<rule> := (FLAT <IDENTIFIER> <S-EXPRESSION>)
| (NORM <IDENTIFIER> <S-EXPRESSION>)
| (ATOM <IDENTIFIER> <S-EXPRESSION>)
Validate that an expression is a single atom:
(APPLY
symbolmatch
(SEXPR
(RULES
(FLAT <start> ATOMIC))))
Input:
hello
β success
(hello world)
β parse error at position 1.