#! /usr/bin/perl # m4conv.pl -- converts standard M4 quotes and prefix builtins # $Id$ # Carlos Duarte , 000210 use strict; my %o = ( LQ => "\`", RQ => "\'", DEFAULT_PREFIX => 'm4_', ); sub usage { print <; $o{REQUOTE} and do { s/\`/$o{LQ}/sg; s/\'/$o{RQ}/sg; }; $o{PREFIX} and eval { s/\b$key_re\b/$o{PREFIX}$&/sg; }; print; exit; sub get_keys { local ($_,$.); my $k; while () { s/\s*$//s; $k .= quotemeta $_; $k .= "|"; } defined $k or return undef; chop $k; return "\\b($k)\\b"; } __DATA__ builtin changecom changequote changeword debugfile debugmode decr define defn divert divnum dnl dumpdef errprint esyscmd eval __file__ format __gnu__ ifdef ifelse include incr index indir len __line__ m4exit m4wrap maketemp patsubst popdef pushdef regexp shift sinclude substr syscmd sysval traceoff traceon translit undefine undivert unix