9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "ozan s. yigit" <oz@cs.yorku.ca>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] samuel
Date: Mon, 11 Mar 2002 18:06:19 +0000	[thread overview]
Message-ID: <4da3d9af.0203111002.2078a2a2@posting.google.com> (raw)
In-Reply-To: <3.0.6.32.20020311101349.00998010@pop3.clear.net.nz>

Andrew Simmons:

> ... I'd just like some way to find function definitions without
> changing the way I lay them out. grep ^nurdge *.c does have the appeal of
> simplicity, but I don't like adjusting my style to suit the machine.

it is not hard to write an ad-hoc scanner/parser to look for right
sorts of things and capture what you want. i once wrote a tool that
finds anything that looks like a function call in c-like programs.
it knows how to skip comments, and how to collect the arguments
(string or otherwise in multiple lines) after an identifier and an
opening paren, with proper number of closing parens:

csee -e 'draw$' frdelete.c
	..
draw(f->b, Rect(pt0.x, pt0.y, pt0.x+(f->r.max.x-pt1.x), q0), f->b,
nil, pt1)
draw(f->b, Rect(f->r.min.x, q0, f->r.max.x, q0+(q2-q1)), f->b, nil,
Pt(f->r.min.x, q1))

whereas unaided grep 'draw' will only get you

draw(f->b, Rect(pt0.x, pt0.y, pt0.x+(f->r.max.x-pt1.x), q0),
draw(f->b, Rect(f->r.min.x, q0, f->r.max.x, q0+(q2-q1)),

this was handy in finding functions regardless of how they were laid
out
instead of just bits and pieces.

oz
---
computing is cognitively constrained. -- peter roosen-runge


  parent reply	other threads:[~2002-03-11 18:06 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-10 20:32 rob pike
2002-03-10 21:13 ` Andrew Simmons
2002-03-10 21:25   ` William Josephson
2002-03-11 10:09   ` Ralph Corderoy
2002-03-11 18:06   ` ozan s. yigit [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-18 10:39 Joel Salomon
2002-03-18 14:53 ` AMSRL-CI-CN
2002-04-08 12:53   ` Joel Salomon
2002-03-13 14:31 bwc
2002-03-11 15:54 rob pike
2002-03-11 17:59 ` Thomas Bushnell, BSG
2002-03-11 15:22 Russ Cox
2002-03-11 17:49 ` Thomas Bushnell, BSG
2002-03-11  8:50 Bengt Kleberg
2002-03-11  4:50 Geoff Collyer
2002-03-11  1:08 Russ Cox
2002-03-11 10:10 ` Thomas Bushnell, BSG
2002-03-11 17:16 ` ozan s. yigit
2002-03-11  0:15 Geoff Collyer
2002-03-11  0:04 Geoff Collyer
2002-03-11 10:09 ` Thomas Bushnell, BSG
2002-03-13 14:13   ` Laura Creighton
2002-03-13 14:23     ` Lucio De Re
2002-03-13 18:08       ` Laura Creighton
2002-03-14  5:53         ` Lucio De Re
2002-03-14  9:56     ` Douglas A. Gwyn
2002-03-10 23:59 Alex Danilo
2002-03-11  0:07 ` Alexander Viro
2002-03-11  7:44   ` Steve Kilbane
2002-03-11  0:45 ` Andrew Simmons
2002-03-11 10:10   ` Thomas Bushnell, BSG
2002-03-10 22:51 forsyth
2002-03-11  0:21 ` Andrew Simmons
2002-03-10 22:20 forsyth
2002-03-10 21:42 presotto
2002-03-10  3:38 rob pike
2002-03-10 20:17 ` Andrew Simmons
2002-03-10 22:15   ` Steve Kilbane
2002-03-10  3:27 geoff
2002-03-10 19:42 ` Andrew Simmons
2002-03-10  2:46 Alex Danilo
2002-02-27 23:05 seanq
2002-02-27 23:15 ` William Josephson
2002-02-28  4:49 ` Lucio De Re
2002-02-28 12:53   ` Boyd Roberts
2002-03-11 10:04   ` Escape Clause
2002-03-19 13:25     ` Harri J Haataja
2002-03-20 14:00       ` Boyd Roberts
2002-03-21 11:02         ` Ralph Corderoy
2002-02-28 12:51 ` Boyd Roberts
2002-02-27 15:24 forsyth
2002-02-27 15:23 ` Boyd Roberts
2002-02-27 14:30 Fco.J.Ballesteros
2002-02-27 14:26 rob pike
2002-02-27 14:23 Fco.J.Ballesteros
2002-02-27 14:21 rob pike
2002-02-28 13:19 ` Jim Kelleman
2002-02-27 14:16 Fco.J.Ballesteros
2002-02-27 13:17 Boyd Roberts
2002-02-27 23:04 ` skipt

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=4da3d9af.0203111002.2078a2a2@posting.google.com \
    --to=oz@cs.yorku.ca \
    --cc=9fans@cse.psu.edu \
    /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).