Xref: utzoo comp.unix.questions:28709 comp.unix.programmer:1078 comp.compilers:1717 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!think.com!mintaka!spdcc!iecc!compilers-sender From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions,comp.unix.programmer,comp.compilers Subject: Re: Give me your strings. Keywords: C, lex, question Message-ID: <1991Feb12.201054.129@convex.com> Date: 12 Feb 91 20:10:54 GMT References: <1991Feb12.144738.11530@lgc.com> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: Tom Christiansen Organization: CONVEX Software Development, Richardson, TX Lines: 28 Approved: compilers@iecc.cambridge.ma.us From the keyboard of cl@lgc.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. :-) --tom -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.