What do you think about this layout? It's pretty useless for big grammars or grammars with more complex layout of course, but it might be good for some small grammars like this. One immediately sees the hierarchical layout. I'm not sure I like the layout myself.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grammar Rules { | |
| token TOP { <line>* } | |
| token line { <empty-line> | <field-specification-line> | <tag-line> } | |
| token empty-line { [ '#' \V* ]? \v } | |
| token field-specification-line { '!' <field-name> \v } | |
| token field-name { 'to' | 'from' | 'subject' } | |
| token tag-line { <tag-command> \h+ <conjunction>+ % [\h* '|' \h*] \v } | |
| token tag-command { <sign> <tag-name> } | |
| token sign { ['+' | '-'] } | |
| token tag-name { <alnum>+ } | |
| token conjunction { <condition_atom>+ % [\h+] } | |
| token condition_atom { <+alnum +[.@-]>+ } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment