Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to use CDT lib/java source
  • From: Ming Cheng <chengm349@xxxxxxxxxxx>
  • Date: Thu, 7 Nov 2019 01:11:40 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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-SenderADCheck; bh=A/O3LCPPzRPefiAyV0E3aRnSpN5EzIFz9le51WcwB3s=; b=YOYBG/SuFE6/yI9kYbz8wmIbsdGGq//ayZBW68jyXILBdQV91go1nfbWDTK7L8Do8baHXI+sU4rPLyNy7Y9uSEr4cyjgmkrKwUxIdd/ZBHONK2zi1ObTabW2PAlMcRHaWAm/AVXZRgM+u3f1NGRFmgNd+aICNB47O4qZDjchioEVpKoeB8xtgGyFZFzN2c28pLQzejc14WjPBVq9uCaXOx1wfJg0aMRcXC3pyJRMJCp5Vi8nkHy7kHF2zdyjdWtlD5hH9Yu+XcwuIMdm78TMzs54IaO2+3YkS/jjdfuG4ov4WjUTPsSRJL/TqS2xBIFI/fbIIbtE0qE0zXFqgOEE/g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xzboie2pJtfqoPClGLLcLX22Jm9CkUIi6bPvq5KqUesTM6mWrNBgSO++xRcHBo56Sz9a2rLy7zhFKUWlkVlrhaaPkUAyIOwsFXNzuQyJL0E9HplnMIfx4Ta81i/tHFOHHH/GxTd+JWn0wkn7mugvLSjEO3CEbCwGOK73i25sC9ViohDpLHayilSlj5uz4URxBd0H3Ai8Bte80hXXa6gAnOH5h65tqCWuYD9IWMXK5Fw2AzHwdNzyWybwuqGW1f1K1RrCANJ6Xiq7o8mvX7BZIbcKEm6r6b7OjWl8KismK8CGg1roYINnIEnHcVM5iBys4VYudjOyuitjD7PTXs+PzA==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHViWZ0R32gYYOp2UKg+91RKq/2Xqdt3aUAgBEfkbU=
  • Thread-topic: [cdt-dev] How to use CDT lib/java source

Hi Marc-André,

 

Glad to see your reply and tips. I just came back from my 2 weeks holiday and I will try to move as much as possible and hope eventually I can share something with your encourage.

 

Thanks.

 

Sent from Mail for Windows 10

 


From: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> on behalf of Marc-Andre Laperle <malaperle@xxxxxxxxx>
Sent: Sunday, October 27, 2019 11:40:06 AM
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] How to use CDT lib/java source
 
Hi Ming,

One way would be to use the AST writing capabilities of CDT. This allows you to create nodes, insert them, etc then generate the code from this new AST. There are several places in the CDT codebase that use that, namely the refactorings which are mostly in org.eclipse.cdt.internal.ui.refactoring.* packages, see https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring
There are also smaller spots in “quick fix” in package org.eclipse.cdt.codan.internal.checkers.ui.quickfix, see https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix

I found this presentation about CDT refactoring, there are a few slides about creating AST nodes (node factory), ASTRewrite and generating changes that might useful to you:
https://wiki.eclipse.org/images/b/be/PTPUserDev2012_Ruegg_Refactoring.pdf

About how to use this within your tool, it will depend a lot on how close your tool is to being an Eclipse plugin running in a workspace with a C/C++ project. If some of those conditions are not met, you will have a few more hurdles, like having to add all cdt.core dependencies on the classpath, figuring out if you can do AST writing on an external file (non-workspace), etc.

Either way, it sounds like an interesting project and something that you could write about in a blog or developer FAQ if you do manage to get it working.

Regards,
Marc-André


On Oct 23, 2019, at 1:58 AM, Ming Cheng <chengm349@xxxxxxxxxxx> wrote:

Hi The team,
 
I want to develop C++ source code generator according to user’s diagram something like UML tool but very limited just for my needs. So my questions are:
 
  1. Can I call CDT lib’s API to generate C++ class/functions?
  2. What’s the ABC steps so I can follow them to merge the lib into my tool to see some very basic features?
 
Ming Cheng.
Warm Regards
 
 
Sent from Mail for Windows 10
 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev


Back to the top