flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > how do infix expression parsing in match? |
| Author |
|
|
revolution 05 Nov 2025, 13:54
The shunting yard algorithm might be a good place to look for a way to do that.
|
|||
|
|
Roman 08 Nov 2025, 05:47
I do this
Code: macro mcalc0 expr { irps reg, expr \{ common reverse @reqq2 equ reg \} } mcalc0 2+3*4/2-5 irpv ttt,@reqq2 { ;if `ttt <> in <`-, `/,`+,`*> ;fasm error ;if `ttt <> "-" && `ttt <> "/" ;fasm error why ? if `ttt <> "-" ;this ok mov eax,ttt ;fasm error mov eax,/ display 't;' end if } |
|||
|
|
Roman 08 Nov 2025, 06:38
o. I do this
Code: irpv ttt,@reqq2 { ;if `ttt <> in <`-, `/> if `ttt = "-" | `ttt = "/" | `ttt = "*" | `ttt = "+" mov ebx,`ttt display 't;' else mov eax,ttt end if } |
|||
|
|
revolution 08 Nov 2025, 06:43
It would be easier to express all computations in RPN form. Those are much easier to parse.
|
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.