From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id yKOaOgtd1WUlIgAAe85BDQ:P1 (envelope-from ) for ; Wed, 21 Feb 2024 03:16:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id yKOaOgtd1WUlIgAAe85BDQ (envelope-from ) for ; Wed, 21 Feb 2024 03:16:44 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SlurbS13; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708481803; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=N1dtveLRe6xvDuap3Jos00U2YNCcgwfu7Yi7QgQlJHo=; b=kxaSq3X1NBD2Ke/KozoebIDom+eCAWJaHmWkSdki6EWD8+z53Rm48loQdmBzECjDtr/9ia SKHWlc5PK6uM4kt/azB4mrn6eNDxeIRNujRJf6Q5Jn1B59knGyH4UjV7SCfImy4gn4QUXB ipr+jMoF/U0tlh+aLDnCy39yJu1fbTD/mAxvdTwEBWRiHo5ixF+lBzVvOHWp5cjyEhtr6o KufzIhIiUfAYVcp4MX1VCyQTK5swSQwT7h1t1CcR9sEJBYg4OcOunmfOWqVTl9H1kG0u0X /OfY80PPbqi5/kVLWMwruX1e5SeVdVApyj3UTCGdKP9on43KGO3uV/0R7Rv8Ug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=SlurbS13; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708481803; a=rsa-sha256; cv=none; b=Ao17P1KQIOUYmWw/pSVwaeKKhGQOuq8gRnhmGIoVkNfZxWjcX/73TzWV/ZnF+pW+Z/EqpM Pj1yMFbMif2l8zTSYbSXL4Y6ywnxKOngB4MPM0SSIxfk3Ursvap5/lE/ZHUOICl5/V/vDq Szt+J+9oeWP/DHuuSXSfFZeSnnZWFZ/IsquwA6bF616RyyU5zhGkhb+BOuDt2602dGhNdl HiAn2c4SUerK8ilO6b6uYQvaNzKUxKXJN7rJt0v3swE87ZZPso8fLK+RqDJXeO6xCHSgZa Xa3pa0hgGw0Z6k/2nlhC1xVdehw6sxgrru6Qa0Q4YLabiSM8AHvPOyBwOUaNXg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 07FFB5A774 for ; Wed, 21 Feb 2024 03:16:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcc9F-0001Zu-Hs; Tue, 20 Feb 2024 21:15:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcc9E-0001Y8-28 for emacs-orgmode@gnu.org; Tue, 20 Feb 2024 21:15:48 -0500 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcc9C-0008Nu-9H for emacs-orgmode@gnu.org; Tue, 20 Feb 2024 21:15:47 -0500 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5114a21176cso1519934e87.1 for ; Tue, 20 Feb 2024 18:15:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708481744; x=1709086544; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N1dtveLRe6xvDuap3Jos00U2YNCcgwfu7Yi7QgQlJHo=; b=SlurbS13ZroN0haTTawq6Yjl2BcTDfzyEBgaiaVUawMe/Wq+0bjsPRzPAhZq79Z992 vVT5Sk2eI07ODHLolTi6l0sHcrwxpgRxLnQ3hzY7ddTcQ2FaNw2bsVDyE5VbZVx4GFAH 5/SmFGs/wx/lmqpGKIL2BtwB1PLqa6cUlNWgLEt6fJEod2FQfZgo6EZjhehHuN42xdYR NSn8Ur7rx5Omo7BoPZnzwq5TinchZCh88Q5nf4cK/Acfzgw9D50QXhxMhn0SAPBFKlIX +aR/HV4Z2EtDioAHy3MXwSxXESbESc8CxzTlODzHItbXIdM/nFXddvj+Uz/rD+qyKhC7 mf1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708481744; x=1709086544; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N1dtveLRe6xvDuap3Jos00U2YNCcgwfu7Yi7QgQlJHo=; b=Ppkn1MTKR2s5s2XYSw+ZgEhEGKwzZWk6akEjd52odKqa3UMcJoGv/FfOyNmNktEzSX O8slNxfk0WMqzK1zC8K/sv0AbcBNC+GQK08NdP8q1qMp5XtaVtf4C618EGP6C3tj2441 ImhSpHW42pbdbBGPqyxloUw1zHSJ+0E4PmdX4VIGqHionrCtY+y5sHXwBru3XfTkNS0B Mw5krYEnr9Jbux8+tnNKlVLhlxJ2Te1dpJEVSlUFQXuCyTKBsyvOtpkTXOQBgmrJIT5A 5U6rVeDeoQXI1TkI6p+wf1kbG8Lhj+GyyO1eZAuMJlB9WkChzYpIgTy7dzsLJWesbD8O Y8qw== X-Gm-Message-State: AOJu0YyLIT6ow593/OKWXeL6+p3j7PL74ukORyDoMqDETnyBh//d8oK6 yBqTohBGQVv8LWewdLbuyIABq418n4udLLDGfTG9i0jIh/ucebMnhepqZMCFP+a9gow7GHPTWpR 3W1INRubFuzz9xcNiXLYX4WJhu87b9JCo X-Google-Smtp-Source: AGHT+IH70/5bhd+u9t3y8zTb3mtCdRA2vdwFmnaCf24jKwoWQhBNaPUQwJDMK3KLWiSPz2TN9MKNNEAPD/H1w/gpGJk= X-Received: by 2002:a05:6512:4023:b0:512:adb7:7951 with SMTP id br35-20020a056512402300b00512adb77951mr6197229lfb.5.1708481743491; Tue, 20 Feb 2024 18:15:43 -0800 (PST) MIME-Version: 1.0 References: <8734tnflag.fsf@localhost> In-Reply-To: <8734tnflag.fsf@localhost> From: Stefano Ghirlanda Date: Tue, 20 Feb 2024 18:15:06 -0800 Message-ID: Subject: Re: Best way to extract info from C files? To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=sg19721222@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.16 X-Spam-Score: -6.16 X-Migadu-Queue-Id: 07FFB5A774 X-Migadu-Scanner: mx11.migadu.com X-TUID: yUNY3jM1oY9e Thanks! I'm looking into tree-sitter now just to learn how it works :) On Tue, Feb 20, 2024 at 3:01=E2=80=AFAM Ihor Radchenko wrote: > > Stefano Ghirlanda writes: > > > I'm trying to build a simple code documentation tool for org-mode, so > > I'm looking for ways to get information from C files (to begin with, > > ideally it will be easy to add other languages). Things like function > > prototypes, struct definitions, etc. What would be the best tool for > > this? My search has come up with things like lsp-mode, semantic, etags > > but I have no experience with any of these. What would be easiest to > > work with / setup, and have the necessary functionality? Or should I > > just write my own parsing code? > > tree-sitter or lsp might work. Or xrefs. Or TAGS. > > > More specifically, my initial goal is to be able to parse things in a > > format similar naturaldocs.org, for example: > > > > // Function: This is a brief description. > > // Parameters: > > // - x: The first parameter > > // - y: The second parameter > > // Return: A value > > int my_function( int x, int y ); > > This simple scenario might be parsed with custom regexps. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at --=20 Stefano Ghirlanda CTO, DataWorks - https://dataworks.consulting Guest Professor - Stockholm University Centre for Cultural Evolution