00:01
We're asked to use bacchus naur form to describe the syntax of expressions in infix notation.
00:08
In infix notation, the set of operators and identifiers is the same as in the bnf or bacchus naur form for post -fix expressions, which were given in the preamble to a previous exercise 39, but instead we're told the parentheses must surround expressions being used.
00:33
As factors.
00:41
So, just recall from that preamble of the post -text notation places the operators at the end of the two terms or factors that it relates to, while the infix notation, we're told is going to place the operators in between the two terms or factors.
01:05
Now, we're also told the infix notation should also include brackets about an expression if the multiplication needs to occur after the addition.
01:16
This is because the multiplication generally occurs for the addition when there are no brackets.
01:25
So to modify the outfix notation, recall from outfix notation, we have expression, colon, colon, equals, and then we have bracket term, line, and we used to have bracket term, bracket term, bracket odd operator, add operator.
02:03
But in this case, we want to put the add operator between the two terms.
02:07
So we'll have bracket term, bracket add operator, followed by bracket term.
02:37
Now, as in the outfix notation, we have the rule...