# Hierarchical syntax Grammar <- Spacing Definition+ EndOfFile Definition <- Identifier ARROW Expression Expression <- Sequence (SLASH Sequence)* Sequence <- Prefix* Prefix <- (AND / NOT / FUSE)? Suffix Suffix <- Primary (QUESTION / STAR / PLUS)? Primary <- Identifier !ARROW / OPEN Expression CLOSE / Literal / Class / DOT # Lexical syntax Identifier <- ~(IdentStart IdentCont*) Spacing IdentStart <- [a-zA-Z_] IdentCont <- IdentStart / [0-9] Literal <- ~( ['] (!['] Char)* ['] / ["] (!["] Char)* ["] ) Spacing Class <- '[' (!']' Range)* ']' Spacing Range <- Char '-' Char / Char Char <- '\\' [nrt'"\[\]\\] / '\\' [0-2][0-7][0-7] / '\\' [0-7][0-7]? / !'\\' . ARROW <- FUSEARROW / LEFTARROW LEFTARROW <- '<-' Spacing FUSEARROW <- '<~' Spacing SLASH <- '/' Spacing AND <- '&' Spacing NOT <- '!' Spacing QUESTION <- '?' Spacing STAR <- '*' Spacing PLUS <- '+' Spacing OPEN <- '(' Spacing CLOSE <- ')' Spacing DOT <- '.' Spacing FUSE <- '~' Spacing Spacing <~ (Space / Comment)* Comment <~ '#' (!EndOfLine .)* EndOfLine Space <- ' ' / '\t' / EndOfLine EndOfLine <- '\r\n' / '\n' / '\r' EndOfFile <- !.