mixfix 368 B

123456789101112131415
  1. The idea to handle mix-fix operators is to
  2. - parse applications as lists of expressions. For instance:
  3. 1 + 2 * 3 will be parsed as [1,+,2,*,3]
  4. We then generate a parser for the operators in scope and try to parse the
  5. application. In this example the grammar would look something like this:
  6. e0 ::= e0 + e1 | e1
  7. e1 ::= e1 * e2 | e2
  8. e2 ::= other