digs = [0-9]+ flopo = digs (. digs)? (E (+|-)? digs)?where (...)? stands for “option”: zero or one of the regular expression inside the parentheses.
For the following strings, determine whether they are valid flopos:
.5 123 0.5 123E4 123.45E+67
expr = term ( ("+" | "-") term )* term = factor ( ("*" | "/") factor )* factor = number | "(" expr ")" number = [0-9]+For the following strings, determine whether they are valid exprs. If they are, show their derivation, either as a complete sequence of derivation steps, or as a parse tree.
1 + -3 2 * 3 - 4 3 * 4 / 5 (3 * 4) / 5 1/2/3/4 1-2/3-4