Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] where to get started writing a language parser for SWIG
  • From: Manoj Palat <manoj.palat@xxxxxxxxxx>
  • Date: Thu, 21 Apr 2022 08:36:25 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lV87SDuFr4QgbEvEEfYuZRg7E1JquHIU3AYXM2b5a/E=; b=Ryu3uX1Y+ltDwYw7rW/tQWs/UTVNWS09ksX6feNeOH8W/wqpP1Do+gcMTWXoY7PN9jOTkwXyrY1q5+2ZXXase4bO3/j/+5qkJjoSwfHRFH7u8x3SQeSeki2+Vlu0pzI6wAcJkXYC3kxw5YoUaiXv5yxuKBhy2m3dBMRFPPtLeVBvzdY9oTDY4CoDNbN+br8WMJBFEWxb1QOoj1Mc+6ZdiPledr7Zv0DoYV03yDBL0x8osqetbl8j7LIWJgom1gotxWqnzXEsCs11/ETcmpK4u5E7LXzoVianLYnx+vSwGyrRFMhIMex0/CaL34f+IJpfhbq1AlEii9NqCbj5Xdk0yw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=WBO/SFYbG63kVmKzRz5BxcDwlR0oW/b5H+y3IZj+dVCkTi2VIOzKuQo4+ayOJiqaFPqFsW2ALmkMOhhAwZ+2P5q0aKDiVA0YRUf+LXOLK6Z1gAb4D1i52venxWccbjRPOekmADXO1sf6+TNrR2aa7R2ZazWLij1kz3XmDvxVIuHMRNqnnQWaDv/FISdCcmf+jAtXV379wxgJd8+cCcZpfvrJEcumsJTy7PC2cMotdv/vkQDNRmVDzQ0Xs0qoUSjieZVKrVdFQoWDujsgMKbL94S70FcUbQ9YYKU1z98ZC70xatR0CuLv4HtCPrNuc/5pbemCcrRcO+SP8A1qd5HYpw==
  • Delivered-to: eclipse-dev@xxxxxxxxxxx
  • List-archive: <>
  • List-help: <>
  • List-subscribe: <>, <>
  • List-unsubscribe: <>, <>
  • Thread-index: AQHYVUwmQeIS5ibmykWNNBm3pdBVDaz5/H4AgAANiWQ=
  • Thread-topic: [EXTERNAL] Re: [eclipse-dev] where to get started writing a language parser for SWIG

@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  , 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 Probably, this could be a good starting point for implementation.





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

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:

Back to the top