[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPS: Loaded pdump

From: Gerd Möllmann
Subject: Re: MPS: Loaded pdump
Date: Sun, 19 May 2024 05:48:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Helmut Eller <eller.helmut@gmail.com> writes:

> On Fri, May 17 2024, Eli Zaretskii wrote:
>> As a one-time thing, I don't think anyone will care how the code was
>> obtained, as long as it is maintained by hand henceforth.
>> But if you suggest this as a permanent inclusion into Emacs, then I
>> don't think we can go that way, since the tools to produce this are
>> neither standard ones available everywhere, nor something we can
>> include with Emacs.
> I think the goal is not to edit the generated code manually but to keep
> the code generator around and edit that if needed.


>> Given that Emacs now has tree-sitter bindings, I wonder whether the
>> same can be done in Emacs Lisp using tree-sitter for parsing.  That'd
>> be acceptable, I think.
> That's an interesting idea.  I tried to rewrite the Python code in Elisp
> and it works, after a fashion.
> The tree-sitter syntax tree is at a lower level than what libclang
> offers and I had to rewrite the tree quite a bit to make it easier to
> use.  I also pipe the C source code through the preprocessor first, so
> that tree-sitter doesn't see macros.  With macros, it's even harder to
> get some easy to use data structures out of it.
> I'm not sure how to proceed from here. Anyway the code is here:


I don't know how to proceed with this either. I mean technically it's
probably clear: have an annotated AST, write AST matchers and an AST
visitor framework (just as an example) and generate C code. Start with
generating some fix_ functions, then others.

It's quite some work. (And I must say that I slowly feel I'd rather do
something else now than MPS :-).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]