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:46:12 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in.ibm.com; dmarc=pass action=none header.from=in.ibm.com; dkim=pass header.d=in.ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 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=DFBcsNWjmVM0TVj4GsHHsWxnPo3NXtl/P6OMsuON988=; b=iXqGkRUhLVSI8Bu/jerB2ZQSQdKAOAAhmb16qN69/W4ECM+pYbMpkYiHw/SNII9UzLDdqEefAuH61XM4X8H5QFtZuPTrZOZ2KoglqdFHxiRUntHfMlhsWKBT5f0LAZrWFhCFO8pmHspGNWdZJNmNnjG1i84g4LejppFovuNLCuKgGJ7dy6tDix+37/OeUHrRV08pnYXTzl9qYkD5EVYE1vuG6r5x6b+Os4PYWAVtW1z7KHH6UsDMPCr8dXA+bDN34Td6T35CN5279VdjjSJ8uIeaeD8JX2GgbAAw/eFPmvSR68tDJ0TYXGInKfWuFyPDnHzfy4cJcbB2+qicynWLYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bKT4gPoQR8cRoHSjfdkekxiUBW/AlZlqq1w3IoiywRDIqkCZ/AbgEfS1VMUOyTCxDAzNQJa4WSaDuu9Sf6m5YElDE/bhvYcLZgflJeIoSYmZuwIOaLeOdi7YLFx3LMsqaRXE3du62B6a0ZfwBJoA3d+aG6K0I0wr4lwJadA2xtpLZvKWdKk2zbpy6VLK7MCzSpGZWT8MFCXk9geupCvtNT6USzVupmcF2nZWqjF63WE6fLt3hhimDyGe43Wr3mpz4Rsim+Dzk3EZALBOGTTd4ErnV4++wC8F8tCWvgcUxFNtoU4UUguFZcwAAgNaSR/SeIIPpplmtWpdNPgJl4ggqQ==
  • Delivered-to: eclipse-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/eclipse-dev/>
  • List-help: <mailto:eclipse-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/eclipse-dev>, <mailto:eclipse-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/eclipse-dev>, <mailto:eclipse-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHYVUwmQeIS5ibmykWNNBm3pdBVDaz5/H4AgAANiWSAAAJPDA==
  • Thread-topic: [EXTERNAL] Re: [eclipse-dev] where to get started writing a language parser for SWIG

@Stephen: Adding that I read Tom Schindl’s reply only now after the sending the mail below. And as he mentioned, since what you are talking is DSL, XText may be  the natural and right  choice [again, I have not used XText – you might want to ping Tom] rather than going through the AST source code manipulation route suggested in my previous mail.

 

Regards,

Manoj

 

From: eclipse-dev <eclipse-dev-bounces@xxxxxxxxxxx> on behalf of Manoj Palat <manoj.palat@xxxxxxxxxx>
Date: Thursday, 21 April 2022 at 2:06 PM
To: Lars Vogel <lars.vogel@xxxxxxxxxxx>, General development mailing list of the Eclipse project. <eclipse-dev@xxxxxxxxxxx>
Subject: [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 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


Back to the top