Talk:Compiler/Verifying syntax: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
Line 9: Line 9:
mean any expr_level_5 expression can be preceded by not?
mean any expr_level_5 expression can be preceded by not?
--[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 19:09, 3 January 2020 (UTC)
--[[User:Wherrera|Wherrera]] ([[User talk:Wherrera|talk]]) 19:09, 3 January 2020 (UTC)

:First/left one yes, second/right one no. Consider expr_level_4 = ["not"] expr_level_5 [('=' | '<') ["not"] expr_level_5] ;
:Ideally the not would be moved into its own private rule, rather than clog up the (partial) comparison rule anyway. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 19:31, 3 January 2020 (UTC)

Revision as of 19:33, 3 January 2020

Incorrect BNF

The BNF given does not permit = to be directly followed by not. Go/Julia/Perl all get that wrong.
The Go output also claims that "g not = h" is valid, whereas Perl/Julia and now Phix call that invalid. --Pete Lomax (talk) 18:57, 3 January 2020 (UTC)

I may not understand the specification given for BNF syntax. Doesn't the rule:

expr_level_4 = ["not"] expr_level_5 [('=' | '<') expr_level_5] ;

mean any expr_level_5 expression can be preceded by not? --Wherrera (talk) 19:09, 3 January 2020 (UTC)

First/left one yes, second/right one no. Consider expr_level_4 = ["not"] expr_level_5 [('=' | '<') ["not"] expr_level_5] ;
Ideally the not would be moved into its own private rule, rather than clog up the (partial) comparison rule anyway. --Pete Lomax (talk) 19:31, 3 January 2020 (UTC)