Talk:Compiler/Verifying syntax: Difference between revisions

Content added Content deleted
Line 12: Line 12:
:First/left one yes, second/right one no. Consider expr_level_4 = ["not"] expr_level_5 [('=' | '<') ["not"] expr_level_5] ;
: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)
: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)

Note the square brackets [] around the [('=' | '<') expr_level_5]. This means that the expression

'2 < 3 < 4'

should not be legal (i.e. a non-associative violation).
[] means 0 or 1.
{} means 0 or more.