⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 awkc++.ps

📁 c programming pearls answer
💻 PS
📖 第 1 页 / 共 5 页
字号:
%!PS-Adobe-2.0
%%Copyright: Copyright (c) 1993 AT&T, All Rights Reserved
%%Version: 3.4
%%DocumentFonts: (atend)
%%Pages: (atend)
%%BoundingBox: (atend)
%%EndComments
/DpostDict 200 dict def
DpostDict begin
%
% Copyright (c) 1993 AT&T, All Rights Reserved
%
% Version 3.4 prologue for troff files.
%

/#copies 1 store
/Prologue (dpost.ps) def
/aspectratio 1 def
/formsperpage 1 def
/landscape false def
/linewidth .3 def
/magnification 1 def
/margin 0 def
/orientation 0 def
/resolution 720 def
/rotation 1 def
/xoffset 0 def
/yoffset 0 def

/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def

/R  /Times-Roman def
/I  /Times-Italic def
/B  /Times-Bold def
/BI /Times-BoldItalic def
/H  /Helvetica def
/HI /Helvetica-Oblique def
/HB /Helvetica-Bold def
/HX /Helvetica-BoldOblique def
/CW /Courier def
/CO /Courier def
/CI /Courier-Oblique def
/CB /Courier-Bold def
/CX /Courier-BoldOblique def
/PA /Palatino-Roman def
/PI /Palatino-Italic def
/PB /Palatino-Bold def
/PX /Palatino-BoldItalic def
/Hr /Helvetica-Narrow def
/Hi /Helvetica-Narrow-Oblique def
/Hb /Helvetica-Narrow-Bold def
/Hx /Helvetica-Narrow-BoldOblique def
/KR /Bookman-Light def
/KI /Bookman-LightItalic def
/KB /Bookman-Demi def
/KX /Bookman-DemiItalic def
/AR /AvantGarde-Book def
/AI /AvantGarde-BookOblique def
/AB /AvantGarde-Demi def
/AX /AvantGarde-DemiOblique def
/NR /NewCenturySchlbk-Roman def
/NI /NewCenturySchlbk-Italic def
/NB /NewCenturySchlbk-Bold def
/NX /NewCenturySchlbk-BoldItalic def
/ZD /ZapfDingbats def
/ZI /ZapfChancery-MediumItalic def
/S  /S def
/S1 /S1 def
/GR /Symbol def

/inch {72 mul} bind def
/min {2 copy gt {exch} if pop} bind def

/setup {
	counttomark 2 idiv {def} repeat pop

	landscape {/orientation 90 orientation add def} if
	/scaling 72 resolution div def
	linewidth setlinewidth
	1 setlinecap

	pagedimensions
	xcenter ycenter translate
	orientation rotation mul rotate
	width 2 div neg height 2 div translate
	xoffset inch yoffset inch neg translate
	margin 2 div dup neg translate
	magnification dup aspectratio mul scale
	scaling scaling scale

	addmetrics
	0 0 moveto
} def

/pagedimensions {
	useclippath userdict /gotpagebbox known not and {
		/pagebbox [clippath pathbbox newpath] def
		roundpage currentdict /roundpagebbox known and {roundpagebbox} if
	} if
	pagebbox aload pop
	4 -1 roll exch 4 1 roll 4 copy
	landscape {4 2 roll} if
	sub /width exch def
	sub /height exch def
	add 2 div /xcenter exch def
	add 2 div /ycenter exch def
	userdict /gotpagebbox true put
} def

/landscapepage {
	landscape not {
		0 height scaling div neg translate	% not quite
		90 rotate
	} if
} bind def

/portraitpage {
	landscape {
		width scaling div 0 translate	% not quite
		-90 rotate
	} if
} bind def

/addmetrics {
	/Symbol /S null Sdefs cf
	/Times-Roman /S1 StandardEncoding dup length array copy S1defs cf
} def

/pagesetup {
	/page exch def
	currentdict /pagedict known currentdict page known and {
		page load pagedict exch get cvx exec
	} if
} def

/decodingdefs [
	{counttomark 2 idiv {y moveto show} repeat}
	{neg /y exch def counttomark 2 idiv {y moveto show} repeat}
	{neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat}
	{neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat}
	{counttomark 2 idiv {y moveto show} repeat}
	{neg setfunnytext}
] def

/setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def

/w {neg moveto show} bind def
/m {neg dup /y exch def moveto} bind def
/done {/lastpage where {pop lastpage} if} def

/f {
	dup /font exch def findfont exch
	dup /ptsize exch def scaling div dup /size exch def scalefont setfont
	linewidth ptsize mul scaling 10 mul div setlinewidth
	/spacewidth ( ) stringwidth pop def
} bind def

/changefont {
	/fontheight exch def
	/fontslant exch def
	currentfont [
		1 0
		fontheight ptsize div fontslant sin mul fontslant cos div
		fontheight ptsize div
		0 0
	] makefont setfont
} bind def

/sf {f} bind def

/cf {
	dup length 2 idiv
	/entries exch def
	/chtab exch def
	/newencoding exch def
	/newfont exch def

	findfont dup length 1 add dict
	/newdict exch def
	{1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall

	newencoding type /arraytype eq {newdict /Encoding newencoding put} if

	newdict /Metrics entries dict put
	newdict /Metrics get
	begin
		chtab aload pop
		1 1 entries {pop def} for
		newfont newdict definefont pop
	end
} bind def

%
% A few arrays used to adjust reference points and character widths in some
% of the printer resident fonts. If square roots are too high try changing
% the lines describing /radical and /radicalex to,
%
%	/radical	[0 -75 550 0]
%	/radicalex	[-50 -75 500 0]
%
% Move braceleftbt a bit - default PostScript character is off a bit.
%

/Sdefs [
	/bracketlefttp		[201 500]
	/bracketleftbt		[201 500]
	/bracketrighttp		[-81 380]
	/bracketrightbt		[-83 380]
	/braceleftbt		[203 490]
	/bracketrightex		[220 -125 500 0]
	/radical		[0 0 550 0]
	/radicalex		[-50 0 500 0]
	/parenleftex		[-20 -170 0 0]
	/integral		[100 -50 500 0]
	/infinity		[10 -75 730 0]
] def

/S1defs [
	/underscore		[0 80 500 0]
	/endash			[7 90 650 0]
] def
end
%%EndProlog
%%BeginSetup
DpostDict begin
mark
/rotation 1 def
/gotpagebbox true def
/linewidth 0.5 def
/xoffset 0 def
/yoffset 0 def
/#copies 1 store
/magnification 1 def
%%FormsPerPage: 1
/formsperpage 1 def
%%Patch from lp
%%EndPatch from lp
/landscape false def
/resolution 720 def
setup
2 setdecoding
end
%%EndSetup
%%Page: 1 1
%%PageBoundingBox: (atend)
DpostDict begin
/saveobj save def
mark
1 pagesetup
12 B f
(An AWK to C++ Translator)4 1449 1 2371 1230 t
10 I f
(Brian W. Kernighan)2 814 1 2689 1470 t
10 R f
(Bell Laboratories)1 696 1 2748 1650 t
(Murray Hill, NJ 07974)3 916 1 2638 1770 t
10 CW f
(bwk@research.bell-labs.com)2316 1890 w
10 I f
(ABSTRACT)2859 2270 w
10 R f
(This paper describes an experiment to produce an)7 2065 1 1546 2530 t
8 R f
(AWK)3648 2530 w
10 R f
(to C++ translator and an)4 1020 1 3876 2530 t
8 R f
(AWK)1296 2650 w
10 R f
( intent is to generate efficient and read-)7 1600( The)1 210( supporting library.)2 779(class definition and)2 789 4 1518 2650 t
(able C++, so that the generated code will run faster than interpreted)11 2728 1 1296 2770 t
8 R f
(AWK)4052 2770 w
10 R f
(and can also be)3 624 1 4272 2770 t
(modified and extended where an)4 1326 1 1296 2890 t
8 R f
(AWK)2653 2890 w
10 R f
( The)1 210(program could not be.)3 897 2 2874 2890 t
8 R f
(AWK)4011 2890 w
10 R f
(class and library)2 664 1 4232 2890 t
( translator to access)3 811(can also be used independently of the)6 1545 2 1296 3010 t
8 R f
(AWK)3686 3010 w
10 R f
(facilities from C++ pro-)3 985 1 3911 3010 t
(grams.)1296 3130 w
10 B f
(1. Introduction)1 670 1 936 3490 t
10 R f
(An)1186 3620 w
8 R f
(AWK)1333 3620 w
10 R f
(program [1] is a sequence of pattern-action statements:)7 2192 1 1549 3620 t
10 I f
(pattern)1296 3800 w
10 CW f
({)1796 3800 w
10 I f
(action)1881 3800 w
10 CW f
(})2156 3800 w
10 I f
(pattern)1296 3920 w
10 CW f
({)1796 3920 w
10 I f
(action)1881 3920 w
10 CW f
(})2156 3920 w
10 I f
(...)1296 4040 w
10 R f
(A)936 4220 w
10 I f
(pattern)1035 4220 w
10 R f
( expression, or combination of these; an)6 1613(is a regular expression, numeric expression, string)6 2014 2 1351 4220 t
10 I f
(action)5006 4220 w
10 R f
( operation of an)3 629( The)1 205(is executable code similar to C.)5 1254 3 936 4340 t
8 R f
(AWK)3049 4340 w
10 R f
(program is)1 430 1 3265 4340 t
(for each input line)3 729 1 1296 4520 t
(for each pattern)2 625 1 1546 4640 t
(if the pattern matches the input line)6 1415 1 1796 4760 t
(do the action)2 516 1 2046 4880 t
(Variables in an)2 608 1 936 5060 t
8 R f
(AWK)1571 5060 w
10 R f
(program contain string or numeric values or both according to context; there are built-)13 3467 1 1789 5060 t
( work on strings or)4 775( Operators)1 449(in variables for useful values such as the input filename and record number.)12 3096 3 936 5180 t
( have arbitrary subscripts \(``associative)4 1588( Arrays)1 326(numbers, coercing the types of their operands as necessary.)8 2406 3 936 5300 t
( is read and input lines are split into fields, called)10 2002(arrays''\). Input)1 632 2 936 5420 t
10 CW f
($1)3599 5420 w
10 R f
(,)3719 5420 w
10 CW f
($2)3773 5420 w
10 R f
( flow statements are)3 810( Control)1 359(, etc.)1 194 3 3893 5420 t
(like those of C:)3 623 1 936 5540 t
10 CW f
(if-else)1587 5540 w
10 R f
(,)2007 5540 w
10 CW f
(while)2060 5540 w
10 R f
(,)2360 5540 w
10 CW f
(for)2413 5540 w
10 R f
(,)2593 5540 w
10 CW f
(do)2646 5540 w
10 R f
( are user-defined and built-in functions for arithmetic,)7 2179(. There)1 311 2 2766 5540 t
(string, regular expression pattern-matching, and input and output to/from arbitrary files and processes.)12 4085 1 936 5660 t
(The standard implementation of)3 1279 1 1186 5790 t
8 R f
(AWK)2490 5790 w
10 R f
(is an interpreter: an)3 773 1 2706 5790 t
8 R f
(AWK)3504 5790 w
10 R f
(program is parsed into an internal rep-)6 1536 1 3720 5790 t
(resentation, which is then interpreted by a set of routines.)9 2288 1 936 5910 t
8 R f
(AWK)1186 6040 w
10 R f
( often)1 243( This)1 241(is a closed language; there is no access to libraries or to separately written code.)14 3358 3 1414 6040 t
( in some)2 355(forces users into contortions to do some operation that would be much more naturally expressed)14 3965 2 936 6160 t
( C++ provides a way to extend)6 1275( translator into)2 597( A)1 129(other language.)1 622 4 936 6280 t
8 R f
(AWK)3592 6280 w
10 R f
(programs, by combining them with)4 1440 1 3816 6280 t
(C++ code.)1 417 1 936 6400 t
8 R f
(AWK)1186 6530 w
10 R f
( numerous examples of)3 932( and there are)3 539( 3, 4]\))2 223(is in some ways a seductive tool \(see, for example, [2,)10 2160 4 1402 6530 t
8 R f
(AWK)936 6650 w
10 R f
( translator provides an)3 914( A)1 130( grew from sensible small versions into awkward large ones.)9 2490(programs that)1 561 4 1161 6650 t
( takes place in a more suitable lan-)7 1453(escape path: a program may be translated so that further development)10 2867 2 936 6770 t
(guage.)936 6890 w

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -