Arithmetic evaluation/Phix: Difference between revisions

m
→‎{{header|Phix}}: more grumpoid comments
(→‎{{header|Phix}}: bugfix (not using opPrec))
m (→‎{{header|Phix}}: more grumpoid comments)
Line 1:
=={{header|Phix}}==
Translation of [[Arithmetic_evaluation#D]], just for fun / in order to decipher all that abstract class Visitor/accept/visit pointless indirection stuff, when in fact a plain and simple recursion is all that it needs. For me <code>visit(ast)</code> and <code>visit(node[LHS/RHS])</code> do exactly what it says on the tin, whereas <code>a.root.accept(c)</code> and <code>xp.LHS/RHS.accept(this)</code> do not. Plus, 221 lines -> 166 lines, should you wrongly care about that, I know I shouldn't...
<lang Phix>-- demo\rosetta\Arithmetic_evaluationD.exw
enum Num, OBkt, CBkt, Add, Sub, Mul, Div
7,806

edits