Re: Give me your strings.

Tom Christiansen <tchrist@convex.COM>
Tue, 12 Feb 91 20:10:54 GMT

          From comp.compilers

Related articles
Give me your strings. (1991-02-12)
Re: Give me your strings. tchrist@convex.COM (Tom Christiansen) (1991-02-12)
Re: Give me your strings. (1991-02-13)
| List of all articles for this month |

Newsgroups: comp.unix.questions,comp.unix.programmer,comp.compilers
From: Tom Christiansen <tchrist@convex.COM>
Keywords: C, lex, question
Organization: CONVEX Software Development, Richardson, TX
References: <>
Date: Tue, 12 Feb 91 20:10:54 GMT

>From the keyboard of (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. :-)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.