Open ryukinix opened 5 years ago
Well, you could use an LL(1) parser to read the expression precedence and give you a polish notation expression. Try using this website to test this grammar:
D' -> v C D'
D' -> ''
C -> I C'
C' -> ^ I C'
C' -> ''
I -> E I'
I' -> => E I'
I' -> ''
E -> N E'
E' -> <=> N E'
E' -> ''
N -> ~ A
N -> A
A -> ( P )
A -> id
Thank you for this contribution! A formal parser will be really useful!
The parsing table it is:
Runtime parsing steps.
Maybe can be useful: https://github.com/vy/meta-sexp
p^q
.Example: