📄 translator.pl
字号:
#!perl -w########################################################################### Converts the OpenVXI headers to the DTDs that we ship as documentation## $Id: translator.pl,v 1.2.4.1 2001/10/03 16:37:00 dmeyer Exp $## Copyright 2001. SpeechWorks International, Inc. ## Use of this software is subject to notices and obligations set forth# in the SpeechWorks Public License - Software Version 1.1 which is# included with this software.## SpeechWorks is a registered trademark, and SpeechWorks Here, # DialogModules and the SpeechWorks logo are trademarks of SpeechWorks # International, Inc. in the United States and other countries. ##########################################################################if ($#ARGV < 1) { print "Usage: $0 header_file output_file\n"; print "\n"; exit 1;}# Attempt to open file.$header_file = $ARGV[0];if (! -e $header_file) { print STDERR "Error: $header_file not found.\n"; exit 1;}unless (open header_file) { print STDERR "Can't open $header_file: $!\n"; exit 1;}# Get last line starting with 'const'$linenum = 0;$lastline = 0;while ($line = <header_file>) { ++$linenum; if ($line =~ /^const/) { $lastline = $linenum; }}close header_file;# Open out put fileopen(FINAL, ">$ARGV[1]") || die "Error: opening <$ARGV[1]> for output\n";# Skip first lines.unless (open header_file) { print STDERR "Can't open $header_file: $!\n"; exit 1;}$linenum = 0;while (($linenum < $lastline) && ($line = <header_file>)) { ++$linenum;}while ($line = <header_file>) { $line =~ s|^\"||; # Drop " at start of line $line =~ s|\\n\"(.)*||g; # Drop \n" at end of line $line =~ s|>\";|>|; # Convert >"; to > on last line $line =~ s|>;|>|; # Convert >; to > on last line $line =~ s|\\\"|\"|g; # Convert \" to " print FINAL "$line";}close(FINAL);close(header_file);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -