|Give me your strings. email@example.com (1991-02-12)|
|Re: Give me your strings. tchrist@convex.COM (Tom Christiansen) (1991-02-12)|
|Re: Give me your strings. firstname.lastname@example.org (1991-02-13)|
|From:||Tom Christiansen <tchrist@convex.COM>|
|Keywords:||C, lex, question|
|Organization:||CONVEX Software Development, Richardson, TX|
|Date:||Tue, 12 Feb 91 20:10:54 GMT|
>From the keyboard of email@example.com (Cameron Laird):
:I want to be able to type
: show_me_source_strings source1.c source2.c
:and receive something like
: source1.c: "This is a string in the C-source source1.c"
: source1.c: "I'm a string too, passed to the function %s.\n""
: source1.c: "I initialize a char *.";
: source2.c: "Me too; I'm in the string-space of this program."
: source2.c: "There's another string in this file, but it's in comments."
:Is the point clear? I'm looking for an executable that knows enough C
:(or Pascal, ...) syntax to isolate string constants, and echo them out
:to a file (possibly stdout).
The cxref program will do this for you. You could also use xstr. You'll
have to postprocess each of these to get precisely the output you
specified. xstr is available on uunet:bsd-sources/pgrm/xstr/* via anon
ftp. I would use xstr myself.
Perl solutions available upon demand. :-)
Return to the
Search the comp.compilers archives again.