-
-
Save titsuki/fa7691c1464c24a17d773e5a511be660 to your computer and use it in GitHub Desktop.
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 Infobox::Grammar { | |
token TOP { <infobox> .+ } # (#1) | |
token infobox { '{{Infobox' <.ws> <name> \n <propertylist> '}}' } | |
token name { <-[\n]>+ } | |
token propertylist { | |
[ | |
| <property> \n | |
| \n | |
]+ | |
} | |
token property { | |
'|' <key=.key-content> '=' <value=.value-content-list> | |
} | |
token key-content { <-[=\n]>+ } | |
token value-content-list { | |
<value-content>+ | |
} | |
token value-content { # (#6) | |
[ | |
| <anchortext> | |
| <weblink> | |
| <rawtext> | |
| <delimiter> | |
]+ | |
} | |
token anchortext { '[[' <-[\n]>+? ']]' } # (#2) | |
token weblink { '[' <-[\n]>+? ']' } # (#3) | |
token rawtext { <-[\|\[\]\n、\,\<\>\}\{]>+ } # (#4) | |
token delimiter { [ '、' | ',' ] } # (#5) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment