[libre-riscv-dev] parser precedence, code review / checking needed

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Apr 3 16:19:36 BST 2020

if anyone knows how to resolve operator precedence, my logic-dyslexia
is kicking in and i am having difficulty working out which operators
are supposed to be in which order, for bit-wise AND, OR, and
PLUS/MINUS, MUL/DIV.  someone else did the PLUS/MINUS MUL/DIV, i'm
attempting to add AND and OR and am getting it wrong

here's how python-ply is supposed to work:

here's a patch showing the relevant files involved:

executing "python3 soc/decoder/power_pseudo.py" is a good test, with
this being good example code:
+cmpi = """
+in_range <-  (x | y) & (a | b)
+in_range <-  (x + y) - (a + b)

help appreciated.


More information about the libre-riscv-dev mailing list