EBNF causes java.lang.IllegalStateException

0 votes
asked Jul 18 in Bug by Potherca (430 points)

To quote the Wikipedia:

Even EBNF can be described using EBNF. Consider below grammar (using conventions such as "-" to indicate set disjunction, "+" to indicate one or more matches, and "?" for optionality)

However, when I run the provided EBNF through PlantUML, I get:

You should send a mail to plantuml@gmail.com or post 
to https://plantuml.com/qa with this log 
(V1.2023.10beta2) java.lang.IllegalStateException

1 Answer

+2 votes
answered Jul 18 by The-Lu (60,200 points)
selected Aug 11 by Potherca
Best answer

Hello P., and all,

It is [currently] normal.
→ Because current implementation use only 'ISO EBNF' form.


concatenation = ( S , factor , S , "," ? ) + ;

is not a ISO BNF form!

You must use ISO EBNF:

The Wikipedia [simplified] grammar (using conventions)ISO EBNF
"+" to indicate one or more matches{ }- form
"?" for optionality[ ] form

Then here is the expected result:

concatenation = { S , factor , S , [","] }- ;

Or use RegEx, like:

concatenation = (( S )( factor )( S ) ,?)+;

See also doc. here:

If that can help,


commented Jul 22 by Todd Musheno (2,680 points)
I think we should look into common "extensions" like this at some point.