@Lars: Thanks for chiming in. I think it’s a good suggestion and that should be the way forward. I checked up whether there is an already existing implementation for SWIG at
https://microsoft.github.io/language-server-protocol/implementors/servers/ , but did not find any. So, it has to be written; and it would be a good idea to wire up these facilities via LSP so that it can be used. Other alternative is to wire it up as a
plugin of Eclipse similar to the original JDT.
Now to the actual implementation part:
@Stephen: From your reply, I understand that this is not JDT related. However, I think what you want to do is similar to what we do it JDT. And I think the best way is to reuse the code in SWIG itself [so
that you get the updates for newer syntaxes, fixes and so on] for parsing and get an Abstract Syntax Tree up first. Any semantic analysis should be easier with AST.
I don’t know SWIG, but I just took a peek at the SWIG code and I see that there is indeed a AST manipulation code available at
https://github.com/swig/swig/blob/master/Source/Swig/tree.c. Probably, this could be a good starting point for implementation.
Regards,
Manoj
From:
Lars Vogel <lars.vogel@xxxxxxxxxxx>
Date: Thursday, 21 April 2022 at 1:14 PM
To: General development mailing list of the Eclipse project. <eclipse-dev@xxxxxxxxxxx>
Cc: Manoj Palat <manoj.palat@xxxxxxxxxx>
Subject: [EXTERNAL] Re: [eclipse-dev] where to get started writing a language parser for SWIG
Hi Stephen,
If you want to implement an editor for SWIG in Eclipse with content
assist, outline etc, the easiest and best way is to use a language
server implementation and integrate it via LSPE into Eclipse. This
way you can use the same language server for other tools like VSCode.
Best regards, Lars
On Thu, Apr 21, 2022 at 8:50 AM Stephen Crowley
<stephencrowley214@xxxxxxxxx> wrote:
>
> Hi Manoj, yes looks right.. it doesnt necessarily have to do with java support though, SWIG supports many languages and one could envision using it to generate C or python or whatever.. does that still fall under JDT?
>
>
> Thanks,
>
> Stephen
>
> On 4/21/22 12:41 AM, Manoj Palat wrote:
>
> Hi Stephen,
>
> To understand the requirement, checking whether you want to convert the SWIG files into a DOM AST of JDT?
>
>
>
> Regards,
>
> Manoj
>
>
>
> From: eclipse-dev <eclipse-dev-bounces@xxxxxxxxxxx> on behalf of Stephen Crowley <stephencrowley214@xxxxxxxxx>
> Date: Thursday, 21 April 2022 at 9:46 AM
> To: eclipse-dev@xxxxxxxxxxx <eclipse-dev@xxxxxxxxxxx>
> Subject: [EXTERNAL] [eclipse-dev] where to get started writing a language parser for SWIG
>
> Hypothetically, what is the proper way to create a mode (im not sure of the proper jargon) to parse SWIG interface files
>
> for syntax hilighting, type hierarchy, etc.
>
>
>
> Is there some some sort of minimal project I can checkout that does this sorta thing?
>
>
>
> Thanks in advance
>
>
>
> --Stephen
>
> _______________________________________________
> eclipse-dev mailing list
> eclipse-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev
--
Eclipse Platform project co-lead
CEO vogella GmbH
Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com