[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-grep] Implemented --show-c-function and --show-function-line=RE

From: Tony Abou-Assaleh
Subject: Re: [bug-grep] Implemented --show-c-function and --show-function-line=RE
Date: Thu, 27 Jan 2005 10:22:49 -0400 (AST)

> Implementing this involved making sure grep's internal matcher could
> be set up and invoked on two different regular expressions (the main
> PATTERN and the RE above for function lines).  This meant in turn that
> the code in src/search.c and src/dfa.c had to no longer rely on static
> variables.  This is done through the introduction of an opaque
> "struct match_handle" and a revealed "struct match_spec" for src/search.c,
> and through the introduction of "struct dfa_syntax", "struct dfa_lex",
> and "struct dfa_parse" to extend by inclusion the existing "struct dfa"
> for src/dfa.c.  Variables shared between different sources files through
> the "extern" mechanism are also gone (as is the need for the now empty
> src/grepmat.c).

Do you think these changes, if extended a bit, can be used to support the
AND operator (or Universes of cgrep, or regions of other greps)?

I have some code that implements universes in grep in an ad-hoc way
(regexp within another regexp, print outer if it includes inner). My code
doesn't allow overlapping or nesting of universes. And with using -P
(PCRE), one could capture functions, especially if their decleration
syntax is standardized



Tony Abou-Assaleh
Ph.D. Candidate, Faculty of Computer Science
Chair of the Dalhousie Student Chapter of the ACM
Dalhousie University, Halifax, NS, Canada, B3H 1W5
Fax:   902-492-1517
Email: address@hidden
WWW:   http://www.cs.dal.ca/~taa/
---------------------[THE END]--------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]