Skip to content

Extracting strings from a grammar with many options #108

Answered by d-frey
sckott asked this question in Q&A
Discussion options

You must be logged in to vote

You real grammar is even worse than the example grammar you posted earlier, sorry. It can not possibly work. Think about it: softSpace is star<space> which means the separator could be nothing. And name, epithet and infraname are all plus<alpha>, separated by softSpace. Looking at just_a_name, genus_epithet and genus_epithet_infra, there is no way to reasonably parse ABC as an input. Could be anything of those three.

Those (plus other) alternatives are inside of a star<sor<...>>. How would you imaging the input foobarbazblablubblaberhalloholagaga to match to those rules? It could be foobarbaz matches just_a_name three times, once with foo, once with bar and once with baz. Or is it meant t…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by d-frey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #108 on December 09, 2020 10:02.