feat: Implement Chapter9

Also provides proper associativity on the operators, to avoid
  ambiguous parses.

  This completes all of the examples in the Spoofax Tutorial/Reference
  that use the propositional signature.
This commit is contained in:
Glen Whitney 2021-01-22 09:29:57 -08:00
parent fddc94a906
commit ba130ecb0f
17 changed files with 402 additions and 25 deletions

View file

@ -34,10 +34,10 @@ context-free syntax
Prop.False = <0>
Prop.Atom = String
Prop.Not = <!<Prop>>
Prop.And = <<Prop> & <Prop>>
Prop.Or = <<Prop> | <Prop>>
Prop.Impl = [[Prop] -> [Prop]]
Prop.Eq = <<Prop> = <Prop>>
Prop.And = <<Prop> & <Prop>> {left}
Prop.Or = <<Prop> | <Prop>> {left}
Prop.Impl = [[Prop] -> [Prop]] {right}
Prop.Eq = <<Prop> = <Prop>> {non-assoc}
Prop = <(<Prop>)> {bracket}
String = ID