EBNF - Allow special sequence management with special-sequence-symbol "?"

+1 vote
asked Oct 16, 2022 in Wanted features by The-Lu (74,900 points)

Hello PlantUML team,

  • Could you allow special sequence management with special-sequence-symbol "?"?

Here is some examples (taken from the ISO EBNF standard):

@startebnf
(* Example from §8.1 ISO-EBNF *)

h-tab = ? IS0 6429 character Horizontal Tabulation ? ;

new-line = { ? IS0 6429 character Carriage Return ? },
? IS0 6429 character Line Feed ?,
{ ? IS0 6429 character Carriage Return ? };
@endebnf

or:

@startebnf
(* Other possible examples: *)
h-tab = ?Unicode U+0009?;
empty-special = ??;
@endebnf

A proposal will be to make a double line around the block. (to debate...)

Thank for the improvement (not urgent, but just ISO EBNF consistent),
Regards.

related to an answer for: Could we add syntax diagrams?
commented Oct 27, 2022 by Todd Musheno (2,680 points)

In http://alphadoc.plantuml.com/doc/markdown/en/ebnf I added an ebnf defintion of ebnf...

A good practical example of how this may be used is digit, and letter... these could be replaced with:

digit = ? regex: \p{Number} ? ;

letter = ? regex: \p{Letter} ? ;

As I am going to assume we will allow any numbers/letters, not just english ones.

Alternatively:

digit = ? regex: [0-1] ? ;

letter = ? regex: [a-z] ? ;

commented Nov 8, 2022 by Todd Musheno (2,680 points)
I think this is enough to release ebnf in the same way the alternative "beta activity diagrams" are.

I would release it into the wild for public comment for a bit and emphasize its in beta... I am sure ebnf people will jump on this once released... although I do it from time to time I am more of a java guy, so the public may be a better sounding board for suggestions at this point.

Should we turn to documentation for what we have?
commented Nov 25, 2022 by Todd Musheno (2,680 points)
To complete this I would suggest changing special to one or more of...

More then the double line (it's just not distinct enough I think, so solid and broken lines or something)

Distinct background color (yellow it already used for comments... Blue maybe?)

Add some kind of indicator or icon (something like the slash on business actors?)

Use a non rectangular block around it (see cloud symbol in deployment diagrams for example)

Wobbly lines might also work.

It's not horrible as is (so if others disagree I will drop this), just think it needs a bit more panache.

What ever one of these is easiest to implement on top of what you have is what I would do
commented Nov 28, 2022 by Todd Musheno (2,680 points)

I think if we use the dashed version of the UStroke for one but not both rectangles... new UStroke(1.0,1.0,1.0)??, we would have something easy to understand at a glance... the numbers might need tweaked a bit.

https://github.com/plantuml/plantuml/blob/48ae51e8c3ee3cd5713834350f682b086db208d8/src/net/sourceforge/plantuml/ebnf/ETileBox.java#L160

commented Dec 5, 2022 by Todd Musheno (2,680 points)
I think this can be closed

2 Answers

+1 vote
answered Nov 4, 2022 by plantuml (295,800 points)
selected Dec 11, 2022 by The-Lu
 
Best answer

With last version, you can have:

Does it make sense?

commented Nov 4, 2022 by The-Lu (74,900 points)
For me that seems good...

Conform to my initial request:
> A proposal will be to make a double line around the block. (to debate...)

Thanks a lot.
Awaiting now 'exception management'...
Regards.
Th.
commented Nov 8, 2022 by Todd Musheno (2,680 points)
Sure does, you got the concept exactly... a bit hard to see... any way to make the lines bold or something? Its simply those should not look the same as the others... how IDK, but they should be visually distinct.
commented Nov 8, 2022 by Todd Musheno (2,680 points)
never mind... forgot about the grey for normal nodes... with thse being white I think its fine!
commented Nov 9, 2022 by Todd Musheno (2,680 points)
oops... it should not look like rules, nor literals.

https://www.plantuml.com/plantuml/uml/SoWkIImgIKtAI-DAoyzNi5LGoiaiIIrAp55Ig56mBov8JSvCpB47iejASrAjkHnIyr90YW40

All 3 elements should be visually distinct. Literal and special look very similar.
commented Nov 9, 2022 by Todd Musheno (2,680 points)
Specials should look "funky"... a lot of books and such use another color (yellow is common), or bold text, borders, and even sometimes drop shadow... etc.

Basically specials should NOT look like a normal item... its "special". ;-) bad pun
commented Nov 15, 2022 by Todd Musheno (2,680 points)
How about one solid and one dotted line?
commented Nov 16, 2022 by The-Lu (74,900 points)

one solid and one dotted line?

Why not?
It seems a good new improvement... (conform to the spirit of `special`)

commented Nov 30, 2022 by Todd Musheno (2,680 points)

I think if we use the dashed version of the UStroke for one but not both rectangles... new UStroke(1.0,1.0,1.0)??, we would have something easy to understand at a glance... the numbers might need tweaked a bit.

https://github.com/plantuml/plantuml/blob/48ae51e8c3ee3cd5713834350f682b086db208d8/src/net/sourceforge/plantuml/ebnf/ETileBox.java#L160

0 votes
answered Oct 17, 2022 by Todd Musheno (2,680 points)
This might close https://forum.plantuml.net/16693/ebnf-add-notation-elements-as-rules IMHO
I would suggest making this as close to other formats while correctly processing "standard EBNF" so I like all suggestions
...