https://bugs.kde.org/show_bug.cgi?id=438206

--- Comment #12 from Sven Brauch <m...@svenbrauch.de> ---
Any help is certainly very welcome. I am not very active on IRC currently, but
I definitely read and answer kdevelop-de...@kde.org.

In principle, the task is simple: in parser/ast.h we have our own data
structure for an AST, and that needs to be populated. The current way to do
that is based on a... let's say, "creative" domain-specific language which
describes how CPython's internal AST representation maps to ours from ast.h. C
code is generated from this DSL file. You could just as well write that C code
by hand -- it's not actually that much, a few hundred lines.

This doesn't work any more, because CPython's representation is gone.

There are certainly several different approaches to fix this, I think my
suggestion above is the most straightforward one since it doesn't structurally
change anything. Though, if one has to touch all this stuff *anyways*, it might
be worth evaluating other parser libraries which support also e.g. proper
incomplete parsing. I'd honestly opt for whatever the person doing it feels
most comfortable with.

I wouldn't discard approaches involving serializing/deserializing the AST (e.g.
to/from XML) because of performance concerns; XML stream
serialization/deserialization (i.e. if you avoid building a DOM) is extremely
fast, and I'm pretty sure that the impact is negligible compared to the
semantic analysis effort later on. The only thing I'd really try to avoid is
spawning a process for each parse job.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to