Talk:Extended Backus–Naur form

Latest comment: 1 month ago by 103.253.47.40 in topic EBNF correct?

Who created BNF?

edit

BNF stands for Backus-Naur form. The article states it was created by Nicklaus Wirth. I always thought it was created by two guys named Backus and Naur. —Preceding unsigned comment added by 149.32.192.33 (talk) 17:29, 8 June 2009 (UTC)Reply

The inventor of Backus-Naur form was John Backus. And Peter Nauer further developer and simplified it 1. Later Niklaus Wirth extended BNF to EBNF. — Preceding unsigned comment added by Msmith76 (talkcontribs) 17:15, 27 July 2020 (UTC)Reply

repetition-symbol

edit

Extended_Backus–Naur_Form#Conventions mentions "*" as a repetition-symbol, yet it isn't present in the grammar of EBNF itself? — Preceding unsigned comment added by 96.225.28.105 (talk) 17:53, 2 December 2015 (UTC)Reply

The examples (taken from the ISO document) clearly show that repetition means 0 or more, but they come long after the table. I added a comment in the table because it was indeed unclear. Nowhere man (talk) 13:26, 3 July 2023 (UTC)Reply

EBNF correct?

edit

Is the EBNF for EBNF correct? (Ignoring the fact that it does not mention white space, comments and other things) Specifically this bit:

     lhs = identifier ;
     rhs = identifier
          | terminal
          | "[" , rhs , "]"
          | "{" , rhs , "}"
          | "(" , rhs , ")"
          | rhs , "|" , rhs
          | rhs , "," , rhs ;
     rule = lhs , "=" , rhs , ";" ;
     grammar = { rule } ;

The "rhs" is left recursive and leads to an infinite loop if you try to implement it how it is described. I think this corrects it:

     lhs = identifier ;
     term = identifier
          | terminal
          | "[" , rhs , "]"
          | "{" , rhs , "}"
          | "(" , rhs , ")" 
     rhs = term
          | term , "|" , rhs
          | term , "," , rhs ;
     rule = lhs , "=" , rhs , ";" ;
     grammar = { rule } ;

Can someone confirm this? — Preceding unsigned comment added by 92.25.123.151 (talk) 13:50, 30 January 2016 (UTC)Reply

I think you're almost right, though left recursion isn't inherently a bad thing. Wouldn't the identifier and terminal match before the recursive "rhs" calls could be made? I know this is years later, but I just noticed as well. I've gone in and overhauled the grammar to, I believe, correctly parse (verified with a parser generator). ZSNES (talk) 08:56, 1 March 2023 (UTC)Reply
I'm completely new at looking into EBNF, but the logic in the example seems strange. Is there hoisting? I would think that 'rhs' would need to be defined prior to the definition of 'term' in order for the logic to actually build upon itself. Am I missing something? 174.77.66.50 (talk) 23:29, 21 June 2023 (UTC)Reply

I was reading through this furthur and it states the valid symbols which doesnt seem to include a `\` even though in the described grammer you have `\n` so this grammer wouldnt be able to parse itself, from what i understand. — Preceding unsigned comment added by 174.95.74.177 (talk) 14:32, 24 May 2023 (UTC)Reply

19283 103.253.47.40 (talk) 07:23, 20 October 2024 (UTC)Reply

Mistake in examples of the Conventions paragraph

edit

The last example is "hh = (aa | bb | cc), "H"". But shouldn't this evaluate to hh: AH AAABH CH ACH AACH AAACH? And not hh: AH BH CH. BartYgor (talk) 11:34, 28 September 2023 (UTC)Reply

Misleading term? (set disjunction)

edit

QUOTE: "using conventions such as "-" to indicate set disjunction"

- "set difference" would be a much better term to use here in my opinion.

"set disjunction" sounds like logical disjunction, and even if one would think about "disjoint sets" it still isn't what the operation does: it does not check that sets are disjoint or not, neither it creates a disjoint set given two sets, it makes non-commutative operation - set difference Shitpoet (talk) 22:19, 18 April 2024 (UTC)Reply