[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Jun 12 13:03:49 BST 2023


--- Comment #131 from Dmitry Selyutin <ghostmansd at gmail.com> ---

Two ideas:
1. Paths or indices can be nodes as well, and be visitable. This allows to
solve the issue on how and what to pass to visitor method.
2. We should support loose matches for visitor handlers, likely traversing MRO.
The visitor below handles any Dict in a generic way but has a special logic for

class MagicVisitor(Visitor):
    def Operands(self, node):
        print("Oh and this is Operands node!", node)
        yield node

    def Dict(self, node):
        yield node

And basically the default __call__ becomes @visitormethod(object)!

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list