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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Jun 4 18:31:06 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1094

--- Comment #45 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Dmitry Selyutin from comment #44)
> I meant three methods per context manager (three for db, three for record,
> etc.). 

yes, i understood. didn't say it, but understood it.

> Ok, if no objections, I'll switch to this way.

none here - the only thing i will say is: please please make
absolutely certain to separate "the act of walking" from
"the visitor which is called by the walker".

(i know that pyomo has the walking-function as part of the Visitor class)

the next question to solve is: how do you "stack" them? how do you
have db know about record, how do you have record know about span/extra/etc.?
i don't mean the *data*.

and the answer to that is where the "three functions" paradigm breaks down,
and i _believe_ you're trying to solve it by placing local variables down
at the BaseVisitor... and trust me when i say that's not the right way
to write a Visitor API

really, when you have time, please do go over StreamBasedExpressionVisitor,
bear in mind it can do both DOM *and* SAX - and we will need both.

(DOM: in-place in-memory tree modifying, used for compiler AST modifying.
 SAX: streaming-only.  think "files", zero context.
      good for e.g. turning certain words into CAPITALS)

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


More information about the libre-soc-bugs mailing list