Talk:Parse EBNF/Tests: Difference between revisions

From Rosetta Code
Content added Content deleted
(correction for an example?)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:


is not a valid EBNF grammar, according to the accepted definition?
is not a valid EBNF grammar, according to the accepted definition?

: I guess because it never defines a production for ''bar''. --[[User:Kernigh|Kernigh]] 01:51, 9 September 2011 (UTC)

:: Then we have a contradiction - grammar { foo = bar . } is correct if definition on the linked page is used (and at least one implementation verifies that), together with restrictions on identifier and literal allowed characters, but is not correct, if we assume that all identifiers should be defined.

:: I'd lift the requirement that all identifiers should be defined, and stick to the provided definitions. Then this example grammar should be in the "correct" section.

Latest revision as of 00:41, 12 September 2011

Why the example provided at the bottom of the page

{ foo = bar . }

is not a valid EBNF grammar, according to the accepted definition?

I guess because it never defines a production for bar. --Kernigh 01:51, 9 September 2011 (UTC)
Then we have a contradiction - grammar { foo = bar . } is correct if definition on the linked page is used (and at least one implementation verifies that), together with restrictions on identifier and literal allowed characters, but is not correct, if we assume that all identifiers should be defined.
I'd lift the requirement that all identifiers should be defined, and stick to the provided definitions. Then this example grammar should be in the "correct" section.