ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 0/7] docparse improvements
Date: Wed, 27 Oct 2021 15:48:50 +0200	[thread overview]
Message-ID: <YXlYwi7+VUIitM7H@yuki> (raw)
In-Reply-To: <87tuh2poue.fsf@suse.de>

Hi!
> It's unfortunate that before starting this effort and the checker that
> we didn't know about tree-sitter (although Sparse may still be the best
> choice for the checker).
> 
> Tree-sitter can parse C into an AST and can easily be vendored into LTP:
> https://tree-sitter.github.io/tree-sitter/using-parsers#building-the-library
> 
> Then we just need to work on the level of the AST. It also has a query
> language. This should allow the initial matching to be done on a high
> level.

The only worry that I have about this would be speed, currently the code
I wrote takes a few second to process thousands of C files in LTP, that
is because we take a lot of shortcuts and ignore all the stuff we do not
need. Full parser that builds AST would be orders of magnitude slower,
so before we attempt to use it it should be benchmarked properly to see
if it's fast enough.

> If we continue down the path of hand parsing C, then it will most likely
> result in constant tweaks and additions.

Well I would say that this patchset is the last addition for the parser,
if we ever need anything more complex we should really switch to
something else. On the other hand I do not think that we will ever need
more complexity in the parser than this, as long as we keep things sane.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-10-27 13:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 15:47 [LTP] [PATCH 0/7] docparse improvements Cyril Hrubis
2021-10-18 15:47 ` [LTP] [PATCH 1/7] docparse: Implement #define and #include Cyril Hrubis
2021-10-29  8:26   ` Petr Vorel
2021-10-29  8:27   ` Petr Vorel
2021-10-18 15:47 ` [LTP] [PATCH 2/7] docparse: Add tests Cyril Hrubis
2021-10-22 11:32   ` Petr Vorel
2021-10-25 12:46     ` Cyril Hrubis
2021-10-25 20:00       ` Petr Vorel
2021-10-22 11:41   ` Petr Vorel
2021-10-25 12:51     ` Cyril Hrubis
2021-10-25 20:01       ` Petr Vorel
2021-10-18 15:47 ` [LTP] [PATCH 3/7] docparse: data_storage: Add integer type node Cyril Hrubis
2021-10-18 15:47 ` [LTP] [PATCH 4/7] docparse: Implement ARRAY_SIZE() Cyril Hrubis
2021-11-01 12:36   ` Richard Palethorpe
2021-11-01 13:18     ` Cyril Hrubis
2021-10-18 15:47 ` [LTP] [PATCH 5/7] docparse: Add type normalization Cyril Hrubis
2021-10-18 15:47 ` [LTP] [PATCH 6/7] docparse: Group data to 'testsuite' and 'defaults' Cyril Hrubis
2021-10-18 15:47 ` [LTP] [PATCH 7/7] docparse/Makefile: Do not abort on missing generators Cyril Hrubis
2021-10-22 11:29   ` Petr Vorel
2021-10-25 12:48     ` Cyril Hrubis
2021-10-27  9:47       ` Petr Vorel
2021-10-18 15:48 ` [LTP] [PATCH 0/7] docparse improvements Cyril Hrubis
2021-10-27 13:22 ` Richard Palethorpe
2021-10-27 13:48   ` Cyril Hrubis [this message]
2021-10-28  8:11     ` Richard Palethorpe
2021-10-29  8:54       ` Cyril Hrubis
2021-11-01  9:04         ` Richard Palethorpe
2021-11-01  9:59           ` Cyril Hrubis
2021-11-01 12:20             ` Richard Palethorpe
2021-11-01 15:10               ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YXlYwi7+VUIitM7H@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).