From f52bf8ab02dfe021e415adb17fb01ea9b1d388f1 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 11 Jul 2006 05:45:00 +0000 Subject: Totally revamped test system. Nitro will be fixed soon. A bunch of new tests. Delphi and XML are now tested, too. bench/example.dump deleted (depends on Ruby version, OS, whatever. Nothing for the repo.) --- test/c/error.out.raydebug | 2 +- test/c/open-string.in.c | 1 + test/c/open-string.out.raydebug | 1 + test/c/strange.out.raydebug | 180 +- test/c/suite.rb | 11 +- test/delphi/pluto.in.pas | 10829 +++++++++++++++++++++++++++++ test/delphi/pluto.out.raydebug | 10829 +++++++++++++++++++++++++++++ test/delphi/suite.rb | 3 + test/delphi/ytools.in.pas | 2708 ++++++++ test/delphi/ytools.out.raydebug | 2708 ++++++++ test/html/ampersand.out.raydebug | 2 +- test/html/suite.rb | 11 +- test/html/tolkien.html | 538 +- test/html/tolkien.out.raydebug | 338 +- test/nitro-xhtml/suite.rb | 3 + test/nitro-xhtml/tags.in.xhtml | 87 + test/nitro-xhtml/tags.out.raydebug | 87 + test/rhtml/day.out.raydebug | 52 +- test/rhtml/suite.rb | 11 +- test/ruby/1.out.raydebug | 1462 ++-- test/ruby/besetzung.out.raydebug | Bin 3160 -> 3105 bytes test/ruby/class.out.raydebug | 166 +- test/ruby/comment.out.raydebug | 34 +- test/ruby/evil.out.raydebug | 2246 +++--- test/ruby/example.out.raydebug | 7578 ++++++++++---------- test/ruby/jarh.out.raydebug | 742 +- test/ruby/open-heredoc.out.raydebug | 2 +- test/ruby/open-inline.in.rb | 1 + test/ruby/open-inline.out.raydebug | 2 + test/ruby/open-string.out.raydebug | 2 +- test/ruby/pleac.out.raydebug | 12736 +++++++++++++++++----------------- test/ruby/quotes.out.raydebug | 6 +- test/ruby/sidebarize.out.raydebug | 288 +- test/ruby/simple.out.raydebug | 4 +- test/ruby/strange.out.raydebug | 682 +- test/ruby/suite.rb | 12 +- test/ruby/test-fitter.out.raydebug | 90 +- test/ruby/tk-calc.out.raydebug | 10 +- test/ruby/undef.out.raydebug | 36 +- test/suite.rb | 113 +- test/xhtml/suite.rb | 9 - test/xhtml/tags.in.xhtml | 87 - test/xhtml/tags.out.raydebug | 87 - test/xml/kate.html | 259 +- test/xml/kate.out.raydebug | 152 +- test/xml/suite.rb | 11 +- 46 files changed, 40952 insertions(+), 14266 deletions(-) create mode 100644 test/c/open-string.in.c create mode 100644 test/c/open-string.out.raydebug create mode 100644 test/delphi/pluto.in.pas create mode 100644 test/delphi/pluto.out.raydebug create mode 100644 test/delphi/suite.rb create mode 100644 test/delphi/ytools.in.pas create mode 100644 test/delphi/ytools.out.raydebug create mode 100644 test/nitro-xhtml/suite.rb create mode 100644 test/nitro-xhtml/tags.in.xhtml create mode 100644 test/nitro-xhtml/tags.out.raydebug create mode 100644 test/ruby/open-inline.in.rb create mode 100644 test/ruby/open-inline.out.raydebug delete mode 100644 test/xhtml/suite.rb delete mode 100644 test/xhtml/tags.in.xhtml delete mode 100644 test/xhtml/tags.out.raydebug (limited to 'test') diff --git a/test/c/error.out.raydebug b/test/c/error.out.raydebug index bc3c350..a52becb 100644 --- a/test/c/error.out.raydebug +++ b/test/c/error.out.raydebug @@ -1 +1 @@ -error(\\)\ +error(\\)\ diff --git a/test/c/open-string.in.c b/test/c/open-string.in.c new file mode 100644 index 0000000..9d68933 --- /dev/null +++ b/test/c/open-string.in.c @@ -0,0 +1 @@ +" \ No newline at end of file diff --git a/test/c/open-string.out.raydebug b/test/c/open-string.out.raydebug new file mode 100644 index 0000000..a6afd22 --- /dev/null +++ b/test/c/open-string.out.raydebug @@ -0,0 +1 @@ +string \ No newline at end of file diff --git a/test/c/strange.out.raydebug b/test/c/strange.out.raydebug index d323c14..8979a50 100644 --- a/test/c/strange.out.raydebug +++ b/test/c/strange.out.raydebug @@ -1,90 +1,90 @@ -preprocessor(#include) include("ruby.h") comment(/* - /sLaSh * - oBfUsCaTeD RuBy * - cOpYrIgHt 2005 * -bY SiMoN StRaNdGaArD * - #{X=320;Y=200;Z=20} */) - -preprocessor(#define) ident(GUN1) integer(42)operator(:) -preprocessor(#define) ident(GUN2) integer(43)operator(:) -preprocessor(#define) ident(bo) reserved(do) -preprocessor(#define) ident(when)operator(()ident(gun)operator(\)) comment(/**/) -preprocessor(#define) ident(DATA) string -preprocessor(#define) ident(DIRTY)operator(()ident(argc)operator(,)ident(argv)operator(\))\ -ident(argc)operator(,)ident(argv)operator(,)pre_type(char)operator(=)ident(eval)operator(()\ -string\ -operator(\);)ident(sun)operator(=)ident(O)operator(.)ident(new)\ -reserved(if)operator(()integer(0)operator(\)) - -pre_type(int) -ident(sun)operator([]={)integer(12)operator(,)integer(9)operator(,)integer(16)operator(,)integer(9)operator(,)integer(2)operator(,)integer(1)operator(,)integer(7)operator(,)integer(1)operator(,)integer(3)operator(,)integer(9)operator(,)integer(27)operator(,)integer(4)operator(,) integer(13)operator(,)integer(2)operator(,)integer(11)operator(,)integer(5)operator(,)integer(4)operator(,)integer(1)operator(,)integer(25)operator(,) -integer(5)operator(,)integer(0)operator(,)integer(1)operator(,)integer(14)operator(,)integer(9)operator(,)integer(15)operator(,)integer(4)operator(,)integer(26)operator(,)integer(9)operator(,)integer(23)operator(,)integer(2)operator(,)integer(17)operator(,)integer(6)operator(,)integer(31)operator(,) integer(6)operator(,)integer(10)operator(,)integer(8)operator(,)integer(22)operator(,)integer(9)operator(,)integer(21)operator(,)integer(1)operator(,) -integer(24)operator(,)integer(8)operator(,)integer(20)operator(,)integer(8)operator(,)integer(18)operator(,)integer(9)operator(,)integer(29)operator(,)integer(5)operator(,)integer(9)operator(,)integer(5)operator(,)integer(1)operator(,)integer(1)operator(,)integer(28)operator(,)integer(8)operator(,)integer(8)operator(,)integer(1)operator(,)integer(30)operator(,) integer(9)operator(,)integer(6)operator(,)integer(8)operator(,) integer(5)operator(,)integer(1)operator(,) -integer(19)operator(,)integer(9)operator(,)integer(36)operator(,)integer(19)operator(,)integer(43)operator(,) integer(9)operator(,)integer(34)operator(,)integer(11)operator(,)integer(50)operator(,)integer(19)operator(,)integer(48)operator(,)integer(18)operator(,)integer(49)operator(,)integer(9)operator(,) integer(35)operator(,)integer(8)operator(,)integer(42)operator(,)integer(18)operator(,) -integer(51)operator(,)integer(8)operator(,)integer(44)operator(,)integer(11)operator(,)integer(32)operator(,) integer(11)operator(,)integer(47)operator(,)integer(9)operator(,)integer(37)operator(,)integer(1)operator(,)integer(39)operator(,)integer(9)operator(,)integer(38)operator(,)integer(19)operator(,) integer(45)operator(,)integer(8)operator(,)integer(40)operator(,)integer(12)operator(,) -integer(41)operator(,)integer(9)operator(,)integer(46)operator(,)integer(12)operator(,)integer(33)operator(,)integer(1)operator(,)integer(57)operator(,)integer(1)operator(,)integer(85)operator(,)integer(5)operator(,)integer(88)operator(,)integer(28)operator(,)integer(83)operator(,)integer(4)operator(,)integer(87)operator(,) integer(6)operator(,)integer(62)operator(,)integer(28)operator(,)integer(89)operator(,) -integer(9)operator(,)integer(80)operator(,)integer(28)operator(,)integer(60)operator(,)integer(21)operator(,)integer(52)operator(,)integer(21)operator(,)integer(72)operator(,)integer(29)operator(,)integer(54)operator(,)integer(21)operator(,)integer(75)operator(,)integer(8)operator(,)integer(70)operator(,)integer(29)operator(,)integer(58)operator(,)integer(28)operator(,)integer(65)operator(,) -integer(9)operator(,)integer(91)operator(,)integer(8)operator(,)integer(74)operator(,)integer(29)operator(,)integer(79)operator(,)integer(2)operator(,)integer(77)operator(,)integer(1)operator(,)integer(53)operator(,)integer(1)operator(,)integer(81)operator(,)integer(5)operator(,) integer(69)operator(,)integer(2)operator(,)integer(64)operator(,)integer(21)operator(,) integer(86)operator(,)integer(29)operator(,) -integer(67)operator(,)integer(9)operator(,)integer(59)operator(,)integer(1)operator(,)integer(61)operator(,)integer(5)operator(,)integer(73)operator(,)integer(6)operator(,)integer(76)operator(,)integer(28)operator(,)integer(56)operator(,)integer(21)operator(,)integer(68)operator(,)integer(29)operator(,)integer(78)operator(,)integer(29)operator(,)integer(63)operator(,)integer(5)operator(,)integer(66)operator(,) -integer(28)operator(,)integer(90)operator(,)integer(29)operator(,) integer(71)operator(,)integer(4)operator(,)integer(55)operator(,)integer(9)operator(,)integer(84)operator(,)integer(28)operator(,)integer(82)operator(,)integer(29)operator(,)integer(101)operator(,)integer(5)operator(,) integer(103)operator(,)integer(9)operator(,) integer(98)operator(,)integer(35)operator(,) -integer(97)operator(,)integer(1)operator(,)integer(94)operator(,)integer(35)operator(,)integer(93)operator(,)integer(1)operator(,)integer(100)operator(,)integer(35)operator(,)integer(92)operator(,)integer(31)operator(,)integer(99)operator(,)integer(5)operator(,)integer(96)operator(,)integer(39)operator(,)integer(95)operator(,)integer(5)operator(,)integer(102)operator(,)integer(35)operator(};) - -pre_type(void) ident(run)operator(()pre_type(int) ident(gun)operator(=)integer(0)operator(\)) operator({) comment(// [gun]=[:GUN1,:GUN2]) - ident(printf)operator(()stringoperator(,) ident(gun)operator(\);) - reserved(switch)operator(()ident(gun)operator(\)) operator({) - reserved(case) ident(GUN1) ident(when)operator(()integer(2)operator(\)) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) comment(// end) - reserved(case) ident(GUN2) ident(when)operator(()integer(3)operator(\)) - ident(printf)operator(()stringoperator(\);) - reserved(break)operator(;) comment(// end) - operator(}) -operator(}) - -pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char)operator(**) ident(argv)operator(\)) operator({) - ident(printf)operator(()stringoperator(,) ident(argc)operator(\);) - pre_type(int) ident(fun)operator(=)integer(5)operator(;) - ident(bo) operator({) - ident(fun) operator(-=) integer(1)operator(;) comment(//.id - gun = fun) - ident(run)operator(()ident(fun)operator(\);) - operator(}) reserved(while)operator(()ident(fun)operator(>)integer(0)operator(\);) - ident(ruby_init)operator((\);) - ident(rb_eval_string)operator(()ident(DATA)operator(\);) - reserved(return) integer(0)operator(;) -operator(}) - -comment(# if 0 // nobody reads un-defined code -def goto*s;$s=[];Y.times{s=[];X.times{s<<[0]*3};$s<< s}end;A=0.5 -include Math;def u g,h,i,j,k,l;f,*m=((j-h\).abs>(k-i\).abs\)?[proc{ -|n,o| g[o] [n ]=l },[h ,i ],[j,k]]:[proc{ -|p,q| g[ p][ q] =l} ,[ i,h ], [k,j]];b,a=m.sort -c,d=a [1 ]-b [1 ],a [0 ]-b [0 ];d.times{|e|f. -call( e+b[ 0] ,c* e/d+b [1]\)};end;V=0;def bo&u -$u||= V; ;$u += 1+V ;; return u.call if$u>1;q=128.0 -;x=(V .. 255 \). map {| y|f1,z =sin(y.to_f*PI/q\), -sin(( y. to_f + 200 \)*PI/( q\)\);[(f1*30.0+110.0\). -to_i,((f1+z\)*10.0+40.0\).to_i,(z*20.0+120.0\).to_i]};Y.times{|i|X. -times{|j|i1=((i*0.3+150\)*(j*1.1+50\)/50.0\).to_i;i2=((i*0.8+510\)*( -j*0.9+1060\)/51.0\).to_i;$s[i][j]=x[(i1*i2\)%255].clone}};$a=(0..25\). -inject([]\){|a,i|a<<(V..3\).inject([]\){|r,j|r<<$c[i*4+j]}};u.call;end -I=LocalJumpError;def run*a,&b;return if a.size==V;if a[V]==666;$b=b -elsif$b;$b.call;end;end;def main s,&u;$m=V;u.call rescue I;end -def rb_eval_string(*a\);end # you promised not to look here -def ruby_init;q=2.0;l=((X**q\)*A+(Y**q\)*A\)**A;V.upto(Y-4\){|s|V. -upto(X-4\){|q|d=((q-X/A\)**q+(s-Y/A\)**q\)**A;e=(cos(d*PI/(l/q\)\)/q -+A\)*3.0+1.0;v=2;f=v/e;a,p,b=$s[s],$s[s+1],$s[s+v];r=a[q][V]*e+ -p[q][V]+a[q+1][V]+b[q][V]+a[q+v][V]+b[q+v/v][V]+p[q+v][V]+b[q+ -v][V]*f;g=[a[q][V],b[q][V],a[q+v][V],b[q+v][V]];h=(g.max-g.min -\)*f;$s[s][q][V]=[[(r/(e+f+6.0\)+A+(h*0.4\)\).to_i,255].min,V].max -}};File.open("res.ppm","w+"\){|f|f.write(# secret.greetings :-\) -"P3\\n# res.ppm\\n#{X} #{Y}\\n255\\n"+$s.map{|a|a.map{|b|b.join' ' -}.join(' '\)+"\\n"}.join\)};end;def switch i,&b;b.call;return unless -defined?($m\);b=(X*0.01\).to_i;d=1.0/40.0;e=0.09;c=(Y*0.01\).to_i -a=$a.map{|(f,g,h,j\)|[f*d,g*e,h*d,j*e]};a.each{|(k,l,m,n\)|u($s,(k*X -\).to_i+b+i,(l*Y\).to_i+c+i,(m*X\).to_i+b+i,(n*Y\).to_i+c+i,[Z]*3\)} -a.each{|(o,q,r,s\)|u($s,(o*(X-Z\)\).to_i+i,(q*(Y-Z\)\).to_i+i,(r*(X- -Z\)\).to_i+i,(s*(Y-Z\)\).to_i+i,[(1<<8\)-1]*3\)};end;Q=Object;class -Regexp;def []=(v,is\);is.each{|s|Q.send(:remove_const,s\)if Q. -const_defined? s;Q.const_set(s,v\)};end;end;def int*ptr;666 -end;class O;def []=(a,b=nil\);$c=a;end;end;alias:void:goto -#endif // pretend as if you havn't seen anything) +preprocessor(#include) include("ruby.h") comment(/* + /sLaSh * + oBfUsCaTeD RuBy * + cOpYrIgHt 2005 * +bY SiMoN StRaNdGaArD * + #{X=320;Y=200;Z=20} */) + +preprocessor(#define) ident(GUN1) integer(42)operator(:) +preprocessor(#define) ident(GUN2) integer(43)operator(:) +preprocessor(#define) ident(bo) reserved(do) +preprocessor(#define) ident(when)operator(()ident(gun)operator(\)) comment(/**/) +preprocessor(#define) ident(DATA) string +preprocessor(#define) ident(DIRTY)operator(()ident(argc)operator(,)ident(argv)operator(\))\ +ident(argc)operator(,)ident(argv)operator(,)pre_type(char)operator(=)ident(eval)operator(()\ +string\ +operator(\);)ident(sun)operator(=)ident(O)operator(.)ident(new)\ +reserved(if)operator(()integer(0)operator(\)) + +pre_type(int) +ident(sun)operator([]={)integer(12)operator(,)integer(9)operator(,)integer(16)operator(,)integer(9)operator(,)integer(2)operator(,)integer(1)operator(,)integer(7)operator(,)integer(1)operator(,)integer(3)operator(,)integer(9)operator(,)integer(27)operator(,)integer(4)operator(,) integer(13)operator(,)integer(2)operator(,)integer(11)operator(,)integer(5)operator(,)integer(4)operator(,)integer(1)operator(,)integer(25)operator(,) +integer(5)operator(,)integer(0)operator(,)integer(1)operator(,)integer(14)operator(,)integer(9)operator(,)integer(15)operator(,)integer(4)operator(,)integer(26)operator(,)integer(9)operator(,)integer(23)operator(,)integer(2)operator(,)integer(17)operator(,)integer(6)operator(,)integer(31)operator(,) integer(6)operator(,)integer(10)operator(,)integer(8)operator(,)integer(22)operator(,)integer(9)operator(,)integer(21)operator(,)integer(1)operator(,) +integer(24)operator(,)integer(8)operator(,)integer(20)operator(,)integer(8)operator(,)integer(18)operator(,)integer(9)operator(,)integer(29)operator(,)integer(5)operator(,)integer(9)operator(,)integer(5)operator(,)integer(1)operator(,)integer(1)operator(,)integer(28)operator(,)integer(8)operator(,)integer(8)operator(,)integer(1)operator(,)integer(30)operator(,) integer(9)operator(,)integer(6)operator(,)integer(8)operator(,) integer(5)operator(,)integer(1)operator(,) +integer(19)operator(,)integer(9)operator(,)integer(36)operator(,)integer(19)operator(,)integer(43)operator(,) integer(9)operator(,)integer(34)operator(,)integer(11)operator(,)integer(50)operator(,)integer(19)operator(,)integer(48)operator(,)integer(18)operator(,)integer(49)operator(,)integer(9)operator(,) integer(35)operator(,)integer(8)operator(,)integer(42)operator(,)integer(18)operator(,) +integer(51)operator(,)integer(8)operator(,)integer(44)operator(,)integer(11)operator(,)integer(32)operator(,) integer(11)operator(,)integer(47)operator(,)integer(9)operator(,)integer(37)operator(,)integer(1)operator(,)integer(39)operator(,)integer(9)operator(,)integer(38)operator(,)integer(19)operator(,) integer(45)operator(,)integer(8)operator(,)integer(40)operator(,)integer(12)operator(,) +integer(41)operator(,)integer(9)operator(,)integer(46)operator(,)integer(12)operator(,)integer(33)operator(,)integer(1)operator(,)integer(57)operator(,)integer(1)operator(,)integer(85)operator(,)integer(5)operator(,)integer(88)operator(,)integer(28)operator(,)integer(83)operator(,)integer(4)operator(,)integer(87)operator(,) integer(6)operator(,)integer(62)operator(,)integer(28)operator(,)integer(89)operator(,) +integer(9)operator(,)integer(80)operator(,)integer(28)operator(,)integer(60)operator(,)integer(21)operator(,)integer(52)operator(,)integer(21)operator(,)integer(72)operator(,)integer(29)operator(,)integer(54)operator(,)integer(21)operator(,)integer(75)operator(,)integer(8)operator(,)integer(70)operator(,)integer(29)operator(,)integer(58)operator(,)integer(28)operator(,)integer(65)operator(,) +integer(9)operator(,)integer(91)operator(,)integer(8)operator(,)integer(74)operator(,)integer(29)operator(,)integer(79)operator(,)integer(2)operator(,)integer(77)operator(,)integer(1)operator(,)integer(53)operator(,)integer(1)operator(,)integer(81)operator(,)integer(5)operator(,) integer(69)operator(,)integer(2)operator(,)integer(64)operator(,)integer(21)operator(,) integer(86)operator(,)integer(29)operator(,) +integer(67)operator(,)integer(9)operator(,)integer(59)operator(,)integer(1)operator(,)integer(61)operator(,)integer(5)operator(,)integer(73)operator(,)integer(6)operator(,)integer(76)operator(,)integer(28)operator(,)integer(56)operator(,)integer(21)operator(,)integer(68)operator(,)integer(29)operator(,)integer(78)operator(,)integer(29)operator(,)integer(63)operator(,)integer(5)operator(,)integer(66)operator(,) +integer(28)operator(,)integer(90)operator(,)integer(29)operator(,) integer(71)operator(,)integer(4)operator(,)integer(55)operator(,)integer(9)operator(,)integer(84)operator(,)integer(28)operator(,)integer(82)operator(,)integer(29)operator(,)integer(101)operator(,)integer(5)operator(,) integer(103)operator(,)integer(9)operator(,) integer(98)operator(,)integer(35)operator(,) +integer(97)operator(,)integer(1)operator(,)integer(94)operator(,)integer(35)operator(,)integer(93)operator(,)integer(1)operator(,)integer(100)operator(,)integer(35)operator(,)integer(92)operator(,)integer(31)operator(,)integer(99)operator(,)integer(5)operator(,)integer(96)operator(,)integer(39)operator(,)integer(95)operator(,)integer(5)operator(,)integer(102)operator(,)integer(35)operator(};) + +pre_type(void) ident(run)operator(()pre_type(int) ident(gun)operator(=)integer(0)operator(\)) operator({) comment(// [gun]=[:GUN1,:GUN2]) + ident(printf)operator(()stringoperator(,) ident(gun)operator(\);) + reserved(switch)operator(()ident(gun)operator(\)) operator({) + reserved(case) ident(GUN1) ident(when)operator(()integer(2)operator(\)) + ident(printf)operator(()stringoperator(\);) + reserved(break)operator(;) comment(// end) + reserved(case) ident(GUN2) ident(when)operator(()integer(3)operator(\)) + ident(printf)operator(()stringoperator(\);) + reserved(break)operator(;) comment(// end) + operator(}) +operator(}) + +pre_type(int) ident(main)operator(()pre_type(int) ident(argc)operator(,) pre_type(char)operator(**) ident(argv)operator(\)) operator({) + ident(printf)operator(()stringoperator(,) ident(argc)operator(\);) + pre_type(int) ident(fun)operator(=)integer(5)operator(;) + ident(bo) operator({) + ident(fun) operator(-=) integer(1)operator(;) comment(//.id - gun = fun) + ident(run)operator(()ident(fun)operator(\);) + operator(}) reserved(while)operator(()ident(fun)operator(>)integer(0)operator(\);) + ident(ruby_init)operator((\);) + ident(rb_eval_string)operator(()ident(DATA)operator(\);) + reserved(return) integer(0)operator(;) +operator(}) + +comment(# if 0 // nobody reads un-defined code +def goto*s;$s=[];Y.times{s=[];X.times{s<<[0]*3};$s<< s}end;A=0.5 +include Math;def u g,h,i,j,k,l;f,*m=((j-h\).abs>(k-i\).abs\)?[proc{ +|n,o| g[o] [n ]=l },[h ,i ],[j,k]]:[proc{ +|p,q| g[ p][ q] =l} ,[ i,h ], [k,j]];b,a=m.sort +c,d=a [1 ]-b [1 ],a [0 ]-b [0 ];d.times{|e|f. +call( e+b[ 0] ,c* e/d+b [1]\)};end;V=0;def bo&u +$u||= V; ;$u += 1+V ;; return u.call if$u>1;q=128.0 +;x=(V .. 255 \). map {| y|f1,z =sin(y.to_f*PI/q\), +sin(( y. to_f + 200 \)*PI/( q\)\);[(f1*30.0+110.0\). +to_i,((f1+z\)*10.0+40.0\).to_i,(z*20.0+120.0\).to_i]};Y.times{|i|X. +times{|j|i1=((i*0.3+150\)*(j*1.1+50\)/50.0\).to_i;i2=((i*0.8+510\)*( +j*0.9+1060\)/51.0\).to_i;$s[i][j]=x[(i1*i2\)%255].clone}};$a=(0..25\). +inject([]\){|a,i|a<<(V..3\).inject([]\){|r,j|r<<$c[i*4+j]}};u.call;end +I=LocalJumpError;def run*a,&b;return if a.size==V;if a[V]==666;$b=b +elsif$b;$b.call;end;end;def main s,&u;$m=V;u.call rescue I;end +def rb_eval_string(*a\);end # you promised not to look here +def ruby_init;q=2.0;l=((X**q\)*A+(Y**q\)*A\)**A;V.upto(Y-4\){|s|V. +upto(X-4\){|q|d=((q-X/A\)**q+(s-Y/A\)**q\)**A;e=(cos(d*PI/(l/q\)\)/q ++A\)*3.0+1.0;v=2;f=v/e;a,p,b=$s[s],$s[s+1],$s[s+v];r=a[q][V]*e+ +p[q][V]+a[q+1][V]+b[q][V]+a[q+v][V]+b[q+v/v][V]+p[q+v][V]+b[q+ +v][V]*f;g=[a[q][V],b[q][V],a[q+v][V],b[q+v][V]];h=(g.max-g.min +\)*f;$s[s][q][V]=[[(r/(e+f+6.0\)+A+(h*0.4\)\).to_i,255].min,V].max +}};File.open("res.ppm","w+"\){|f|f.write(# secret.greetings :-\) +"P3\\n# res.ppm\\n#{X} #{Y}\\n255\\n"+$s.map{|a|a.map{|b|b.join' ' +}.join(' '\)+"\\n"}.join\)};end;def switch i,&b;b.call;return unless +defined?($m\);b=(X*0.01\).to_i;d=1.0/40.0;e=0.09;c=(Y*0.01\).to_i +a=$a.map{|(f,g,h,j\)|[f*d,g*e,h*d,j*e]};a.each{|(k,l,m,n\)|u($s,(k*X +\).to_i+b+i,(l*Y\).to_i+c+i,(m*X\).to_i+b+i,(n*Y\).to_i+c+i,[Z]*3\)} +a.each{|(o,q,r,s\)|u($s,(o*(X-Z\)\).to_i+i,(q*(Y-Z\)\).to_i+i,(r*(X- +Z\)\).to_i+i,(s*(Y-Z\)\).to_i+i,[(1<<8\)-1]*3\)};end;Q=Object;class +Regexp;def []=(v,is\);is.each{|s|Q.send(:remove_const,s\)if Q. +const_defined? s;Q.const_set(s,v\)};end;end;def int*ptr;666 +end;class O;def []=(a,b=nil\);$c=a;end;end;alias:void:goto +#endif // pretend as if you havn't seen anything) diff --git a/test/c/suite.rb b/test/c/suite.rb index 8b32792..fc94ad3 100644 --- a/test/c/suite.rb +++ b/test/c/suite.rb @@ -1,9 +1,2 @@ -class CTest < CodeRaySuite - - @file = __FILE__ - LANG = :c - EXTENSION = 'c' - -end - -$suite << CTest.suite if $suite +class C < CodeRay::TestCase +end diff --git a/test/delphi/pluto.in.pas b/test/delphi/pluto.in.pas new file mode 100644 index 0000000..b7aaad7 --- /dev/null +++ b/test/delphi/pluto.in.pas @@ -0,0 +1,10829 @@ +unit FindTH; + +interface + +uses + Classes, windows, Dialogs, ComCtrls, CompEx, SysUtils, YTools, YTypes, + clock, plutoconst, StdCtrls, Masks, Forms, XReg; + +const + RegMoleVersion = '1.1'; + +type + TFindThreadProgress = (fpNone, fpEvery512th, fpEach); + + TRegFindThread = class(TThread) + private + SearchText: string; + SearchFor: TSearchOptions; + Progress: TFindThreadProgress; + FindNodeText: string; + TimeElapsed: Double; + syncIcon: Integer; + syncStatusText: string; + CurrentPath: string; + KeysScanned: Integer; + Mask: TMask; + dwordVal: DWORD; + SearchForValues: Boolean; + + procedure Find; + + //Synchronizers + procedure Start; + procedure Add; + procedure UpdateStatus; + procedure Finish; + protected + procedure Execute; override; + public + SpecialPath: string; + FindNode: TTreeNode; + ListTV: TTreeView; + ObjectsFound, KeysFound, ValuesFound, DataFound: Integer; + Ranges: TRanges; + destructor Destroy; override; + constructor CreateIt(PriorityLevel: TThreadPriority; s: string; + SearchFor: TSearchOptions; Progress: TFindThreadProgress); + end; + +implementation + +uses + ValuesU, StrUtils; + +{ TRegFindThread } + +procedure TRegFindThread.Add; +var + Node: TTreeNode; +begin + with ListTV do begin + //Items.BeginUpdate; + Node := TTreeNode.Create(Items); + SetTNImage(Node, syncIcon); + Items.AddNode(Node, FindNode, Copy(CurrentPath, 1, 255), nil, + naAddChildFirst); + if not FindNode.Expanded and (FindNode.Count = 1) then //First Node + FindNode.Expand(False); + //Items.EndUpdate; + end; +end; + +constructor TRegFindThread.CreateIt(PriorityLevel: TThreadPriority; s: string; + SearchFor: TSearchOptions; Progress: TFindThreadProgress); +begin + inherited Create(True); // Create thread suspended + Priority := PriorityLevel; // Set Priority Level + FreeOnTerminate := True; // Thread Free Itself when terminated + + SearchText := s; + Ranges := nil; + Self.SearchFor := SearchFor; + Self.Progress := Progress; +end; + +destructor TRegFindThread.Destroy; +begin + if Assigned(FindNode) then + FindNode.Data := nil; + inherited; +end; + +procedure TRegFindThread.Execute; +begin + Synchronize(Start); + Find; + Synchronize(Finish); +end; + +procedure TRegFindThread.Find; +var + SpecialKey: HKEY; + + procedure Add(const Path: string; const Icon: Integer); + var + zCurrentPath: string; + begin + zCurrentPath := CurrentPath; + + CurrentPath := Path; + syncIcon := Icon; + Synchronize(Self.Add); + + CurrentPath := zCurrentPath; + end; + + procedure AddValueName(const ValueName: string; Typ: TRegDataType); + begin + Add(CurrentPath + '\\' + ValueName, IconOfDataType(Typ)); + end; + + procedure AddValueData(const ValueName: string; Context: TRegContext); + begin + Add(CurrentPath + '\\' + ValueName + ' = ' + DataPreviewOfContext(Context), + IconOfDataType(Context.Typ)); + end; + + function FoundInStr(const Data: string): Boolean; + begin + Result := False; + if SearchText = '' then + Exit; + + if (Data = '') and not (sfWildCards in SearchFor) then + Exit; + + if sfWildCards in SearchFor then begin + if Assigned(Mask) then + Result := Mask.Matches(Data); + end else begin + {if not (sfFileNames in SearchFor) then begin + if TextBegin(SearchText, UntilChar(Data, '~')) and FileExists(Data) then + Result := SameFileName(SearchText, GetFileNew(Data)); + Exit; + end; } + + if [sfParts, sfIgnoreCase] <= SearchFor then + if SfUseLocales in SearchFor then + Result := 0= SizeOf(Cardinal)) and + (dwordVal = PCardinal(Copy(Data, 1, SizeOf(Cardinal)))^) then begin + Inc(DataFound); + AddValueData(ValueName, + RegContext(Typ, ByteAOfStr(Data))); + end; + end; + + else + if sfOtherTypes in SearchFor then begin + if FoundInStr(Data) then begin + Inc(DataFound); + AddValueData(ValueName, + RegContext(Typ, ByteAOfStr(Data))); + end; + end; + end; + end; + + begin + MaxLen := Info.MaxValueLen + 1; //Include Nullbyte + + Buffer := nil; + if sfValueData in SearchFor then + GetMem(Buffer, Info.MaxDataLen); + + GetMem(ValueName, MaxLen); + for i := 0 to Info.NumValues-1 do begin + NameLen := MaxLen; + Len := Info.MaxDataLen; + if not Success(RegEnumValue(Key, i, ValueName, NameLen, nil, @Typ, + Buffer, @Len)) then + Continue; + + if sfValueNames in SearchFor then + if FoundInStr(ValueName) then begin + Inc(ValuesFound); + AddValueName(ValueName, Typ); + end; + + if sfValueData in SearchFor then + ScanValue(ValueName, Typ, string(Copy(TByteA(Buffer), 0, Len))); + end; + + FreeMem(ValueName, MaxLen); + if sfValueData in SearchFor then + FreeMem(Buffer, Info.MaxDataLen); + end; + + procedure ScanKey(Key: HKEY; const KeyName: string = ''); + var + p: PChar; + i, z: Integer; + l, Len: DWORD; + NewKey: HKEY; + Info: TRegKeyInfo; + begin + if Terminated then Exit; + + Inc(KeysScanned); + if Progress <> fpNone then + if (Progress = fpEach) or + ((Progress = fpEvery512th) and ((KeysScanned and $1FF) = 0)) then begin + syncStatusText := '(' + IntToStr(KeysScanned) + ' k) ' + CurrentPath; + Synchronize(UpdateStatus); + end; + + with Info do + if not Success(RegQueryInfoKey(Key, nil, nil, nil, @NumSubKeys, + @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, @MaxDataLen, + nil, nil)) then + Exit; + + if (Info.NumValues > 0) and SearchForValues then + ScanValues(Key, Info); + + if Info.NumSubKeys <= 0 then + Exit; + + Len := Info.MaxSubKeyLen + 1; + GetMem(p, Len); + + for i := 0 to Info.NumSubKeys-1 do begin + l := Len; + RegEnumKeyEx(Key, i, p, l, nil, nil, nil, nil); + if sfKeys in SearchFor then + if FoundInStr(p) then begin + Inc(KeysFound); + Add(CurrentPath + '\' + p, iconKeyMiddle); + end; + + if Success(RegOpenKey(Key, p, NewKey)) then begin + z := Length(CurrentPath); + CurrentPath := CurrentPath + '\' + p; + + try + ScanKey(NewKey, p); + finally + RegCloseKey(NewKey); + end; + + SetLength(CurrentPath, z); + end; + + if Terminated then Break; + end; + + FreeMem(p, Len); + end; + +begin + with TClock.Create do begin + FindNode.Text := FindNodeText + ': '; + + try + if sfHKU in SearchFor then begin + CurrentPath := 'HKU'; + ScanKey(HKEY_USERS); + end; + if sfHKLM in SearchFor then begin + CurrentPath := 'HKLM'; + ScanKey(HKEY_LOCAL_MACHINE); + end; + if sfHKDD in SearchFor then begin + CurrentPath := 'HKDD'; + ScanKey(HKEY_DYN_DATA); + end; + + if SpecialPath <> '' then begin + if Success(RegOpenKey(HKEYOfStr(ExRegRoot(SpecialPath)), + PChar(ExRegKey(SpecialPath)), SpecialKey)) then begin + CurrentPath := LWPSolve(SpecialPath); + ScanKey(SpecialKey); + RegCloseKey(SpecialKey); + end else + ShowMessage('Could not open' + EOL + + Quote(SpecialPath)); + end; + except + syncStatusText := '(' + IntToStr(KeysScanned) + ' k) ' + CurrentPath + + 'Error --> Terminated.'; + Synchronize(UpdateStatus); + Sleep(1000); + end; + + TimeElapsed := SecondsPassed; + Free; end; +end; + +function StrOfSearchOptions(const Options: TSearchOptions): string; + + procedure Add(const s: string); + begin + Result := Result + s; + end; + + procedure AddOption(const Option: string; const Flag: TSearchVar; + const Optional: Boolean = False); + begin + if Flag in Options then + Add(Option) + else + if not Optional then + Add('^' + Option); + end; + +begin + Result := ''; + + Add('['); + AddOption('H', sfAsHex, True); + AddOption('W ', sfWildcards, True); + + AddOption('C', sfIgnoreCase); + AddOption('L', sfUseLocales); + AddOption('P ', sfParts); + + AddOption('K', sfKeys); + AddOption('N', sfValueNames); + AddOption('D ', sfValueData); + + AddOption('S', sfString); + AddOption('D', sfDWORD); + AddOption('O', sfOtherTypes); + AddOption('?', sfSpecialTypes); + + Add('] ['); + + if [sfHKU, sfHKLM, sfHKDD] <= Options then + Add('ALL') + else begin + AddOption('HKU ', sfHKU, True); + AddOption('HKLM ', sfHKLM, True); + AddOption('HKDD ', sfHKDD, True); + Result := TrimRight(Result); + end; + + Add(']'); +end; + +procedure TRegFindThread.Start; +begin + Mask := nil; + KeysFound := 0; + ValuesFound := 0; + DataFound := 0; + KeysScanned := 0; + + //Prepare for options + if sfAsHex in SearchFor then begin + SearchText := string(ByteAOfHex(SearchText)); + SearchFor := SearchFor - [sfDWord, sfIgnoreCase]; + end else begin + if SfUseLocales in SearchFor then + SearchText := AnsiLowerCase(SearchText); + + dwordVal := 0; + if sfDWord in SearchFor then + if IsValidInteger(SearchText) then + dwordVal := StrToInt(SearchText) + else + Exclude(SearchFor, sfDWord); + + if sfWildCards in SearchFor then + try + Mask := TMask.Create(SearchText); + except + Mask.Free; + Mask := nil; + end; + end; + + SearchForValues := (sfValueNames in SearchFor) + or (sfValueData in SearchFor); + + FindNodeText := 'Find ' + Quote(FriendlyStr(SearchText)) + ' ' + + StrOfSearchOptions(SearchFor); + + with ListTV.Items do begin + BeginUpdate; + FindNode := AddChildObject(nil, FindNodeText + '...', nil); + FindNode.Data := Self; + SetTNImage(FindNode, iconHostReg); + EndUpdate; + end; +end; + +procedure TRegFindThread.UpdateStatus; +begin + FindNode.Text := FindNodeText + ' ' + syncStatusText; +end; + +procedure TRegFindThread.Finish; +var + Found: string; +begin + ObjectsFound := KeysFound + ValuesFound + DataFound; + + Found := StrNumerus(ObjectsFound, 'object', 'objects', 'No'); + if ObjectsFound < 2 then + Found := Found + ' found.' + else begin + Found := Found + ' found: '; + if KeysFound > 0 then + Found := Found + StrNumerus(KeysFound, 'KeyName, ', 'KeyNames, ', 'No'); + if ValuesFound > 0 then + Found := Found + StrNumerus(ValuesFound, 'ValueName, ', 'ValueNames, ', + 'No'); + if DataFound > 0 then + Found := Found + StrNumerus(DataFound, 'Data', 'Datas', 'No'); + + if RightStr(Found, 2) = ', ' then + Delete(Found, Length(Found) - 1, 2); + end; + + FindNode.Text := FindNodeText + Format(' OK (%0.1f s) %s', + [TimeElapsed, Found]); +end; + +end. +unit FindWinU; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Clipbrd, NewPanels, plutoconst, FindTH, YTools, + PrefTools, Menus, XReg, RangeEdit; + +type + TFindWin = class(TForm) + ListTV: TTreeView; + FindP: TPanel; + FindE: TEdit; + ColorPanel1: TColorPanel; + ResultsPopup: TPopupMenu; + Copy1: TMenuItem; + ColorPanel2: TColorPanel; + FindPrefP: TPanel; + CommonGB: TGroupBox; + Label4: TLabel; + SfWildCardsCB: TCheckBox; + SfPartsCB: TCheckBox; + SfIgnoreCaseCB: TCheckBox; + SfAsHexCB: TCheckBox; + SfAsDWord: TCheckBox; + SfUseLocalesCB: TCheckBox; + FindGB: TGroupBox; + SfHKUCB: TCheckBox; + SfHKLMCB: TCheckBox; + SfHKDDCB: TCheckBox; + SfRootKeyRB: TRadioButton; + SfCurKeyRB: TRadioButton; + SfCLSIDCB: TCheckBox; + SfInterfaceCB: TCheckBox; + SfKeysCb: TCheckBox; + SfValuesCB: TCheckBox; + SfDataCB: TCheckBox; + SfStringCB: TCheckBox; + SfOtherCB: TCheckBox; + SfDWordCB: TCheckBox; + Panel2: TPanel; + GroupBox1: TGroupBox; + Label1: TLabel; + ThreadPriorityComB: TComboBox; + ProgressRG: TRadioGroup; + Panel5: TPanel; + BorderPanel1: TBorderPanel; + MoleLogoI: TImage; + TypeRangeE: TRangeEdit; + SfTypesCB: TCheckBox; + Panel1: TPanel; + TransparentCB: TPrefCheckBox; + StayOnTopCB: TPrefCheckBox; + FindB: TButton; + FindPrefB: TButton; + procedure FindBClick(Sender: TObject); + procedure ListTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FindEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ActivateIt(Sender: TObject); + procedure DeActivateIt(Sender: TObject); + procedure FormDeactivate(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure SfWildCardsCBClick(Sender: TObject); + procedure StayOnTopCBClick(Sender: TObject); + procedure SfRootKeysUpdate(Sender: TObject); + procedure FindPrefBClick(Sender: TObject); + + procedure CloseFindPrefP; + procedure OpenFindPrefP; + procedure FindEChange(Sender: TObject); + procedure SfDataCBClick(Sender: TObject); + procedure ListTVDblClick(Sender: TObject); + procedure SfAsHexCBClick(Sender: TObject); + procedure Copy1Click(Sender: TObject); + procedure SfIgnoreCaseCBClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure SfTypesCBClick(Sender: TObject); + end; + +const + fpbOpen = 0; + fpbCloseCaption = 'Params &<<'; + + fpbClosed = 1; + fpbOpenCaption = 'Params &>>'; + +var + FindWin: TFindWin; + +implementation + +uses plutomain, PrefU, ValuesU; + +{$R *.DFM} + +procedure TFindWin.FindBClick(Sender: TObject); +var + SearchFor: TSearchOptions; + FindThread: TRegFindThread; + + procedure AddOption(CheckBox: TCustomCheckBox; Flag: TSearchVar); + begin + with CheckBox as TCheckBox do + if Enabled and Checked then + Include(SearchFor, Flag); + end; + +begin + SearchFor := []; + + AddOption(SfKeysCB, sfKeys); + + AddOption(SfValuesCB, sfValueNames); + AddOption(SfDataCB, sfValueData); + + AddOption(SfStringCB, sfString); + AddOption(SfDWordCB, sfDWord); + AddOption(SfOtherCB, sfOtherTypes); + + if SfRootKeyRB.Checked then begin + AddOption(SfHKUCB, sfHKU); + AddOption(SfHKLMCB, sfHKLM); + AddOption(SfHKDDCB, sfHKDD); + end; + + AddOption(SfAsHexCB, sfAsHex); + AddOption(SfWildCardsCB, sfWildCards); + AddOption(SfPartsCB, sfParts); + AddOption(SfIgnoreCaseCB, sfIgnoreCase); + AddOption(SfUseLocalesCB, sfUseLocales); + + {AddOption(SfCLSIDCB, sfCLSID); + AddOption(SfInterfaceCB, sfInterface);} + + if SfTypesCB.Checked and not TypeRangeE.RangeMaximal then + Include(SearchFor, sfSpecialTypes); + + FindThread := TRegFindThread.CreateIt( + TThreadPriority(ThreadPriorityComB.ItemIndex), FindE.Text, SearchFor, + TFindThreadProgress(ProgressRG.ItemIndex)); + + FindThread.ListTV := ListTV; + + if sfSpecialTypes in SearchFor then + FindThread.Ranges := TypeRangeE.Value; + + if SfCurKeyRB.Checked then + FindThread.SpecialPath := + LWPSolve(StrOfRegPath(CurKey(uhNonSystemShortcuts))); + + FindThread.Resume; + CloseFindPrefP; +end; + +procedure TFindWin.ListTVKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + Node: TTreeNode; + + procedure TerminateFindThread; + var + FindThread: TRegFindThread; + begin + if (Node.Level = 0) then begin + FindThread := TRegFindThread(Node.Data); + if not Assigned(FindThread) then + Node.Delete + else + try + FindThread.Terminate; + except + Node.Text := 'Error: couldn''t terminate thread!'; + end; + end else + Node.Delete; + end; + +begin + Node := ListTV.Selected; + if not Assigned(Node) then + Exit; + + case Key of + VK_F12: if Assigned(Node.Parent) then + Node.Parent.AlphaSort; + + VK_RETURN: ListTVDblClick(Sender); + + VK_DELETE: TerminateFindThread; + end; +end; + +procedure TFindWin.FindEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_RETURN then + FindBClick(Sender); + + if Key = VK_UP then begin + CloseFindPrefP; + Key := 0; + end else if Key = VK_Down then begin + OpenFindPrefP; + Key := 0; + end; +end; + +procedure TFindWin.ActivateIt(Sender: TObject); +begin + ActivateThis(Sender); +end; + +procedure TFindWin.DeActivateIt(Sender: TObject); +begin + DeActivateThis(Sender); +end; + +procedure TFindWin.FormDeactivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + DeActivateThis(ActiveControl); + + AlphaBlend := TransparentCB.Checked; +end; + +procedure TFindWin.FormActivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + ActivateThis(ActiveControl); + + AlphaBlend := False; +end; + +procedure TFindWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_ESCAPE then + Close; + MainWin.FormKeyDown(Sender, Key, Shift); +end; + +procedure TFindWin.SfWildCardsCBClick(Sender: TObject); +begin + SfPartsCB.Enabled := not SfWildcardsCB.Checked; + SfIgnoreCaseCB.Enabled := not SfWildcardsCB.Checked; + SfUseLocalesCB.Enabled := SfIgnoreCaseCB.Checked and not SfWildcardsCB.Checked; +end; + +procedure TFindWin.StayOnTopCBClick(Sender: TObject); +begin + if StayOnTopCB.Checked then + FormStyle := fsStayOnTop + else + FormStyle := fsNormal; +end; + +procedure TFindWin.SfRootKeysUpdate(Sender: TObject); +begin + with SfRootKeyRB do begin + SfHKLMCB.Enabled := Checked; + SfHKUCB.Enabled := Checked; + SfHKDDCB.Enabled := Checked; + end; +end; + +procedure TFindWin.FindPrefBClick(Sender: TObject); +begin + case FindPrefB.Tag of + fpbOpen: + CloseFindPrefP; + fpbClosed: + OpenFindPrefP; + else + ShowMessage('Fehler: FindPrefB hat unbekanntes Tag'); + end; +end; + +procedure TFindWin.CloseFindPrefP; +begin + with FindPrefB do begin + Tag := fpbClosed; + Caption := fpbOpenCaption; + end; + FindPrefP.Visible := False; + ListTV.Repaint; +end; + +procedure TFindWin.OpenFindPrefP; +begin + with FindPrefB do begin + Tag := fpbOpen; + Caption := fpbCloseCaption; + end; + FindPrefP.Visible := True; + ListTV.Repaint; +end; + +procedure TFindWin.FindEChange(Sender: TObject); +begin + if IsValidInteger(FindE.Text) then + SfDWORDCB.Caption := 'D&WORD OK' + else + SfDWORDCB.Caption := 'D&WORD ??'; + + SfAsHexCB.Enabled := (FindE.Text <> '') + and not CharIn(FindE.Text, AllChars - HexadecimalChars - [' ']); + SfAsDWord.Enabled := SfAsHexCB.Enabled and (Length(TrimAll(FindE.Text)) < 8); +end; + +procedure TFindWin.SfDataCBClick(Sender: TObject); +begin + with SfDataCB do begin + SfStringCB.Enabled := Checked; + SfDWordCB.Enabled := Checked; + SfOtherCB.Enabled := Checked; + end; +end; + +procedure TFindWin.ListTVDblClick(Sender: TObject); +var + Node: TTreeNode; +begin + Node := ListTV.Selected; + if not Assigned(Node) or (Node.Level = 0) then + Exit; + + MainWin.GotoKey(UntilLastChar(Node.Text, '=')) +end; + +procedure TFindWin.SfAsHexCBClick(Sender: TObject); +begin + with SfAsHexCB do begin + SfIgnoreCaseCB.Enabled := Checked; + SfWildCardsCB.Enabled := Checked; + end; +end; + +procedure TFindWin.Copy1Click(Sender: TObject); +var + Node: TTreeNode; +begin + Node := ListTV.Selected; + if not Assigned(Node) then + Exit; + + Clipboard.AsText := Node.Text; +end; + +procedure TFindWin.SfIgnoreCaseCBClick(Sender: TObject); +begin + SfUseLocalesCB.Enabled := SfIgnoreCaseCB.Checked; +end; + +procedure TFindWin.FormCreate(Sender: TObject); +var + ImageFile: string; +begin + Caption := 'Pluto.RegMole ' + RegMoleVersion + + ' - The fastest registry search engine for Win9x'; + + ImageFile := PlutoDir + 'mole.bmp'; + if FileExists(ImageFile) then + MoleLogoI.Picture.LoadFromFile(ImageFile); + + Width := Screen.WorkAreaWidth - 100; + + CloseFindPrefP; +end; + +procedure TFindWin.FormShow(Sender: TObject); +begin + Top := Screen.WorkAreaHeight - 450; + Height := Screen.WorkAreaHeight - Top; + Left := (Screen.WorkAreaWidth - Width) div 2; +end; + +procedure TFindWin.SfTypesCBClick(Sender: TObject); +begin + TypeRangeE.Enabled := SfTypesCB.Checked; +end; + +end. +unit Plutoconst; + +interface + +uses ComCtrls, Classes, XReg, UniKey, YTools; + +var + Started: Boolean = False; + MurphyMode: Boolean = False; + PlutoKey: TUniKey; + +const + Version = '1.6 -nium Alpha'; + Overnight = True; + Codename = 'Phoenix'; + //Generation.Version-Release-Beta + // GG.VVRRBB + VersionNum: Double = 1.600000; + //Must be Double! + +const + iconKey = 0; + + iconFirstHKEY = 2; + iconHKLM = iconFirstHKEY; + iconHKU = iconFirstHKEY + 2; + + iconFirstShortcut = iconFirstHKEY + 4; + iconHKCC = iconFirstShortcut; + iconHKCU = iconFirstShortcut + 2; + iconHKCR = iconFirstShortcut + 4; + iconHKDD = iconFirstShortcut + 6; + iconHKPD = iconFirstShortcut + 8; + iconHKWM = iconFirstShortcut + 10; + iconHKWU = iconFirstShortcut + 12; + iconShortcut = iconFirstShortcut + 14; + nHKeyIcons = 16; + + iconFirstType = iconFirstShortcut + nHKeyIcons; + iconNone = iconFirstType + 0; + iconString = iconFirstType + 1; + iconExpandString =iconFirstType + 2; + iconBinary = iconFirstType + 3; + iconCardinal = iconFirstType + 4; + iconCardBigEndian=iconFirstType + 5; + iconLink = iconFirstType + 6; + iconMultiString = iconFirstType + 7; + iconResList = iconFirstType + 8; + iconFullResDesc = iconFirstType + 9; + iconResReqList = iconFirstType + 10; + iconUnknownType = iconFirstType + 11; + nTypeIcons = 12; + + iconFirstValue = iconFirstType + nTypeIcons; + iconValueElse = iconFirstValue; + iconValueEdit = iconFirstValue + 1; + iconValueEditBinary = iconFirstValue + 2; + iconValueZeromize = iconFirstValue + 3; + iconValueDublicate = iconFirstValue + 4; + iconMainValue = iconFirstValue + 5; + iconTakeAsMainValue = iconFirstValue + 6; + nValueIcons = 7; + + iconFirstKey = iconFirstValue + nValueIcons; + iconKeyInfos = iconFirstKey; + iconSubKey = iconFirstKey + 1; + iconKeyDublicate = iconFirstKey + 2; + iconKeyFind = iconFirstKey + 3; + iconKeyTrace = iconFirstKey + 4; + nKeyIcons = 5; + + iconFirstContextMenues = iconFirstKey + nKeyIcons; + iconRename = iconFirstContextMenues; + iconDelete = iconFirstContextMenues + 1; + nContextMenuesIcon = 2; + + iconFirstIni = iconFirstContextMenues + nContextMenuesIcon; + iconIniSection = iconFirstIni; + nIniIcons = 1; + + iconFirstHost = iconFirstIni + nIniIcons; + iconHostReg = iconFirstHost; + iconHostIni = iconFirstHost + 1; + iconHostUni = iconFirstHost + 2; + iconHostUni2 = iconFirstHost + 3; + nHostIcons = 4; + + iconFirstOther = iconFirstHost + nHostIcons; + + iconSortArrowAsc = iconFirstOther + 0; + iconSortArrowDesc = iconFirstOther + 1; + iconKeyMiddle = iconFirstOther + 2; + iconLock = iconFirstOther + 3; + + //iconDefect = iconFirstOther; + + { WorkWin.ChangeImages } + iconFirstChange = 0; + iconCKeyPlus = iconFirstChange; + iconCKeyMinus = iconFirstChange + 1; + iconCValuePlus = iconFirstChange + 2; + iconCValueMinus = iconFirstChange + 3; + iconCContext = iconFirstChange + 4; + iconOldContext = iconFirstChange + 5; + iconNewContext = iconFirstChange + 6; + iconGroup = iconFirstChange + 7; + iconGroupBlinking = iconFirstChange + 8; + nChangeIcons = 7; + + DefaultValueFlag = Pointer(1); + MultiEditFlag = Pointer(2); + + NoValueCaption = '[No Value]'; + + EditControlFlag = 100; + + MaxPreviewLen = 255; + RegMaxDataSize = $FFFF; //64 KB + +const + BoolStrFileName = 'Boolean Strings.txt'; + ShortcutsFileName = 'Shortcuts.ini'; + StandardShortcutsFileName = 'StandardShortcuts.ini'; + SisyFilterFileName = 'sisy filter.txt'; + + clDarkGray = $00404040; + clBrightRed = $00BBBBFF; + clVeryBrightRed = $00DDDDFF; + clBrightBlue = $00FFBBBB; + clBrightGreen = $00BBFFBB; + clCyan = $00FFFF44; + clBrightCyan = $00FFFFBB; + clVeryBrightCyan = $00FFFFDD; + clBrightYellow = $00BBFFFF; + clVeryBrightYellow = $00DDFFFF; + clBrightPurple = $00FFBBFF; + clBrightSilver = $00DDDDDD; + clGold = $0055CCEE; + + clVeryBrightBlue = $00FFDDDD; + +type + TValueListColumn = (vlcName, vlcSize, vlcType, vlcData); + +const + ValueListColumnRange = [Low(TValueListColumn)..High(TValueListColumn)]; + +type + TSearchVar = (sfKeys, sfValueNames, sfValueData, + sfAsHex, sfAsDWord, + sfWildCards, sfParts, sfIgnoreCase, SfUseLocales, + sfHKU, sfHKLM, sfHKDD,// sfCLSID, sfInterface, + sfString, sfDWord, sfOtherTypes, sfSpecialTypes); + + TSearchOptions = set of TSearchVar; + + //be carefull: used in with! + TKeyShortcut = record + Alias: string; + RealPath: string; + Node: TTreeNode; + end; + PKeyShortcut = ^TKeyShortcut; + TShortcutA = array of TKeyShortcut; + + TOpenNode = function (Reg: TXRegistry; Node: TTreeNode): Boolean; + TCheckNode = procedure (Node: TTreeNode; OnlyOnce: Boolean = True); + + //NodeInfo System + TNodeFlag = (nfDefect, nfReadOnly, nfChecked, + nfCopy, nfCut, nfPaste); + TNodeFlags = set of TNodeFlag; + + TUniHostType = (uhNone, + uhReg, uhIni, uhRegFile, + uhUserShortcut, uhStandardShortcut, uhSystemShortcut); + TUniHostTypes = set of TUniHostType; + +const + uhShortcuts = [uhUserShortcut, uhStandardShortcut, uhSystemShortcut]; + uhNonSystemShortcuts = [uhUserShortcut, uhStandardShortcut]; + + NodeFlagStrings: array[TNodeFlag] of string = ( + 'nfDefect', 'nfReadOnly', 'nfChecked', + 'nfCopy', 'nfCut', 'nfPaste'); + + HostTypeStrings: array[TUniHostType] of string = ('uhNone', + 'uhReg', 'uhIni', 'uhRegFile', + 'uhUserShortcut', 'uhStandardShortcut', 'uhSystemShortcut'); + +type + TNodeInfo = packed class + public + HostType: TUniHostType; + Flags: TNodeFlags; + constructor Create(HostType: TUniHostType = uhNone; Flags: TNodeFlags = []); + + procedure IncludeFlag(Flag: TNodeFlag); + procedure ExcludeFlag(Flag: TNodeFlag); + + function IsHost: Boolean; + function IsShortcut: Boolean; + + function ReadOnly: Boolean; + function Checked: Boolean; + function Defect: Boolean; + end; + +function NodeInfo(Node: TTreeNode): TNodeInfo; +procedure ReportStatus(const s: string); + +const + PlatformStrings: array[0..2] of string = + ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT'); + +var + PlutoDir: string = ''; + +implementation + +uses SysUtils; + +function NodeInfo(Node: TTreeNode): TNodeInfo; +begin + if not Assigned(Node) then begin + Result := nil; + Exit end; + + if not Assigned(Node.Data) then + Node.Data := TNodeInfo.Create; + Result := TNodeInfo(Node.Data); +end; + +{ TNodeInfo } + +constructor TNodeInfo.Create(HostType: TUniHostType; Flags: TNodeFlags); +begin + inherited Create; + Self.HostType := HostType; + Self.Flags := Flags; +end; + +function TNodeInfo.Checked: Boolean; +begin + Result := nfChecked in Flags; +end; + +function TNodeInfo.ReadOnly: Boolean; +begin + Result := nfReadOnly in Flags; +end; + +function TNodeInfo.Defect: Boolean; +begin + Result := nfDefect in Flags; +end; + +procedure TNodeInfo.IncludeFlag(Flag: TNodeFlag); +begin + Include(Flags, Flag); +end; + +procedure TNodeInfo.ExcludeFlag(Flag: TNodeFlag); +begin + Exclude(Flags, Flag); +end; + +function TNodeInfo.IsHost: Boolean; +begin + Result := HostType <> uhNone; +end; + +function TNodeInfo.IsShortcut: Boolean; +begin + Result := HostType in uhShortcuts; +end; + +function GetPlutoDir: string; +begin + Result := LWPSlash(GetParam('-imports=', MyDir)); + if not DirectoryExists(Result) then begin + ReportStatus('PlutoDir "' + Result + '" not found -> setting to default (MyDir).'); + Result := MyDir; + end; + ReportStatus('PlutoDir=' + Result); +end; + +var + ReportSL: TStringList; + ReportFileName: string; + +procedure ReportStatus(const s: string); +begin + ReportSL.Add(s); + try + ReportSL.SaveToFile(ReportFileName); + except end; +end; + +initialization + ReportFileName := MyDir + 'loadreport.txt'; + ReportSL := TStringList.Create; + PlutoDir := GetPlutoDir; + +end. +//winampviscolor : +unit plutomain; +{$DEFINE UNIKEY} +{$DEFINE CYCFS} + +{=============================================================================== + + cYcnus.Pluto 1.57 Beta 14 + by Murphy + + ©2000-2003 by cYcnus + visit www.cYcnus.de + + murphy@cYcnus.de (Kornelius Kalnbach) + + this programm is published under the terms of the GPL + +===============================================================================} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ImgList, ComCtrls, ExtCtrls, Menus, Clipbrd, IniFiles, + ShellAPI, Grids, + //Components + NewPanels, + //Units + YTools, YTypes, UniKey, XReg, + //Pluto + Plutoconst, + SpyTH, SisyphusTH; + +const + NoPreBlinkHint = #1; + +type + TMainWin = class(TForm) + StatusBar: TStatusBar; + StatusBarPU: TPopupMenu; + CopyPath: TMenuItem; + InsertPath: TMenuItem; + ShowRealPathMI: TMenuItem; + PathP: TPanel; + N1: TMenuItem; + MainMenu1: TMainMenu; + Desktop1: TMenuItem; + Pluto1: TMenuItem; + RegEdit1: TMenuItem; + Free1: TMenuItem; + BigVal1: TMenuItem; + Hilfe1: TMenuItem; + History1: TMenuItem; + SplashScreen1: TMenuItem; + wwwcYcnusde1: TMenuItem; + Credits1: TMenuItem; + Optionen1: TMenuItem; + PrefMI: TMenuItem; + EditBoolStrMI: TMenuItem; + N4: TMenuItem; + ImageList1: TImageList; + Plutoini1: TMenuItem; + About1: TMenuItem; + kornycYcnusde1: TMenuItem; + ools1: TMenuItem; + NotePad1: TMenuItem; + RegEdit2: TMenuItem; + SysEdit1: TMenuItem; + WordPad1: TMenuItem; + N3: TMenuItem; + N5: TMenuItem; + Suchen1: TMenuItem; + Find1: TMenuItem; + File1: TMenuItem; + ExitPluto1: TMenuItem; + OpenProgramFolder1: TMenuItem; + N6: TMenuItem; + OpenWinDir1: TMenuItem; + HintBlinkT: TTimer; + FindCLSID1: TMenuItem; + Clipboard1: TMenuItem; + GotoCLSID1: TMenuItem; + CommandLineParameters1: TMenuItem; + plutocYcnusde1: TMenuItem; + N7: TMenuItem; + heinzcYcnusde1: TMenuItem; + kornycYcnusde2: TMenuItem; + N8: TMenuItem; + ExternalHexEditMI: TMenuItem; + Cleanup1: TMenuItem; + DeleteTempFolder1: TMenuItem; + Debug1: TMenuItem; + CurrentDir1: TMenuItem; + RepairPluto155bBug1: TMenuItem; + BackupRegistryscanreg1: TMenuItem; + Username1: TMenuItem; + SupportMI: TMenuItem; + MurphyMI: TMenuItem; + ToDoMI: TMenuItem; + Beta1: TMenuItem; + UniKeycYcnusde1: TMenuItem; + YToolscYcnusde1: TMenuItem; + YPanelscYcnusde1: TMenuItem; + Usedenginescomponents1: TMenuItem; + PrefToolscYcnusde1: TMenuItem; + BugReportsRequests1: TMenuItem; + murphycYcnusde1: TMenuItem; + Credits2: TMenuItem; + News1: TMenuItem; + cYcnus1: TMenuItem; + Contact1: TMenuItem; + N2: TMenuItem; + IjustwantCONTACT1: TMenuItem; + N9: TMenuItem; + AnotherPluto1: TMenuItem; + UniKeyDemoMI: TMenuItem; + Path1: TMenuItem; + RegisterPlugIns1: TMenuItem; + UniPluginOD: TOpenDialog; + SwapLM_CUB: TButton; + PathE: TEdit; + ShowLoadreport1: TMenuItem; + KillPluto1: TMenuItem; + ShowPlatform1: TMenuItem; + MSConfig1: TMenuItem; + TimetoRelaxMI: TMenuItem; + N10: TMenuItem; + + procedure FormCreate(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure InsertPathClick(Sender: TObject); + + procedure StatusBarResize(Sender: TObject); + procedure StatusBarDblClick(Sender: TObject); + procedure StatusBarUpdate; + procedure CopyPathClick(Sender: TObject); + + procedure SetStatus; + procedure GotoKey(Key: string); + procedure FindCLSID; + procedure GotoCLSID; + procedure UserGotoKey; + procedure ShowRealPathMIClick(Sender: TObject); + procedure PathEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure PathEChange(Sender: TObject); + procedure PathEExit(Sender: TObject); + + procedure AppActivate(Sender: TObject); + procedure PathEKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ActivateIt(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure FormDeactivate(Sender: TObject); + procedure Pluto1Click(Sender: TObject); + procedure RegEdit1Click(Sender: TObject); + procedure Free1Click(Sender: TObject); + procedure BigVal1Click(Sender: TObject); + procedure SplashScreen1Click(Sender: TObject); + procedure HistoryClick(Sender: TObject); + procedure Credits1Click(Sender: TObject); + + function Greeting(Name: string = NoPreBlinkHint): string; + procedure PrefMIClick(Sender: TObject); + procedure EditBoolStrMIClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure SisyTerminate(Sender: TObject); + procedure OnSisyChange(Sender: TSisyThread; Change: TSisyChange); + procedure OnSisyValuePlus(Sender: TSisyThread; Change: TSisyChange); + procedure OnSisyValueMinus(Sender: TSisyThread; Change: TSisyChange); + procedure OnSisyContextChange(Sender: TSisyThread; Change: TSisyChange); + + procedure Plutoini1Click(Sender: TObject); + procedure RegEdit2Click(Sender: TObject); + procedure SysEdit1Click(Sender: TObject); + procedure NotePad1Click(Sender: TObject); + procedure WordPad1Click(Sender: TObject); + procedure OpenWinDir1Click(Sender: TObject); + procedure OpenProgramFolder1Click(Sender: TObject); + procedure ExitPluto1Click(Sender: TObject); + procedure Find1Click(Sender: TObject); + procedure FormPaint(Sender: TObject); + + procedure Load; + procedure StatusBarDrawPanel(StatusBar: TStatusBar; + Panel: TStatusPanel; const Rect: TRect); + procedure PathEKeyPress(Sender: TObject; var Key: Char); + procedure HintBlinkTTimer(Sender: TObject); + procedure FindCLSID1Click(Sender: TObject); + procedure GotoCLSID1Click(Sender: TObject); + procedure CommandLineParameters1Click(Sender: TObject); + procedure WebLinkMIClick(Sender: TObject); + procedure DeleteTempFolder1Click(Sender: TObject); + procedure CurrentDir1Click(Sender: TObject); + procedure RepairPluto155bBug1Click(Sender: TObject); + procedure BackupRegistryscanreg1Click(Sender: TObject); + procedure SisyStarted(Sender: TObject); + procedure StopHintBlinking; + procedure Username1Click(Sender: TObject); + procedure SupportMIClick(Sender: TObject); + procedure ToDoMIClick(Sender: TObject); + procedure MailLinkMIClick(Sender: TObject); + procedure IjustwantCONTACT1Click(Sender: TObject); + procedure ExternalHexEditMIClick(Sender: TObject); + procedure AnotherPluto1Click(Sender: TObject); + procedure Path1Click(Sender: TObject); + procedure RegisterPlugIns1Click(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure SwapLM_CUBClick(Sender: TObject); + procedure ShowLoadreport1Click(Sender: TObject); + procedure KillPluto1Click(Sender: TObject); + procedure ShowPlatform1Click(Sender: TObject); + procedure MSConfig1Click(Sender: TObject); + procedure TimetoRelaxMIClick(Sender: TObject); + private + DoAutoComplete: Boolean; + MainWinLoaded: Boolean; + DontSavePrefs: Boolean; + PreBlinkHint: string; + end; + +var + MainWin: TMainWin; + + StatusBar: TStatusBar; + MainReg: TXRegistry; + + SpyThread: TRegSpyThread; + Sisys: TList; + +function TempDir: string; +function PlutoUniPath: string; +function PlutoIniFileName: string; + +function PathOfNode(Node: TTreeNode): string; +function CurKey(AllowedShortcutTypes: TUniHostTypes = []): TRegPath; + +procedure ArrangePlutoStyle; +procedure ArrangeRegEdStyle; +procedure ArrangeFreeStyle; +procedure ArrangeBigValStyle; + +procedure ActivateThis(Sender: TObject); +procedure DeActivateThis(Sender: TObject); + +procedure SwapFonts(Sender: TWinControl); + +procedure AddHint(const Hint: string; Blinking: Boolean = False); +procedure AddToLastHint(Appendix: string); +procedure ChangeLastHint(NewHint: string); + +implementation + +uses + //Forms + FindWinU, valuesU, TreeU, WorkU, splash, PrefU, + //Units + Clock, Start, keybrd, CompEx, Colors, FindAllThread, + PrefTools; + +{$R *.DFM} + +var + SavedPlutoIniFileName: string = ''; + +procedure AddHint(const Hint: string; Blinking: Boolean = False); +begin + if Assigned(WorkWin) then + WorkWin.AddAHint(Hint); + + with MainWin do begin + StopHintBlinking; + + if Blinking then begin + HintBlinkT.Enabled := True; + if PreBlinkHint = NoPreBlinkHint then + PreBlinkHint := StatusBar.Panels[0].Text; + StatusBar.Panels[0].Text := WorkWin.LastHint; + end; + end; +end; + +procedure AddToLastHint(Appendix: string); +begin + with WorkWin.HintLB.Items do begin + if Count = 0 then + Exit; + + Strings[Count-1] := Strings[Count-1] + Appendix; + end; + Application.ProcessMessages; +// Sleep(1000); +end; + +procedure ChangeLastHint(NewHint: string); +begin + with WorkWin.HintLB.Items do begin + if Count = 0 then + Exit; + + Strings[Count-1] := NewHint; + end; + Application.ProcessMessages; +// Sleep(1000); +end; + +function CurKey(AllowedShortcutTypes: TUniHostTypes = []): TRegPath; +var + s: string; + Item: TListItem; +begin + if Assigned(RegTV.Selected) then begin + s := PathOfNode(RegTV.Selected); + if AllowedShortcutTypes <> [] then + s := TraceKey(s, AllowedShortcutTypes); + Result.Root := ExRegRoot(s); + Result.Key := ExRegKey(s); + + Item := ValueList.ItemFocused; + if Assigned(Item) then + Result.Value := RealValueName(Item); + Result.ValueSet := Assigned(Item); + end; +end; + +function PathOfNode(Node: TTreeNode): string; +begin + Result := ''; + + if not Assigned(Node) then + Exit; + + if Assigned(Node.Parent) then + Result := LWPSlash(PathOfNode(Node.Parent)) + Node.Text + else + Result := Node.Text; +end; + +procedure TMainWin.AppActivate(Sender: TObject); +var + ActForm: TCustomForm; + + procedure TryShow(Win: TCustomForm); + begin + if Assigned(Win) and Win.Visible then + Win.Show; + end; + +begin + ActForm := Screen.ActiveCustomForm; //LastActiveForm; + TryShow(ValuesWin); + TryShow(WorkWin); + TryShow(TreeWin); + TryShow(FindWin); + TryShow(SplashWin); + TryShow(MainWin); + TryShow(ActForm); +end; + +procedure TMainWin.FormCreate(Sender: TObject); + + procedure InitHKEYString(var H: THKEYString; const Long, Short: string; + Handle: Integer = 0; IsDefault: Boolean = False); + begin + H.Long := Long; + H.Short := Short; + H.Handle := Handle; + H.IsDefault := IsDefault; + end; + +begin +{$IFDEF UNIKEY} +{$IFDEF CYCFS} + RegisterUniClass('Y:\programme\unikey\cyc_fs.uni'); +{$ENDIF} +{$ENDIF} + + Application.OnActivate := AppActivate; + PlutoMain.StatusBar := StatusBar; + + //Creating + MainReg := TXRegistry.Create; + + //Initialize + Caption := 'cYcnus.Pluto ' + Version; + PreBlinkHint := NoPreBlinkHint; + + SetLength(HKEYStrings, Length(HKEYStrings) + 2); + InitHKEYString(HKEYStrings[LastDefaultHKEYString + 1], + 'HKEY_WindowsMachine', 'HKWM'); + + InitHKEYString(HKEYStrings[LastDefaultHKEYString + 2], + 'HKEY_WindowsUser', 'HKWU'); + + Application.HintHidePause := -1; //that's approximately 136 years :D + + StatusBar.Panels[0].Width := Screen.Width div 6; + + MurphyMI.Visible := MurphyMode; + +{$IFDEF UNIKEY} + UniPluginOD.InitialDir := MyDir; +{$ELSE} + UniKeyDemoMI.Visible := False; +{$ENDIF} +end; + +procedure TMainWin.GotoKey(Key: string); +var + Full: TregPath; + Node: TTreeNode; + keySA: TStrA; + i: integer; + + function NodeOfRoot(Root: string): TTreeNode; + var + i: Integer; + begin + Result := nil; + Root := LongHKEY(Root); + + for i := 0 to RootNodes.Count-1 do + if SameText(TTreeNode(RootNodes[i]).Text, Root) then begin + Result := TTreeNode(RootNodes[i]); + Break; end; + + for i := 0 to High(Shortcuts) do + if SameText(Shortcuts[i].Alias, Full.Root) then begin + Result := Shortcuts[i].Node; + Break; end; + end; + +begin + keySA := nil; + + //Get FullPath of the Key + Key := TrimLeft(Key); + if TextAtPos(Key, 1, 'Reg:') then + Key := TrimLeft(FromChar(Key, ':')); + Key := UnQuote(Key); + + Full := RegPathOfStr(Key); + if Trim(Full.Root) = '' then begin + AddHint('Empty Path.', True); + Exit; end; + + //Get Root Node + Node := NodeOfRoot(Full.Root); + if not Assigned(Node) then begin + if not PathE.Focused then + AddHint('Key not found:' + EOL + Key); + Exit; end; + + //Create an array of all SubKeys + keySA := Split(Full.Key, '\'); + + //Avoid SmartExpand + TreeWin.DoSmartExpand := False; begin + + //Open all SubKeys + for i := 0 to High(keySA) do begin + //Open the Node if neccessary + if not Node.Expanded then begin + if not Node.Selected then + RegTV.Selected := Node; + CheckNode(Node, False); + //TreeWin.RegTVChange(Self, Node); + Node.Expand(False); + end; + + //Get Node of the SubKey + Node := FindNodeText(Node, keySA[i]); + if not Assigned(Node) then begin + if not PathE.Focused then + AddHint('Goto Key not found: ' + KeySA[i], True); + Exit; + end; + end; + + end; TreeWin.DoSmartExpand := True; + + if Node <> RegTV.Selected then begin + RegTV.Selected := Node; + TreeWin.RegTVChange(Self, Node); + end; + + Application.ProcessMessages; + + if Full.ValueSet then + ValuesWin.FocusItem(Full.Value, not (Active and PathE.Focused)) + else begin + if not (Active and PathE.Focused) then //if not user is currently editing the path + TreeWin.FocusControl(RegTV); + + if LastChar(Full.Key) = '\' then + Node.Expand(False); + end; +end; + +procedure SwapFonts(Sender: TWinControl); + + function OtherFont(N: TFontName): TFontName; + begin + Result := 'Courier New'; + if N = Result then + Result := 'Arial'; + end; + +begin + TEdit(Sender).Font.Name := OtherFont(TTreeView(Sender).Font.Name); +end; + +procedure ActivateThis(Sender: TObject); +begin + if not Assigned(Sender) then + Exit; + + with TEdit(Sender) do begin + if Tag <> EditControlFlag then + Exit; + Color := RealColor(clVeryBrightBlue); + Font.Color := clBlack; + end; +end; + +procedure DeActivateThis(Sender: TObject); +begin + if not Assigned(Sender) then + Exit; + + with TEdit(Sender) do begin + if Tag <> EditControlFlag then + Exit; + Color := RealColor(clDarkGray); + Font.Color := clWhite; + end; +end; + +procedure CreateSisyThreads; +var + i: Integer; + + procedure CreateSisyThread(const Name: string; const KeyName: string; + Key: HKEY; StatusLabel: TLabel); + var + Sisy: TSisyThread; + begin + ChangeLastHint('Creating ' + Name + '...'); + Sisy := TSisyThread.CreateIt(Name, KeyName, Key, StatusLabel, PlutoKey); + Sisy.OnChange := MainWin.OnSisyChange; +// Sisy.OnSpecialChange[cValuePlus] := MainWin.OnSisyValuePlus; +// Sisy.OnSpecialChange[cValueMinus] := MainWin.OnSisyValueMinus; +// Sisy.OnSpecialChange[cContextChange] := MainWin.OnSisyContextChange; + Sisys.Add(Sisy); + AddToLastHint('OK'); + end; + +begin + AddHint('Starting Sisyphus ' + SisyVersion + '...'); + + Sisys := TSisyList.Create; + WorkWin.LoadSisyFilter; + + CreateSisyThread('Sisy HKU', 'HKU', HKU, WorkWin.SisyHKUL); + CreateSisyThread('Sisy HKLM', 'HKLM', HKLM, WorkWin.SisyHKLML); + + ChangeLastHint('Initializing Sisyphus...'); + for i := 0 to Sisys.Count-1 do + with TSisyThread(Sisys[i]) do begin + if Name = 'Sisy HKU' then + with WorkWin.SisyHKUCB do begin + Settings.KeyName := StrOfUni(Uni.Path); + Settings.Load; + Settings.AutoSave := True; + if Checked then + Resume; + end + else if Name = 'Sisy HKLM' then + with WorkWin.SisyHKLMCB do begin + Settings.KeyName := StrOfUni(Uni.Path); + Settings.Load; + Settings.AutoSave := True; + if Checked then + Resume; + end; + OnStarted := MainWin.SisyStarted; + end; +end; + +procedure CreateSpyThread; +begin + AddHint('Creating SpyThread...'); + SpyThread := TRegSpyThread.CreateIt(tpLowest); + WorkWin.SpyDelayIEChange(MainWin); + WorkWin.SpyTestLClick(MainWin); + AddToLastHint('OK'); +end; + +procedure ShowParams; +var + SL: TStringList; +begin + if Switch('params?') then begin + SL := TStringList.Create; + GetParams(SL); + ShowMessage(SL.Text); + SL.Free; + end; +end; + +procedure GotoParamKey; +var + s: string; +begin + s := ParamStr(1); + if (s <> '') + and (s[1] <> '-') then begin //Params have '-' as prefix + AddHint('Goto Key ' + Quote(s) + '...'); + MainWin.GotoKey(s); + end else begin + RegTV.Selected := RegTV.TopItem; + end; +end; + +procedure TMainWin.Load; +begin + TreeWin.Load; + WorkWin.LoadBoolStr; + + CreateSpyThread; + CreateSisyThreads; + + AddHint(Greeting, True); + + ShowParams; + GotoParamKey; + + if Assigned(SplashWin) and SplashWin.Visible then + SplashWin.SetFocus; +end; + +procedure TMainWin.CopyPathClick(Sender: TObject); +begin + Clipboard.AsText := StatusBar.Panels[1].Text; +end; + +procedure TMainWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (ssAlt in shift) and (Key = VK_F4) then begin + Key := 0; + Close; + Exit; end; + + if ssCtrl in Shift then + case Key of + Byte('W'): begin + MainPC.ActivePage := WorkWin.WorkPage; + if Assigned(MainPC.ActivePage) then + WorkWin.FocusControl(TWinControl(ShowPC.ActivePage.Tag)) + end; + + Byte('H'): MainPC.ActivePage := WorkWin.HintPage; + + Byte('L'): MainWin.FindCLSID; + end; + + if Shift = [] then + case Key of + VK_F6: TreeWin.FocusControl(RegTV); + + VK_F7: with ValueList do begin + ValuesWin.FocusControl(ValueList); + if (Selected = nil) and (Items.Count > 0) then begin + Selected := Items[0]; + ItemFocused := Selected; + end; + end; + + VK_F8: WorkWin.FocusControl(MainPC); + end; + + if Key = VK_SCROLL then begin + TreeWin.CheckRegTVHotTrack; + ValuesWin.CheckValueListHotTrack; + end; +end; + +procedure TMainWin.StatusBarResize(Sender: TObject); +begin + with StatusBar do + Panels[1].Width := + Width - (Panels[0].Width + Panels[2].Width + Panels[3].Width); +end; + +procedure TMainWin.StatusBarDblClick(Sender: TObject); +begin + ShowRealPathMIClick(Sender); +end; + +procedure TMainWin.InsertPathClick(Sender: TObject); +begin + GotoKey(Clipboard.AsText); +end; + +procedure TMainWin.SetStatus; +begin + StatusBarUpdate; +end; + +procedure TMainWin.StatusBarUpdate; +var + Inf: TRegKeyInfo; +begin + OpenCurKey; + MainReg.GetKeyInfo(Inf); + MainReg.CloseKey; + + StatusBar.Panels[2].Text := StrNumerus(Inf.NumSubKeys, 'key', 'keys', 'no'); + StatusBar.Panels[3].Text := StrNumerus(Inf.NumValues, 'value', 'values', 'no'); + + if ShowRealPathMI.Checked then + StatusBar.Panels[1].Text := StrOfRegPath(CurKey(uhShortcuts)) + else + StatusBar.Panels[1].Text := StrOfRegPath(CurKey(uhNonSystemShortcuts)); + + if not PathE.Focused then + PathE.Text := StrOfRegPath(CurKey); +end; + +procedure TMainWin.ShowRealPathMIClick(Sender: TObject); +begin + ShowRealPathMI.Checked := not ShowRealPathMI.Checked; + StatusBarUpdate; +end; + +procedure TMainWin.PathEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + Pos: Integer; + s: string; +begin + DoAutoComplete := not (Key in [VK_DELETE, VK_BACK, VK_ESCAPE]); + + case Key of + VK_BACK: + begin + s := PathE.Text; + Pos := PathE.SelStart; + + if ssCtrl in Shift then + repeat + Dec(Pos); + until (Pos < 1) or (s[Pos] = '\') + else if PathE.SelLength = 0 then + Exit; + + PathE.Text := Copy(s, 1, Pos); + PathE.SelStart := Length(s); + Key := 0; + UserGotoKey; + end; + + VK_ESCAPE: + with PathE do begin + if SelLength = 0 then + Exit; + Text := StrOfRegPath(CurKey); + SelStart := Length(Text); + end; + + VK_RETURN: begin + if CurKey.ValueSet then + ValuesWin.ValueListDblClick(Self); + Key := 0; + end; + + VK_RIGHT: begin + if not (ssCtrl in Shift) then + Exit; + + Key := 0; + + s := PathE.Text; + Pos := PathE.SelStart + 1; + repeat + Inc(Pos); + until (Pos > Length(s)) or (s[Pos] = '\'); + + PathE.SelStart := Pos - 1; + end; + + VK_LEFT: begin + if not (ssCtrl in Shift) then + Exit; + + with PathE do begin + Key := 0; + + s := Text; + Pos := SelStart; + repeat + Dec(Pos); + until (Pos < 1) or (s[Pos] = '\'); + + if Pos < 1 then + Pos := 1; + + SelStart := Pos - 1; + end; + end; + end; +end; + +procedure TMainWin.UserGotoKey; +begin + GotoKey(PathE.Text); +end; + +procedure TMainWin.PathEChange(Sender: TObject); +var + Prefix, Suffix, Key, Path, Root: string; + i, p, Len: Integer; + SL: TStringList; + CompleteKind: (ckRoots, ckKeys, ckValues); + + procedure GetRootNames(Strings: TStrings); + var + Node: TTreeNode; + begin + SL.Clear; + Node := RegTV.Items.GetFirstNode; + while Assigned(Node) do begin + SL.Add(Node.Text); + Node := Node.GetNextSibling; + end; + end; + +begin + if not DoAutoComplete then + Exit; + + Key := PathE.Text; + Root := TraceKey(ExRegRoot(Key)); + + if not CharIn(Key, '\') then + CompleteKind := ckRoots + else if ExRegValueSet(Key) then + CompleteKind := ckValues + else + CompleteKind := ckKeys; + + case CompleteKind of + ckRoots: begin + Prefix := ''; + Suffix := Key; + end; + + ckKeys: begin + Path := ExRegFullKey(Key); + Prefix := UntilLastChar(Path, '\'); + Suffix := FromLastChar(Path, '\'); + end; + + ckValues: begin + p := Pos('\\', Key); + Prefix := Copy(Key, 1, p - 1); + Suffix := Copy(Key, p + 2, Length(Key) - p - 1); + end; + + else + end; + + SL := TStringList.Create; + + if CompleteKind in [ckKeys, ckValues] then + with MainReg do begin + RootKey := HKEYOfStr(ExRegRoot(Root)); + OpenKey(ExRegKey(Root)); + OpenKey(ExRegKey(Prefix)); + + if CompleteKind = ckValues then begin + if not HasValues then + Exit; + GetValueNames(SL); + end else if CompleteKind = ckKeys then begin + if not HasSubKeys then + Exit; + GetKeyNames(SL); + end; + + CloseKey; + end + else begin + GetRootNames(SL); + end; + + if Suffix = '' then begin + if (SL.Count > 0) and not StrIn(SL, '') then + Suffix := SL[0]; + end else begin + for i := 0 to SL.Count-1 do + if TextAtBegin(SL[i], Suffix) then begin + Suffix := SL[i]; + Break; end; + end; + + Len := Length(PathE.Text); + + if CompleteKind = ckValues then + Prefix := Prefix + '\\' + else if CompleteKind = ckKeys then + Prefix := Prefix + '\'; + + with PathE do begin + DoAutoComplete := False; //Avoid Recursion + Text := Prefix + Suffix; + DoAutoComplete := True; + + SelStart := Len; + SelLength := Length(Text) - Len; + end; + + SL.Free; +end; + +procedure TMainWin.PathEExit(Sender: TObject); +begin + DeActivateThis(PathE); + DoAutoComplete := False; +end; + +procedure ArrangePlutoStyle; +begin + with ValuesWin do begin + Height := MainWin.ClientHeight div 3; + Top := MainWin.ClientHeight - Height - 43; + Left := 0; + Width := MainWin.ClientWidth - 4; + //Align := alBottom; + end; + + with WorkWin do begin + Top := 0; + Width := Max(MainWin.ClientWidth div 3, WorkWin.Constraints.MinWidth); + Left := ValuesWin.Width - Width; + Height := MainWin.ClientHeight - 43 - ValuesWin.Height; + //Align := alRight; + end; + + with TreeWin do begin + Top := 0; + Height := WorkWin.Height; + Left := 0; + Width := ValuesWin.Width - WorkWin.Width; + end; + + {TreeWin.Align := alNone; + WorkWin.Align := alNone; + ValuesWin.Align := alNone;} +end; + +procedure ArrangeFreeStyle; +const + Space = 10; +begin + with ValuesWin do begin + Height := Screen.Height div 3; + Align := alBottom; + end; + + with WorkWin do begin + Width := Max(Screen.WorkAreaWidth div 3, Constraints.MinWidth + 2 * Space); + Align := alRight; + end; + + with TreeWin do begin + Align := alClient; + end; + + TreeWin.Align := alNone; + WorkWin.Align := alNone; + ValuesWin.Align := alNone; + + with ValuesWin do begin + Height := Height - 2 * Space; + Width := Width - 2 * Space; + Top := Top + Space; + Left := Left + Space; + end; + + with TreeWin do begin + Height := Height - 1 * Space; + Width := Width - 1 * Space; + Top := Top + Space; + Left := Left + Space; + end; + + with WorkWin do begin + Height := Height - 1 * Space; + Width := Width - 2 * Space; + Top := Top + Space; + Left := Left + Space; + end; +end; + +procedure ArrangeBigValStyle; +var + MinHeight: Integer; +begin + MinHeight := WorkWin.Constraints.MinHeight + + MainWin.Constraints.MinHeight; + + with ValuesWin do begin + Height := Screen.WorkAreaHeight - Max(Screen.Height div 3, MinHeight); + Align := alBottom; + end; + + with WorkWin do begin + Width := Screen.WorkAreaWidth div 3; + Align := alRight; + end; + + with TreeWin do begin + Align := alClient; + end; + + TreeWin.Align := alNone; + WorkWin.Align := alNone; + ValuesWin.Align := alNone; +end; + +procedure ArrangeRegEdStyle; +begin + with TreeWin do begin + Width := Screen.WorkAreaWidth div 4; + Align := alLeft; + end; + + with ValuesWin do begin + Align := alClient; + Align := alNone; + Height := Height - WorkWin.Constraints.MinHeight; + end; + + with WorkWin do begin + Top := ValuesWin.Top + ValuesWin.Height; + Left := ValuesWin.Left; + Height := Constraints.MinHeight; + Width := ValuesWin.Width; + end; + + TreeWin.Align := alNone; +end; + +procedure TMainWin.PathEKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if not (Key in [VK_DELETE, VK_BACK, VK_ESCAPE]) then + UserGotoKey; +end; + +procedure TMainWin.ActivateIt(Sender: TObject); +begin + ActivateThis(Sender); +end; + +procedure TMainWin.FormActivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + ActivateThis(ActiveControl); +end; + +procedure TMainWin.FormDeactivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + DeActivateThis(ActiveControl); +end; + +procedure TMainWin.Pluto1Click(Sender: TObject); +begin + ArrangePlutoStyle; +end; + +procedure TMainWin.RegEdit1Click(Sender: TObject); +begin + ArrangeRegEdStyle; +end; + +procedure TMainWin.Free1Click(Sender: TObject); +begin + ArrangeFreeStyle; +end; + +procedure TMainWin.BigVal1Click(Sender: TObject); +begin + ArrangeBigValStyle; +end; + +procedure TMainWin.SplashScreen1Click(Sender: TObject); +begin + SplashWin.Show; +end; + +procedure TMainWin.HistoryClick(Sender: TObject); +begin + NotePad(PlutoDir + 'version.txt'); +end; + +procedure TMainWin.WebLinkMIClick(Sender: TObject); +begin + Browse('http://' + TMenuItem(Sender).Caption); +end; + +procedure TMainWin.SupportMIClick(Sender: TObject); +begin + Browse('http://cYcnus.de/php/phpbb/viewforum.php?f=1'); +end; + +procedure TMainWin.Credits1Click(Sender: TObject); +var + FileName: string; +begin + FileName := PlutoDir + 'credits deluxe.htm'; + if FileExists(FileName) then + ExecFile(FileName) + else begin + FileName := PlutoDir + 'credits.htm'; + if FileExists(FileName) then + ExecFile(FileName); + end; +end; + +function GetCLSIDFromClipboard: string; +var + CLSID: string; +begin + CLSID := BetweenChars(Clipboard.AsText, '{', '}', True); + if CLSID = '' then begin + Result := Clipboard.AsText; + InputQuery('No CLSID in Clipboard.', + 'Use following format:' + EOL + + '{00000000-0000-0000-0000-000000000000}', Result); + Exit; end else + Result := CLSID; +end; + +procedure TMainWin.FindCLSID; +var + CLSID, Desc: string; +begin + CLSID := GetCLSIDFromClipboard; + Desc := RegNameOfCLSID(CLSID); + if Desc <> '' then + InputQuery('Your CLSID is...', CLSID, Desc) + else + ShowMessage('CLSID not found: ' + CLSID + '.'); +end; + +procedure TMainWin.GotoCLSID; +var + CLSID, Desc: string; +begin + CLSID := GetCLSIDFromClipboard; + Desc := RegNameOfCLSID(CLSID); + if Desc <> '' then begin + GotoKey('HKCR\CLSID\' + CLSID); + TreeWin.FocusControl(RegTV); + end else + ShowMessage('CLSID not found: ' + CLSID + '.'); +end; + +function TMainWin.Greeting(Name: string = NoPreBlinkHint): string; +const + Alias: array[0..4] of string = + ('Licenser', 'Murphy', 'Sleeper', 'Leon', 'Great Admin'); + RealNames: array[0..4] of string = + ('Heinz', 'Korny', 'Sven', 'Simon', 'Korny ;-)'); +var + i: Integer; + s: string; +begin + if Name = NoPreBlinkHint then + Name := PrefWin.UserNameE.Text; + + if Trim(Name) = '' then + s := 'No name?' + else if SameText(Trim(Name), 'Pluto-User') then + s := 'Hi!' + else + for i := 0 to 4 do + if SameText(Name, Alias[i]) then begin + s := 'Hi ' + RealNames[i] + '! This is a cYcnus.EasterEgg'; + Break; end + else if Length(Name) > 20 then + s := 'Hi ' + Name + + '. What a name.' + else + s := 'Hi ' + Name + '!'; + + Result := s; +end; + +procedure TMainWin.PrefMIClick(Sender: TObject); +begin + PrefWin.Show; +end; + +function TempDir: string; +begin + Result := PlutoDir + 'temp\'; + if not (DirectoryExists(Result) or CreateDir(Result)) then + Result := PlutoDir; +end; + +function PlutoIniFileName: string; + + function Default: string; + begin + Result := MyDir + 'pluto.ini'; + end; + +begin + Result := SavedPlutoIniFileName; + if Result <> '' then + Exit; + +// Result := Params.ReadString('ini', ''); + + if IsValidFileName(Result) then + Result := PlutoDir + Result + else + Result := Default; + + SavedPlutoIniFileName := Result; //Faster in future calls +end; + +function PlutoUniPath: string; +begin + //Result := 'Reg: HKCU\Software\Pluto\'; + Result := 'Ini <' + PlutoIniFileName + '>:'; +end; + +procedure TMainWin.EditBoolStrMIClick(Sender: TObject); +begin + NotePad(PlutoDir + BoolStrFileName); + ShowMessage('Click OK when you finished editing.' + EOL + + '(Pluto will reload the Boolean Strings.)'); + WorkWin.LoadBoolStr; +end; + +procedure TMainWin.SisyStarted(Sender: TObject); +{var + NextSisyIndex: Integer; + NextSisy: TSisyThread; } +begin + {NextSisy := nil; + + with TSisyThread(Sender) do begin + //AddHint(Format('%s started after %0.1f seconds', [Name, SecsPerRound]), True); + + with Sisys do begin + NextSisyIndex := IndexOf(Sender) + 1; + if NextSisyIndex < Count then + NextSisy := Items[NextSisyIndex]; + end; + + if Assigned(NextSisy) then + with NextSisy do + if not Started and Suspended then + Resume; + end; } +end; + +procedure TMainWin.SisyTerminate(Sender: TObject); +begin + if Assigned(Sisys) then + Sisys.Delete(Sisys.IndexOf(Sender)); + AddHint('Sisyphus ' + Quote(TSisyThread(Sender).Name) + ' destroyed.'); +end; + +procedure TMainWin.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +var + i: Integer; + + procedure TerminateThread(Thread: TThread; Name: string); + const + ThreadTimeOut = 3000; + begin + if Assigned(Thread) then + with Thread do begin + Priority := tpNormal; + Terminate; + while Suspended do Resume; // ensure running + if 0 <> WaitForSingleObject(Handle, ThreadTimeOut) then begin + ShowMessage('Timeout: Killing Thread: ' + Name + EOL + + 'This is a critical error and may cause memory leaks and crashes.' + EOL + + 'We recommend to reboot your system before you continue.'); + Windows.TerminateThread(Handle, 0); + end else + Thread.Free; + end; + end; + +begin + CanClose := False; + + try + AddHint('Stopping SisyphusThreads...'); + if Assigned(Sisys) then + for i := 0 to Sisys.Count-1 do + TSisyThread(Sisys[i]).Suspend; + AddToLastHint('OK'); + + AddHint('Wait for SpyThread...'); + TerminateThread(SpyThread, 'SpyThread'); + AddToLastHint('OK'); + + AddHint('Wait for SisyphusThreads...'); + if Assigned(Sisys) then + for i := 0 to Sisys.Count-1 do begin + ChangeLastHint('Wait for SisyphusThreads...' + TSisyThread(Sisys[i]).Name); + TerminateThread(TSisyThread(Sisys[i]), TSisyThread(Sisys[i]).Name); + end; + ChangeLastHint('Wait for SisyphusThreads...OK'); + except + with WorkWin.HintLB.Items do + ShowMessage('Error while trying to terminate threads.' + EOL + + 'Last Message:' + EOL + + Strings[Count - 1]); + CanClose := True; + end; + + AddHint('Terminating successfull.'); + CanClose := True; +end; + +procedure TMainWin.FormClose(Sender: TObject; var Action: TCloseAction); + + procedure TryClose(Win: TCustomForm); + begin + if Assigned(Win) and Win.Visible then + Win.Close; + end; + +begin + MainReg.Free; + + Action := caFree; + + if DontSavePrefs then + Exit; + + AddHint('Saving settings...'); + + try + TryClose(WorkWin); + TryClose(ValuesWin); + TryClose(TreeWin); + TryClose(FindWin); + TryClose(SplashWin); + TryClose(PrefWin); + except + DontSavePrefs := True; //try again without pref saving + end; + + with PlutoKey.GetKey('Window') do + try + WriteBool('Maximized', WindowState = wsMaximized); + if WindowState = wsNormal then begin + WriteInteger('Left', Left); + WriteInteger('Top', Top); + WriteInteger('Width', Width); + WriteInteger('Height', Height); + end; + finally + Free; + end; +end; + +procedure TMainWin.Plutoini1Click(Sender: TObject); +begin + NotePad(PlutoIniFileName); + ShowMessage('Click OK when you finished editing.' + EOL + + '(Pluto will reload ' + PlutoIniFileName + ')'); + PrefWin.PrefHost.Load; +end; + +procedure TMainWin.RegEdit2Click(Sender: TObject); +begin + RegEdit; +end; + +procedure TMainWin.SysEdit1Click(Sender: TObject); +begin + SysEdit; +end; + +procedure TMainWin.NotePad1Click(Sender: TObject); +begin + NotePad; +end; + +procedure TMainWin.WordPad1Click(Sender: TObject); +begin + WordPad; +end; + +procedure TMainWin.OpenWinDir1Click(Sender: TObject); +begin + ExploreFolder(WinDir); +end; + +procedure TMainWin.OpenProgramFolder1Click(Sender: TObject); +begin + ExploreFolder(MyDir); +end; + +procedure TMainWin.ExitPluto1Click(Sender: TObject); +begin + Close; +end; + +procedure TMainWin.Find1Click(Sender: TObject); +begin + FindWin.SfRootKeyRB.Checked := True; + FindWin.Show; +end; + +procedure TMainWin.FormPaint(Sender: TObject); +begin + if Started and not MainWinLoaded then begin + MainWinLoaded := True; + Load; + end; +end; + +procedure TMainWin.StatusBarDrawPanel(StatusBar: TStatusBar; + Panel: TStatusPanel; const Rect: TRect); +begin + with StatusBar.Canvas do begin + Brush.Color := clBlack; + FillRect(Rect); + with Font do begin + Name := 'MS Sans Serif'; + Style := []; + case Panel.Index of + 0: if HintBlinkT.Enabled then + Color := clBrightRed + else + Color := clBrightSilver; + 1: Color := clWhite; + 2: Color := clCyan; + 3: Color := clBrightPurple; + end; + end; + + if Panel.Alignment = taRightJustify then + TextOut(Rect.Right - TextWidth(Panel.Text), Rect.Top, Panel.Text) + else + TextOut(Rect.Left, Rect.Top, Panel.Text); + end; +end; + +procedure TMainWin.PathEKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #127 then //Silly key management + Key := #0; +end; + +procedure TMainWin.HintBlinkTTimer(Sender: TObject); +begin + StatusBar.Panels[0].Text := 'Ready'; + StopHintBlinking; +end; + +procedure TMainWin.StopHintBlinking; +begin + HintBlinkT.Enabled := False; + PreBlinkHint := NoPreBlinkHint; +end; + +procedure TMainWin.FindCLSID1Click(Sender: TObject); +begin + FindCLSID; +end; + +procedure TMainWin.GotoCLSID1Click(Sender: TObject); +begin + GotoCLSID; +end; + +procedure TMainWin.CommandLineParameters1Click(Sender: TObject); +begin + NotePad(PlutoDir + 'Params.txt'); +end; + +procedure TMainWin.DeleteTempFolder1Click(Sender: TObject); +begin + if mrYes = MessageDlg('Deleting ' + Quote(TempDir + '*.*' + EOL, '"') + + 'Are you sure?', mtConfirmation, [mbYes, mbCancel], 0) then + DeleteFiles(TempDir + '*.*', False); +end; + +procedure TMainWin.CurrentDir1Click(Sender: TObject); +begin + ShowMessage('MyDir: ' + MyDir + EOL + + 'PlutoDir: ' + PlutoDir + EOL + + 'CurrentDir: ' + GetCurrentDir + EOL + + 'Params: ' + EOL + + GetParams(EOL)); +end; + +procedure TMainWin.RepairPluto155bBug1Click(Sender: TObject); +var + Msg: string; + Reg: TXRegistry; +begin + Reg := TXRegistry.Create; + + try + Reg.RootKey := HKCU; + Reg.OpenKey('Software'); + Msg := ''; + if Reg.KeyExists('Sisyphus') then + Msg := Msg + 'HKCU\Software\Sisyphus' + EOL; + if Reg.KeyExists('Main') then + Msg := Msg + 'HKCU\Software\Main' + EOL; + if Reg.KeyExists('Spy') then + Msg := Msg + 'HKCU\Software\Spy' + EOL; + if Reg.KeyExists('View') then + Msg := Msg + 'HKCU\Software\View' + EOL; + if Msg = '' then begin + ShowMessage('No bug detected :-)'); + end else begin + Msg := + 'Hi folks!' + EOL + + 'We are very sorry: A bug in Pluto made some components in the Edit' + EOL + + 'window save their values to the regsitry instead of the ini file.' + EOL + + 'If you want to repair that, you have to delete the following keys:' + EOL + + EOL + + Msg + + EOL + + 'This is not dangerous at all, but if you are interested in having' + EOL + + 'a clean registry, you should delete this useless keys.' + EOL + + EOL + + 'You surely noticed that this key names are rubish because they are' + EOL + + 'in the level that is normally used by programs.' + EOL + + 'If you have programs installed that use this keys for their' + EOL + + 'preferences, you may get problems when deleting the keys!' + EOL + + EOL + + 'So, now you have to decide what to do:' + EOL + + EOL + + 'Yes: Delete the keys. You have to confirm the deleting of each key.' + EOL + + 'No: Jump to the Software key and delete manually.' + EOL + + 'Cancel: Do nothing.' + EOL + + 'Yes to All: Delete all keys.'; + + case MessageDlg(Msg, mtWarning, [mbYes, mbNo, mbYesToAll, mbCancel], 0) of + mrYes: begin + if Reg.KeyExists('Main') + and (mrYes=MessageDlg('Delete HKU\Software\Main ?', + mtWarning, [mbYes, mbNo], 0)) then + Reg.DeleteKey('Main'); + + if Reg.KeyExists('Sisyphus') + and (mrYes=MessageDlg('Delete HKU\Software\Sisyphus ?', + mtWarning, [mbYes, mbNo], 0)) then + Reg.DeleteKey('Sisyphus'); + + if Reg.KeyExists('Spy') + and (mrYes=MessageDlg('Delete HKU\Software\Spy ?', + mtWarning, [mbYes, mbNo], 0)) then + Reg.DeleteKey('Spy'); + + if Reg.KeyExists('View') + and (mrYes=MessageDlg('Delete HKU\Software\View ?', + mtWarning, [mbYes, mbNo], 0)) then + Reg.DeleteKey('View'); + end; + + mrYesToAll: begin + Reg.DeleteKey('Main'); + Reg.DeleteKey('Sisyphus'); + Reg.DeleteKey('Spy'); + Reg.DeleteKey('View'); + end; + + mrNo: begin + TreeWin.SetFocus; + GotoKey('HKCU\Software\'); + end; + end; + end; + + finally + Reg.Free; + end; +end; + +procedure TMainWin.BackupRegistryscanreg1Click(Sender: TObject); +begin + ExecFile('scanreg'); +end; + +procedure TMainWin.Username1Click(Sender: TObject); +begin + ShowMessage(UserName); +end; + +procedure TMainWin.ToDoMIClick(Sender: TObject); +begin + NotePad(PlutoDir + 'ToDo.txt'); +end; + +procedure TMainWin.MailLinkMIClick(Sender: TObject); +begin + MailTo(TMenuItem(Sender).Caption); +end; + +procedure TMainWin.IjustwantCONTACT1Click(Sender: TObject); +begin + MailTo('pluto@cYcnus.de'); +end; + +procedure TMainWin.ExternalHexEditMIClick(Sender: TObject); +begin + ExecFile(PrefWin.ExternalHexEditE.Text); +end; + +procedure TMainWin.AnotherPluto1Click(Sender: TObject); +begin + ExecFile(Application.ExeName); +end; + +procedure TMainWin.Path1Click(Sender: TObject); +begin +{$IFDEF UNIKEY} + UserUniPath := InputBox('UniKey', 'Input an UniPath.' + EOL + + EOL + + 'No idea? Try one of these: ' + EOL + + 'WinAmpVisColor :' + EOL + + 'Params:' + EOL + + 'Reg: HKCU' + EOL + + 'Ini <' + MyDir + 'pluto.ini>:' + EOL + + 'Ini <' + MyDir + 'pluto.ini>:[View]' + EOL, + UserUniPath); +{$ENDIF} +end; + +procedure TMainWin.RegisterPlugIns1Click(Sender: TObject); +begin +{$IFDEF UNIKEY} + if UniPluginOD.Execute then + RegisterUniClass(UniPluginOD.FileName); +{$ENDIF} +end; + +procedure TMainWin.FormResize(Sender: TObject); +begin + ArrangeIcons; + ArrangePlutoStyle; + WorkWin.WindowState := wsNormal; + ValuesWin.WindowState := wsNormal; + TreeWin.WindowState := wsNormal; +end; + +procedure TMainWin.SwapLM_CUBClick(Sender: TObject); +var + Path: string; +begin + Path := TraceKey(PathE.Text, uhShortcuts); + if SwapHKU_HKLM(Path) then begin + PathE.Text := Path; + UserGotoKey; + end; +end; + +procedure TMainWin.ShowLoadreport1Click(Sender: TObject); +begin + NotePad(MyDir + 'loadreport.txt'); +end; + +procedure TMainWin.KillPluto1Click(Sender: TObject); +begin + Application.Terminate; +end; + +procedure TMainWin.ShowPlatform1Click(Sender: TObject); +begin + ShowMessage(Format('Platform: %s' + EOL + + 'Versin: %d.%d Build %d', + [PlatformStrings[Win32Platform], + Win32MajorVersion, Win32MinorVersion, Win32BuildNumber])); +end; + +procedure TMainWin.MSConfig1Click(Sender: TObject); +begin + ExecFile('msconfig'); +end; + +procedure TMainWin.TimetoRelaxMIClick(Sender: TObject); +var + RelaxFile: string; +begin + with PlutoKey.GetKey('Main') do + try + RelaxFile := ReadString('Relax'); + finally + Free; + end; + + if RelaxFile = '' then + ShowMessage('This menu item can be used for something that lets you relax,' + EOL + + 'for example Diablo2, you favorite song or the latest news about the' + EOL + + 'decreasing AOL member numbers.' + EOL + + EOL + + 'Feel free to use everything you want.' + EOL + + 'Open the pluto.ini (CTRL+I) and add a new value "Relax" in the "Main"' + EOL + + 'section.' + EOL + + EOL + + 'And don''t forget:' + EOL + + 'R E L A X ! ! !') + else + ExecFile(RelaxFile); +end; + +procedure TMainWin.OnSisyChange(Sender: TSisyThread; Change: TSisyChange); + + procedure UpdateValue; + var + Reg: TXRegistry; + Index: Integer; + begin + if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then + Exit; + + Reg := TXRegistry.Create; + try + Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); + if Reg.OpenKey(ExRegKey(Change.Path)) then + with ValuesWin do begin + Index := FindItemByRealName(ExRegValue(Change.Path)); + if Index > -1 then begin + if Change.Typ = cValueMinus then + ValueList.Items.Delete(Index) + else if Change.Typ = cContextChange then + UpdateValue(Reg, ValueList.Items[Index]); + end else if Change.Typ = cValuePlus then + AddValue(Reg, ExRegValue(Change.Path)); + end; + finally + Reg.Free; + end; + end; + +begin + AddHint(Sender.Name + ' notified ' + Change.Path); + if Change.Typ in [cValueMinus, cValuePlus, cContextChange] then + UpdateValue; +end; + +procedure TMainWin.OnSisyValuePlus(Sender: TSisyThread; Change: TSisyChange); +var + Reg: TXRegistry; +begin + if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then + Exit; + + Reg := TXRegistry.Create; + try + Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); + if Reg.OpenKey(ExRegKey(Change.Path)) then + ValuesWin.AddValue(Reg, ExRegValue(Change.Path)); + finally + Reg.Free; + end; +end; + +procedure TMainWin.OnSisyValueMinus(Sender: TSisyThread; Change: TSisyChange); +var + Reg: TXRegistry; + Index: Integer; +begin + if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then + Exit; + + Reg := TXRegistry.Create; + try + Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); + if Reg.OpenKey(ExRegKey(Change.Path)) then + with ValuesWin do begin + Index := FindItemByRealName(ExRegValue(Change.Path)); + if Index > -1 then + ValueList.Items.Delete(Index); + end; + finally + Reg.Free; + end; +end; + +procedure TMainWin.OnSisyContextChange(Sender: TSisyThread; Change: TSisyChange); +var + Reg: TXRegistry; + Index: Integer; +begin + if not SameRegPath(ExRegFullKey(Change.Path), PathOfNode(RegTV.Selected)) then + Exit; + + Reg := TXRegistry.Create; + try + Reg.RootKey := HKEYOfStr(ExRegRoot(Change.Path)); + if Reg.OpenKey(ExRegKey(Change.Path)) then + with ValuesWin do begin + Index := FindItemByRealName(ExRegValue(Change.Path)); + if Index > -1 then + UpdateValue(Reg, ValueList.Items[Index]); + end; + finally + Reg.Free; + end; +end; + +end. +unit PrefU; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ExtCtrls, StdCtrls, PlutoConst, NewPanels, PrefTools, + YTools, YTypes, start, XReg, LinkLabel; + +type + TPrefWin = class(TForm) + PrefPC: TPageControl; + CommonPage: TTabSheet; + KeyPage: TTabSheet; + DataPage: TTabSheet; + KeysBP: TBorderPanel; + GroupBox3: TGroupBox; + MainPrevBP: TBorderPanel; + GroupBox4: TGroupBox; + BorderPanel6: TBorderPanel; + GroupBox6: TGroupBox; + SortKeysCB: TPrefCheckBox; + PrefHost: TPrefHost; + MainPreviewCB: TPrefCheckBox; + SplashScreenCB: TPrefCheckBox; + PrefValuesPC: TPageControl; + StringPage: TTabSheet; + MultiStringPage: TTabSheet; + IntPage: TTabSheet; + BinaryPage: TTabSheet; + BorderPanel8: TBorderPanel; + GroupBox8: TGroupBox; + ShowDwordAsHex: TPrefCheckBox; + BorderPanel7: TBorderPanel; + GroupBox7: TGroupBox; + CountZeroByteCB: TPrefCheckBox; + BorderPanel1: TBorderPanel; + GroupBox2: TGroupBox; + UseExtendedModelCB: TPrefCheckBox; + BorderPanel2: TBorderPanel; + GroupBox1: TGroupBox; + ShowAsBinaryCB: TPrefCheckBox; + ShowBinaryAsRG: TPrefRadioGroup; + Smart4BBCB: TPrefCheckBox; + DWordPreviewL: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + UserNameE: TPrefEdit; + Label8: TLabel; + MainPreviewE: TPrefEdit; + Label12: TLabel; + DefaultIconPreviewCB: TPrefCheckBox; + KeyInfoPreviewCB: TPrefCheckBox; + SelectExternalHexEditOD: TOpenDialog; + BorderPanel3: TBorderPanel; + GroupBox9: TGroupBox; + IntegrationPage: TTabSheet; + BorderPanel4: TBorderPanel; + GroupBox5: TGroupBox; + Label11: TLabel; + SelectExternalHexEditB: TButton; + RunExternalHexEditB: TButton; + ExternalHexEditE: TPrefEdit; + Label13: TLabel; + BorderPanel5: TBorderPanel; + GroupBox10: TGroupBox; + Label15: TLabel; + RegisterAppCB: TCheckBox; + Label3: TLabel; + Memo1: TMemo; + ExpandStringsRG: TPrefRadioGroup; + QuotersE: TPrefEdit; + Label1: TLabel; + StringPreviewL: TLabel; + ShowLineCountCB: TPrefCheckBox; + ShowTreeViewLinesCB: TPrefCheckBox; + ValuePage: TTabSheet; + BorderPanel10: TBorderPanel; + GroupBox12: TGroupBox; + ShowListViewGridCB: TPrefCheckBox; + Label9: TLabel; + DefaultValueNameE: TPrefEdit; + Label10: TLabel; + GotoPlutoKeyB: TButton; + ColorPanel2: TColorPanel; + LinkLabel1: TLinkLabel; + SmartExpandCB: TPrefCheckBox; + KeysSingleClickCB: TPrefCheckBox; + ValuesSingleClickCB: TPrefCheckBox; + ShowProgressCB: TPrefCheckBox; + ColorPanel1: TColorPanel; + Label2: TLabel; + ReloadB: TButton; + DefaultB: TButton; + SaveB: TButton; + procedure PrefPCDrawTab(Control: TCustomTabControl; + TabIndex: Integer; const Rect: TRect; Active: Boolean); + procedure PrefHostLoaded(Sender: TObject); + procedure StandardPreviewChange(Sender: TObject); + procedure DataPreviewChange(Sender: TObject); + procedure UserNameEChange(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure FormDeactivate(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure PrefValuesPCDrawTab(Control: TCustomTabControl; + TabIndex: Integer; const Rect: TRect; Active: Boolean); + procedure ShowDwordAsHexClick(Sender: TObject); + procedure MainPreviewEChange(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure ActivateIt(Sender: TObject); + procedure DeActivateIt(Sender: TObject); + procedure ReloadBClick(Sender: TObject); + procedure RunExternalHexEditBClick(Sender: TObject); + procedure SelectExternalHexEditBClick(Sender: TObject); + procedure ExternalHexEditEChange(Sender: TObject); + procedure DefaultBClick(Sender: TObject); + procedure RegisterAppCBClick(Sender: TObject); + procedure SaveBClick(Sender: TObject); + procedure StringPreviewChange(Sender: TObject); + procedure ShowTreeViewLinesCBClick(Sender: TObject); + procedure ShowListViewGridCBClick(Sender: TObject); + procedure DefaultValueNameEChange(Sender: TObject); + procedure LoadPrefs; + procedure UseExtendedModelCBClick(Sender: TObject); + procedure IntegrationPageShow(Sender: TObject); + procedure GotoPlutoKeyBClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure KeysSingleClickCBClick(Sender: TObject); + procedure ValuesSingleClickCBClick(Sender: TObject); + procedure QuotersEChange(Sender: TObject); + procedure SplashScreenCBClick(Sender: TObject); + procedure SaveBMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + public + StringQuoterBegin, StringQuoterEnd: string; + end; + +var + PrefWin: TPrefWin; + +implementation + +uses + TreeU, ValuesU, Splash, plutomain, WorkU; + +{$R *.dfm} + +procedure TPrefWin.PrefPCDrawTab(Control: TCustomTabControl; + TabIndex: Integer; const Rect: TRect; Active: Boolean); +var + PC: TPageControl; + Page: TTabSheet; +begin + PC := TPageControl(Control); + Page := PC.Pages[TabIndex]; + with PC.Canvas.Font do begin + if Page.Caption = 'Common' then + Color := clWhite + else if Page.Caption = 'Keys' then + Color := clBrightCyan + else if Page.Caption = 'Values' then + Color := clBrightPurple + else if Page.Caption = 'Data' then + Color := clBrightBlue + else if Page.Caption = 'System' then + Color := clBrightYellow + else + Color := clWhite; + end; + + with PC.Canvas do + if Active then begin + Font.Style := [fsBold]; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 5, Rect.Top + 3, Page.Caption); + end else begin + Font.Style := []; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 3, Rect.Top + 2, Page.Caption); + end; +end; + +procedure TPrefWin.PrefHostLoaded(Sender: TObject); +begin + PrefHost.KeyName := PlutoUniPath; +end; + +procedure TPrefWin.StandardPreviewChange(Sender: TObject); +begin + if Started then + RegTV.Repaint; +end; + +procedure TPrefWin.DataPreviewChange(Sender: TObject); +begin + if not Started then + Exit; + + ValuesWin.UpdateValues; + RegTV.Repaint; +end; + +procedure TPrefWin.UserNameEChange(Sender: TObject); +begin + StatusBar.Panels[0].Text := MainWin.Greeting; +end; + +procedure TPrefWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_ESCAPE then + Close; + + if Key = VK_SCROLL then + MainWin.FormKeyDown(Sender, Key, Shift); +end; + +procedure TPrefWin.FormDeactivate(Sender: TObject); +begin + if ActiveControl.Tag = EditControlFlag then + DeActivateThis(ActiveControl); + + AlphaBlendValue := 127; +end; + +procedure TPrefWin.FormActivate(Sender: TObject); +begin + if Started and (ActiveControl.Tag = EditControlFlag) then + ActivateThis(ActiveControl); + + AlphaBlendValue := 255; +end; + +procedure TPrefWin.PrefValuesPCDrawTab(Control: TCustomTabControl; + TabIndex: Integer; const Rect: TRect; Active: Boolean); +var + PC: TPageControl; + Page: TTabSheet; +begin + PC := TPageControl(Control); + Page := PC.Pages[TabIndex]; + with PC.Canvas.Font do begin + if Page = StringPage then + Color := clBrightRed + else if Page = MultiStringPage then + Color := clBrightPurple + else if Page = IntPage then + Color := clBrightBlue + else if Page = BinaryPage then + Color := clBrightGreen; + end; + + with PC.Canvas do + if Active then begin + Font.Style := [fsBold]; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 18 + 5, Rect.Top + 3, Page.Caption); + PC.Images.Draw(PC.Canvas, Rect.Left + 4, Rect.Top + 2, Page.ImageIndex); + end else begin + Font.Style := []; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 18 + 3, Rect.Top + 2, Page.Caption); + PC.Images.Draw(PC.Canvas, Rect.Left + 1, Rect.Top + 1, Page.ImageIndex); + end; +end; + +procedure TPrefWin.ShowDwordAsHexClick(Sender: TObject); +begin + DWordPreviewL.Caption := 'Preview: ' + ValuesU.DataPreviewOfContext( + RegContext(rdCardinal, Reverse(ByteAOfHex(HexOfCard(1234567890, 8))))); + DataPreviewChange(Self); +end; + +procedure TPrefWin.MainPreviewEChange(Sender: TObject); +begin + if MainPreviewE.Text = '' then + MainPreviewCB.Caption := '&Show Preview for Default Value' + else + MainPreviewCB.Caption := '&Show Preview for ' + + Quote(MainPreviewE.Text); + + StandardPreviewChange(Self); +end; + +procedure TPrefWin.FormCreate(Sender: TObject); +begin + UserNameE.DefaultValue := UserName; + MainPreviewEChange(Self); + PrefPC.ActivePageIndex := 0; + PrefValuesPC.ActivePageIndex := 0; +end; + +procedure TPrefWin.ActivateIt(Sender: TObject); +begin + ActivateThis(Sender); +end; + +procedure TPrefWin.DeActivateIt(Sender: TObject); +begin + DeActivateThis(Sender); +end; + +procedure TPrefWin.ReloadBClick(Sender: TObject); +begin + LoadPrefs; +end; + +procedure TPrefWin.RunExternalHexEditBClick(Sender: TObject); +var + FileName, TestValue: string; +begin + FileName := TempDir + '~test.bin'; + TestValue := 'This is only a test.' + EOL + + 'Everything seems to be OK.'; + if SaveByteA(ByteAOfStr(TestValue), FileName) then + ExecFileWith(ExternalHexEditE.Text, FileName) + else + ShowMessage('Could not write into file:' + EOL + + FileName); +end; + +procedure TPrefWin.SelectExternalHexEditBClick(Sender: TObject); +begin + with SelectExternalHexEditOD do begin + InitialDir := ExtractPath(ExternalHexEditE.Text); + FileName := ExtractFileName(ExternalHexEditE.Text); + if Execute and FileExists(FileName) then + ExternalHexEditE.Text := FileName; + end; +end; + +procedure TPrefWin.ExternalHexEditEChange(Sender: TObject); +begin + RunExternalHexEditB.Enabled := FileExists(ExternalHexEditE.Text); + if Assigned(WorkWin) then + WorkWin.ExternalEditB.Enabled := RunExternalHexEditB.Enabled; + if Assigned(MainWin) then + MainWin.ExternalHexEditMI.Enabled := RunExternalHexEditB.Enabled; +end; + +procedure TPrefWin.DefaultBClick(Sender: TObject); +begin + if mrYes=MessageDlg('Do you really want to reset the preferences' + EOL + + 'to their defaults?' + EOL + + '(This can not be undone.)', mtWarning, [mbYes, mbCancel], 0) then begin + CopyFile(PChar(PlutoIniFileName), PChar(PlutoIniFileName + '.backup'), False); + //PrefHost.KeyName := 'Ini <' + PlutoIniFileName + '.backup>:'; + //PrefHost.Save; + //PrefHost.KeyName := PlutoUniPath; + PrefHost.BackUp; + end; +end; + +procedure TPrefWin.RegisterAppCBClick(Sender: TObject); +begin + with TXRegistry.Create do + try + RootKey := HKLM; + OpenKey('Software\Microsoft\Windows\CurrentVersion\App Paths'); + if RegisterAppCB.Checked then begin + OpenKey('pluto.exe', True); + WriteString('', GetFileNew(Application.ExeName)); + end else + DeleteKey('pluto.exe'); + finally + Free; + end; +end; + +procedure TPrefWin.SaveBClick(Sender: TObject); +begin + PrefHost.Save; +end; + +procedure TPrefWin.StringPreviewChange(Sender: TObject); +begin + StringPreviewL.Caption := 'Preview: ' + ValuesU.DataPreviewOfContext( + RegContext(rdString, ByteAOfStr('%windir%'))); + DataPreviewChange(Self); +end; + +procedure TPrefWin.ShowTreeViewLinesCBClick(Sender: TObject); +begin + with RegTV do begin + ShowLines := ShowTreeViewLinesCB.Checked; + ShowButtons := ShowLines; + end; + StandardPreviewChange(Sender); +end; + +procedure TPrefWin.ShowListViewGridCBClick(Sender: TObject); +begin + ValueList.GridLines := ShowListViewGridCB.Checked; +end; + +procedure TPrefWin.DefaultValueNameEChange(Sender: TObject); +begin + DefaultValueCaption := DefaultValueNameE.Text; + if Started then + TreeWin.RegTVChange(Self, RegTV.Selected); +end; + +procedure TPrefWin.LoadPrefs; +begin + PrefHost.Load; +end; + +procedure TPrefWin.UseExtendedModelCBClick(Sender: TObject); +begin + WorkWin.MultiStringTypeRG.ItemIndex := Integer(UseExtendedModelCB.Checked); + DataPreviewChange(Sender); +end; + +procedure TPrefWin.IntegrationPageShow(Sender: TObject); +begin + with TXRegistry.Create do + try + RootKey := HKLM; + OpenKey('Software\Microsoft\Windows\CurrentVersion\App Paths\pluto.exe'); + RegisterAppCB.Checked := SameFileName(GetFileNew(ReadString('')), + GetFileNew(Application.ExeName)); + finally + Free; + end; +end; + +procedure TPrefWin.GotoPlutoKeyBClick(Sender: TObject); +begin + MainWin.GotoKey('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\pluto.exe'); +end; + +procedure TPrefWin.FormShow(Sender: TObject); +begin + PrefHost.Load; +end; + +procedure TPrefWin.KeysSingleClickCBClick(Sender: TObject); +begin + TreeWin.CheckRegTVHotTrack; +end; + +procedure TPrefWin.ValuesSingleClickCBClick(Sender: TObject); +begin + ValuesWin.CheckValueListHotTrack; +end; + +procedure TPrefWin.QuotersEChange(Sender: TObject); +var + QBegin, QEnd: string; +begin + with QuotersE do begin + if Text = '' then + QBegin := '' + else + QBegin := Text[1]; + if Length(Text) < 2 then + QEnd := QBegin + else + QEnd := Text[2]; + end; + + if (QBegin <> StringQuoterBegin) or (QEnd <> StringQuoterEnd) then begin + StringQuoterBegin := QBegin; + StringQuoterEnd := QEnd; + StringPreviewChange(Self); + end; +end; + +procedure TPrefWin.SplashScreenCBClick(Sender: TObject); +begin + if Started and Assigned(SplashWin) then + SplashWin.SplashScreenCB.Checked := SplashScreenCB.Checked; +end; + +procedure TPrefWin.SaveBMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + Label2.Font.Color := clBrightRed; + Application.ProcessMessages; + Sleep(200); + Label2.Font.Color := clWhite; +end; + +end. +unit RegScanner; + +interface + +uses + Windows, SysUtils, Dialogs, Classes, + YTools, YTypes, XReg, Clock; + +type + TRegScanThread = class; + + TRegScanKeyEvent = procedure (Sender: TRegScanThread; const KeyName: string; Key: HKEY; Info: TRegKeyInfo) of object; + TRegScanValueEvent = procedure (Sender: TRegScanThread; const ValueName: string; Context: TRegContext) of object; + + TRegScanTask = record + Root: string; + Key: HKEY; + end; + TRegScanTasks = array of TRegScanTask; + + TRegScanThread = class(TThread) + private + Keys, KeysOK, Values, ValuesOK: Integer; + DoScanValues: Boolean; + FOnKey: TRegScanKeyEvent; + FOnValue: TRegScanValueEvent; + FOnFaileKey: TRegScanKeyEvent; + protected + procedure ScanKey(Key: HKEY; const KeyName: string = ''); virtual; + procedure ScanValues(Key: HKEY; Info: TRegKeyInfo); virtual; + + public + Path: string; + CurrentTask: TRegScanTask; + Tasks: TRegScanTasks; + destructor Destroy; override; + procedure Execute; override; + procedure ScanAll; + function CurrentPath: string; + published + constructor CreateIt(PriorityLevel: TThreadPriority; + DoScanValues: Boolean = True; Tasks: TRegScanTasks = nil); + + property OnKey: TRegScanKeyEvent read FOnKey write FOnKey; + property OnValue: TRegScanValueEvent read FOnValue write FOnValue; + property OnFaileKey: TRegScanKeyEvent read FOnFaileKey write FOnFaileKey; + end; + +implementation + +{ TRegScanThread } + +constructor TRegScanThread.CreateIt(PriorityLevel: TThreadPriority; + DoScanValues: Boolean = True; Tasks: TRegScanTasks = nil); +begin + inherited Create(True); + Priority := PriorityLevel; + FreeOnTerminate := False; + Self.DoScanValues := DoScanValues; + Self.Tasks := Tasks; +end; + +destructor TRegScanThread.Destroy; +begin + inherited; +end; + +procedure TRegScanThread.ScanAll; +var + i: Integer; +begin + Keys := 0; + KeysOK := 0; + Values := 0; + ValuesOK := 0; + + for i := 0 to High(Tasks) do begin + CurrentTask := Tasks[i]; + with CurrentTask do begin + Inc(Keys); + ScanKey(Key); + end; + + if Terminated then Break; + end; +end; + +procedure TRegScanThread.ScanValues(Key: HKEY; Info: TRegKeyInfo); +var + i: Integer; + MaxLen, NameLen, Len, Typ: Cardinal; + p: PChar; + Buffer: TByteA; + + procedure ScanValue(ValueName: string; Typ: TRegDataType; Data: TByteA); + begin + if Assigned(OnValue) then + OnValue(Self, ValueName, RegContext(Typ, Data)); + Inc(ValuesOK); + end; + +begin + MaxLen := Info.MaxValueLen + 1; //Include Nullbyte + SetLength(Buffer, Info.MaxDataLen); + GetMem(p, MaxLen); + + Inc(Values, Info.NumValues); + for i := 0 to Info.NumValues-1 do begin + NameLen := MaxLen; + Len := Info.MaxDataLen; + if Success(RegEnumValue(Key, i, p, NameLen, nil, @Typ, Pointer(Buffer), + @Len)) then + ScanValue(Copy(p, 0, NameLen), Typ, Copy(Buffer, 0, Len)) + else + Yield; + end; + FreeMem(p, MaxLen); +end; + +procedure TRegScanThread.ScanKey(Key: HKEY; const KeyName: string = ''); +var + i: Integer; + NewHKEY: HKEY; + Info: TRegKeyInfo; + l, Len: DWORD; + p: PChar; + z: Integer; +begin + if Terminated then Exit; + + with Info do begin + if not Success(RegQueryInfoKey(Key, nil, nil, nil, @NumSubKeys, + @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, @MaxDataLen, + nil, nil)) then + Exit; + + if Assigned(OnKey) then + OnKey(Self, KeyName, Key, Info); + if DoScanValues and (NumValues > 0) then + ScanValues(Key, Info); + + if Info.NumSubKeys > 0 then begin + Inc(Keys, NumSubKeys); + + Len := MaxSubKeyLen + 1; + GetMem(p, Len); + + for i := 0 to NumSubKeys-1 do begin + l := Len; + RegEnumKeyEx(Key, i, p, l, nil, nil, nil, nil); + if Success(RegOpenKey(Key, p, NewHKEY)) then begin + z := Length(Path); + Path := Path + '\' + p; + ScanKey(NewHKEY, p); + RegCloseKey(NewHKEY); + SetLength(Path, z); + end else + if Assigned(OnFaileKey) then + OnFaileKey(Self, p, Key, Info); + + if Terminated then + Break; + end; + FreeMem(p, Len); + end; + end; + + Inc(KeysOK); +end; + +procedure TRegScanThread.Execute; +var + Secs: Double; +begin + with TClock.Create do begin + ScanAll; + Secs := SecondsPassed; + Free; + end; + + WriteLn('finished.'); + WriteLn( Format('Keys: %6d counted (%3d failed)', [Keys, Keys - KeysOK])); + if DoScanValues then + WriteLn(Format('Values: %6d counted (%3d failed)', [Values, Values - ValuesOK])); + WriteLn('t ' + Format('%.2f', [Secs]) + ' seconds'); + if Secs > 0 then + WriteLn('r ' + Format('%.0f', [Keys / Secs]) + ' k/s'); +end; + +function TRegScanThread.CurrentPath: string; +begin + Result := CurrentTask.Root + Path; +end; + +end. +unit RegTV; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls; + +type + TRegTV = class(TTreeView) + private + { Private-Deklarationen } + protected + { Protected-Deklarationen } + public + { Public-Deklarationen } + published + { Published-Deklarationen } + end; + +procedure Register; + +implementation + +procedure Register; +begin + RegisterComponents('pluto', [TRegTV]); +end; + +end. +unit Sisyphus; + +interface + +uses + Windows, Classes, SysUtils, XReg, YTools, YTypes, Clock; + +type + TSpyValue = class + Name: string; + Next: TSpyValue; + //DIC: TByteA; + Typ: TXRegDataType; + Data: TByteA; + constructor Create(AName: string); + end; + + TSpyKey = class + public + Parent: TSpyKey; + Name: string; + Next: TSpyKey; + Keys: TSpyKey; + Values: TSpyValue; + procedure Spy(AHKEY: HKEY); + function Path: string; + constructor Create(AParent: TSpyKey; AName: string); + destructor Destroy; override; + end; + +var + Reg: TXRegistry; + HKLMSpyKey, HKUSpyKey: TSpyKey; + Started: Boolean = False; + +implementation + +uses + Plutomain; + +procedure AddChange(M: string); +begin + Yield; + //AddHint(M); +end; + +{ TSpyValue } + +constructor TSpyValue.Create(AName: string); +begin + Name := AName; + Next := nil; +end; + +{ TSpyKey } + +constructor TSpyKey.Create(AParent: TSpyKey; AName: string); +begin + Name := AName; + Parent := AParent; + + Next := nil; + Keys := nil; + Values := nil; +end; + +destructor TSpyKey.Destroy; +var + Value, NextValue: TSpyValue; + Key, NextKey: TSpyKey; +begin + Value := Values; + while Value <> nil do begin + NextValue := Value.Next; + Value.Free; + Value := NextValue; + end; + + Key := Keys; + while Key <> nil do begin + NextKey := Key.Next; + Key.Free; + Key := NextKey; + end; + + inherited; +end; + +function TSpyKey.Path: string; +begin + if Assigned(Parent) then + Result := Parent.Path + '\' + else + Result := 'Reg: '; + + Result := Result + Name; +end; + +procedure TSpyKey.Spy(AHKEY: HKEY); +var + SL: TStringList; + + procedure CompareValues; + var + i: Integer; + Value, LastValue, NewValue, SearchValue: TSpyValue; + begin + //OK, this part is a little bit complicate. So I will comment very much. + //First, two terms are important: + // means the list of values that will be read from the registry now: + Reg.GetValueNames(SL); + //So is TStringList. + + // means the image that was saved before. + //Here, it is a linear list of TSpyValue objects. That means that you can + //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify + //some comments. + + //!!! Comparing means: Make fit !!! + + //If wasn't saved before, it is just empty. + + //!!! There is no difference in comparing and saving in this method !!! + + //Building means: Comparing with an empty image. + + //We go through and make fit it + + //The following rules are important: + //Value = "The currently interesting value. + //LastValue = "The value with X.Next = Value" = "Value.Pref" + + LastValue := nil; // := "Values.Prev" + Value := Values; // := "LastValue.Next" + + //Now compare step by step + for i := 0 to SL.Count-1 do begin + if Assigned(Value) and (SL[i] = Value.Name) then begin + //cV= Normally (0.9999) everything's the same + LastValue := Value; + Value := Value.Next; + end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) + //Because the list finally must exactly fit SL, the "SL[i] value" hast + //to be inserted right here. But first let's look... + + //Maybe it was just moved? So search for it... + NewValue := nil; + if Assigned(Value) then begin + SearchValue := Value; + while Assigned(SearchValue.Next) do + if (SearchValue.Next.Name = SL[i]) then begin + //cV\ + NewValue := SearchValue.Next; + AddChange('cV\ ' + Path); + SearchValue.Next := SearchValue.Next.Next; + Break; end; + end; + + if not Assigned(NewValue) then begin + //cV+ No, not found! So it is new... + NewValue := TSpyValue.Create(SL[i]); + AddChange('cV+ ' + Path + '\\' + NewValue.Name); + with NewValue do begin + Typ := Reg.GetDataType(SL[i]); + Data := Reg.ReadBin(SL[i]); + end; + end; + + //The new object now must be placed after the last value + if Assigned(LastValue) then begin + LastValue.Next := NewValue; + end else begin + //If it's the first value, we don't have LastValue defined + //So we have to set the "Root" to it + Values := NewValue; + end; + //Now the rest of has to be placed after the new value + NewValue.Next := Value; + //And LastValue also has to refreshed: It is "Value.Pref" = NewValue! + LastValue := NewValue; + end; + end; + + //Because the whole before Value is exactly , the rest + //(if there is one) must have been deleted! + + //So first let's ensure that ends here: + if Assigned(LastValue) then begin + LastValue.Next := nil; + end else begin + //Another time: is empty now, so set Values instead + Values := nil; + end; + + //Now, the first value that maybe was "cut" off is Value: + while Assigned(Value) do begin + //cV- So, here really something HAS been deleted + LastValue := Value; + Value := Value.Next; + AddChange('cV- ' + Path + '\\' + LastValue.Name); + LastValue.Free; + end; + end; + + procedure CompareData; + var + Value: TSpyValue; + Typ: TXRegDataType; + Data: TByteA; + begin + //So, finally = . That means we now can compare the data: + Value := Values; + while Assigned(Value) do begin + Typ := Reg.GetDataType(Value.Name); + Data := Reg.ReadBin(Value.Name); + if Typ <> Value.Typ then begin + //cT# + AddChange('cT# ' + Path + '\\' + Value.Name); + Value.Typ := Typ; + end; + if not SameByteA(Data, Value.Data) then begin + //cD# + AddChange('cD# ' + Path + '\\' + Value.Name); + Value.Data := Data; + end; + + Value := Value.Next; + end; + end; + + procedure CompareKeys; + var + i: Integer; + Key, LastKey, NewKey, SearchKey: TSpyKey; + NewHKEY: HKEY; + begin + //OK, this part is a little bit complicate. So I will comment very much. + //First, two terms are important: + // means the list of keys that will be read from the registry now: + Reg.GetKeyNames(SL); + //So is TStringList. + + // means the image that was saved before. + //Here, it is a linear list of TSpyKey objects. That means that you can + //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify + //some comments. + + //!!! Comparing means: Make fit !!! + + //If wasn't saved before, it is just empty. + + //!!! There is no difference in comparing and saving in this method !!! + + //Building means: Comparing with an empty image. + + //We go through and make fit it + + //The following rules are important: + //Key = "The currently interesting key. + //LastKey = "The key with X.Next = Key" = "Key.Pref" + + LastKey := nil; // := "Keys.Prev" + Key := Keys; // := "LastKey.Next" + + //Now compare step by step + for i := 0 to SL.Count-1 do begin + if Assigned(Key) and (SL[i] = Key.Name) then begin + //cK= Normally (0.9999) everything's the same + RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY); + Key.Spy(NewHKEY); + LastKey := Key; + Key := Key.Next; + end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) + //Because the list finally must exactly fit SL, the "SL[i] key" hast + //to be inserted right here. But first let's look... + + //Maybe it was just moved? So search for it... + NewKey := nil; + if Assigned(Key) then begin + SearchKey := Key; + while Assigned(SearchKey.Next) do + if (SearchKey.Next.Name = SL[i]) then begin + //cK\ + NewKey := SearchKey.Next; + AddChange('cK\ ' + Path); + SearchKey.Next := SearchKey.Next.Next; + Break; end; + end; + + if not Assigned(NewKey) then begin + //cK+ No, not found! So it is new... + NewKey := TSpyKey.Create(Self, SL[i]); + AddChange('cK+ ' + Path + '\' + NewKey.Name); + + RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY); + NewKey.Spy(NewHKEY); + end; + + //The new object now must be placed after the last key + if Assigned(LastKey) then begin + LastKey.Next := NewKey; + end else begin + //If it's the first key, we don't have LastKey defined + //So we have to set the "Root" to it + Keys := NewKey; + end; + //Now the rest of has to be placed after the new key + NewKey.Next := Key; + //And LastKey also has to refreshed: It is "Key.Pref" = NewKey! + LastKey := NewKey; + end; + end; + + //Because the whole before Key is exactly , the rest + //(if there is one) must have been deleted! + + //So first let's ensure that ends here: + if Assigned(LastKey) then begin + LastKey.Next := nil; + end else begin + //Another time: is empty now, so set Keys instead + Keys := nil; + end; + + //Now, the first key that maybe was "cut" off is Key: + while Assigned(Key) do begin + //cV- So, here really something HAS been deleted + LastKey := Key; + Key := Key.Next; + AddChange('cK- ' + Path + '\' + LastKey.Name); + LastKey.Free; + end; + end; + + +begin + SL := TStringList.Create; + + try + Reg.CurrentKey := AHKEY; + + CompareValues; + + CompareData; + + CompareKeys; + + finally + RegCloseKey(AHKEY); + end; + + SL.Free; +end; + +initialization + Reg := TXRegistry.Create; + HKLMSpyKey := TSpyKey.Create(nil, 'HKEY_LOCAL_MACHINE'); + HKUSpyKey := TSpyKey.Create(nil, 'HKEY_USERS'); + +finalization + Reg.Free; + HKLMSpyKey.Free; + HKUSpyKey.Free; + +end. +unit SisyphusTH; + +interface + +uses + Windows, Classes, StdCtrls, Dialogs, SysUtils, XReg, YTools, YTypes, Clock, + ComCtrls, PlutoConst, UniKey, CompEx; + +const + SisyVersion = '1.2 b3'; + StatusPoints = 25; + +type + TSisyChangeType = (cNone, cError, + cKeyPlus, cKeyMinus, + cValuePlus, cValueMinus, + cContextChange); + +const + SisyChangeStrings: array[TSisyChangeType] of string = + ('?', 'Error', + 'cK+', 'cK-', + 'cV+', 'cV-', + 'cC'); + +type + TSpyValue = class + Name: string; + Next: TSpyValue; + Context: TRegContext; + constructor Create(const Name: string; Context: TRegContext); + end; + + TSisyThread = class; + + TSpyKey = class + public + Parent: TSpyKey; + Name: string; + Next: TSpyKey; + Keys: TSpyKey; + Values: TSpyValue; + procedure Spy(AHKEY: HKEY; Sisy: TSisyThread); + function Path: string; + constructor Create(AParent: TSpyKey; AName: string); + destructor Destroy; override; + end; + + TSisyChange = class + public + Typ: TSisyChangeType; + Path: string; + Old, New: TRegContext; + constructor Create(ATyp: TSisyChangeType; const APath: string; + AOldContext: TRegContext; ANewContext: TRegContext); + procedure ReportToPluto; + end; + + TSisyChangeEvent = procedure (Sender: TSisyThread; Change: TSisyChange) of object; + TSisyThread = class(TThread) + private + Reg: TXRegistry; + Key: TSpyKey; + KeyHKEY: HKEY; + CurrentChange: TSisyChange; + FOnChange: TSisyChangeEvent; + FOnSpecialChanges: array[TSisyChangeType] of TSisyChangeEvent; + procedure FreeKey; + procedure IncKeyCount; + procedure IncKeyIndex; + function GetSpecialChange(ChangeType: TSisyChangeType): TSisyChangeEvent; + procedure SetSpecialChange(ChangeType: TSisyChangeType; + const Value: TSisyChangeEvent); + protected + procedure AddValueChange(Typ: TSisyChangeType; const Path: string; + Old, New: TRegContext); + procedure AddKeyChange(Typ: TSisyChangeType; const Path: string); + procedure Execute; override; + procedure ShowInfo; + procedure NotifyChange; + procedure ReportCurrentChange; + public + CurrentSpyKey: TSpyKey; + StatusLabel: TLabel; + Name: string; + Started: Boolean; + DoReport: Boolean; + SecsPerRound: Double; + InfoForShow: string; + OnStarted: TNotifyEvent; + KeyCount: Integer; + PrevKeyCount: Integer; + KeyIndex: Integer; + TheClock: TClock; + Uni: TUniKey; + MaxValueCountToScan, MaxKeyCountToScan, MaxDataLenToScan: Cardinal; + constructor CreateIt(const AName, AKeyName: string; AHKEY: HKEY; + ALabel: TLabel; AUniKey: TUniKey); + destructor Destroy; override; + + property OnChange: TSisyChangeEvent read FOnChange write FOnChange; + property OnSpecialChange[ChangeType: TSisyChangeType]: TSisyChangeEvent + read GetSpecialChange write SetSpecialChange; + end; + + TSisyList = class(TList) + protected + function GetSisy(Index: Integer): TSisyThread; + procedure PutSisy(Index: Integer; Sisy: TSisyThread); + public + procedure Suspend; + procedure Resume; + property Items[Index: Integer]: TSisyThread read GetSisy write PutSisy; default; + end; + +procedure SetSisyChangeState(Node: TTreeNode; Active: Boolean); +function SisyChangeActivated(Node: TTreeNode): Boolean; + +var + SisyFilter: TStringList; + +implementation + +uses plutomain, workU, ValuesU; + +procedure SetSisyChangeState(Node: TTreeNode; Active: Boolean); +begin + Node.Data := Pointer(not Active); +end; + +function SisyChangeActivated(Node: TTreeNode): Boolean; +begin + Result := Node.Data = Pointer(False); +end; + +{ TSisyThread } + +constructor TSisyThread.CreateIt(const AName, AKeyName: string; + AHKEY: HKEY; ALabel: TLabel; AUniKey: TUniKey); +begin + inherited Create(True); // Create thread suspended + + Started := False; + DoReport := True; + KeyCount := 0; + FreeOnTerminate := False; // Thread frees itself not when terminated + + KeyHKEY := AHKEY; + Name := AName; + StatusLabel := ALabel; + StatusLabel.Caption := 'Zzzzzzz...'; + + Reg := TXRegistry.Create; + TheClock := TClock.Create; + + Uni := AUniKey.GetKey(Name); + Priority := TThreadPriority(Uni.ReadInteger('Priority', Integer(tpLowest))); + PrevKeyCount := Uni.ReadInteger('KeyCount', 0); + + MaxKeyCountToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxKeys', -1)); + MaxValueCountToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxValues', -1)); + MaxDataLenToScan := Cardinal(Uni.ReadInteger('ScanTuner: MaxDataLen', -1)); + + Key := TSpyKey.Create(nil, AKeyName); +end; + +procedure TSisyThread.FreeKey; +begin + Reg.Free; + TheClock.Free; + Key.Free; +end; + +destructor TSisyThread.Destroy; +begin + Synchronize(FreeKey); + inherited; +end; + +procedure TSisyThread.Execute; +begin + InfoForShow := Name + ' initializing...'; + Synchronize(ShowInfo); + + TheClock.Restart; + Started := False; + while not Terminated do + try + KeyIndex := 0; + + { ===================== } + Key.Spy(KeyHKEY, Self); + { ===================== } + + if Terminated then + Continue; //= Exit + + SecsPerRound := TheClock.SecondsPassed; + TheClock.Restart; + if not Started then begin + Started := True; + Uni.WriteInteger('KeyCount', KeyCount); + if Assigned(OnStarted) then + OnStarted(Self); + end; + except + ShowMessage('Error in Sisyphus'); + end; +end; + +procedure TSisyThread.AddValueChange(Typ: TSisyChangeType; const Path: string; + Old, New: TRegContext); + + procedure TryNotify(Event: TSisyCHangeEvent); + begin + + end; + +begin + if not (Started and DoReport) then + Exit; + + CurrentChange := TSisyChange.Create(Typ, Path, Old, New); + Synchronize(ReportCurrentChange); + Synchronize(NotifyChange); + +// CurrentChange.Free; //this makes Pluto itself +end; + +procedure TSisyThread.AddKeyChange(Typ: TSisyChangeType; const Path: string); +begin + AddValueChange(Typ, Path, ZeroRegContext, ZeroRegContext); +end; + +procedure TSisyThread.ShowInfo; +begin + if Assigned(StatusLabel) then + StatusLabel.Caption := InfoForShow; +end; + +procedure TSisyThread.ReportCurrentChange; +begin + if Assigned(CurrentChange) then + CurrentChange.ReportToPluto; +end; + +procedure TSisyThread.IncKeyCount; +var + c: Integer; +begin + if Started then + Exit; + + Inc(KeyCount); + + if (KeyCount and $1FF) = 0 then begin + if KeyCount > PrevKeyCount then + PrevKeyCount := KeyCount; + + c := 0; + if PrevkeyCount > 0 then + c := Round((KeyCount * StatusPoints) / PrevKeyCount); + InfoForShow := '|' + MulStr('.', c) + MulStr(' ', StatusPoints - c) + '|' + + Format(' (%0.1f s) %d/%d k ', + [TheClock.SecondsPassed, KeyCount, PrevKeyCount]); + + Synchronize(ShowInfo); + end; +end; + +procedure TSisyThread.IncKeyIndex; +var + c: Integer; +begin + if not Started then + Exit; + + Inc(KeyIndex); + + if ((KeyIndex and $1FF) = 0) and (KeyCount > 0) then begin + if KeyIndex > KeyCount then + KeyCount := KeyIndex; + + c := 0; + if KeyCount > 0 then + c := Round((KeyIndex * StatusPoints) / KeyCount); + + InfoForShow := '|' + MulStr(':', c) + MulStr('.', StatusPoints - c) + '|' + + Format(' (%0.1f s) %d/%d k ', [SecsPerRound, KeyIndex, KeyCount]); + + Synchronize(ShowInfo); + end; +end; + +function TSisyThread.GetSpecialChange(ChangeType: TSisyChangeType): + TSisyChangeEvent; +begin + Result := FOnSpecialChanges[ChangeType]; +end; + +procedure TSisyThread.SetSpecialChange(ChangeType: TSisyChangeType; + const Value: TSisyChangeEvent); +begin + FOnSpecialChanges[ChangeType] := Value; +end; + +procedure TSisyThread.NotifyChange; +var + Event: TSisyChangeEvent; +begin + Event := FOnSpecialChanges[CurrentChange.Typ]; + if Assigned(Event) then + Event(Self, CurrentChange); + + if Assigned(FOnChange) then + FOnChange(Self, CurrentChange); +end; + +{ TSpyValue } + +constructor TSpyValue.Create(const Name: string; Context: TRegContext); +begin + Self.Name := Name; + Next := nil; + Self.Context := Context; +end; + +{ TSpyKey } + +constructor TSpyKey.Create(AParent: TSpyKey; AName: string); +begin + Name := AName; + Parent := AParent; + + Next := nil; + Keys := nil; + Values := nil; +end; + +destructor TSpyKey.Destroy; +var + Value, NextValue: TSpyValue; + Key, NextKey: TSpyKey; +begin + Value := Values; + while Assigned(Value) do begin + NextValue := Value.Next; + Value.Free; + Value := NextValue; + end; + + Key := Keys; + while Assigned(Key) do begin + NextKey := Key.Next; + Key.Free; + Key := NextKey; + end; + + inherited; +end; + +function TSpyKey.Path: string; +begin + if Assigned(Parent) then + Result := Parent.Path + '\' + else + Result := ''; + + Result := Result + Name; +end; + +procedure TSpyKey.Spy(AHKEY: HKEY; Sisy: TSisyThread); +var + SL: TStringList; + LastKey: TSpyKey; + + procedure CompareValues; + var + i: Integer; + Value, LastValue, NewValue, SearchValue, SearchValue_Prev: TSpyValue; + begin + //OK, this part is a little bit complicate. So I will comment very much. + //First, two terms are important: + // means the list of values that will be read from the registry now: + Sisy.Reg.GetValueNames(SL); + if Cardinal(SL.Count) > Sisy.MaxValueCountToScan then + Exit; + //So is TStringList. + + // means the image that was saved before. + //Here, it is a linear list of TSpyValue objects. That means that you can + //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify + //some comments. + + //!!! Comparing means: Make fit !!! + + //If wasn't saved before, it is just empty. + + //!!! There is no difference in comparing and saving in this method !!! + + //Building means: Comparing with an empty image. + + //We go through and make fit it + + //The following rules are important: + //Value = "The currently interesting value. + //LastValue = "The value with X.Next = Value" = "Value.Pref" + + LastValue := nil; // := "Values.Prev" + Value := Values; // := "LastValue.Next" + + //Now compare step by step + for i := 0 to SL.Count-1 do begin + if Assigned(Value) and (SL[i] = Value.Name) then begin + //cV= Normally (0.9999) everything's the same + LastValue := Value; + Value := Value.Next; + end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) + //Because the list finally must exactly fit SL, the "SL[i] value" hast + //to be inserted right here. But first let's look... + + //Maybe it was just moved? So search for it... + NewValue := nil; + if Assigned(Value) then begin + SearchValue_Prev := Value; + SearchValue := Value.Next; + while Assigned(SearchValue) do begin + if SearchValue.Name = SL[i] then begin //we found our moved value + SearchValue_Prev.Next := SearchValue.Next; //delete it from + NewValue := SearchValue; //save that we found it + Break end; + SearchValue_Prev := SearchValue; + SearchValue := SearchValue.Next; + end; + end; + + if not Assigned(NewValue) then begin + //cV+ No, not found! So it is new... + NewValue := TSpyValue.Create(SL[i], Sisy.Reg.ReadContext(SL[i])); + { ================ cV+ ================ } + if Sisy.Started and Sisy.Reg.ValueReallyExists(SL[i]) then + Sisy.AddValueChange(cValuePlus, Path + '\\' + NewValue.Name, + ZeroRegContext, NewValue.Context); + end; + + //The new object now must be placed after the last value + if Assigned(LastValue) then + LastValue.Next := NewValue + else + //If it's the first value, we don't have LastValue defined + //So we have to set the "Root" to it + Values := NewValue; + + //Now the rest of has to be placed after the new value + NewValue.Next := Value; + //And LastValue also has to refreshed: It is "Value.Pref" = NewValue! + LastValue := NewValue; + end; + end; + + //Because the whole before Value is exactly , the rest + //(if there is one) must have been deleted! + + //So first let's ensure that ends here: + if Assigned(LastValue) then + LastValue.Next := nil + else + //Another time: is empty now, so set Values instead + Values := nil; + + //Now, the first value that maybe was "cut" off is Value: + while Assigned(Value) do begin + //cV- So, here really something HAS been deleted + LastValue := Value; + Value := Value.Next; + { ================ cV- ================ } + if Sisy.Started and not Sisy.Reg.ValueReallyExists(LastValue.Name) then + Sisy.AddValueChange(cValueMinus, Path + '\\' + LastValue.Name, + LastValue.Context, ZeroRegContext); + LastValue.Free; + end; + end; + + procedure CompareData; + var + Value: TSpyValue; + Context: TRegContext; + Size: Cardinal; + begin + Context := ZeroRegContext; //Initialize + //So, finally = . That means we now can compare the data: + Value := Values; + while Assigned(Value) and not Sisy.Terminated do begin + Size := Sisy.Reg.GetDataSize(Value.Name); + if (Size = Cardinal(-1)) or + (Size <= Sisy.MaxDataLenToScan) then begin + Context := Sisy.Reg.ReadContext(Value.Name); + if not SameContext(Context, Value.Context) then begin + { ================ cC ================ } + Sisy.AddValueChange(cContextChange, Path + '\\' + Value.Name, + Value.Context, Context); + Value.Context := Context; + end; + end; + + Value := Value.Next; + end; + end; + + procedure CompareKeys; + var + i: Integer; + Key, LastKey, NewKey, SearchKey, SearchKey_Prev: TSpyKey; + SavedDoReport: Boolean; + NewHKEY: HKEY; + begin + //OK, this part is a little bit complicate. So I will comment very much. + //First, two terms are important: + // means the list of keys that will be read from the registry now: + + Sisy.Reg.GetKeyNames(SL); + if Cardinal(SL.Count) > Sisy.MaxKeyCountToScan then + Exit; + //So is TStringList. + + // means the image that was saved before. + //Here, it is a linear list of TSpyKey objects. That means that you can + //only get X.Next and not X.Prev! However, I use "X.Prev" to simplify + //some comments. + + //!!! Comparing means: Make fit !!! + + //If wasn't saved before, it is just empty. + + //!!! There is no difference in comparing and saving in this method !!! + + //Building means: Comparing with an empty image. + + //We go through and make fit it + + //The following rules are important: + //Key = "The currently interesting key. + //LastKey = "The key with X.Next = Key" = "Key.Pref" + + LastKey := nil; // := "Keys.Prev" + Key := Keys; // := "LastKey.Next" + + //Now compare step by step + for i := 0 to SL.Count-1 do begin + if Assigned(Key) and (SL[i] = Key.Name) then begin + //cK= Normally (0.9999) everything's the same + if Success(RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY)) then + try + Key.Spy(NewHKEY, Sisy); + finally + RegCloseKey(NewHKEY); + end; + if Sisy.Terminated then + Exit; + + LastKey := Key; + Key := Key.Next; + end else begin //Something's different? Yes, the IMPORTANT rest (0.0001)) + //Because the list finally must exactly fit SL, the "SL[i] key" has + //to be inserted right here. But first let's look... + + //Maybe it was just moved? So search for it... + NewKey := nil; + if Assigned(Key) then begin + SearchKey_Prev := Key; + SearchKey := Key.Next; + while Assigned(SearchKey) do begin + if SearchKey.Name = SL[i] then begin //we found our moved key + SearchKey_Prev.Next := SearchKey.Next; //delete it from + NewKey := SearchKey; //save that we found it + Break end; + SearchKey_Prev := SearchKey; + SearchKey := SearchKey.Next; + end; + end; + + if not Assigned(NewKey) then begin //if we didn't find it + //cK+ No, not found! So it is new... + NewKey := TSpyKey.Create(Self, SL[i]); + Sisy.IncKeyCount; + Sisy.Reg.CurrentKey := AHKEY; + { ================ cK+ ================ } + if Sisy.Started and Sisy.Reg.KeyExists(SL[i]) then + Sisy.AddKeyChange(cKeyPlus, Path + '\' + NewKey.Name); + + SavedDoReport := Sisy.DoReport; + if Success(RegOpenKey(AHKEY, PChar(SL[i]), NewHKEY)) then + try + Sisy.DoReport := False; + NewKey.Spy(NewHKEY, Sisy); //<-- recursion itself + finally + RegCloseKey(NewHKEY); + Sisy.DoReport := SavedDoReport; + end; + + if Sisy.Terminated then + Exit; + end; + + //The new key now must be placed after the last key + if Assigned(LastKey) then + LastKey.Next := NewKey + else + //If it's the first key, we don't have LastKey defined + //So we have to set the "Root" to it + Keys := NewKey; + + //Now the rest of has to be placed after the new key + NewKey.Next := Key; + //And LastKey also has to refreshed: It is "Key.Pref" = NewKey! + LastKey := NewKey; + end; + end; + + //Because the whole before Key is exactly , the rest + //(if there is one) must have been deleted! + + //So first let's ensure that ends here: + if Assigned(LastKey) then + LastKey.Next := nil + else + //Another time: is empty now, so set Keys instead + Keys := nil; + + //Now, the first key that maybe was "cut" off is Key: + while Assigned(Key) do begin + //cV- So, here really something HAS been deleted + LastKey := Key; + Key := Key.Next; + Sisy.Reg.CurrentKey := AHKEY; + { ================ cK- ================ } + if Sisy.Started and not Sisy.Reg.KeyExists(LastKey.Name) then + Sisy.AddKeyChange(cKeyMinus, Path + '\' + LastKey.Name); + LastKey.Free; + end; + end; + + +begin + if Sisy.Terminated or (AHKEY = 0) then + Exit; + LastKey := Sisy.CurrentSpyKey; + Sisy.CurrentSpyKey := Self; + + Sisy.IncKeyIndex; + + SL := TStringList.Create; + try + Sisy.Reg.CurrentKey := AHKEY; + CompareValues; + if Sisy.Started then CompareData; + CompareKeys; + finally + Sisy.Reg.CurrentKey := 0; + SL.Free; + Sisy.CurrentSpyKey := LastKey; + end; +end; + +{ TSisyChange } + +constructor TSisyChange.Create(ATyp: TSisyChangeType; const APath: string; + AOldContext: TRegContext; ANewContext: TRegContext); +begin + inherited Create; + Typ := ATyp; + Path := APath; + Old := AOldContext; + New := ANewContext; +end; + +procedure TSisyChange.ReportToPluto; +var + Node, RootNode: TTreeNode; + Root, SubPath: string; + NewNode: Boolean; + i: Integer; + + function IconOfSisyChangeType(Typ: TSisyChangeType): Integer; + begin + Result := -1; + case Typ of + //cNone, cError: Result := -1; + cKeyPlus..cContextChange: Result := Integer(Typ) - 2; + end; + end; + + function FindNode(Text: string): TTreeNode; + begin + Result := WorkWin.SisyTV.Items.GetFirstNode; + while Assigned(Result) do begin + if SameText(Result.Text, Text) then + Exit; + Result := Result.GetNextSibling; + end; + end; + +begin + if not WorkWin.SisyListCB.Checked then + Exit; + + if Typ in [cContextChange, cValueMinus, cValuePlus] then begin + Root := ExRegFullKey(Path); + SubPath := ExRegValue(Path); + end else begin + Root := UntilLastChar(ExRegFullKey(Path), '\'); + SubPath := FromLastChar(ExRegFullKey(Path), '\'); + end; + + with WorkWin do + for i := 0 to SisyFilter.Count-1 do begin + if TextAtPos(Root, 1, SisyFilter[i]) then begin + //show that it's working + with FilterChangesB do begin + Caption := 'Filter..!'; + Repaint; + Caption := 'Filter...'; + Repaint; + end; + Exit; end; + end; + + with WorkWin.SisyTV.Items do begin + BeginUpdate; + try + RootNode := FindNode(Root); + NewNode := not Assigned(RootNode); + if NewNode then begin + RootNode := AddChild(nil, Root); + RootNode.ImageIndex := iconGroup; + end else if not SisyChangeActivated(RootNode) then begin + EndUpdate; + Exit end; + + Node := AddChildObject(RootNode, SubPath, Self); + Node.ImageIndex := IconOfSisyChangeType(Typ); + if Typ = cContextChange then begin + AddChild(Node, DataPreviewOfContext(Old)).ImageIndex := iconOldContext; + AddChild(Node, DataPreviewOfContext(New)).ImageIndex := iconNewContext; + end; + finally + EndUpdate; + end; + end; + + if NewNode and WorkWin.SisyExpandGroupsCB.Checked then + RootNode.Expand(False); + + if not RootNode.Expanded then + RootNode.ImageIndex := iconGroupBlinking; +end; + +{ TSisyList } + +function TSisyList.GetSisy(Index: Integer): TSisyThread; +begin + Result := Get(Index); +end; + +procedure TSisyList.PutSisy(Index: Integer; Sisy: TSisyThread); +begin + Put(Index, Sisy); +end; + +procedure TSisyList.Resume; +var + i: Integer; +begin + for i := 0 to Count-1 do + Items[i].Resume; +end; + +procedure TSisyList.Suspend; +var + i: Integer; +begin + for i := 0 to Count-1 do + Items[i].Resume; +end; + +initialization + SisyFilter := TStringList.Create; + SisyFilter.Sorted := True; + SisyFilter.Duplicates := dupIgnore; + +finalization + SisyFilter.Free; + +end. +unit splash; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ExtCtrls, StdCtrls, ImgList, YTools, IniFiles, LinkLabel, PrefTools, + PlutoConst; + +type + TSplashWin = class(TForm) + Image1: TImage; + StartB: TButton; + SplashScreenCB: TPrefCheckBox; + LinkLabel1: TLinkLabel; + LinkLabel2: TLinkLabel; + LogoL: TLabel; + procedure StartBClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure SplashScreenCBClick(Sender: TObject); + end; + +var + SplashWin: TSplashWin; + +implementation + +uses plutomain, TreeU, WorkU, PrefU; + +{$R *.DFM} + +procedure TSplashWin.StartBClick(Sender: TObject); +begin + Close; +end; + +procedure TSplashWin.FormShow(Sender: TObject); +const + Messages: array[0..12] of string = ('Let''s see...', + 'Ready', + 'Hello World!', + 'Start', + 'OK', + 'Pluto!', + 'Go Go Go', + 'Everything''s OK', + 'Yes!', + 'God save the Queen', + 'Oh yeah', + 'Yabadabadoo!', + 'Don''t worry, be happy!' + ); +var + ImageFile: string; +begin + Left := (Screen.Width - Width) div 2; + Top := (Screen.Height - Height) div 2; + + StartB.Caption := Messages[Random(Length(Messages))]; + SplashWin.SplashScreenCB.Load; + + Caption := 'cYcnus.Pluto ' + Version + ' says ' + MainWin.Greeting; + + try + ImageFile := PlutoDir + 'logo deluxe.bmp'; + if FileEx(ImageFile) then begin + with Image1.Picture do + if Graphic = nil then + LoadFromFile(ImageFile); + if not Switch('MurphyMode') then + LogoL.Visible := False; + Exit; + end; + + ImageFile := PlutoDir + 'logo.bmp'; + if FileEx(ImageFile) then begin + with Image1.Picture do + if Graphic = nil then + LoadFromFile(ImageFile); + end; + except + ShowMessage('Could not load Splash Screen image!'); + end; +end; + +procedure TSplashWin.FormCreate(Sender: TObject); +begin + Hide; + Randomize; +end; + +procedure TSplashWin.FormHide(Sender: TObject); +begin + //Image1.Picture.Bitmap.FreeImage; +end; + +procedure TSplashWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_ESCAPE then + Close; +end; + +procedure TSplashWin.SplashScreenCBClick(Sender: TObject); +begin + if Started then + PrefWin.SplashScreenCB.Checked := SplashScreenCB.Checked; +end; + +end. +unit SpyTH; + +interface + +uses + Classes, Windows, Dialogs, ComCtrls, CompEx, SysUtils, YTools, clock, + plutoconst, StdCtrls, forms, XReg, stringcomp; + +type + TChildren = array of TTreeNode; + + TRegSpyThread = class(TThread) + private + Reg: TXRegistry; + CurNode: TTreeNode; + Dead: Boolean; + Dif: TSLComp; + CurChildren: TChildren; + protected + procedure Execute; override; + + procedure SaveCheckNode; + procedure SaveGetDif; + procedure SaveDeleteDead; + procedure SaveGetChildren; + procedure SaveAddNew; + public + Restart: Boolean; + Mess: string; + Delay: Integer; + function Alive(Node: TTreeNode): Boolean; + procedure Spy; + procedure Reload(Node: TTreeNode); + procedure ReloadValues; + procedure AddTrace(Trace: string); + constructor CreateIt(PriorityLevel: TThreadPriority); + destructor Destroy; override; + end; + +implementation + +uses plutomain, TreeU, WorkU, ValuesU; + +{ TRegSpyThread } + +constructor TRegSpyThread.CreateIt(PriorityLevel: TThreadPriority); +begin + inherited Create(True); // Create thread suspended + Priority := PriorityLevel; // Set Priority Level + FreeOnTerminate := False; // Thread frees itself when terminated + Reg := TXRegistry.Create; + Delay := 100; +end; + +procedure TRegSpyThread.Execute; +begin + while not Terminated do begin + Restart := False; + try + if not Terminated then + Sleep(Delay); + if not Terminated then + Spy; + except end; + end; +end; + +function TRegSpyThread.Alive(Node: TTreeNode): Boolean; +begin + Result := False; + + if Restart then + Exit; + + if Terminated then + Exit; + + if Assigned(Node) then + try + if (Node.Text = '') then + Exit; + + if not Assigned(Node) then + Exit; + + Result := True; + except + Exit; + end; +end; + +procedure TRegSpyThread.SaveCheckNode; +begin + Dead := not Alive(CurNode); + if Dead then + Exit; + + CheckNode(CurNode, False); +end; + +procedure TRegSpyThread.SaveGetDif; +var + Real, Cur: TStringList; +begin + Dead := not Alive(CurNode); + if Dead then + Exit; + + dif := nil; + + if not CurNode.Expanded then begin + Dead := True; + Exit; end; + + if not OpenNodeOK(Reg, CurNode) then + Exit; + + Real := TStringList.Create; + + Reg.GetKeyNames(Real); + Reg.CloseKey; + + Cur := GetChildNames(CurNode); + + if (Cur.Count = 0) and (Real.Count = 0) then + Dead := True; + + dif := TSLComp.Create(Cur, Real, False); + + Cur.Free; + Real.Free; +end; + +procedure TRegSpyThread.SaveDeleteDead; +var + TN: TTreeNode; + i: Integer; +begin + Dead := not Alive(CurNode); + if Dead then + Exit; + + if not Assigned(dif) or not Assigned(dif.OnlyA) then + Exit; + + if CurNode.Expanded then + for i := 0 to dif.OnlyA.Count-1 do begin + TN := FindNode(CurNode, dif.OnlyA[i]); + if Assigned(TN) then begin + RegTV.Selected := GetNextBest(TN); + TN.Delete; + AddTrace('Key deleted: ' + dif.OnlyA[i]); + end; + end + else + Exit; +end; + +procedure TRegSpyThread.SaveGetChildren; +var + i: Integer; + TN: TTreeNode; +begin + Dead := not Alive(CurNode); + if Dead then + Exit; + + CurChildren := nil; + SetLength(CurChildren, CurNode.Count); + + i := 0; + TN := CurNode.GetFirstChild; + while Assigned(TN) do begin + if i <= High(CurChildren) then + CurChildren[i] := TN + else + ShowMessage('Error: Too much children'); + Inc(i); + TN := CurNode.GetNextChild(TN) + end; +end; + +procedure TRegSpyThread.SaveAddNew; +var + i: Integer; +begin + Dead := not Alive(CurNode); + if Dead then + Exit; + + if not Assigned(Dif) or not Assigned(Dif.OnlyB) or (Dif.OnlyB.Count = 0) then + Exit; + + for i := 0 to Dif.OnlyB.Count-1 do begin //Erstellt/hinbenannt + RegTV.Items.AddChild(CurNode, Dif.OnlyB[i]); + AddTrace('New Key: ' + dif.OnlyB[i]); + MainWin.StatusBarUpdate; + //AddHint('Neuer Schlüssel: ' + CurNode.Text + '\' + Dif.OnlyB[i]); + end; +end; + +procedure TRegSpyThread.Reload(Node: TTreeNode); +var + i: Integer; + TN: TTreeNode; + zCurNode: TTreeNode; + MyChildren: TChildren; +begin + if Terminated or Restart then + Exit; + + CurNode := Node; + + zCurNode := CurNode; + try + //Mess := 'SaveCheckNode'; + Synchronize(SaveCheckNode); + if Dead or Terminated then + Exit; + + //Mess := 'SaveGetDif'; + Synchronize(SaveGetDif); + if Dead or Terminated then + Exit; + + //Mess := 'SaveDeleteDead'; + Synchronize(SaveDeleteDead); + if Dead or Terminated then + Exit; + + //Mess := 'SaveGetChildren'; + Synchronize(SaveGetChildren); + if Dead or Terminated then + Exit; + + //Mess := 'SaveGetChildren'; + Synchronize(SaveAddNew); + if Dead or Terminated then + Exit; + + Dif.Free; + + //Mess := 'MyChildren'; + SetLength(MyChildren, Length(CurChildren)); + for i := 0 to High(MyChildren) do + MyChildren[i] := CurChildren[i]; + + for i := 0 to High(MyChildren) do begin + TN := MyChildren[i]; + if Alive(TN) then + //if TN.Expanded then + //if NodeVisible(TN) then + Reload(TN); + //else + //Break; + if Restart or Terminated then + Break; + end; + MyChildren := nil; + + except + if Terminated then + Exit; + AddHint('Error in Spy: ' + Mess); + WorkWin.Label7.Caption := 'ERROR'; + end; + CurNode := zCurNode; +end; + +function FindItemByRealName(LV: TListView; Text: string): TListItem; +var + i: Integer; +begin + Result := nil; + for i := 0 to LV.Items.Count-1 do + if LV.Items[i].Caption = Text then begin + Result := LV.Items[i]; + Exit; end; + for i := 0 to LV.Items.Count-1 do + if SameText(RealValueName(LV.Items[i]), Text) then begin + Result := LV.Items[i]; + Break; end; +end; + +procedure TRegSpyThread.ReloadValues; +var + Item: TListItem; + Real, Cur: TStringList; + Dif: TSLComp; + i: integer; +begin + if Terminated or Restart then + Exit; + + if not OpenNodeOK(Reg, RegTV.Selected) then + Exit; + + Real := TStringList.Create; + Reg.GetValueNames(Real); + + Cur := TStringList.Create; + with ValueList.Items do + for i := 0 to Count-1 do + Cur.Add(RealValueName(Item[i])); + + Dif := TSLComp.Create(Cur, Real, False); + Real.Free; + Cur.Free; + + for i := 0 to Dif.OnlyA.Count-1 do begin //Gelöscht/wegbenannt + Item := FindItemByRealName(ValueList, Dif.OnlyA[i]); + if Assigned(Item) then begin + Item.Delete; + AddTrace('Value deleted: ' + Dif.OnlyA[i]); + end; + end; + + for i := 0 to ValueList.Items.Count-1 do begin //Daten + Item := ValueList.Items[i]; + {if Item.SubItems.Count < 2 then begin + ShowMessage('Fehler in Sync.'); + Exit end; } + if ValuesWin.UpdateValue(Reg, Item) then + AddTrace('Value Changed: ' + Item.Caption + ' = ' + + ValueDataPreview(Reg.ReadContext(RealValueName(Item)))); + end; + + for i := 0 to dif.OnlyB.Count-1 do begin //Erstellt/hinbenannt + ValuesWin.AddValue(Reg, dif.OnlyB[i]); + AddTrace('New Value: ' + Dif.OnlyB[i]); + end; + + Reg.CloseKey; + Dif.Free; +end; + +procedure TRegSpyThread.Spy; +var + i: Integer; + a: Real; +begin + with TClock.Create do begin + for i := 0 to RootNodes.Count-1 do + Reload(TTreeNode(RootNodes[i])); + for i := 0 to High(Shortcuts) do + Reload(Shortcuts[i].Node); + Synchronize(ReloadValues); + a := SecondsPassed * 1000; + Free; end; + + if a > 0 then + WorkWin.Label7.Caption := 'Spy: ' + Format('%0.2f', [a]) + ' s'; +end; + +procedure TRegSpyThread.AddTrace(Trace: string); +begin + with WorkWin do + if ListTracesCB.Checked then + SpyLB.Items.Add(Trace); +end; + +destructor TRegSpyThread.Destroy; +begin + Dif.Free; + Reg.Free; + inherited; +end; + +end. +unit TreeU; +{$DEFINE UNIKEY} +{$DEFINE CYCFS} + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + ComCtrls, Menus, Clipbrd, keybrd, Dialogs, YTools, PlutoConst, CompEx, + IniFiles, XReg, Colors, Clock, + ToolWin, RegFiles {$IFDEF UNIKEY}, UniKey, ImgList {$ENDIF}; + +type + TTreeWin = class(TForm) + RegTVPU: TPopupMenu; + NewSubKeyMI: TMenuItem; + NewKeyMI: TMenuItem; + CreateShortcutMI: TMenuItem; + TraceMI: TMenuItem; + N3: TMenuItem; + DeleteMI: TMenuItem; + DublicateMI: TMenuItem; + N4: TMenuItem; + FindMI: TMenuItem; + RegTV: TTreeView; + PastePathMI: TMenuItem; + N1: TMenuItem; + InsertPathMI: TMenuItem; + RenameMI: TMenuItem; + CopyPathMI: TMenuItem; + CutPathMI: TMenuItem; + EditShortcutMI: TMenuItem; + N2: TMenuItem; + Export1: TMenuItem; + SubKeylist1: TMenuItem; + ValueNameslist1: TMenuItem; + KeyInfosMI: TMenuItem; + N5: TMenuItem; + ExportAsReg: TMenuItem; + ExportD: TSaveDialog; + procedure FormCreate(Sender: TObject); + procedure RegTVClick(Sender: TObject); + procedure RegTVChange(Sender: TObject; Node: TTreeNode); + procedure RegTVChanging(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); + procedure RegTVCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean); + procedure RegTVCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure RegTVDblClick(Sender: TObject); + procedure RegTVDeletion(Sender: TObject; Node: TTreeNode); + procedure RegTVDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure RegTVDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); + procedure RegTVEdited(Sender: TObject; Node: TTreeNode; var S: String); + procedure RegTVEditing(Sender: TObject; Node: TTreeNode; var AllowEdit: Boolean); + procedure RegTVEndDrag(Sender, Target: TObject; X, Y: Integer); + procedure RegTVEnter(Sender: TObject); + procedure RegTVExpanded(Sender: TObject; Node: TTreeNode); + procedure RegTVExpanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean); + procedure RegTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); + procedure RegTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure RegTVMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure RegTVStartDrag(Sender: TObject; var DragObject: TDragObject); + + function CreateKey(Subkey: Boolean): Boolean; + procedure CloneKey; + procedure DeleteKey; + procedure NewShortcut; + procedure MoveKey(const Src, Trg: TRegPath; CopyWanted: Boolean); + procedure MoveValues(SrcNode, TrgNode: TTreeNode; CopyWanted: Boolean); + + procedure NewSubKeyMIClick(Sender: TObject); + procedure NewKeyMIClick(Sender: TObject); + procedure CreateShortcutMIClick(Sender: TObject); + procedure TraceMIClick(Sender: TObject); + procedure DeleteMIClick(Sender: TObject); + procedure DublicateMIClick(Sender: TObject); + procedure FindMIClick(Sender: TObject); + procedure RegTVPUPopup(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure RegTVKeyPress(Sender: TObject; var Key: Char); + procedure RegTVAdvancedCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; + var PaintImages, DefaultDraw: Boolean); + procedure RenameMIClick(Sender: TObject); + procedure CopyPathMIClick(Sender: TObject); + procedure InsertPathMIClick(Sender: TObject); + procedure RegTVGetImageIndex(Sender: TObject; Node: TTreeNode); + procedure CheckRegTVHotTrack; + procedure PasteKeyMIClick(Sender: TObject); + procedure CutPathMIClick(Sender: TObject); + + procedure OpenNextLevel(Node: TTreeNode); + procedure EditShortcutMIClick(Sender: TObject); + procedure SubKeylist1Click(Sender: TObject); + procedure ValueNameslist1Click(Sender: TObject); + procedure KeyInfosMIClick(Sender: TObject); + function GetKeyInfos: string; + procedure ExportAsRegClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + + procedure Load; + procedure Reg4WriterTerminate(Sender: TObject); + private + DragNode: TTreeNode; + NoAsterisk: Boolean; //To prevent NumPadMULTIPLY and asterisk errors + UserCopyKeyFlag: Boolean; + SpaceCount: Integer; //EasterEgg + public + CantWrite: Boolean; + DoSmartExpand: Boolean; + end; + +procedure CheckNode(Node: TTreeNode; OnlyOnce: Boolean = True; + TakeNodeSelected: Boolean = False); + +function AddShortcut(Alias, RealPath: string; Icon: Integer; + AHostType: TUniHostType = uhUserShortcut; WriteIni: Boolean = False): TTreeNode; +function ShortcutIndex(Node: TTreeNode): Integer; + +function TraceKey(const Path: string; AllowedShortcutTypes: TUniHostTypes = + uhNonSystemShortcuts): string; + +type + TOpenNodeMode = (onNodeNil, onError, onReadOnly, onFull); + +const + onOK = [onFull, onReadOnly]; + +function OpenNode(Reg: TXRegistry; Node: TTreeNode): TOpenNodeMode; +function OpenNodeOK(Reg: TXRegistry; Node: TTreeNode): Boolean; +function OpenCurKey: Boolean; +function OpenCurParent: Boolean; + +var + TreeWin: TTreeWin; + + RegTV: TTreeView; //Shortcut for other units, equals TreeWin.RegTV + +{$IFDEF UNIKEY} + UserUniPath: string {$IFDEF CYCFS} = 'cYcFS '{$ENDIF}; +{$ENDIF} + Shortcuts: TShortcutA; + RootNodes: TList; //list of TTreeNode; + +implementation + +uses + PlutoMain, ValuesU, FindWinU, WorkU, PrefU, ShellEx, Types; + +{$R *.dfm} + +{$IFDEF UNIKEY} +function UniOfNode(Node: TTreeNode): TUniKey; +var + UniPath: TUniPath; +begin + UniPath := UniOfStr(UserUniPath); + UniPath.Path := Join(Copy(NodePath(Node), 1, MaxInt), '/'); + Result := TUniKey.CreateU(UniPath, reTryToSolve); +end; +{$ENDIF} + +procedure TTreeWin.FormCreate(Sender: TObject); +begin + TreeU.RegTV := RegTV; + + DragNode := nil; + NoAsterisk := False; + DoSmartExpand := True; + UserCopyKeyFlag := True; + SpaceCount := 0; //EasterEgg + + RegTV.Items.Clear; + CheckRegTVHotTrack; + + KeyInfosMI.ImageIndex := iconKeyInfos; + + NewSubKeyMI.ImageIndex := iconSubKey; + NewKeyMI.ImageIndex := iconKey; + CreateShortcutMI.ImageIndex := iconShortcut; + + RenameMI.ImageIndex := iconRename; + DeleteMI.ImageIndex := iconDelete; + DublicateMI.ImageIndex := iconKeyDublicate; + + FindMI.ImageIndex := iconKeyFind; + TraceMI.ImageIndex := iconKeyTrace; +end; + +procedure TTreeWin.RegTVClick(Sender: TObject); +begin + if KeyIsDown(VK_CONTROL) then begin + TraceMIClick(Sender); + Exit; end; +end; + +procedure TTreeWin.RegTVChange(Sender: TObject; Node: TTreeNode); +var + Reg: TXRegistry; + OpenRe: TOpenNodeMode; + +{$IFDEF UNIKEY} + Uni: TUniKey; + ValueNames: TStringList; + Item: TListItem; + i: Integer; + + procedure AppendSubItemData(SubItems: TStrings; Uni: TUniKey; + const ValueName: string); + var + SL: TStringList; + + procedure Add(const s: string); + begin + SubItems.Append(s); + end; + + begin + SL := nil; + try + Add('beta'); + + case Uni.GetDataType(ValueName) of + + udString, udExpandString: begin + Add('String'); + Add(Uni.ReadString(ValueName)); + end; + + udCardinal, udCardBigEndian, udInteger: begin + Add('Numeric'); + Add(IntToStr(Uni.ReadInteger(ValueName))); + end; + + udBinary, udNone: begin + Add('Binary'); + Add(FriendlyStr(Uni.ReadBinary(ValueName))); + end; + + udBoolean: begin + Add('Boolean'); + Add(StrOfBool(Uni.ReadBool(ValueName))); + end; + + udStringList: begin + Add('List'); + if not Assigned(SL) then + SL := TStringList.Create + else + SL.Clear; + Uni.ReadStringList(ValueName, SL); + Add(Join(SL, MultiStringSeparator)); + end; + + udColor: begin + Add('Color'); + Add(ColorToString(Uni.ReadColor(ValueName))); + end; + + else + Add('Unsupported Data Type: ' + + IntToStr(Cardinal(Uni.GetDataType(ValueName)))); + end; //case + + finally + SL.Free; + end; + end; + + +{$ENDIF} + +begin + SpaceCount := 0; //Easteregg + + CheckNode(Node, False); + CantWrite := False; + + try + SpyThread.Suspend; + Reg := TXRegistry.Create; + try + +{$IFDEF UNIKEY} + if RootOfNode(Node).ImageIndex = iconHostUni then begin + ValueNames := TStringList.Create; + ValueList.Clear; + + Uni := UniOfNode(Node); + {Uni := CreateUniSubKey(UserUniPath, Copy(NodePath(Node), 1, MaxInt), + reFaile); } + if Assigned(Uni) then + try + Uni.GetValueNames(ValueNames); + + for i := 0 to ValueNames.Count-1 do begin + Item := ValuesWin.AddValue(Reg, ValueNames[i], False); + Item.ImageIndex := iconHostUni2; + AppendSubItemData(Item.SubItems, Uni, ValueNames[i]); + end; + + finally + Uni.Free; + ValueNames.Free; + end; + + end else begin +{$ENDIF} + + OpenRe := OpenNode(Reg, Node); + if OpenRe in onOK then begin + ValuesWin.LoadValues(Reg); + if OpenRe = onReadOnly then begin + AddHint('Read only', True); + CantWrite := True; + end; + end else if OpenRe = onError then begin + ValueList.Clear; + CantWrite := True; + if Node.Level = 0 then begin + AddHint('Shortcut target not found', True); + end else + AddHint('Key not found: ' + Node.Text, True); + end; + +{$IFDEF UNIKEY} + end; +{$ENDIF} + + finally + Reg.Free; + end; + + CantWrite := CantWrite or not Assigned(Node) + or NodeInfo( Node ).ReadOnly //Node itself + or NodeInfo(RootOfNode(Node)).ReadOnly //or host + or (SameText(CurKey(uhNonSystemShortcuts).Root, 'HKEY_DYN_DATA')); + + MainWin.SetStatus; + WorkWin.InfoMemo.Text := GetKeyInfos; + finally + SpyThread.Restart := True; + SpyThread.Resume; + end; +end; + +procedure TTreeWin.RegTVChanging(Sender: TObject; Node: TTreeNode; + var AllowChange: Boolean); +begin + CantWrite := False; + AllowChange := Assigned(Node); + // CheckNode(Node, True); +end; + +procedure TTreeWin.RegTVCollapsing(Sender: TObject; Node: TTreeNode; + var AllowCollapse: Boolean); +begin + SpyThread.Restart := True; + Node.DeleteChildren; + RegTVChange(Sender, Node); +end; + +procedure TTreeWin.RegTVCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean); +var + Info: TNodeInfo; +begin + {if Node.Text = '' then begin + ShowMessage('Error: Key has empty name.'); + Node.Delete; + Exit; end;} + + Info := NodeInfo(Node); + with TTreeView(Sender).Canvas.Font do begin + if Info.Defect then begin + Style := []; + Color := $AAAAAA + end else begin + case Info.HostType of + + uhReg: begin + Style := [fsBold]; + Color := clCyan; + end; + + {uhIni: begin + Style := [fsBold]; + Color := clBrightYellow; + end; + + uhRegFile: begin + Style := [fsBold]; + Color := clBrightGreen; + end; } + + uhSystemShortcut: begin + Style := []; + Color := clBrightCyan; + end; + + uhStandardShortcut: begin + Style := [fsBold]; + Color := $EEEEEE; + end; + + uhUserShortcut: begin + Style := []; + Color := $EEEEEE; + end; + + else + Style := []; + if Info.ReadOnly then + Color := clBrightRed + else + Color := clWhite; + end; + + end; + end; +end; + +procedure TTreeWin.RegTVDblClick(Sender: TObject); +var + Node: TTreeNode; + MouseX: Integer; + NodeRect: TRect; +begin + Node := RegTV.Selected; + if not Assigned(Node) then + Exit; + + MouseX := RegTV.ScreenToClient(Mouse.CursorPos).X; + NodeRect := Node.DisplayRect(True); + if MouseX > NodeRect.Right then begin + with ValuesWin do begin + FocusItem(PrefWin.MainPreviewE.Text); + ValueListDblClick(Self); + end; + end; +end; + +procedure TTreeWin.RegTVDeletion(Sender: TObject; Node: TTreeNode); +begin + if Assigned(SpyThread) then + SpyThread.Restart := True; + if Node.Selected then + RegTV.Selected := GetNextBest(Node); + NodeInfo(Node).Free; +end; + +procedure TTreeWin.RegTVDragDrop(Sender, Source: TObject; X, Y: Integer); + + procedure DragKey; + var + Src, Trg: TRegPath; + Node: TTreeNode; + begin + Src := RegPathOfStr(TraceKey(PathOfNode(DragNode))); + Trg := RegPathOfStr(TraceKey(PathOfNode(RegTV.DropTarget))); + Trg.Key := Trg.Key + '\' + DragNode.Text; + + MoveKey(Src, Trg, KeyIsDown(VK_CONTROL)); + + Node := RegTV.DropTarget; + if Node.Expanded then + Node.Collapse(False); + Node.Expanded := False; + CheckNode(Node, False, True); + Node.Expand(False); + end; + + procedure DragValues; + begin + MoveValues(RegTV.Selected, RegTV.DropTarget, KeyIsDown(VK_CONTROL)); + end; + +begin + if Source is TTreeView then + DragKey + else if Source is TListView then + DragValues; +end; + +procedure TTreeWin.RegTVDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); +begin + Accept := False; + if not Assigned(RegTV.DropTarget) then + Exit; + + if Source is TTreeView then begin + if not Assigned(DragNode) then + Exit; + if not KeyIsDown(VK_CONTROL) then begin + if (DragNode = RegTV.DropTarget) + or RegTV.DropTarget.HasAsParent(DragNode) then + Exit; //avoid recursive moving + end; + end else if Source is TListView then begin + //accept + end; + Accept := True; +end; + +procedure TTreeWin.RegTVEdited(Sender: TObject; Node: TTreeNode; var S: string); +var + old, tmp: string; + i: Integer; + Shortcut: PKeyShortcut; +begin + if s = Node.Text then + Exit; + + Old := Node.Text; + + if NodeInfo(Node).HostType = uhUserShortcut then begin + i := ShortcutIndex(Node); + if i = -1 then begin + ShowMessage('Shortcut not found!'); + s := old; + Exit; end; + + Shortcut := @Shortcuts[i]; + Shortcut.Alias := s; + + with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do + try + DeleteKey('Shortcuts', Old); + WriteString('Shortcuts', Shortcut.Alias, Shortcut.RealPath); + finally + Free; + end; + Node.Text := s; + RegTVChange(Self, Node); + Exit; end; + + if s = '' then begin + ShowMessage('KeyNames cannot be empty.'); + s := old; + Exit; end; + + SpyThread.Suspend; + SpyThread.Restart := True; + Node.Text := s; + + if Length(s) > RegMaxKeyLen then begin + s := Copy(s, 1, RegMaxKeyLen); + if MessageDlg( + 'The maximum size of a key name is ' + IntToStr(RegMaxKeyLen) + ' characters.' + EOL + + 'Shorten the key name to:' + EOL + + Quote(StringWrap(s, 80)), + mtConfirmation, [mbOK, mbCancel], 0) <> mrOK then begin + s := Old; + SpyThread.Resume; + Exit; + end; + end; + + if CharIn(s, [#0..#31, '\']) then begin + s := ReplaceChars(s, [#0..#31], '#'); + s := ReplaceChars(s, '\', '-'); + + if MessageDlg('The following characters are not allowed in KeyNames:' + EOL + + '- Control chars (0-31)' + EOL + + '- ' + Quote('\') + EOL + + 'The following name is allowed:' + EOL + + s + EOL + + 'Use this name instead?', + mtConfirmation, [mbYes, mbNo], 0) <> mrYes then begin + s := Old; + SpyThread.Resume; + Exit; + end; + end; + + try + OpenCurParent; + if not SameText(s, Old) then begin + if not MainReg.KeyExists(s) or + (mrIgnore = MessageDlg( + 'Key already exists.' + EOL + + 'Click Ignore to overwrite the key.', + mtConfirmation, [mbCancel, mbIgnore], 0) + ) then begin + MainReg.DeleteKey(s); + MainReg.MoveKey(Old, s, True); + Node.Text := Old; + end else begin + s := Old; + end; + end else begin //change CharCase + tmp := MainReg.GetFreeKeyName; + AddHint('Forced change of case using temporary key ' + Quote(tmp)); + MainReg.MoveKey(Old, tmp, True); + MainReg.MoveKey(tmp, s, True); + end; + finally + MainReg.CloseKey; + end; + + Node.Text := s; + SpyThread.Resume; + RegTVChange(Sender, Node); +end; + +procedure TTreeWin.RegTVEditing(Sender: TObject; Node: TTreeNode; + var AllowEdit: Boolean); +begin + CheckNode(Node, False); + if RegTV.Selected <> Node then + Exit; + AllowEdit := (NodeInfo(Node).HostType in [uhNone, uhUserShortcut]) + and (not CantWrite) + and OpenCurKey; + MainReg.CloseKey; +end; + +procedure TTreeWin.RegTVEndDrag(Sender, Target: TObject; X, Y: Integer); +begin + DragNode := nil; +end; + +procedure TTreeWin.RegTVEnter(Sender: TObject); +begin + if not Started then + Exit; + ValueList.ItemFocused := nil; + MainWin.SetStatus; +end; + +procedure TTreeWin.RegTVExpanded(Sender: TObject; Node: TTreeNode); +begin + if not DoSmartExpand or not PrefWin.SmartExpandCB.Checked then + Exit; + + if not Assigned(Node) then + Exit; + + RegTVChange(Sender, Node); + + //SmartExpand + if (Node.Count > 0) and (ValueList.Items.Count = 0) then begin + RegTV.Selected := Node.GetFirstChild; + RegTVChange(Sender, RegTV.Selected); + end; + + if Node.Count = 1 then + Node.GetFirstChild.Expand(False); +end; + +procedure TTreeWin.RegTVExpanding(Sender: TObject; Node: TTreeNode; + var AllowExpansion: Boolean); +var + SL: TStringList; + Reg: TXRegistry; + Clock: TClock; +{$IFDEF UNIKEY} + Uni: TUniKey; +{$ENDIF} + + procedure AddKeys(TreeView: TTreeView; Node: TTreeNode; SL: TStrings); + var + i: Integer; + begin + for i := 0 to SL.Count-1 do + TreeView.Items.AddNode(TTreeNode.Create(TreeView.Items), Node, SL[i], + nil, naAddChild); + end; + + procedure AddKeysProgressive(TreeView: TTreeView; Node: TTreeNode; + SL: TStrings); + var + i, delta: Integer; + GaugeRect, FullRect: TRect; + GaugeWidth: Integer; + begin + delta := SL.Count div 100; + GaugeWidth := 100; + with TreeView.Canvas do begin + FullRect := Node.DisplayRect(True); + with FullRect do begin + Left := Right + 40; + Right := Left + GaugeWidth + 2; + Inc(Top, 5); + Dec(Bottom, 5); + end; + with Pen do begin + Width := 1; + Style := psSolid; + end; + Pen.Color := clBrightBlue; + Brush.Style := bsClear; + Rectangle(FullRect); + Pen.Style := psClear; + end; + + GaugeRect := FullRect; + with GaugeRect do begin + Inc(Left); + Inc(Top); + Dec(Bottom); + end; + + for i := 0 to SL.Count-1 do begin + TreeView.Items.AddNode(TTreeNode.Create(TreeView.Items), Node, SL[i], + nil, naAddChild); + + if ((i + 1) mod delta) = 0 then begin + with TreeView.Canvas do begin + GaugeRect.Right := GaugeRect.Left + (GaugeWidth * i) div SL.Count; + Brush.Color := GadientAqua(90 + Round(100 * ((i+1) / SL.Count))); + FillRect(GaugeRect); + end; + end; + end; + + with TreeView.Canvas do begin + Pen.Color := clVeryBrightBlue; + Pen.Style := psSolid; + Brush.Color := GadientAqua(200); + Rectangle(FullRect); + Brush.Style := bsClear; + end; + end; + +begin + if Node.Expanded then + Exit; + + SpyThread.Suspend; + SL := TStringList.Create; + Clock := TClock.Create; + + try + +{$IFDEF UNIKEY} + if RootOfNode(Node).ImageIndex = iconHostUni then begin + Uni := UniOfNode(Node); + if Assigned(Uni) then + try + Uni.GetKeyNames(SL); + finally + Uni.Free; + end; + + end else begin +{$ENDIF} + + Reg := TXRegistry.Create; + try + if OpenNodeOK(Reg, Node) then + Reg.GetKeyNames(SL); + finally + Reg.Free; + end; + +{$IFDEF UNIKEY} + end; +{$ENDIF} + + Node.DeleteChildren; + if PrefWin.ShowProgressCB.Checked and (SL.Count > 100) then + AddKeysProgressive(RegTV, Node, SL) + else + AddKeys(RegTV, Node, SL); + + if PrefWin.SortKeysCB.Checked then + Node.AlphaSort; + + if MurphyMode then begin + Clock.Stop; + AddHint(Format('[MM] Key opened after %0.2f s.', [Clock.SecondsPassed])); + end; + finally + Clock.Free; + SL.Free; + SpyThread.Resume; + end; +end; + +procedure TTreeWin.RegTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); +begin + Node.SelectedIndex := Node.ImageIndex; +end; + +procedure TTreeWin.RegTVKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + Node: TTreeNode; +begin + if Key = VK_SCROLL then + CheckRegTVHotTrack; + + if RegTV.IsEditing then + Exit; + + Node := RegTV.Selected; + if not Assigned(Node) then + Exit; + + if ssShift in Shift then + case Key of + VK_DOWN: begin + Node := Node.GetNextSibling; + if Assigned(Node) then + RegTV.Selected := Node; + Key := 0; end; + + VK_UP: begin + Node := Node.GetPrevSibling; + if Assigned(Node) then + RegTV.Selected := Node; + Key := 0; end; + + VK_RIGHT: Key := VK_MULTIPLY; + VK_LEFT: Key := VK_DIVIDE; + end; + + if Assigned(Node.Parent) then begin + case Key of + VK_END: + begin + RegTV.Selected := Node.Parent.GetLastChild; + Key := 0; end; + + VK_HOME: + begin + RegTV.Selected := Node.Parent.GetFirstChild; + Key := 0; end; + end; + end; + + case Key of + 0: Exit; + VK_RETURN: ValuesWin.FocusControl(ValueList); + VK_DELETE: DeleteMIClick(Sender); + VK_SPACE: begin + JumpToSel(RegTV); + Inc(SpaceCount); + if SpaceCount > 10 then begin + ShowMessage('YES!'); + SpaceCount := 0; + end; + end; + VK_F9: SwapFonts(RegTV); + + VK_F12: + if ssShift in Shift then begin + if Assigned(Node.Parent) then Node.Parent.AlphaSort; + end else + if Node.Expanded then Node.AlphaSort; + + VK_LEFT, VK_SUBTRACT: + begin + if Node.Expanded then + Node.Collapse(False) + else if Assigned(Node.Parent) then + RegTV.Selected := Node.Parent; + Key := 0; end; + + VK_RIGHT, VK_ADD: + begin + if not Node.HasChildren then + TreeWin.RegTV.Items.AddChild(Node, ''); + if Node.Expanded then + RegTV.Selected := Node.GetFirstChild + else + Node.Expand(False); + Key := 0; end; + + VK_MULTIPLY: + begin + NoAsterisk := True; + OpenNextLevel(Node); + JumpToSel(RegTV); + AddHint('Press the Multiply Key again to open the next level.'); + Key := 0; end; + + VK_DIVIDE: + begin + DoSmartExpand := False; + Node.Collapse(true); + DoSmartExpand := True; + Key := 0; end; + end; + + if ssctrl in Shift then + case Key of + Ord('C'): CopyPathMIClick(Sender); + Ord('X'): CutPathMIClick(Sender); + Ord('V'): PasteKeyMIClick(Sender); + end; +end; + +procedure TTreeWin.RegTVMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + Node: TTreeNode; + RelX, RelY: Integer; + NodeRect: TRect; +begin + CheckRegTVHotTrack; + + if not Active then + Exit; + + RelX := RegTV.ScreenToClient(Mouse.CursorPos).X; + RelY := RegTV.ScreenToClient(Mouse.CursorPos).Y; + Node := RegTV.GetNodeAt(RelX, RelY); + if not Assigned(Node) then + Exit; + + if not Node.Selected then + Node.Selected := True; + + if Button = mbLeft then begin + NodeRect := RegTV.Selected.DisplayRect(True); + if RegTV.HotTrack + or (RelX < NodeRect.Left) and (RelX > NodeRect.Left - 20) then begin + //4px more to the left (friendlier for the user) + if not Node.HasChildren then + RegTV.Items.AddChild(Node, ''); + DoSmartExpand := False; + with Node do + if not Expanded then + Expand(False) + else + Collapse(False); + DoSmartExpand := True; + end; + end; +end; + +procedure TTreeWin.RegTVStartDrag(Sender: TObject; var DragObject: TDragObject); +begin + DragNode := RegTV.Selected; + if NodeInfo(DragNode).IsHost then + DragNode := nil; +end; + +function OpenNodeError(Reg: TXRegistry; Node: TTreeNode; + out Mode: TOpenNodeMode): Integer; +var + Key: string; +begin + Result := ERROR_SUCCESS; + Mode := onNodeNil; + if not Assigned(Node) then + Exit; + + Reg.CloseKey; + Key := TraceKey(PathOfNode(Node)); + Reg.RootKey := HKEYOfStr(ExRegRoot(Key)); + Result := Reg.OpenKeyError(ExRegKey(Key), False, True); + if Success(Result) then + if Reg.RootKey = HKDD then + Mode := onReadOnly + else + Mode := onFull + else if Reg.OpenKeyReadOnly(ExRegKey(Key)) then + Mode := onReadOnly + else + Mode := onError; +end; + +function OpenNode(Reg: TXRegistry; Node: TTreeNode): TOpenNodeMode; +begin + OpenNodeError(Reg, Node, Result); +end; + +function OpenNodeOK(Reg: TXRegistry; Node: TTreeNode): Boolean; +begin + Result := OpenNode(Reg, Node) in onOK; +end; + +function OpenCurKey: Boolean; +begin + Result := OpenNodeOK(MainReg, RegTV.Selected); +end; + +function OpenCurParent: Boolean; +begin + Result := Assigned(RegTV.Selected) + and OpenNodeOK(MainReg, RegTV.Selected.Parent); +end; + +function TTreeWin.CreateKey(Subkey: Boolean): Boolean; +var + Node, NewNode: TTreeNode; + KeyName: string; + i: integer; +begin + Result := False; + + if CantWrite then + Exit; + + Node := RegTV.Selected; + if not Assigned(Node) then + Exit; + + if not Subkey then begin + //key shall be created on same level... + if Node.Level = 0 then begin + Node := RegTV.Selected; + if TraceKey(PathOfNode(Node)) <> PathOfNode(Node) then + //check for shortcut: shortcuts are unequal to their trace + if mrOK = MessageDlg( + 'You are trying to create a Key in the shortcut''s level.' + EOL + + 'Pluto needs to jump to the target of the shortcut to do this.', + mtConfirmation, [mbOK, mbCancel], 0) then begin + MainWin.GotoKey(TraceKey(PathOfNode(Node))); + Node := RegTV.Selected.Parent; + end else Exit + else begin + ShowMessage('Key is a HKEY.' + EOL + + 'It is not possible to create Keys on HKEY level.'); + Exit; end; + end else + Node := Node.Parent; //set reference key to parent + end; + + try + + case OpenNode(MainReg, Node) of + + onFull: begin + KeyName := 'New'; //find best free name + i := 0; + while MainReg.KeyExists(KeyName) do begin + Inc(i); + KeyName := 'New ' + IntToStr(i); + end; + + Result := MainReg.CreateKey(KeyName) and MainReg.KeyExists(KeyName); + // ^-- CREATE KEY + + if not Result then // <-- FAILED + ShowMessage('Could not create key!'); + end; + + onReadOnly: ShowMessage('Key is read-only.'); + + else + ShowMessage('Error: Couldn''t open key.'); + + end; //case + + finally + MainReg.CloseKey; + end; + + if not Result then + Exit; + + if not Node.Expanded then begin //find the node, if Parent not Expanded + CheckNode(Node, False); + DoSmartExpand := False; + Node.Expand(False); + DoSmartExpand := True; + NewNode := FindNode(Node, KeyName); + end else + NewNode := RegTV.Items.AddChild(Node, KeyName); //else create a new node + + Result := Assigned(NewNode); + if not Result then + ShowMessage('Error: Could not find created key.'); + + if Result then begin + RegTV.Selected := NewNode; + RegTV.Selected.EditText; + end; +end; + +procedure TTreeWin.CloneKey; +var + Node: TTreeNode; + Full: TRegPath; + MainKey, SubKey, NewKey, zKey: string; + i: integer; +begin + Node := RegTV.Selected; + + if CantWrite then + Exit; + + if NodeInfo(Node).IsHost then + Exit; + + Full := CurKey(uhNonSystemShortcuts); + MainKey := LWPSolve(Full.Key); + SubKey := FromLastChar(MainKey, '\'); + MainKey := UntilLastChar(MainKey, '\'); + if SubKey = '' then begin //Directly beyound HKEY + SubKey := MainKey; + MainKey := ''; + end; + + try + MainReg.RootKey := HKEYOfStr(Full.Root); + if not MainReg.OpenKey(MainKey, False) then begin + ShowMessage('Error: Couldn''t not open Key: ' + MainKey); + Exit end; + if Copy(SubKey, 1, 3) <> 'New' then + NewKey := 'New ' + SubKey + else + NewKey := SubKey; + + zKey := Trim(FromLastChar(NewKey, ' ')); + + i := StrToIntDef(zKey, 0); + if IsValidInteger(zKey) then + zKey := Trim(UntilLastChar(NewKey, ' ')) + else + zKey := NewKey; + + while MainReg.KeyExists(NewKey) do begin + Inc(i); + NewKey := zKey + ' ' + IntToStr(i); + end; + + MainReg.MoveKey(SubKey, NewKey, False); + finally + MainReg.CloseKey; + end; + + Node := RegTV.Items.Add(Node, NewKey); + RegTV.Selected := Node; + Node.EditText; +end; + +procedure TTreeWin.NewShortcut; +var + Node, ShortCutNode: TTreeNode; + ScName, ScRealPath: string; + i: Integer; +begin + Node := RegTV.Selected; + if not Assigned(Node) then + Exit; + + if Node.Level = 0 then + ScName := 'new ' + Node.Text + else + ScName := '' + Node.Text; + + ScRealPath := TraceKey(PathOfNode(Node)); + if not InputQuery('New shortcut to ', ScRealPath, ScName) then + Exit; + + for i := 0 to High(ShortCuts) do + if SameText(ScName, ShortCuts[i].Alias) then begin + ShowMessage('Name already in use.'); + NewShortcut; + Exit; end; + + ShortCutNode := AddShortcut(ScName, ScRealPath, iconShortcut, uhUserShortcut, + True); + CheckNode(Node, False); + RegTV.Selected := ShortCutNode; +end; + +function AddShortcut(Alias, RealPath: string; Icon: Integer; + AHostType: TUniHostType = uhUserShortcut; + WriteIni: Boolean = False): TTreeNode; +var + Last: Integer; +begin + RealPath := TraceKey(RealPath); //Important: do this BEFORE adding a new, + //empty shortcut to ShortCuts + + SetLength(ShortCuts, Length(ShortCuts) + 1); + Last := High(Shortcuts); + ShortCuts[Last].Alias := Alias; + ShortCuts[Last].RealPath := RealPath; + + Result := RegTV.Items.Add(nil, Alias); + ShortCuts[Last].Node := Result; + + if Alias = 'HKEY_WindowsMachine' then + Icon := iconHKWM + else if Alias = 'HKEY_WindowsUser' then + Icon := iconHKWU; + SetTNImage(Result, Icon); + + NodeInfo(Result).HostType := AHostType; + + if WriteIni then + with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do + try + WriteString('Shortcuts', Alias, RealPath); + finally + Free; + end; +end; + +procedure TTreeWin.DeleteKey; +var + i: Integer; + Node, Node2: TTreeNode; +begin + Node := RegTV.Selected; + + + i := ShortcutIndex(Node); + if (i > -1) then begin + if (mrYes = MessageDlg('This is a Pluto shortcut to a real key.'#13#10 + + 'Do you really want to delete the shortcut?', + mtConfirmation, [mbYes, mbCancel], 0)) then begin + SpyThread.Suspend; + SpyThread.Restart := True; + with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do + try + DeleteKey('Shortcuts', Shortcuts[i].Alias); + finally + Free; + end; + Shortcuts[i] := Shortcuts[High(Shortcuts)]; + SetLength(Shortcuts, Length(Shortcuts)-1); + RegTV.Selected := GetNextBest(Node); + Node.Delete; + RegTVChange(Self, RegTV.Selected); + SpyThread.Resume; + end; + Exit; end; + + if CantWrite then + Exit; + + if NodeInfo(Node).IsHost then + Exit; + + SpyThread.Suspend; + SpyThread.Restart := True; + + Node2 := GetNextBest(Node); + + if MessageDlg('Do you really want to delete this key?', mtConfirmation, + [mbYes, mbCancel], 0) = mrYes then + try + if OpenCurParent then begin + if not MainReg.DeleteKey(Node.Text) then //<-- DELETE KEY + ShowMessage('Key could not be deleted.') + else begin + RegTV.Selected := Node2; + if Assigned(Node.Parent) and (Node2 = Node.Parent) then + Node.Parent.Collapse(False); + Node.Delete; + end; + end; + finally + MainReg.CloseKey; + end; + + RegTVChange(Self, Node2); + + SpyThread.Resume; +end; + +procedure TTreeWin.MoveKey(const Src, Trg: TRegPath; CopyWanted: Boolean); +var + TrgReg: TXRegistry; +begin + with MainReg do begin + RootKey := HKEYOfStr(Src.Root); + OpenKey(''); + + if not KeyExists(Src.Key) then begin + ShowMessage('Source not found.'); + Exit; end; + end; + + TrgReg := TXRegistry.Create; + with TrgReg do begin + RootKey := HKEYOfStr(Trg.Root); + OpenKey(''); + if KeyExists(Trg.Key) then begin + ShowMessage('Target already existing.'); + TrgReg.Free; + Exit; end; + end; + + if not CopyWanted then + if mrYes <> MessageDlg('From source: ' + StrOfRegPath(Src) + EOL + + 'To target: ' + StrOfRegPath(Trg) + EOL + + 'Do you really want to move this key?', + mtConfirmation, [mbYes, mbCancel], 0) + then + Exit; + + try + MainReg.MoveKey(Src.Key, TrgReg, Trg.Key, not CopyWanted); //<-- MOVE KEY + except + end; + + if not TrgReg.OpenKey(Trg.Key, False) then + ShowMessage('Could not move key!') + else + if not CopyWanted then + DragNode.Delete; + + + TrgReg.Free; + + MainReg.CloseKey; +end; + +procedure TTreeWin.MoveValues(SrcNode, TrgNode: TTreeNode; + CopyWanted: Boolean); +var + SrcReg, TrgReg: TXRegistry; + i: Integer; + ValueName: string; + AnswerToAll: Integer; + + function AskForReplacing(const ValueName: string): Integer; + begin + if AnswerToAll = -1 then begin + Result := MessageDlg( + 'Value ' + Quote(ValueName) + 'already exists in target key.' + EOL + + 'Do you want to replace it?', + mtWarning, [mbNo, mbYes, mbNoToAll, mbYesToAll, mbAbort], 0); + if Result in [mrNoToAll, mrYesToAll] then begin + if Result = mrYesToAll then + Result := mrYes + else if Result = mrNoToAll then + Result := mrNo; + AnswerToAll := Result; + end; + end else Result := AnswerToAll; + end; + +begin + AnswerToAll := -1; + + if not CopyWanted then + if mrYes<>MessageDlg( + Format( + 'Do you really want to move %s' + EOL + + 'from: %s' + EOL + + 'to: %s', + [StrNumerus(ValueList.SelCount, 'value', 'values'), + PathOfNode(SrcNode), PathOfNode(TrgNode)] + ), mtConfirmation, [mbYes, mbAbort], 0) then + Exit; + + SrcReg := TXRegistry.Create; + try + if not (OpenNode(SrcReg, SrcNode) in onOK) then + MessageDlg('Couldn''t open source key: ' + PathOfNode(SrcNode), + mtError, [mbOK], 0); + + TrgReg := TXRegistry.Create; + try + if not (OpenNode(TrgReg, TrgNode) in onOK) then + MessageDlg('Couldn''t open target key: ' + PathOfNode(TrgNode), + mtError, [mbOK], 0); + + with ValueList.Items do begin + for i := 0 to Count-1 do begin + if not Item[i].Selected then + Continue; + ValueName := RealValueName(Item[i]); + + if TrgReg.ValueExists(ValueName) then begin + case AskForReplacing(ValueName) of + mrYes: ; + mrNo: Continue; + mrAbort: Break; + end; + end; + + TrgReg.WriteContext(ValueName, SrcReg.ReadContext(ValueName)); + if not CopyWanted then + SrcReg.DeleteValue(ValueName); + end; + end; + + finally + TrgReg.Free; + end; + + finally + SrcReg.Free; + end; + + if not CopyWanted then + ValuesWin.Reload; +end; + +procedure TTreeWin.NewSubKeyMIClick(Sender: TObject); +begin + CreateKey(True); +end; + +procedure TTreeWin.NewKeyMIClick(Sender: TObject); +begin + CreateKey(False); +end; + +procedure TTreeWin.CreateShortcutMIClick(Sender: TObject); +begin + NewShortcut; +end; + +procedure TTreeWin.TraceMIClick(Sender: TObject); +begin + if NodeInfo(RegTV.Selected).IsShortcut then + MainWin.GotoKey(TraceKey(PathOfNode(RegTV.Selected))); +end; + +procedure TTreeWin.DeleteMIClick(Sender: TObject); +begin + if not RegTV.IsEditing then + DeleteKey; +end; + +procedure TTreeWin.DublicateMIClick(Sender: TObject); +begin + CloneKey; +end; + +procedure TTreeWin.FindMIClick(Sender: TObject); +begin + FindWin.SfCurKeyRB.Checked := True; + FindWin.Show; +end; + +procedure TTreeWin.RegTVPUPopup(Sender: TObject); +begin + RegTVChange(Sender, RegTV.Selected); + with NodeInfo(RegTV.Selected) do begin + NewSubKeyMI.Enabled := not CantWrite; + NewKeyMI.Enabled := not CantWrite and (not IsHost or IsShortcut); + DublicateMI.Enabled := not CantWrite and not IsHost; + + with DeleteMI do + if HostType = uhUserShortcut then begin + Caption := '&Delete Shortcut'; + Enabled := True; + end else begin + Caption := '&Delete'; + Enabled := not CantWrite and not IsHost; + end; + + RenameMI.Enabled := not CantWrite and (HostType in [uhNone, uhUserShortcut]); + TraceMI.Visible := IsShortcut; + EditShortcutMI.Visible := HostType = uhUserShortcut; + end; +end; + +procedure CheckNode(Node: TTreeNode; OnlyOnce: Boolean = True; + TakeNodeSelected: Boolean = False); +var + CurIcon, NewIcon: Integer; + Reg: TXRegistry; + OpenMode: TOpenNodeMode; + Info: TNodeInfo; +{$IFDEF UNIKEY} + Uni: TUniKey; +{$ENDIF} + KeyHasChildren: Boolean; + + procedure SetShortcutIcon(Node: TTreeNode); + var + Full: string; + i: Integer; + begin + Full := TraceKey(PathOfNode(Node)); + for i := Low(Shortcuts) to High(Shortcuts) do + if Full = Shortcuts[i].RealPath then begin + CurIcon := Shortcuts[i].Node.ImageIndex; + Exit; end; + if Node.ImageIndex in [iconShortcut, iconShortcut + 1] then + CurIcon := iconKey + (CurIcon - iconShortcut); + end; + +begin + if not Assigned(Node) then + Exit; + + Info := NodeInfo(Node); + if OnlyOnce and Info.Checked then + Exit; + + CurIcon := Node.ImageIndex; + if (CurIcon > iconFirstType) then begin +{$IFDEF UNIKEY} + if RootOfNode(Node).ImageIndex <> iconHostUni then begin + SetShortcutIcon(Node); + CurIcon := (CurIcon div 2) * 2; + end; +{$ELSE} + Exit; +{$ENDIF} + end else begin + SetShortcutIcon(Node); + CurIcon := (CurIcon div 2) * 2; + end; + NewIcon := CurIcon; + + Info.ExcludeFlag(nfDefect); + Info.ExcludeFlag(nfReadOnly); + +{$IFDEF UNIKEY} + KeyHasChildren := False; + + if RootOfNode(Node).ImageIndex = iconHostUni then begin + Uni := UniOfNode(Node); + if Assigned(Uni) then + try + KeyHasChildren := Uni.HasKeys; + if usReadOnly >= Uni.Skills then + OpenMode := onReadOnly + else + OpenMode := onFull; + finally + Uni.Free; + end + else + OpenMode := onError; + end else begin +{$ENDIF} + Reg := TXRegistry.Create; + try + OpenMode := OpenNode(Reg, Node); + KeyHasChildren := Reg.HasSubKeys; + finally + Reg.Free; + end; +{$IFDEF UNIKEY} + end; +{$ENDIF} + + if OpenMode = onReadOnly then + Info.IncludeFlag(nfReadOnly); + + if OpenMode in onOK then begin + //OK, could open + if not Node.Expanded then begin //Collapsed + if KeyHasChildren then begin //HasSubKeys + if not Node.HasChildren then begin + //Update: Ensure HasChildren + if TakeNodeSelected or Node.Selected then + TreeWin.RegTV.Items.AddChild(Node, ''); + end; + //Ensure Plus-Icon + NewIcon := CurIcon + 1; + end else begin + //Has still Children? + if Node.HasChildren then + Node.DeleteChildren; + end; + + end else begin //Expanded + //HasSubKeys? + if KeyHasChildren then begin + //OK + NewIcon := CurIcon + 1; + end else begin + //not OK --> update + Node.Collapse(True); + Node.DeleteChildren; + end; + end; + + //not OK, couldn't open + end else begin //defect + if Node.HasChildren then + Node.DeleteChildren; + Info.IncludeFlag(nfDefect); + end; + + if Node.ImageIndex <> iconHostUni then //don't change icon of UniHosts + Node.ImageIndex := NewIcon; + + Info.IncludeFlag(nfChecked); +end; + +procedure TTreeWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + MainWin.FormKeyDown(Sender, Key, Shift); +end; + +function ShortcutIndex(Node: TTreeNode): Integer; +//If Node is a Shortcut, +//S. returns its index in the Shortcuts array +//else -1 +begin + if Node.Level > 0 then begin + Result := -1; + Exit; end; + + for Result := 0 to High(Shortcuts) do + if Shortcuts[Result].Node = Node then begin + Exit; + end; + + Result := -1; +end; + +function TraceKey(const Path: string; AllowedShortcutTypes: TUniHostTypes = + uhNonSystemShortcuts): string; +var + i: Integer; + isAim: Boolean; + + function NodeOkForTracing(Node: TTreeNode): Boolean; + begin + Result := Assigned(Node) and + (NodeInfo(Node).HostType in AllowedShortcutTypes); + end; + +begin + Result := MakeLongHKEY(Path); + repeat + isAim := True; + for i := 0 to High(ShortCuts) do begin + with Shortcuts[i] do + if NodeOkForTracing(Node) and + SameText(UntilChar(Result, '\'), Alias) then begin + if Alias = RealPath then + Break; + Delete(Result, 1, Length(Alias)); + Result := RealPath + Result; + isAim := False; + Break; end; + end; + until isAim; +end; + +procedure TTreeWin.RegTVKeyPress(Sender: TObject; var Key: Char); +begin + if (Key = '*') and NoAsterisk then begin + Key := #0; + NoAsterisk := False; + end; +end; + +procedure TTreeWin.RegTVAdvancedCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; + var PaintImages, DefaultDraw: Boolean); +var + Rect: TRect; + MainValueName: string; + Reg: TXRegistry; + Info: TRegKeyInfo; + PreviewPosX: Integer; + + procedure DefaultIconPreview(Reg: TXRegistry); + var + Icon: HICON; + IconFile: string; + begin + if (Node.Level = 0) and not RegTV.ShowLines then + Exit; + + IconFile := Reg.ReadDefaultIcon; + if IconFile = '' then + Exit; + + Icon := GetIconFromFile(ExpandString(IconFile)); + if Icon = 0 then + Exit; + + with Rect do begin + Dec(Left, TTreeView(Sender).Indent + 16); + DrawIconEx(Sender.Canvas.Handle, Left, Top, + Icon, 16, 16, + 0, 0, DI_NORMAL); + DestroyIcon(Icon); + end; + end; + + procedure AddPreview(const PreviewText: string; Color: TColor); + begin + with Sender.Canvas do begin + SetTextColor(Handle, Color); + ExtTextOut(Handle, PreviewPosX, Rect.Top + 1, TextFlags, nil, + PChar(PreviewText), Length(PreviewText), nil); + Inc(PreviewPosX, TextWidth(PreviewText)); + end; + end; + +begin + if Stage <> cdPostPaint then + Exit; + + MainValueName := PrefWin.MainPreviewE.Text; + + Rect := Node.DisplayRect(True); + PreviewPosX := Rect.Right + 5; + + Reg := TXRegistry.Create(KEY_READ); + try + if OpenNodeOK(Reg, Node) then begin +// Sender.Canvas.Font.Style := []; + if PrefWin.KeyInfoPreviewCB.Checked and Reg.GetKeyInfo(Info) then + with Info do begin + if NumSubKeys > 0 then + AddPreview(IntToStr(NumSubKeys) + 'k ', clCyan); + if NumValues > 0 then + AddPreview(IntToStr(NumValues) + 'v ', clBrightPurple); + end; + + if PrefWin.MainPreviewCB.Checked then + if Reg.ValueReallyExists(MainValueName) then + AddPreview(DataPreviewOfContext(Reg.ReadContext(MainValueName)), $00AAFFFF); + {clBrightYellow} + if PrefWin.DefaultIconPreviewCB.Checked then + DefaultIconPreview(Reg); + end; + finally + Reg.Free; + end; + + {if nfCopy in NodeInfo(Node).Flags then begin + //Node.StateIndex := 2; + Brush.Style := bsClear; + with Font do begin + Style := [fsItalic, fsBold]; + Color := clRed; + end; + //TextOut(Rect.Left - 10, Rect.Top + 3, 'c'); + end;} +end; + +procedure TTreeWin.RenameMIClick(Sender: TObject); +begin + RegTV.Selected.EditText; +end; + +procedure TTreeWin.CopyPathMIClick(Sender: TObject); +begin + UserCopyKeyFlag := True; + MainWin.CopyPathClick(Sender); +end; + +procedure TTreeWin.InsertPathMIClick(Sender: TObject); +begin + MainWin.InsertPathClick(Sender); +end; + +procedure TTreeWin.RegTVGetImageIndex(Sender: TObject; Node: TTreeNode); +begin + if not NodeInfo(Node).Checked then + CheckNode(Node); +end; + +procedure TTreeWin.CheckRegTVHotTrack; +const + FindCursorOfSwitch: array[Boolean] of TCursor = (crArrow, crHandPoint); +var + NewHotTrack: Boolean; +begin + NewHotTrack := ScrollON xor PrefWin.KeysSingleClickCB.Checked; + if NewHotTrack = RegTV.HotTrack then Exit; + + with RegTV do begin + HotTrack := NewHotTrack; + Cursor := FindCursorOfSwitch[HotTrack]; + Mouse.CursorPos := Mouse.CursorPos; //update cursor + end; +end; + +procedure TTreeWin.PasteKeyMIClick(Sender: TObject); +var + Src, Trg: TRegPath; + Node: TTreeNode; +begin + Src := RegPathOfStr(Clipboard.AsText); + Trg := CurKey(uhNonSystemShortcuts); + Trg.Key := Trg.Key + '\' + FromLastChar(Src.Key, '\', True); + + MoveKey(Src, Trg, UserCopyKeyFlag); + + Node := RegTV.Selected; + if Node.Expanded then + Node.Collapse(False); + Node.Expanded := False; + CheckNode(Node, False); + Node.Expand(False); + + if not UserCopyKeyFlag then + RegTV.Repaint; // CheckNode(Node, False); + + UserCopyKeyFlag := True; +end; + +procedure TTreeWin.CutPathMIClick(Sender: TObject); +begin + UserCopyKeyFlag := False; + MainWin.CopyPathClick(Sender); +end; + +procedure TTreeWin.OpenNextLevel(Node: TTreeNode); + + procedure ExpandKeys(Node: TTreeNode); + begin + CheckNode(Node, False, True); + if not Node.HasChildren then + Exit; + if not Node.Expanded then + Node.Expand(False) + else begin + Node := Node.GetFirstChild; + while Assigned(Node) do begin + ExpandKeys(Node); + Node := Node.GetNextSibling; end; + end; + end; + +begin + DoSmartExpand := False; + ExpandKeys(Node); + DoSmartExpand := True; +end; + +procedure TTreeWin.EditShortcutMIClick(Sender: TObject); +var + NewPath: string; + i: Integer; + Node: TTreeNode; + Shortcut: PKeyShortcut; +begin + Node := RegTV.Selected; + if NodeInfo(Node).HostType <> uhUserShortcut then + Exit; + + i := ShortcutIndex(Node); + if i = -1 then + Exit; + + with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do + try + NewPath := ReadString('Shortcuts', Shortcuts[i].Alias, ''); + finally + Free; + end; + + if not InputQuery('Edit Shortcut', 'Shortcut to...', NewPath) then + Exit; + + Node.Collapse(False); + Shortcut := @Shortcuts[i]; + Shortcut.RealPath := TraceKey(NewPath); + with TIniFile.Create(PlutoDir + 'Shortcuts.ini') do + try + WriteString('Shortcuts', Shortcut.Alias, Shortcut.RealPath); + finally + Free; + end; + + RegTVChange(Self, Node); +end; + +procedure TTreeWin.SubKeylist1Click(Sender: TObject); +var + SL: TStringList; +begin + SL := TStringList.Create; + if OpenCurKey then + try + MainReg.GetKeyNames(SL); + if PrefWin.SortKeysCB.Checked then + SL.Sort; + Clipboard.AsText := SL.Text; + finally + MainReg.CloseKey; + SL.Free; + end; +end; + +procedure TTreeWin.ValueNameslist1Click(Sender: TObject); +var + SL: TStringList; +begin + SL := TStringList.Create; + if OpenCurKey then + try + MainReg.GetValueNames(SL); + if PrefWin.SortKeysCB.Checked then + SL.Sort; + Clipboard.AsText := SL.Text; + finally + MainReg.CloseKey; + SL.Free; + end; +end; + +procedure TTreeWin.KeyInfosMIClick(Sender: TObject); +begin + MessageDlg(GetKeyInfos, mtInformation, [mbOK], 0); +end; + +function TTreeWin.GetKeyInfos: string; +const + sErrorMsg = 'Error! No: %d Msg: %s'; + +var + Node: TTreeNode; + Reg: TXRegistry; + Mode: TOpenNodeMode; + Error: Integer; + Info: TNodeInfo; + Flag: TNodeFlag; + + procedure Add(const S: string); + begin + Result := Result + S; + end; + + procedure AddLn(const S: string = ''); + begin + Add(S + EOL); + end; + + procedure AddNodeInfo(Key: HKEY); + var + KeyInfo: TRegKeyInfo; + Res: Integer; + KeyAge: TDateTime; + begin + FillChar(KeyInfo, SizeOf(TRegKeyInfo), 0); + with KeyInfo do begin + Res := RegQueryInfoKey(Reg.CurrentKey, nil, nil, nil, @NumSubKeys, + @MaxSubKeyLen, nil, @NumValues, @MaxValueLen, + @MaxDataLen, nil, @LastWriteTime); + + if Res = ERROR_SUCCESS then begin + Add(Format( + 'Subkeys: %0:d' + EOL + + 'Values: %2:d' + EOL + + 'Max subkeys length: %1:d' + EOL + + 'Max value name length: %3:d' + EOL + + 'Max data length: %4:d' + EOL + + '', + [NumSubKeys, MaxSubKeyLen, NumValues, MaxValueLen, MaxDataLen])); + KeyAge := DateTimeOfFileTime(LastWriteTime); + if KeyAge > 0 then + AddLn('Last write time: ' + DateTimeToStr(KeyAge)); + end else + AddLn('Couldn''t get key info.' + EOL + + 'Error Code: ' + IntToStr(Res) + EOL + + 'Message: ' + SysErrorMessage(Res)); + end; + end; + +begin + Result := ''; + Node := RegTV.Selected; + + Reg := TXRegistry.Create(KEY_READ); + try + try + Error := OpenNodeError(Reg, RegTV.Selected, Mode); + + case Mode of + onFull: AddLn('Full Access'); + onReadOnly: AddLn('Read only'); + onError: + AddLn(Format(sErrorMsg, [Error, SysErrorMessage(Error)])); + onNodeNil: AddLn('Node is nil!'); + + else + AddLn('Unknown Mode: ' + IntToStr(Integer(Mode))); + end; + + if Mode in onOK then + AddNodeInfo(Reg.CurrentKey); + + except + on E: Exception do begin + Error := GetLastError; + if Error <> ERROR_SUCCESS then + AddLn(Format('Error! No: %d Msg: %s', [Error, SysErrorMessage(Error)])) + else + AddLn(E.Message); + end; + end; + finally + Reg.Free; + end; + + if MurphyMode then begin + AddLn('[MM] ImageIndex: ' + IntToStr(Node.ImageIndex)); + Info := NodeInfo(Node); + + if Info.HostType in [uhNone..High(HostTypeStrings)] then + AddLn('[MM] HostType: ' + HostTypeStrings[Info.HostType]) + else + AddLn('[MM] Unknown HostType: ' + IntToStr(Integer(Info.HostType))); + Add('[MM] Flags: '); + for Flag := Low(TNodeFlag) to High(TNodeFlag) do + if Flag in Info.Flags then + Add(NodeFlagStrings[Flag] + ' '); + AddLn; + end; +end; + +procedure TTreeWin.ExportAsRegClick(Sender: TObject); +var + Node: TTreeNode; + Reg: TXRegistry; + + procedure ExportAsReg4(Reg: TXRegistry; const FileName: string); + var + Reg4Writer: TReg4Writer; + begin + Reg4Writer := TReg4Writer.Create(tpNormal, FileName, + TraceKey(PathOfNode(Node)), Reg.DeliverKey); + with Reg4Writer do begin + OnTerminate := Reg4WriterTerminate; + try + AddHint(Format('starting .reg-export: %s...', + [Root + '\' + Path])); + Resume; + except + Free; + end; + end; + AddToLastHint('started.'); + end; + + + procedure ExportAsHive(Reg: TXRegistry; const FileName: string); + begin + if Reg.SaveKey('', FileName) then + AddHint('hive export successfull.') + else + AddHint(Format('hive export failed: %s', + [SysErrorMessage(LastSuccessRes)])); + end; + +begin + Node := RegTV.Selected; + with ExportD do begin + FileName := MakeValidFileName(Node.Text, 'key'); + + if Execute then begin + Reg := TXRegistry.Create; + try + if OpenNodeOK(Reg, Node) then begin + if FileExists(FileName) and (mrYes=MessageDlg( + 'File already exists.' + EOL + + 'Delete existing file?', + mtWarning, [mbYes, mbNo], 0)) then begin + FileSetAttr(FileName, 0); + DeleteFile(FileName); + end; + case FilterIndex of + 1: ExportAsReg4(Reg, FileName); + 2: ExportAsHive(Reg, FileName); + else + ShowMessage(Format('Wrong Filter: %d', [FilterIndex])); + end; + end; + finally + Reg.Free; + end; + end; + end; +end; + +procedure TTreeWin.FormClose(Sender: TObject; var Action: TCloseAction); +begin +// Action := caNone; +end; + +procedure TTreeWin.Load; +var + NodeHKLM, NodeHKU, NodeHKDD, NodeHKPD: TTreeNode; + NodeHostReg: TTreeNode; + + procedure LoadShortcuts(FileName: string; HostType: TUniHostType); + var + i: Integer; + SL: TStringList; + ShortcutIni: TIniFile; + begin + if not FileEx(FileName) then begin + AddToLastHint('not found:'); + AddHint(FileName); + Exit end; + + ShortcutIni := TIniFile.Create(FileName); + SL := TStringList.Create; + + try + ShortcutIni.ReadSectionValues('Shortcuts', SL); + for i := 0 to SL.Count-1 do + AddShortcut(SL.Names[i], SL.Values[SL.Names[i]], iconShortcut, + HostType); + AddToLastHint('OK'); + finally + SL.Free; + ShortcutIni.Free; + end; + end; + +begin + NodeHostReg := nil; + + AddHint('Creating Hosts...'); + RootNodes := TList.Create; + ChangeLastHint('Creating Hosts...HKEY_LOCAL_MACHINE'); + NodeHKLM := RegTV.Items.AddChild(NodeHostReg, 'HKEY_LOCAL_MACHINE'); + SetTNImage(NodeHKLM, iconHKLM); + NodeInfo(NodeHKLM).HostType := uhReg; + RootNodes.Add(NodeHKLM); + + ChangeLastHint('Creating Hosts...HKEY_USERS'); + NodeHKU := RegTV.Items.AddChild(NodeHostReg, 'HKEY_USERS'); + SetTNImage(NodeHKU, iconHKU); + NodeInfo(NodeHKU).HostType := uhReg; + RootNodes.Add(NodeHKU); + + ChangeLastHint('Creating Hosts...HKEY_CURRENT_USER'); + if RegRealPath('HKEY_CURRENT_USER') = 'HKEY_CURRENT_USER' then + //could not dereference hkcu + AddShortcut('HKEY_CURRENT_USER', 'HKEY_CURRENT_USER', + iconHKCU, uhReg) + else + AddShortcut('HKEY_CURRENT_USER', RegRealPath('HKEY_CURRENT_USER'), + iconHKCU, uhSystemShortcut); + + ChangeLastHint('Creating Hosts...HKEY_CURRENT_CONFIG'); + AddShortcut('HKEY_CURRENT_CONFIG', RegRealPath('HKEY_CURRENT_CONFIG'), + iconHKCC, uhSystemShortcut); + + ChangeLastHint('Creating Hosts...HKEY_CLASSES_ROOT'); + AddShortcut('HKEY_CLASSES_ROOT', RegRealPath('HKEY_CLASSES_ROOT'), + iconHKCR, uhSystemShortcut); + + MainReg.RootKey := HKEY_DYN_DATA; + if MainReg.OpenKeyReadOnly('') then begin + MainReg.CloseKey; + ChangeLastHint('Creating Hosts...HKEY_DYN_DATA'); + NodeHKDD := RegTV.Items.AddChild(nil, 'HKEY_DYN_DATA'); + NodeInfo(NodeHKDD).HostType := uhReg; + NodeInfo(NodeHKDD).IncludeFlag(nfReadOnly); + SetTNImage(NodeHKDD, iconHKDD); + RootNodes.Add(NodeHKDD); + end; + + MainReg.RootKey := HKEY_PERFORMANCE_DATA; + if MainReg.OpenKeyReadOnly('') then begin + MainReg.CloseKey; + ChangeLastHint('Creating Hosts...HKEY_PERFORMANCE_DATA'); + NodeHKPD := RegTV.Items.AddChild(nil, 'HKEY_PERFORMANCE_DATA'); + NodeInfo(NodeHKPD).HostType := uhReg; + SetTNImage(NodeHKPD, iconHKPD); + RootNodes.Add(NodeHKPD); + end; + + ChangeLastHint('Creating Host...OK'); + + AddHint('Loading Standard Shortcuts...'); + LoadShortcuts(PlutoDir + StandardShortcutsFileName, uhStandardShortcut); + + AddHint('Loading User Shortcuts...'); + LoadShortcuts(PlutoDir + ShortcutsFileName, uhUserShortcut); + +{$IFDEF UNIKEY} + AddShortcut('Uni', '', iconHostUni); +{$ENDIF} +end; + +procedure TTreeWin.Reg4WriterTerminate(Sender: TObject); +begin + with Sender as TRegFileWriter do + AddHint(Format('.reg-export finished (%0.2f s): %s', + [Clk.SecsPassed, Root + '\' + Path])); +end; + +end. +unit valuesU; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + ComCtrls, Menus, Clipbrd, XReg, CompEx, Math, YTools, Dialogs, YTypes, + PlutoConst, keybrd, ImgList, clock; + +type + TValuesWin = class(TForm) + ValueListPU: TPopupMenu; + NewStringMI: TMenuItem; + NewDWORDMI: TMenuItem; + NewBinaryMI: TMenuItem; + ConvertToMI: TMenuItem; + ConvStringMI: TMenuItem; + ConvDWORDMI: TMenuItem; + ConvBinaryMI: TMenuItem; + ValueList: TListView; + DeleteMI: TMenuItem; + N1: TMenuItem; + RenameMI: TMenuItem; + NewElseMI: TMenuItem; + NewMultiStringMI: TMenuItem; + REGNONE1: TMenuItem; + LINK1: TMenuItem; + NewExpandStringMI: TMenuItem; + N3BINARY1: TMenuItem; + N4DWORD1: TMenuItem; + N4DWORDLITTLEEDIAN1: TMenuItem; + NewBigEndianMI: TMenuItem; + N6LINK1: TMenuItem; + N7MULTISZ1: TMenuItem; + RESOURCELIST1: TMenuItem; + N9FULLRESOURCEDESCRIPTOR1: TMenuItem; + ARESOURCEREQUIREMENTSLIST1: TMenuItem; + NewDefaultValueMI: TMenuItem; + EditMI: TMenuItem; + EditBinaryMI: TMenuItem; + N3: TMenuItem; + CopyDataPreviewMI: TMenuItem; + DublicateMI: TMenuItem; + MultiString1: TMenuItem; + ZeromizeMI: TMenuItem; + N4: TMenuItem; + CopyPathMI: TMenuItem; + TakeAsMainValueMI: TMenuItem; + SelectAllMI: TMenuItem; + InvertSelectionMI: TMenuItem; + procedure FormCreate(Sender: TObject); + procedure InitListColumnTags; + + procedure NewStringMIClick(Sender: TObject); + procedure NewDWORDMIClick(Sender: TObject); + procedure NewBinaryMIClick(Sender: TObject); + procedure ConvertValue(Sender: TObject); + + procedure CreateValue(Typ: TRegDataType); + procedure ZeromizeValue; + procedure DeleteValue; + procedure CloneValue; + function TryRenameValue(OldName: string; var NewName: string): Boolean; + + procedure ValueListChange(Sender: TObject; Item: TListItem; Change: TItemChange); + procedure ValueListCustomDrawItem(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure ValueListDblClick(Sender: TObject); + procedure ValueListEditing(Sender: TObject; Item: TListItem; var AllowEdit: Boolean); + procedure ValueListEdited(Sender: TObject; Item: TListItem; var S: String); + procedure ValueListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ValueListResize(Sender: TObject); + + function UpdateValue(Reg: TXRegistry; Item: TListItem): Boolean; + procedure UpdateValues(SelectedOnly: Boolean = False); + procedure Reload(JumpToNewValue: Boolean = False; ValueName: string = ''); + procedure LoadValues(Reg: TXRegistry); + + function AddValue(Reg: TXRegistry; const ValueName: string; AppendInfos: Boolean = True): TListItem; + procedure ValueListPUPopup(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ValueListDeletion(Sender: TObject; Item: TListItem); + procedure DeleteMIClick(Sender: TObject); + procedure RenameMIClick(Sender: TObject); + procedure NewBigEndianMIClick(Sender: TObject); + procedure NewExpandStringMIClick(Sender: TObject); + procedure NewMultiStringMIClick(Sender: TObject); + procedure NewStrangeTypeMIClick(Sender: TObject); + procedure NewDefaultValueMIClick(Sender: TObject); + procedure ValueListChanging(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean); + procedure ValueListMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure EditBinaryMIClick(Sender: TObject); + procedure EditMIClick(Sender: TObject); + procedure ValueListCustomDrawSubItem(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure ValueListCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); + procedure ValueListColumnClick(Sender: TObject; Column: TListColumn); + procedure DublicateMIClick(Sender: TObject); + procedure CopyDataPreviewMIClick(Sender: TObject); + procedure CopyDataPreview; + procedure ZeromizeMIClick(Sender: TObject); + procedure CopyPathMIClick(Sender: TObject); + + function FindItemByRealName(const ValueName: string): Integer; + + function FocusItem(ARealValueName: string; + FocusValueList: Boolean = False): Boolean; + procedure TakeAsMainValueMIClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure ValueListClick(Sender: TObject); + procedure CheckValueListHotTrack; + procedure SelectAllMIClick(Sender: TObject); + procedure InvertSelectionMIClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + ValueLabelClicked: Boolean; + SortBy: TValueListColumn; + SortByColumn: TListColumn; + SubItemIndex: array[TValueListColumn] of Integer; + public + ValueNames: TStringList; + ValuesCommon: Boolean; + ValueCommonType: TRegDataType; + end; + +var + ValuesWin: TValuesWin; + ValueList: TListView; + + DefaultValueCaption: string = ''; + +function ItemIsDefaultValue(Item: TListItem): Boolean; +function RealValueName(Item: TListItem): string; +procedure SetRealValueName(Item: TListItem; Caption: string); +function IconOfDataType(Typ: TRegDataType): Integer; +function IsMainValue(Item: TListItem): Boolean; + +function ColorOfDataType(DataType: TRegDataType; + DefaultColor: TColor = clWhite): TColor; +function DataPreviewOfContext(Context: TRegContext): string; + +function ValueDataSize(Context: TRegContext): string; +function ValueDataType(Context: TRegContext): string; +function ValueDataPreview(Context: TRegContext): string; +function ValueTypeIcon(Context: TRegContext): Integer; + +function StrOfRegDataType(Typ: TRegDataType): string; + +implementation + +uses PlutoMain, TreeU, WorkU, PrefU; + +{$R *.dfm} + +function ItemIsDefaultValue(Item: TListItem): Boolean; +begin + Result := Item.Data = Pointer(DefaultValueFlag); +end; + +function RealValueName(Item: TListItem): string; +begin + if ItemIsDefaultValue(Item) then + Result := '' + else + Result := Item.Caption; +end; + +procedure SetRealValueName(Item: TListItem; Caption: string); +begin + if Caption = '' then begin + Item.Caption := DefaultValueCaption; + Item.Data := Pointer(DefaultValueFlag); + end else begin + Item.Caption := Caption; + Item.Data := nil; + end; +end; + +function IsMainValue(Item: TListItem): Boolean; +begin + Result := False; + if csDestroying in PrefWin.ComponentState then + Exit; + + Result := RealValueName(Item) = PrefWin.MainPreviewE.Text; +end; + +function ColorOfDataType(DataType: TRegDataType; + DefaultColor: TColor = clWhite): TColor; +begin + if DataType in rdStringTypes then Result := clBrightRed + else if DataType = rdMultiString then Result := clBrightPurple + else if DataType in rdCardTypes then Result := clBrightBlue + else if DataType = rdBinary then Result := clBrightGreen + else Result := DefaultColor; +end; + +function StrOfRegDataType(Typ: TRegDataType): string; +const + RegDataTypeStrings: array[rdNone..rdLastType] of string = ( + 'NONE', + 'SZ', + 'EXPAND_SZ', + 'BINARY', + 'DWORD', + 'DWORD_BIG_ENDIAN', + 'LINK', + 'MULTI_SZ', + 'RESOURCE_LIST', + 'FULL_RESOURCE_DESCRIPTOR', + 'RESOURCE_REQUIREMENTS_LIST', + 'QUAD_WORD' + ); +begin + if Typ in [rdNone..rdLastType] then + Result := RegDataTypeStrings[Typ] + else + Result := IntToStr(Typ); +end; + +procedure TValuesWin.NewStringMIClick(Sender: TObject); +begin + CreateValue(rdString); +end; + +procedure TValuesWin.NewDWORDMIClick(Sender: TObject); +begin + CreateValue(rdCardinal); +end; + +procedure TValuesWin.NewBinaryMIClick(Sender: TObject); +begin + CreateValue(rdBinary); +end; + +procedure TValuesWin.CreateValue(Typ: TRegDataType); +var + Item: TListItem; + ValueName: string; + i: Integer; + SL: TStringList; +begin + if csDestroying in (TreeWin.ComponentState + MainWin.ComponentState) then + Exit; + + if TreeWin.CantWrite then + Exit; + + with MainReg do begin + try + OpenCurKey; + + ValueName := 'New'; // find free name + i := 0; + while ValueExists(ValueName) do begin + Inc(i); + ValueName := 'New ' + IntToStr(i); + end; + + case Typ of + rdString: begin + WriteString(ValueName, ''); + end; + rdExpandString: begin + WriteExpandString(ValueName, ''); + end; + rdCardinal: begin + WriteCardinal(ValueName, 0); + end; + rdCardBigEndian: begin + WriteCardinal(ValueName, 0, True); + end; + rdMultiString: begin + SL := TStringList.Create; + WriteMultiString(ValueName, SL); + SL.Free; + end; + rdBinary: begin + WriteBin(ValueName, nil); + end; + else + WriteBinType(ValueName, nil, Typ); + end; + + if not ValueExists(ValueName) then begin + ShowMessage('Could not create Value.'); + CloseKey; + Exit; end; + + ValuesWin.AddValue(MainReg, ValueName); + finally + CloseKey; + end; + end; + + Item := FindItem(ValueList, ValueName); + + if not Assigned(Item) then begin + ShowMessage('Error, Value not found: ' + ValueName); + Exit; end; + + SelectItemOnly(ValueList, Item); + MainWin.StatusBarUpdate; + ValueLabelClicked := True; + Item.EditCaption; +end; + +procedure TValuesWin.FormCreate(Sender: TObject); +begin + ValuesU.ValueList := ValueList; + + DefaultValueCaption := PrefWin.DefaultValueNameE.Text; + ValueLabelClicked := False; + SortBy := vlcName; + SortByColumn := nil; + + ValueListResize(Sender); + ValueList.Items.Clear; + CheckValueListHotTrack; + + ValueNames := TStringList.Create; + ValuesCommon := False; + ValueCommonType := 0; + + NewDefaultValueMI.ImageIndex := iconMainValue; + NewStringMI.ImageIndex := iconString; + NewDWORDMI.ImageIndex := iconCardinal; + NewBinaryMI.ImageIndex := iconBinary; + NewMultiStringMI.ImageIndex := iconMultiString; + NewElseMI.ImageIndex := iconValueElse; + + DublicateMI.ImageIndex := iconValueDublicate; + DeleteMI.ImageIndex := iconDelete; + ZeromizeMI.ImageIndex := iconValueZeromize; + + EditMI.ImageIndex := iconValueEdit; + EditBinaryMI.ImageIndex := iconValueEditBinary; + RenameMI.ImageIndex := iconRename; + + TakeAsMainValueMI.ImageIndex := iconTakeAsMainValue; +end; + +procedure TValuesWin.ConvertValue(Sender: TObject); +{var + Allow: Boolean; + OldActive: Integer; } +begin +{ TargetPage := ShowPC.Pages[TMenuItem(Sender).Tag]; + + OldActive := ShowPC.ActivePageIndex; + ShowPC.ActivePageIndex := TMenuItem(Sender).Tag; + WorkWin.ShowPCChanging(Sender, Allow); + if not Allow then + ShowPC.ActivePageIndex := OldActive; } +end; + +function ValueDataSize(Context: TRegContext): string; +var + Typ: TRegDataType; + Size: Integer; +// ValueName: string; +// SL: TStringList; +begin + Result := ''; + + if csDestroying in PrefWin.ComponentState then + Exit; + +// ValueName := RealValueName(Item); + Typ := Context.Typ; + Size := Length(Context.Data); + + if Typ in rdStringTypes then + if not PrefWin.CountZeroByteCB.Checked then + Dec(Size); + + if Typ = rdMultiString then + if PrefWin.ShowLineCountCB.Checked then begin + Size := CharCount(StrOfByteA(Context.Data), #0) - 2; +{ SL := TStringList.Create; + try + Reg.ReadMultiString(ValueName, SL, PrefWin.UseExtendedModelCB.Checked); + Size := SL.Count; + finally + SL.Free; + end; } + Result := '#'; + end; + + Result := Result + IntToStr(Size); +end; + +function ValueDataType(Context: TRegContext): string; +begin + Result := StrOfRegDataType(Context.Typ); +end; + +function DataPreviewOfContext(Context: TRegContext): string; + + function DWORDPreview(Value: Integer): string; + begin + if PrefWin.ShowDwordAsHex.Checked then + Result := IntToStr(Value) + ' = $' + IntToHex(Value, 8) + else + Result := IntToStr(Value) + end; + + function BinaryPreview(Context: TRegContext): string; + var + z: string; + + function DWORDStringOfByteA(a: TByteA; AddBinary: Boolean = False): string; + var + piece: TByteA; + i: Integer; + begin + Result := ''; + + i := 0; + while (i <= High(a)) and (Length(Result) < MaxPreviewLen) do begin + piece := Copy(a, i, 4); + if AddBinary then + Result := Result + FriendlyStr(piece) + '='; + SetLength(piece, 4); + Result := Result + IntToStr(PInteger(piece)^) + ' '; + Inc(i, SizeOf(Integer)); + end; + end; + + begin + with Context do begin + Data := Copy(Data, 0, MaxPreviewLen); + case PrefWin.ShowBinaryAsRG.ItemIndex of + 0: z := FriendlyStr(Data); + 1: z := DWORDStringOfByteA(Data); + 2: z := DWORDStringOfByteA(Data, True); + 3: z := BinOfByteA(Data, 8, ' '); + 4: z := HexOfByteA(Data, 0); + 5: z := HexOfByteA(Data, 1); + 6: z := HexOfByteA(Data, 2); + 7: z := HexOfByteA(Data, 4); + end; + end; + + Result := Copy(z, 1, MaxPreviewLen); + end; + + function StringPreview(Context: TRegContext): string; + var + s: string; + Expanded: string; + DoExpand: Boolean; + begin + s := PChar(Context.Data); + with PrefWin do + Result := StringQuoterBegin + FriendlyStr(s) + StringQuoterEnd; + if s = '' then + Exit; + + case PrefWin.ExpandStringsRG.ItemIndex of + 0: DoExpand := False; + 1: DoExpand := (Context.Typ = rdExpandString) and (CharCount(s, '%') >= 2); + 2: DoExpand := True; + else + ShowMessage('Error: Unknown PrefWin.ExpandStringsRG.ItemIndex!'); + PrefWin.ExpandStringsRG.ItemIndex := 0; + Exit; + end; + + if DoExpand then begin + Expanded := ExpandString(s); + if s <> Expanded then + Result := Result + ' <' + Expanded + '>'; + end; + end; + + function IntegerPreview(Context: TRegContext): string; + begin + if Length(Context.Data) >= SizeOf(Cardinal) then begin + Result := DWORDPreview(PInteger(Context.Data)^); + end else + Result := BinaryPreview(Context); + end; + + function MultiStringPreview(Context: TRegContext): string; + var + z: string; + SL: TStringList; + i: Integer; + begin + z := ''; + + SL := TStringList.Create; + try + RegMultiStringOfByteA(Context.Data, SL, PrefWin.UseExtendedModelCB.Checked); + + for i := 0 to SL.Count-1 do + z := z + SL[i] + ' '; + finally + SL.Free; + end; + + Result := Copy(FriendlyStr(z), 1, MaxPreviewLen); + end; + +begin + Result := ''; + + if csDestroying in PrefWin.ComponentState then + Exit; + + if (Context.Data = nil) or (Length(Context.Data) > RegMaxDataSize) then + Exit; + + if Length(Context.Data) > MaxPreviewLen then + SetLength(Context.Data, MaxPreviewLen); + + if PrefWin.ShowAsBinaryCB.Checked then begin + Result := BinaryPreview(Context); + Exit; end; + + case Context.Typ of + rdExpandString, rdString: Result := StringPreview(Context); + rdCardinal, rdCardBigEndian: Result := IntegerPreview(Context); + rdMultiString: Result := MultiStringPreview(Context); + else + if PrefWin.Smart4BBCB.Checked and (Length(Context.Data) = 4) then + Result := IntegerPreview(Context) + else + Result := BinaryPreview(Context); + end; +end; + +function ValueDataPreview(Context: TRegContext): string; +begin + Result := DataPreviewOfContext(Context); +end; + +function IconOfDataType(Typ: TRegDataType): Integer; +begin + if Typ in [rdNone..rdLastType] then + Result := iconFirstType + Ord(Typ) + else + Result := iconUnknownType; +end; + +function ValueTypeIcon(Context: TRegContext): Integer; +begin + Result := IconOfDataType(Context.Typ); +end; + +function TValuesWin.UpdateValue(Reg: TXRegistry; Item: TListItem): Boolean; +//Return Value: True if something has changed +var + Size, Typ, Data: string; + Icon: Integer; + Context: TRegContext; +begin + Result := False; + if not Assigned(Item) then + Exit; + + Context := Reg.ReadContext(RealValueName(Item)); + Data := ValueDataPreview(Context); + Size := ValueDataSize(Context); + Typ := ValueDataType(Context); + Icon := ValueTypeIcon(Context); + + if Icon <> Item.ImageIndex then begin + Item.ImageIndex := Icon; + Result := True; + end; + + while Item.SubItems.Count < Integer(High(TValueListColumn)) do + Item.SubItems.Add(''); + + if Size <> Item.SubItems[SubItemIndex[vlcSize]] then begin + Result := True; + Item.SubItems[SubItemIndex[vlcSize]] := Size; + end; + + if Typ <> Item.SubItems[SubItemIndex[vlcType]] then begin + Result := True; + Item.SubItems[SubItemIndex[vlcType]] := Typ; + end; + + if (Data <> Item.SubItems[SubItemIndex[vlcData]]) then begin + Result := True; + Item.SubItems[SubItemIndex[vlcData]] := Data; + if IsMainValue(Item) then + RegTV.Repaint; + end; +end; + +procedure AppendNewValueInfos(Item: TListItem; Context: TRegContext); +begin + Item.ImageIndex := ValueTypeIcon(Context); + with Item.SubItems do begin + Append(ValueDataSize(Context)); + Append(ValueDataType(Context)); + Append(ValueDataPreview(Context)); + end; +end; + +function TValuesWin.AddValue(Reg: TXRegistry; const ValueName: string; + AppendInfos: Boolean = True): TListItem; +begin + Result := ValueList.Items.AddItem(nil, -1); + Result.Indent := -1; + SetRealValueName(Result, ValueName); + if AppendInfos then + AppendNewValueInfos(Result, Reg.ReadContext(ValueName)); +end; + +procedure TValuesWin.ValueListChange(Sender: TObject; Item: TListItem; + Change: TItemChange); +var + ValueName: string; + Reg: TXRegistry; + + function ComputeValuesCommon(Reg: TXRegistry; var DataType: TRegDataType): Boolean; + var + i: Integer; + ItemType: TRegDataType; + begin + Result := False; + + i := 0; + DataType := 0; + while i < ValueList.Items.Count do begin + Item := ValueList.Items[i]; + if not Item.Selected then begin + Inc(i); + Continue; end; + + ValueName := RealValueName(Item); + if Reg.ValueReallyExists(ValueName) then begin + + ItemType := Reg.GetDataType(ValueName); + if not Result then begin + DataType := ItemType; + Result := True; + end else if ItemType <> DataType then begin + Result := False; + DataType := 0; + Break; end; + + with ValueNames do + if Item.Focused then + Insert(0, ValueName) + else + Add(ValueName); + + end else begin + ShowMessage('Value has been deleted!'); + DataType := 0; + Result := False; + Reload; + Break; end; + + Inc(i); + end; + end; + +begin + if not Assigned(Item) or ValueList.IsEditing or not ValueList.Enabled then + Exit; + + if Change <> ctState then + Exit; + + if csDestroying in WorkWin.ComponentState then + Exit; + + if (ValueList.SelCount = 0) then begin + ValueNames.Clear; + WorkWin.ReInitShowPC; + Exit; end; + + if not Item.Focused then + Exit; + + WorkWin.ReInitShowPC; + + ValueNames.Clear; + Reg := TXRegistry.Create; + try + if OpenNodeOK(Reg, RegTV.Selected) then begin + ValuesCommon := ComputeValuesCommon(Reg, ValueCommonType); + if ValuesCommon then + WorkWin.ShowValues(Reg); + end; + finally + Reg.Free; + end; + + if csDestroying in MainWin.ComponentState then + Exit; + + if ActiveControl = ValueList then + MainWin.SetStatus; +end; + +procedure TValuesWin.ValueListCustomDrawItem(Sender: TCustomListView; + Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); +begin + with ValueList.Canvas.Font do begin + if Item.Focused then + Style := Style + [fsBold]; + if ItemIsDefaultValue(Item) then + Color := clBrightYellow + else + Color := ColorOfDataType(TRegDataType(Item.ImageIndex - iconFirstType)); + end; +end; + +procedure TValuesWin.ValueListDblClick(Sender: TObject); +begin + ValueListChange(Sender, ValueList.ItemFocused, ctState); + MainPC.ActivePage := WorkWin.WorkPage; + + if not Assigned(ValueList.ItemFocused) then + Exit; + + if csDestroying in WorkWin.ComponentState then + Exit; + + WorkWin.EditData; +end; + +procedure TValuesWin.ValueListEditing(Sender: TObject; Item: TListItem; + var AllowEdit: Boolean); +begin + if not ValueLabelClicked then begin + AllowEdit := False; + Exit; end; + + if ItemIsDefaultValue(Item) then //unschön, aber beste Lösung bisher + Keyboard.SimKey(VK_DELETE); +end; + +procedure TValuesWin.ValueListEdited(Sender: TObject; Item: TListItem; + var S: string); +var + Old: string; + OldCaption: string; +begin + OldCaption := Item.Caption; + Old := RealValueName(Item); + + if s = Old then begin + if ItemIsDefaultValue(Item) then + s := DefaultValueCaption; + Exit; end; + + SpyThread.Suspend; + try + Item.Caption := s; + + if TryRenameValue(Old, s) then begin + SetRealValueName(Item, s); //Sichere Zuweisung des Standard-Flags + s := Item.Caption; //Anschließend externer Aufruf "Item.Caption := s"! + end else begin + s := OldCaption; + end; + + finally + SpyThread.Restart := True; + SpyThread.Resume; + end; +end; + +procedure TValuesWin.ValueListKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + T: string; + Item: TListItem; +begin + if ValueList.IsEditing then + Exit; + + if csDestroying in TreeWin.ComponentState then + Exit; + + Item := ValueList.ItemFocused; + + case Key of + VK_SPACE: JumpToSel(ValueList); + + VK_F9: SwapFonts(ValueList); + + VK_F5: Reload; + + VK_F12: begin //Sort + if Assigned(Item) then + T := Item.Caption; + ValueList.SortType := TSortType(2 - (Integer(ValueList.SortType))); + if ValueList.SortType = stNone then + TreeWin.RegTVChange(Sender, RegTV.Selected); + ValueList.ItemFocused := FindItem(ValueList, T); + if Assigned(ValueList.ItemFocused) then + ValueList.ItemFocused.MakeVisible(True); + end; + + VK_DELETE: DeleteMIClick(Sender); + + VK_RETURN: ValueListDblCLick(Sender); + + Ord('C'): + if not ValueList.IsEditing then + CopyPathMIClick(Sender); + + VK_SCROLL: CheckValueListHotTrack; + end; +end; + +procedure TValuesWin.ValueListResize(Sender: TObject); +begin + with ValueList do + Columns[3].Width := ClientWidth - (0 + + Columns[0].Width + Columns[1].Width + Columns[2].Width); +end; + +procedure TValuesWin.DeleteValue; +var + Item, NewSel: TListItem; + YesToAll: Boolean; + i: Integer; + + procedure DeleteIt(Item: TListItem); + begin + OpenCurKey; + if MainReg.DeleteValue(RealValueName(Item)) + and not MainReg.ValueReallyExists(RealValueName(Item)) then begin + Item.Delete; + end else begin + ShowMessage('Could not delete Value ' + Quote(RealValueName(Item))); + Inc(i); + end; + MainReg.CloseKey; + + if IsMainValue(Item) then + RegTV.Repaint; + end; + +begin + SpyThread.Suspend; + + NewSel := GetNextBestNotSelected(ValueList.ItemFocused); + + YesToAll := False; + i := 0; + while i < ValueList.Items.Count do begin + Item := ValueList.Items[i]; + if not Item.Selected then begin + Inc(i); + Continue; end; + + if YesToAll then + DeleteIt(Item) + else begin + case MessageDlg('Do you really want to delete the Value ' + + Quote(RealValueName(Item)) + '?', + mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel], 0) of + mrYes: DeleteIt(Item); + mrYesToAll: YesToAll := True; + mrCancel: Exit; + mrNo: begin + Item.Selected := False; + NewSel := Item; + end; + end; + end; + end; + + if Assigned(NewSel) then begin + ValueList.ItemFocused := NewSel; + NewSel.Selected := True; + end else + WorkWin.ReInitShowPC; + + SpyThread.Restart := True; + SpyThread.Resume; +end; + +procedure TValuesWin.ZeromizeValue; +var + Item: TListItem; + YesToAll: Boolean; + i: Integer; + + procedure ZeromizeIt(Item: TListItem); + begin + with MainReg do begin + OpenCurKey; + ZeromizeValue(RealValueName(Item)); + UpdateValue(MainReg, Item); + CloseKey; + end; + end; + +begin + SpyThread.Suspend; + + YesToAll := False; + i := 0; + while i < ValueList.Items.Count do begin + Item := ValueList.Items[i]; + if not Item.Selected then begin + Inc(i); + Continue; end; + + if YesToAll then + ZeromizeIt(Item) + else + case MessageDlg('Do you really want to zeromize ValueData of ' + + Quote(RealValueName(Item)) + ' ?', + mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel], 0) of + + mrYes: begin + ZeromizeIt(Item); + Inc(i); + end; + + mrYesToAll: begin + YesToAll := True; + ZeromizeIt(Item); + end; + mrCancel: Exit; + end; + + if IsMainValue(Item) then + RegTV.Repaint; + end; + + + SpyThread.Resume; +end; + +procedure TValuesWin.ValueListPUPopup(Sender: TObject); +var + Writable, ValueOK, OnlyOneValue, OneValueOK: Boolean; + Item: TListItem; +begin + if Assigned(ValueList.ItemFocused) then + ValueList.ItemFocused.Selected := True; + + if csDestroying in (TreeWin.ComponentState + PrefWin.ComponentState) then + Exit; + + Writable := not TreeWin.CantWrite; + NewDefaultValueMI.Visible := Writable; + NewStringMI.Visible := Writable; + NewDWORDMI.Visible := Writable; + NewBinaryMI.Visible := Writable; + NewMultiStringMI.Visible := Writable; + NewElseMI.Visible := Writable; + + ValueOK := Writable and (ValueList.ItemFocused <> nil); + OnlyOneValue := ValueList.SelCount = 1; + OneValueOK := OnlyOneValue and ValueOK; + + EditMI.Visible := ValueOK; + EditBinaryMI.Visible := ValueOK; + DublicateMI.Visible := OneValueOK; + CopyPathMI.Visible := OnlyOneValue; + CopyDataPreviewMI.Visible := OnlyOneValue; + TakeAsMainValueMI.Visible := OnlyOneValue; + RenameMI.Visible := OneValueOK; + DeleteMI.Visible := ValueOK; + ZeromizeMI.Visible := ValueOK; + + Item := ValueList.ItemFocused; + if not Assigned(Item) then + Exit; + + TakeAsMainValueMI.Checked := RealValueName(Item) = PrefWin.MainPreviewE.Text; +end; + +procedure TValuesWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if ValueList.IsEditing then + Exit; + + if csDestroying in MainWin.ComponentState then + Exit; + MainWin.FormKeyDown(Sender, Key, Shift); +end; + +procedure TValuesWin.ValueListDeletion(Sender: TObject; Item: TListItem); +begin + if Assigned(SpyThread) then + SpyThread.Restart := True; + + if csDestroying in WorkWin.ComponentState then + Exit; + + if Assigned(ShowPC.ActivePage) + and Item.Selected and Item.Focused then begin + ValueList.ItemFocused := GetNextBest(Item); + WorkWin.ReInitShowPC; + end; +end; + +procedure TValuesWin.DeleteMIClick(Sender: TObject); +begin + if ValueList.IsEditing then + Exit; + + DeleteValue; +end; + +procedure TValuesWin.RenameMIClick(Sender: TObject); +begin + if Assigned(ValueList.ItemFocused) then begin + ValueLabelClicked := True; + ValueList.ItemFocused.EditCaption; + ValueLabelClicked := False; + end; +end; + +procedure TValuesWin.NewBigEndianMIClick(Sender: TObject); +begin + CreateValue(rdCardBigEndian); +end; + +procedure TValuesWin.NewExpandStringMIClick(Sender: TObject); +begin + CreateValue(rdExpandString); +end; + +procedure TValuesWin.NewMultiStringMIClick(Sender: TObject); +begin + CreateValue(rdMultiString); +end; + +procedure TValuesWin.NewStrangeTypeMIClick(Sender: TObject); +begin + CreateValue(TRegDataType(TMenuItem(Sender).Tag)); +end; + +procedure TValuesWin.NewDefaultValueMIClick(Sender: TObject); +var + DefaultItem: TListItem; + i: Integer; +begin + if csDestroying in (TreeWin.ComponentState + MainWin.ComponentState) then + Exit; + if TreeWin.CantWrite then + Exit; + + with MainReg do begin + try + OpenCurKey; + + if StandardValueExists then begin + ShowMessage('Default Value already exists.'); + CloseKey; + Exit; end; + + WriteString('', ''); + + if not StandardValueExists then begin + ShowMessage('Could not create Default Value.'); + CloseKey; + Exit; end; + + ValuesWin.AddValue(MainReg, ''); + finally + CloseKey; + end; + end; + + with ValueList.Items do begin + DefaultItem := nil; + for i := 0 to Count-1 do + if ItemIsDefaultValue(Item[i]) then + Break; + + if i < Count then + DefaultItem := Item[i]; + end; + + if not Assigned(DefaultItem) then + ShowMessage('Error: Lost Default Value!') + else begin + SelectItemOnly(ValueList, DefaultItem); + MainWin.StatusBarUpdate; + ValueListDblClick(Sender); + end; +end; + +procedure TValuesWin.ValueListChanging(Sender: TObject; Item: TListItem; + Change: TItemChange; var AllowChange: Boolean); +begin + if Item = nil then + AllowChange := False; +end; + +procedure TValuesWin.ValueListMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + ValueLabelClicked := False; + with ValueList do + if ([htOnIcon, htOnLabel] * GetHitTestInfoAt(X, Y)) <> [] then + ValueLabelClicked := True; +end; + +procedure TValuesWin.EditBinaryMIClick(Sender: TObject); +begin + if csDestroying in WorkWin.ComponentState then + Exit; + + WorkWin.ShowAsBinary := True; + ValueListChange(Sender, ValueList.ItemFocused, ctState); + ValueListDblClick(Sender); +end; + +procedure TValuesWin.EditMIClick(Sender: TObject); +begin + ValueListDblClick(Sender); +end; + +procedure TValuesWin.ValueListCustomDrawSubItem(Sender: TCustomListView; + Item: TListItem; SubItem: Integer; State: TCustomDrawState; + var DefaultDraw: Boolean); +begin + with ValueList.Canvas.Font do begin + Style := []; + if SubItem = 1 then + Color := clSilver + else + Color := ColorOfDataType(TRegDataType(Item.ImageIndex - iconFirstType)); + end; +end; + +procedure TValuesWin.ValueListCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); +begin + case SortBy of + vlcName: Compare := AnsiCompareText(RealValueName(Item1), RealValueName(Item2)); + vlcSize: Compare := Integer( + StrToIntDef(Item1.SubItems[SubItemIndex[vlcSize]], -1) > + StrToIntDef(Item2.SubItems[SubItemIndex[vlcSize]], -1)); + vlcData: Compare := Integer(Item1.SubItems[SubItemIndex[vlcData]] > + Item2.SubItems[SubItemIndex[vlcData]]); + vlcType: Compare := Integer(Item1.ImageIndex > Item2.ImageIndex); + end; + + if Assigned(SortByColumn) + and (SortByColumn.ImageIndex = iconSortArrowDesc) then + Compare := 1 - Compare; +end; + +procedure TValuesWin.ValueListColumnClick(Sender: TObject; Column: TListColumn); +begin + case Column.ImageIndex of + iconSortArrowAsc: Column.ImageIndex := iconSortArrowDesc; + iconSortArrowDesc: Column.ImageIndex := -1; + else + if Assigned(SortByColumn) then + SortByColumn.ImageIndex := -1; + if TValueListColumn(Column.Tag) in ValueListColumnRange then + SortBy := TValueListColumn(Column.Tag) + else + ShowMessage('Unknown Column Tag'); + Column.ImageIndex := iconSortArrowAsc; + end; + + if Column.ImageIndex = -1 then + ValueList.SortType := stNone + else begin + ValueList.SortType := stData; + SortByColumn := Column; + end; + + Update; + ValueList.AlphaSort; +end; + +procedure TValuesWin.CloneValue; +var + OldName, NewName: string; + + function GetNewName(Reg: TXRegistry; const OldName: string): string; + var + i: Integer; + Prefix: string; + begin + if OldName = '' then + Result := 'New Default Value' + else if Copy(OldName, 1, 4) <> 'New ' then + Result := 'New ' + OldName + else + Result := OldName; + + Prefix := Result; + i := 1; + while Reg.ValueExists(Result) do begin + Result := Prefix + ' ' + IntToStr(i); + Inc(i); + end; + end; + +begin + if csDestroying in TreeWin.ComponentState then + Exit; + + if TreeWin.CantWrite then + Exit; + + OldName := RealValueName(ValueList.ItemFocused); + + try + OpenCurKey; + + NewName := GetNewName(MainReg, OldName); + MainReg.CopyValue(OldName, NewName); + AddValue(MainReg, NewName); + finally + MainReg.CloseKey; + end; +end; + +procedure TValuesWin.DublicateMIClick(Sender: TObject); +begin + CloneValue; +end; + +procedure TValuesWin.CopyDataPreviewMIClick(Sender: TObject); +begin + if ValueList.IsEditing then + Exit; + + CopyDataPreview; +end; + +procedure TValuesWin.CopyDataPreview; +begin + OpenCurKey; + Clipboard.AsText := DataPreviewOfContext(MainReg.ReadContext( + RealValueName(ValueList.ItemFocused))); + MainReg.CloseKey; +end; + +procedure TValuesWin.UpdateValues(SelectedOnly: Boolean = False); +var + i: Integer; + Reg: TXRegistry; +begin + if not Started then + Exit; + + SpyThread.Suspend; + + Reg := TXRegistry.Create; + try + if OpenNodeOK(Reg, RegTV.Selected) then + with ValueList.Items do begin + for i := 0 to Count-1 do begin + if SelectedOnly and not Item[i].Selected then + Continue; + UpdateValue(Reg, Item[i]); + end; + end; + finally + Reg.Free; + end; + + SpyThread.Resume; +end; + +function TValuesWin.TryRenameValue(OldName: string; + var NewName: string): Boolean; +var + x: string; +begin + Result := False; + if OldName = NewName then + Exit; + + if (Length(NewName) > RegMaxValueNameLen) then begin + NewName := Copy(NewName, 1, RegMaxValueNameLen); + if MessageDlg( + 'The maximum size of a value name is ' + IntToStr(RegMaxValueNameLen) + ' characters.' + EOL + + 'Shorten the value name to:' + EOL + + Quote(StringWrap(NewName, 80)), + mtConfirmation, [mbOK, mbCancel], 0) <> mrOK then + Exit; + end; + + if CharIn(NewName, [#0..#31]) then begin + NewName := ReplaceChars(NewName, [#0..#31], '#'); + if MessageDlg('The following chars are not allowed in ValueNames:' + EOL + + '- Control chars (#0..#31)' + EOL + + 'The following name is allowed:' + EOL + + NewName + EOL + + 'Use this name instead?', + mtConfirmation, [mbYes, mbNo], 0) <> mrYes then + Exit; + end; + + if not OpenCurKey then + Exit; + + if SameText(OldName, NewName) then begin //CharCase ändern + x := MainReg.GetFreeValueName; + MainReg.RenameValue(OldName, x); + MainReg.RenameValue(x, NewName); + end else begin + if not MainReg.ValueReallyExists(NewName) then begin + MainReg.RenameValue(OldName, NewName); + end else begin + if NewName = '' then + ShowMessage('Default value already exists.') + else + ShowMessage('Value ' + Quote(NewName) + ' already exists.'); + Exit; end; + end; + MainReg.CloseKey; + + if TextIn(NewName, 'default') then + AddHint('You can create default values by empty string ValueNames.'); + + Result := True; +end; + +procedure TValuesWin.ZeromizeMIClick(Sender: TObject); +begin + ZeromizeValue; +end; + +procedure TValuesWin.CopyPathMIClick(Sender: TObject); +begin + if ValueList.IsEditing then + Exit; + + if csDestroying in MainWin.ComponentState then + Exit; + + MainWin.CopyPathClick(Sender); +end; + +function TValuesWin.FindItemByRealName(const ValueName: string): Integer; +begin + with ValueList.Items do begin + for Result := 0 to Count-1 do + if SameText(RealValueName(Item[Result]), ValueName) then + Exit; + end; + Result := -1; +end; + +function TValuesWin.FocusItem(ARealValueName: string; + FocusValueList: Boolean = False): Boolean; +var + i: Integer; +begin + with ValueList do begin + i := FindItemByRealName(ARealValueName); + + if (i > -1) and (i < Items.Count) then + Selected := Items[i] + else + Selected := nil; + + ItemFocused := Selected; + + Result := Assigned(Selected); + if Result then + JumpToSel(ValueList); + + if FocusValueList then + FocusControl(ValueList); + end; +end; + +procedure TValuesWin.TakeAsMainValueMIClick(Sender: TObject); +var + Item: TListItem; + ValueName: string; +begin + if csDestroying in PrefWin.ComponentState then + Exit; + + Item := ValueList.ItemFocused; + if not Assigned(Item) then + Exit; + + ValueName := RealValueName(Item); + with PrefWin.MainPreviewE do + if ValueName = Text then + Text := '' + else + Text := ValueName; +end; + +procedure TValuesWin.InitListColumnTags; +var + i: Integer; +begin + for i := 0 to ValueList.Columns.Count-1 do + with ValueList.Columns.Items[i] do begin + Tag := -1; + if Caption = 'Name' then + Tag := Integer(vlcName) + else if Caption = 'Size' then + Tag := Integer(vlcSize) + else if Caption = 'Type' then + Tag := Integer(vlcType) + else if Caption = 'Data' then + Tag := Integer(vlcData) + else + ShowMessage(Format('Error: Unknown ValueList.Columns[%d].Caption = "%s"', + [Index, Caption])); + if Tag > -1 then + SubItemIndex[TValueListColumn(Tag)] := Index - 1; + end; +end; + +procedure TValuesWin.FormShow(Sender: TObject); +begin + InitListColumnTags; +end; + +procedure TValuesWin.Reload(JumpToNewValue: Boolean = False; + ValueName: string = ''); +var + Sel: TListItem; + SelIndex: Integer; + SelRealValueName: string; +begin + if csDestroying in TreeWin.ComponentState then + Exit; + + SelIndex := -1; + if JumpToNewValue then + SelRealValueName := ValueName + else begin + Sel := ValueList.ItemFocused; + if Assigned(Sel) then + SelIndex := Sel.Index; + + if SelIndex > -1 then + SelRealValueName := RealValueName(ValueList.Items[SelIndex]); + end; + + TreeWin.RegTVChange(Self, RegTV.Selected); + + if SelIndex > -1 then + if not FocusItem(SelRealValueName, True) then begin + SelIndex := GetBestIndex(ValueList, SelIndex); + if SelIndex > -1 then + with ValueList do begin + Selected := Items[SelIndex]; + ItemFocused := Selected; + end; + end; +end; + +procedure TValuesWin.LoadValues(Reg: TXRegistry); +var + SL: TStringList; + i: Integer; + Clock: TClock; +begin + if csDestroying in WorkWin.ComponentState then + Exit; + + with ValueList.Items do begin + Clock := TClock.Create(1, tfSecs); + ValueList.Enabled := False; + BeginUpdate; + try + Clear; + WorkWin.ReInitShowPC; + + SL := TStringList.Create; + try + Reg.GetValueNames(SL); + for i := 0 to SL.Count-1 do + ValuesWin.AddValue(Reg, SL[i]); + finally + SL.Free; + end; + + finally + EndUpdate; + ValueList.Enabled := True; + Clock.Stop; + if MurphyMode then + AddHint(Format('Values loaded after %0.2f secs.', [Clock.SecsPassed])); + Clock.Free; + end; + end; +end; + +procedure TValuesWin.FormClose(Sender: TObject; var Action: TCloseAction); +begin +// Action := caNone; +end; + +procedure TValuesWin.ValueListClick(Sender: TObject); +begin + CheckValueListHotTrack; + if ValueList.HotTrack then + ValueListDblClick(Sender); +end; + +procedure TValuesWin.CheckValueListHotTrack; +const + StyleOfSwitch: array[Boolean] of TListHotTrackStyles = ( + [], [htHandPoint, htUnderlineHot] ); +var + NewHotTrack: Boolean; +begin + if csDestroying in PrefWin.ComponentState then + Exit; + + NewHotTrack := ScrollON xor PrefWin.ValuesSingleClickCB.Checked; + if NewHotTrack = ValueList.HotTrack then Exit; + + with ValueList do begin + HotTrack := NewHotTrack; + HotTrackStyles := StyleOfSwitch[HotTrack]; + Mouse.CursorPos := Mouse.CursorPos; + end; +end; + +procedure TValuesWin.SelectAllMIClick(Sender: TObject); +var + i: Integer; +begin + with ValueList.Items do + for i := 0 to Count-1 do + Item[i].Selected := True; +end; + +procedure TValuesWin.InvertSelectionMIClick(Sender: TObject); +var + i: Integer; +begin + with ValueList.Items do + for i := 0 to Count-1 do + Item[i].Selected := not Item[i].Selected; +end; + +procedure TValuesWin.FormDestroy(Sender: TObject); +begin + ValueNames.Free; +end; + +end. +unit WorkU; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ComCtrls, NewPanels, Grids, Clipbrd, + IntEdit, ExtCtrls, Menus, YTools, CompEx, PlutoConst, + XReg, Clock, Colors, ShellAPI, IniFiles, Math, + keybrd, Buttons, YTypes, LinkLabel, start, + PrefTools, ImgList, PHexMemo, PipelineTh, DropSource, DropTarget, + CrackTools; + +type + TColorStringFmt = (csfThreeSpacedDecimals); + + TWorkWin = class(TForm) + StringPU: TPopupMenu; + SpaceMI: TMenuItem; + FileMI: TMenuItem; + FileOpenD: TOpenDialog; + MainPC: TPageControl; + HintPage: TTabSheet; + Splitter1: TSplitter; + HintLB: TListBox; + InfoMemo: TMemo; + WorkPage: TTabSheet; + WorkP: TPanel; + ShowPC: TPageControl; + StringPage: TTabSheet; + BorderPanel1: TBorderPanel; + StringE: TEdit; + OKStringB: TButton; + BoolStrCB: TCheckBox; + CancelStringB: TButton; + StringAsColorP: TPanel; + StringAsFileP: TBorderPanel; + IconImage: TImage; + IntPage: TTabSheet; + BorderPanel5: TBorderPanel; + OKIntB: TButton; + CardBoolCB: TCheckBox; + CancelIntB: TButton; + BinaryPage: TTabSheet; + BorderPanel6: TBorderPanel; + Panel2: TPanel; + Label5: TLabel; + OffsetHE: THexEdit; + OKBinaryB: TButton; + CancelBinaryB: TButton; + StringTypeRG: TRadioGroup; + SpyPage: TTabSheet; + BorderPanel2: TBorderPanel; + SpyResumeB: TButton; + SpySuspendB: TButton; + SpyLB: TListBox; + Label4: TLabel; + Label7: TLabel; + CardTypeRG: TRadioGroup; + MultiStringPage: TTabSheet; + BorderPanel7: TBorderPanel; + OKMultiStringB: TButton; + CancelMultiStringB: TButton; + MultiStringM: TMemo; + DataTypeComB: TComboBox; + CardinalE: TCardEdit; + ColorDlg: TColorDialog; + MultiStringOpenD: TOpenDialog; + MultiStringSaveD: TSaveDialog; + MultiStringPU: TPopupMenu; + LadenMI: TMenuItem; + SpeichernMI: TMenuItem; + Hinzufgen1: TMenuItem; + N1: TMenuItem; + SisyPage: TTabSheet; + SpyClearTracesB: TButton; + Label11: TLabel; + HexEdit1: THexEdit; + Label12: TLabel; + Label13: TLabel; + SortMultiStringMI: TMenuItem; + SpyTestL: TLabel; + Panel3: TPanel; + CurValueE: TEdit; + BorderPanel8: TBorderPanel; + BorderPanel9: TBorderPanel; + SisyTV: TTreeView; + TabImages: TImageList; + ChangeImages: TImageList; + Panel7: TPanel; + ColorPanel1: TColorPanel; + Splitter2: TSplitter; + SpyDelayIE: TPrefIntEdit; + ListTracesCB: TPrefCheckBox; + Panel5: TPanel; + Panel8: TPanel; + SisyExpandGroupsCB: TPrefCheckBox; + ClearChangesB: TButton; + FilterChangesB: TButton; + SisyTVPU: TPopupMenu; + SisyGotoKeyMI: TMenuItem; + SisyDeleteChangeMI: TMenuItem; + SisyActivateChangeMI: TMenuItem; + N3: TMenuItem; + SisyCopyPathMI: TMenuItem; + N4: TMenuItem; + Panel9: TPanel; + ExternalEditB: TButton; + LoadExternalB: TButton; + ReloadStringB: TButton; + BinaryHM: TPHexMemo; + PipelineCB: TCheckBox; + ReloadDWordB: TButton; + ReloadBinaryB: TButton; + ReloadMultiStringB: TButton; + DescL: TLabel; + SisyHKUCB: TPrefCheckBox; + SisyHKLMCB: TPrefCheckBox; + SisyHKUL: TLabel; + SisyHKLML: TLabel; + SisyListCB: TPrefCheckBox; + CardSpecial0B: TButton; + CardSpecial1B: TButton; + CardSpecial_1B: TButton; + CardSpecial7FB: TButton; + SisyPU: TPopupMenu; + Idle1: TMenuItem; + Lowest1: TMenuItem; + Lower1: TMenuItem; + Normal1: TMenuItem; + Higher1: TMenuItem; + Highes1: TMenuItem; + SisyShowCurrentPathMI: TMenuItem; + N5: TMenuItem; + MultiStringTypeRG: TRadioGroup; + SeparatorE: TEdit; + Label1: TLabel; + MultiStringCountL: TLabel; + DropFileTarget: TDropFileTarget; + CryptoPage: TTabSheet; + BorderPanel3: TBorderPanel; + CryptoE: TEdit; + OKCryptoB: TButton; + CancelCryptoB: TButton; + ReloadCryptoB: TButton; + CryptoTypeRG: TRadioGroup; + Label2: TLabel; + LinkLabel2: TLinkLabel; + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure SpyResumeBClick(Sender: TObject); + procedure SpySuspendBClick(Sender: TObject); + procedure ArrPlutoBClick(Sender: TObject); + procedure ArrRegEdBClick(Sender: TObject); + procedure ArrFreeBClick(Sender: TObject); + procedure ArrBigValBClick(Sender: TObject); + + procedure SpaceMIClick(Sender: TObject); + procedure FileMIClick(Sender: TObject); + procedure HintLBClick(Sender: TObject); + procedure MainPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); + procedure ValueMIClick(Sender: TObject); + procedure StringEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure StringEChange(Sender: TObject); + procedure OKStringBClick(Sender: TObject); + procedure BoolStrCBClick(Sender: TObject); + procedure CardinalEChange(Sender: TObject); + procedure CardBoolCBClick(Sender: TObject); + procedure CardinalEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure OKIntBClick(Sender: TObject); + procedure ShowPCChange(Sender: TObject); + procedure ShowPCChanging(Sender: TObject; var AllowChange: Boolean); + procedure ShowPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); + procedure ShowPCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure FormCreate(Sender: TObject); + procedure OKBinaryBClick(Sender: TObject); + procedure HexGrid1Click(Sender: TObject); + procedure HexGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure BoolStrPopup(Sender: TObject); + procedure StringPageEnter(Sender: TObject); + procedure IntPageEnter(Sender: TObject); + procedure BinaryPageEnter(Sender: TObject); + procedure ReInitShowPC; + procedure ActivateIt(Sender: TObject); + procedure DeActivateIt(Sender: TObject); + procedure FormDeactivate(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure MultiStringMChange(Sender: TObject); + procedure OKMultiStringBClick(Sender: TObject); + procedure StringAsColorPDblClick(Sender: TObject); + procedure MultiStringMEnter(Sender: TObject); + procedure LadenMIClick(Sender: TObject); + procedure SpeichernMIClick(Sender: TObject); + procedure Hinzufgen1Click(Sender: TObject); + procedure CancelBClick(Sender: TObject); + procedure HexGrid1Enter(Sender: TObject); + procedure SpyClearTracesBClick(Sender: TObject); + procedure SpyLBKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + //procedure BinLMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure BinLClick(Sender: TObject); + procedure HexGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ValueViewChanged(Sender: TObject); + procedure HexEdit1Change(Sender: TObject); + procedure SortMultiStringMIClick(Sender: TObject); + procedure SpyTestLClick(Sender: TObject); + procedure FocusForEditing; + procedure CurValueEKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure CurValueEEnter(Sender: TObject); + + procedure AddAHint(const Hint: string); + procedure SisyTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); + procedure SisyTVDblClick(Sender: TObject); + procedure SisyTVKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure SisyCBClick(Sender: TObject); + procedure BinaryHMLineChange(NewLine: Cardinal); + procedure OffsetHEChange(Sender: TObject); + procedure SpyDelayIEChange(Sender: TObject); + procedure SisyTVExpanded(Sender: TObject; Node: TTreeNode); + procedure ClearChangesBClick(Sender: TObject); + procedure FilterChangesBClick(Sender: TObject); + procedure SisyTVPUPopup(Sender: TObject); + procedure SisyActivateChangeMIClick(Sender: TObject); + procedure SisyDeleteChangeMIClick(Sender: TObject); + procedure SisyCopyPathMIClick(Sender: TObject); + procedure ExternalEditBClick(Sender: TObject); + procedure LoadExternalBClick(Sender: TObject); + procedure ReloadBClick(Sender: TObject); + procedure PipelineCBClick(Sender: TObject); + procedure BinaryHMEnter(Sender: TObject); + procedure xUseExtendedModelCBClick(Sender: TObject); + procedure SeparatorEChange(Sender: TObject); + procedure HintLBKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure DWORDSpecialBClick(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure SisyPUPopup(Sender: TObject); + procedure SisyPriorityMIClick(Sender: TObject); + procedure SisyShowCurrentPathMIClick(Sender: TObject); + procedure DropFileTargetDrop(Sender: TObject; ShiftState: TShiftState; + Point: TPoint; var Effect: Integer); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormResize(Sender: TObject); + procedure IconImageDblClick(Sender: TObject); + procedure SisyTVCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); + procedure SisyTVMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure OKCryptoBClick(Sender: TObject); + procedure CryptoEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + private + PipelineThread: TPipelineThread; + BoolStr: array of array[Boolean] of string; + HexEditAutoChange: Boolean; + TargetPage: TTabSheet; + procedure DeleteChange(Node: TTreeNode); + procedure DeactivateChange(Node: TTreeNode); + procedure CopySelectedChangeName; + procedure ClearChanges; + public + ShowAsBinary: Boolean; + function LastHint: string; + function LoadBoolStr: Boolean; + function LoadSisyFilter: Boolean; + procedure ShowValues(Reg: TXRegistry); + procedure UpdateWriteButtons; + procedure EditData; + end; + +var + WorkWin: TWorkWin; + ShowPC: TPageControl; + MainPC: TPageControl; + +implementation + +uses TreeU, ValuesU, plutomain, splash, SisyphusTH, PrefU, ShellEx; + +{$R *.dfm} + +function ColorOfString(s: string; Format: TColorStringFmt; + Default: TColor = clBlack): TColor; +var + SA: TStrA; + i: Integer; +begin + Result := Default; + SA := nil; + + case Format of + csfThreeSpacedDecimals: begin + SA := Split(s, ' '); + if Length(SA) <> 3 then + Exit; + for i := 0 to 2 do + if not (IsValidInteger(SA[i]) and (StrToIntDef(SA[i], -1) in [0..255])) then + Exit; + Result := ColorOfRGB(StrToIntDef(SA[0], 0), + StrToIntDef(SA[1], 0), + StrToIntDef(SA[2], 0)); + end; + end; +end; + +function StringOfColor(Color: TColor; Format: TColorStringFmt): string; +var + RGB: TRGB; +begin + Result := ''; + + RGB := RGBOfColor(Color); + case Format of + csfThreeSpacedDecimals: begin + with RGB do + Result := IntToStr(R) + ' ' + IntToStr(G) + ' ' + IntToStr(B); + end; + end; +end; + +function TWorkWin.LastHint: string; +begin + with HintLB.Items do + if Count > 0 then + Result := Strings[Count-1] + else + Result := ''; +end; + +procedure TWorkWin.AddAHint(const Hint: string); +begin + if not Assigned(HintLB) then + Exit; + + with HintLB.Items do begin + if Count > 0 then begin + if StrAtBegin(LastHint, Hint) then begin //same hint again + with HintLB do + Tag := Tag + 1; + Strings[Count-1] := Format('%s (%d)', [Hint, HintLB.Tag]); + Exit end else + HintLB.Tag := 1; + end; + Add(Hint); + end; + Application.ProcessMessages; //draw +// Sleep(1000); //wait to read hints +end; + +procedure TWorkWin.ReInitShowPC; +begin + with CurValueE do begin + Text := NoValueCaption; + Font.Color := clSilver; + Enabled := False; + end; + + ShowPC.ActivePage := nil; + + StringE.Text := ''; + StringTypeRG.ItemIndex := 0; + + MultiStringTypeRG.Buttons[1].Enabled := False; + + CardinalE.Value := 0; + CardTypeRG.ItemIndex := 0; + + BinaryHM.Data := nil; + PipelineCB.Checked := False; + + DataTypeComB.ItemIndex := Integer(rdBinary); + + MultiStringM.Clear; +end; + +procedure TWorkWin.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + MainWin.FormKeyDown(Sender, Key, Shift); +end; + +procedure TWorkWin.SpyResumeBClick(Sender: TObject); +begin + SpyThread.Resume; + SpyTestLClick(Sender); +end; + +procedure TWorkWin.SpySuspendBClick(Sender: TObject); +begin + SpyThread.Suspend; + SpyTestLClick(Sender); +end; + +procedure TWorkWin.ArrPlutoBClick(Sender: TObject); +begin + ArrangePlutoStyle; +end; + +procedure TWorkWin.ArrRegEdBClick(Sender: TObject); +begin + ArrangeRegEdStyle; +end; + +procedure TWorkWin.ArrFreeBClick(Sender: TObject); +begin + ArrangeFreeStyle; +end; + +procedure TWorkWin.ArrBigValBClick(Sender: TObject); +begin + ArrangeBigValStyle; +end; + +procedure TWorkWin.SpaceMIClick(Sender: TObject); +begin + StringE.Text := ''; +end; + +procedure TWorkWin.HintLBClick(Sender: TObject); +begin + StatusBar.Panels[0].Text := GetSel(HintLB); + WorkWin.InfoMemo.Text := StatusBar.Panels[0].Text; +end; + +procedure TWorkWin.MainPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; + const Rect: TRect; Active: Boolean); +var + PC: TPageControl; + Page: TTabSheet; +begin + PC := TPageControl(Control); + Page := PC.Pages[TabIndex]; + with PC.Canvas.Font do begin + if Page.Caption = 'Hint' then + Color := clBrightRed + else if Page.Caption = 'Edit' then + Color := clBrightGreen + else if Page.Caption = 'Spy' then + Color := clBrightBlue + else if Page.Caption = 'Sisyphus' then + Color := clBrightCyan + else + Color := clWhite; + end; + + with PC.Canvas do + if Active then begin + Font.Style := [fsBold]; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 18 + 5, Rect.Top + 3, Page.Caption); + PC.Images.Draw(PC.Canvas, Rect.Left + 4, Rect.Top + 2, Page.ImageIndex); + end else begin + Font.Style := []; + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 18 + 3, Rect.Top + 2, Page.Caption); + PC.Images.Draw(PC.Canvas, Rect.Left + 1, Rect.Top + 1, Page.ImageIndex); + end; +end; + +procedure TWorkWin.ValueMIClick(Sender: TObject); +begin + StringE.Text := UntilStr(TMenuItem(Sender).Caption,' = '); + OKStringBClick(Sender); +end; + +procedure TWorkWin.StringEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if key = VK_RETURN then begin + OKStringBClick(Sender); + ValuesWin.FocusControl(ValueList); + end; + if key = VK_ESCAPE then + CancelBClick(Sender); +end; + +procedure TWorkWin.StringEChange(Sender: TObject); +var + i: Integer; + State: TCheckBoxState; + Desc: string; +begin + IconImage.Picture := nil; + + with StringAsColorP do begin + Color := ColorOfString(StringE.Text, csfThreeSpacedDecimals, -1); + Visible := Color <> -1; + end; + + try + with IconImage.Picture.Icon do begin + ReleaseHandle; + Handle := GetIconFromFile(StringE.Text); + StringAsFileP.Visible := Handle <> 0; + end; + except + end; + + State := cbGrayed; + for i := 0 to High(BoolStr) do begin + if StringE.Text = BoolStr[i][False] then + State := cbUnchecked + else if StringE.Text = BoolStr[i][True] then + State := cbChecked + else + Continue; + Break; + end; + + BoolStrCB.Visible := State in [cbChecked, cbUnchecked]; + BoolStrCB.State := State; + + Desc := StringE.Text; + Desc := RegNameOfCLSID(Desc); + with DescL do begin + Visible := (Desc <> ''); + if Visible then + Caption := 'CLSID is: ' + Desc; + end; +end; + +procedure TWorkWin.OKStringBClick(Sender: TObject); +var + i: Integer; +begin + try + OpenCurKey; + with ValuesWin.ValueNames do + for i := 0 to Count-1 do begin + case StringTypeRG.ItemIndex of + 0: MainReg.WriteString(Strings[i], StringE.Text); + 1: MainReg.WriteExpandString(Strings[i], StringE.Text); + end; + end; + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; + ValuesWin.ValueListDblClick(Sender); +end; + +procedure TWorkWin.BoolStrCBClick(Sender: TObject); +var + i: Integer; +begin + for i := 0 to High(BoolStr) do begin + if (BoolStr[i, False] = StringE.Text) + or (BoolStr[i, True] = StringE.Text) then + Break; + end; + + if i > High(BoolStr) then + Exit; + + StringE.Text := BoolStr[i][BoolStrCB.Checked]; +end; + +procedure TWorkWin.CardinalEChange(Sender: TObject); +begin + HexEditAutoChange := True; + with CardBoolCB do begin + Enabled := True; + case CardinalE.Value of + 1: Checked := True; + 0: Checked := False; + else + Enabled := False; + end; + end; + HexEdit1.Value := CardinalE.Value; + HexEditAutoChange := False; +end; + +procedure TWorkWin.CardBoolCBClick(Sender: TObject); +begin + if HexEditAutoChange then + Exit; + CardinalE.Value := Ord(CardBoolCB.Checked); +end; + +procedure TWorkWin.CardinalEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if key = VK_RETURN then begin + OKIntBClick(Sender); + ValuesWin.FocusControl(ValueList); + end; + + if key = VK_ESCAPE then + CancelBClick(Sender); +end; + +procedure TWorkWin.OKIntBClick(Sender: TObject); +var + i: Integer; + + procedure Write4BB(const ValueName: string; Value: Cardinal); + var + Typ: TRegDataType; + begin + if MainReg.ValueReallyExists(ValueName) then + Typ := MainReg.GetDataType(ValueName) + else + Typ := rdBinary; + + if Typ in rdCardTypes then + Typ := rdBinary; + + MainReg.WriteBinType(ValueName, ByteAOfInt(CardinalE.Value), Typ); + end; + +begin + try + OpenCurKey; + with ValuesWin.ValueNames do + for i := 0 to Count-1 do begin + case CardTypeRG.ItemIndex of + 0: MainReg.WriteCardinal(Strings[i], CardinalE.Value); + 1: MainReg.WriteCardinal(Strings[i], CardinalE.Value, True); + 2: Write4BB(Strings[i], CardinalE.Value); + end; + end; + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; +end; + +procedure TWorkWin.ShowPCChange(Sender: TObject); +begin + FocusControl(TObject(ShowPC.ActivePage.Tag) as TWinControl); +end; + +procedure TWorkWin.ShowPCChanging(Sender: TObject; var AllowChange: Boolean); + + function ByteAOfDWORD(a: DWORD): TByteA; + begin + SetLength(Result, SizeOf(DWORD)); + Move(a, Pointer(Result)^, SizeOf(DWORD)); + end; + +var + SourcePage: TTabSheet; + ValueName: string; +begin + SourcePage := ShowPC.ActivePage; + if SourcePage = IntPage then begin + + if TargetPage = StringPage then begin + AddHint('Converting: DWORD --> String'); + StringE.Text := CardinalE.Text; + end else if TargetPage = BinaryPage then begin + AddHint('Converting: DWORD --> Binary'); + BinaryHM.Data := ByteAOfDWORD(CardinalE.Value); + end else + AllowChange := False; + + end else if SourcePage = StringPage then begin + if TargetPage = IntPage then begin + if IsValidCardinal(StringE.Text) then begin + AddHint('Converting: String --> DWORD'); + CardinalE.Text := StringE.Text; + end else begin + AddHint('This no valid DWORD; Converting aborted.', True); + AllowChange := False; + end; + end else if TargetPage = BinaryPage then begin + AddHint('Converting: String --> Binary'); + BinaryHM.Data := TByteA(StringE.Text); + end else if TargetPage = MultiStringPage then begin + AddHint('Converting: String --> MultiString'); + if SeparatorE.Text = '' then + MultiStringM.Text := StringE.Text; + SeparatorEChange(Sender); + end else + AllowChange := False; + + end else if SourcePage = BinaryPage then begin + if TargetPage = StringPage then begin + AddHint('Converting: Binary --> String'); + StringE.Text := FriendlyStr(string(BinaryHM.Data)); + end else if TargetPage = IntPage then begin + if Length(BinaryHM.Data) >= SizeOf(DWORD) then begin + AddHint('Converting: Binary --> DWORD'); + CardinalE.Value := PDWORD(BinaryHM.Data)^; + end else begin + AddHint('Binary value not long enough (4 Byte); Converting aborted.', True); + AllowChange := False; + end; + end else if TargetPage = CryptoPage then begin + if ValuesWin.ValueNames.Count = 1 then begin + ValueName := ValuesWin.ValueNames[0]; + with CryptoTypeRG do begin + ItemIndex := -1; + if SameText(ValueName, 'ScreenSave_Data') then begin + ItemIndex := 0; + CryptoE.Text := DecodeScreenSaver(BinaryHM.Data); + end else if SameText(ValueName, 'parm1enc') + or SameText(ValueName, 'parm2enc') then begin + ItemIndex := 1; + CryptoE.Text := DecodeSharedFolder(BinaryHM.Data); + end; + end; + if CryptoTypeRG.ItemIndex = -1 then + AllowChange := False; + end; + end else + AllowChange := False; + + end else if SourcePage = MultiStringPage then begin + if TargetPage = StringPage then begin + AddHint('Converting: MultiString --> String '); + if SeparatorE.Text = '' then + StringE.Text := MultiStringM.Text + else + StringE.Text := Join(MultiStringM.Lines, SeparatorE.Text); + //end else if TargetPage = BinaryPage then begin + end else + AllowChange := False; + + end else + AllowChange := False; +end; + +procedure TWorkWin.ShowPCDrawTab(Control: TCustomTabControl; TabIndex: Integer; + const Rect: TRect; Active: Boolean); +var + PC: TPageControl; + Page: TTabSheet; +begin + PC := TPageControl(Control); + Page := PC.Pages[TabIndex]; + with PC.Canvas.Font do begin + if Page = StringPage then + Color := clBrightRed + else if Page = MultiStringPage then + Color := clBrightPurple + else if Page = IntPage then + Color := clBrightBlue + else if Page = BinaryPage then + Color := clBrightGreen + else if Page = CryptoPage then + Color := clBrightCyan; + end; + + with PC.Canvas do begin + if Active then + Brush.Color := clGray + else + Brush.Color := clDarkGray; + FillRect(Rect); + TextOut(Rect.Left + 18 + 3, Rect.Top, Page.Caption); + MainWin.ImageList1.Draw(Control.Canvas, Rect.Left - 1, Rect.Top - 1, Page.ImageIndex); + end; +end; + +procedure TWorkWin.ShowPCMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + with ShowPC do + if htOnItem in GetHitTestInfoAt(X, Y) then + TargetPage := Pages[IndexOfTabAt(X, Y)]; +end; + +procedure TWorkWin.FormCreate(Sender: TObject); +var + i: Integer; +begin + WorkU.ShowPC := ShowPC; + WorkU.MainPC := MainPC; + + //Zeromize + ShowPC.ActivePage := nil; + InfoMemo.Text := ''; + MultiStringM.Clear; + SisyTV.Items.Clear; + CurValueE.Text := NoValueCaption; + HexEditAutoChange := False; + TargetPage := nil; + + //Tagging + StringPage.Tag := Integer(StringE); + IntPage.Tag := Integer(CardinalE); + BinaryPage.Tag := Integer(BinaryHM); + MultiStringPage.Tag := Integer(MultiStringM); + ShowAsBinary := False; + + if not Win9x then + CryptoPage.TabVisible := False; + + MainPC.ActivePage := HintPage; + ShowPC.ActivePage := nil; + + DropFileTarget.register(StringE); + + with StringTypeRG do + for i := 0 to ControlCount-1 do + (Controls[i] as TRadioButton).OnKeyDown := StringEKeyDown; + + ExternalEditB.Enabled := FileEx(PrefWin.ExternalHexEditE.Text); + + PipelineThread := TPipelineThread.CreateIt(tpIdle, '', BinaryHM); + PipelineThread.OnChange := LoadExternalBClick; +end; + +procedure TWorkWin.OKBinaryBClick(Sender: TObject); +var + Typ: Cardinal; + i: Integer; +begin + try + Typ := StrToIntDef(UntilChar(DataTypeComB.Text, ' '), Integer(rdBinary)); + OpenCurKey; + with ValuesWin.ValueNames do + for i := 0 to Count-1 do + MainReg.WriteBinType(Strings[i], BinaryHM.Data, Typ); + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; +end; + +procedure TWorkWin.HexGrid1Click(Sender: TObject); +begin + {with BinaryHM do begin + with BinL, Font do + if ActiveByte < ByteCount then + Color := clBrightGreen + else begin + Color := clSilver; + Caption := '00000000'; + end; + BinL.Caption := IntToBinFill(CurrentByte, 8); + end; } +end; + +procedure TWorkWin.HexGrid1KeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if key = VK_RETURN then begin + OKBinaryBClick(Sender); + ValuesWin.FocusControl(ValueList); + end; + if key = VK_ESCAPE then + CancelBClick(Sender); +end; + +procedure TWorkWin.BoolStrPopup(Sender: TObject); +begin + StringE.Text := TMenuItem(Sender).Caption; +end; + +procedure TWorkWin.StringPageEnter(Sender: TObject); +begin + FocusControl(StringE); +end; + +procedure TWorkWin.IntPageEnter(Sender: TObject); +begin + FocusControl(CardinalE); +end; + +procedure TWorkWin.BinaryPageEnter(Sender: TObject); +begin + FocusControl(BinaryHM); +end; + +procedure TWorkWin.ActivateIt(Sender: TObject); +begin + ActivateThis(Sender); +end; + +procedure TWorkWin.DeActivateIt(Sender: TObject); +begin + DeActivateThis(Sender); +end; + +procedure TWorkWin.FormDeactivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + TEdit(ActiveControl).OnExit(Sender); +end; + +procedure TWorkWin.FormActivate(Sender: TObject); +begin + if Assigned(ActiveControl) and (ActiveControl.Tag = EditControlFlag) then + TEdit(ActiveControl).OnEnter(Sender); +end; + +procedure TWorkWin.MultiStringMChange(Sender: TObject); +begin + MultiStringCountL.Caption := StrNumerus(MultiStringM.Lines.Count, + 'Line', 'Lines', 'No'); +end; + +procedure TWorkWin.OKMultiStringBClick(Sender: TObject); +var + UseExtendedModel: Boolean; + i: Integer; + JoinedText: string; +begin + if (MultiStringTypeRG.ItemIndex = 1) then begin + if ValuesWin.ValueCommonType = rdMultiString then + if mrYes<>MessageDlg('Do you want to change the type of this value?' + EOL + + 'MultiString --> String', mtWarning, [mbYes, mbCancel], 0) then + Exit; + + try + OpenCurKey; + JoinedText := Join(MultiStringM.Lines, SeparatorE.Text); + with ValuesWin.ValueNames do + for i := 0 to Count-1 do + MainReg.WriteString(Strings[i], JoinedText); + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; + Exit; end; + + UseExtendedModel := True; + if ContainsEmptyLines(MultiStringM.Lines) then + case MessageDlg('This text contains empty lines.' + EOL + + 'These are not allowed in the standard MultiString model.' + EOL + + 'Do you want to delete them?' + EOL + + EOL + + 'Yes: Delete empty lines' + EOL + + 'No: Use the Extended Model', + mtWarning, [mbYes, mbNo, mbCancel], 0) of + + mrNo: UseExtendedModel := True; + + mrYes: begin + with MultiStringM do begin + Lines.BeginUpdate; + DeleteEmptyLines(Lines); + Lines.EndUpdate; + end; + end; + + else Exit; + + end; + + try + OpenCurKey; + with ValuesWin.ValueNames do + for i := 0 to Count-1 do begin + if MainReg.GetDataType(Strings[i]) <> rdMultiString then + if mrYes <> MessageDlg('Do you want to change the type of this value?' + EOL + + '--> MultiString', mtWarning, [mbYes, mbCancel], 0) then + Exit; + if UseExtendedModel then + MainReg.WriteStringList(Strings[i], MultiStringM.Lines) + else + MainReg.WriteMultiString(Strings[i], MultiStringM.Lines); + end; + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; + + ValuesWin.ValueListDblClick(Sender); +end; + +procedure TWorkWin.StringAsColorPDblClick(Sender: TObject); +begin + if ColorDlg.Execute then + StringE.Text := StringOfColor(ColorDlg.Color, csfThreeSpacedDecimals); +end; + +procedure TWorkWin.MultiStringMEnter(Sender: TObject); +begin + MultiStringM.SelectAll; + ActivateIt(MultiStringM); +end; + +procedure TWorkWin.LadenMIClick(Sender: TObject); +begin + with MultiStringOpenD do begin + InitialDir := ExtractFileDrive(MyDir); + if Execute then + MultiStringM.Lines.LoadFromFile(FileName); + end; +end; + +procedure TWorkWin.SpeichernMIClick(Sender: TObject); +begin + with MultiStringSaveD do begin + InitialDir := ExtractFileDrive(MyDir); + if Execute then + MultiStringM.Lines.SaveToFile(FileName); + end; +end; + +procedure TWorkWin.Hinzufgen1Click(Sender: TObject); +var + SL: TStringList; +begin + with MultiStringOpenD do begin + InitialDir := ExtractFileDrive(MyDir); + if Execute then begin + SL := TStringList.Create; + SL.LoadFromFile(FileName); + MultiStringM.Lines.AddStrings(SL); + SL.Free; + end; + end; +end; + +procedure TWorkWin.CancelBClick(Sender: TObject); +begin + ValuesWin.FocusControl(ValueList); + ValuesWin.ValueListChange(Sender, ValueList.Selected, ctState); +end; + +procedure TWorkWin.HexGrid1Enter(Sender: TObject); +begin + HexGrid1Click(Sender); +end; + +procedure TWorkWin.SpyClearTracesBClick(Sender: TObject); +begin + SpyLB.Clear; +end; + +procedure TWorkWin.SpyLBKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (ssShift in Shift) and (key = VK_DELETE) then begin + key := 0; + SpyLB.Clear; + Exit; end; + + if key = VK_F9 then begin + key := 0; + SwapFonts(SpyLB); + Exit; end; +end; + +procedure TWorkWin.BinLClick(Sender: TObject); +begin + // with HexGrid1 do + // Byt[ActiveByte] := IntOfBin(BinL.Caption); +end; + +procedure TWorkWin.HexGrid1KeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + //HexGrid1Click(Sender); +end; + +procedure TWorkWin.ValueViewChanged(Sender: TObject); +var + i: Integer; +begin + if not Started then + Exit; + + SpyThread.Suspend; + OpenCurKey; + for i := 0 to ValueList.Items.Count-1 do + ValuesWin.UpdateValue(MainReg, ValueList.Items[i]); + + MainReg.CloseKey; + SpyThread.Resume; +end; + +procedure TWorkWin.HexEdit1Change(Sender: TObject); +begin + if not HexEditAutoChange then + CardinalE.Value := HexEdit1.Value; +end; + +procedure TWorkWin.SortMultiStringMIClick(Sender: TObject); +var + SL: TStringList; +begin + SL := TStringList.Create; + with SL do begin + Assign(MultiStringM.Lines); + Sort; + end; + MultiStringM.Lines.Assign(SL); + SL.Free; +end; + +procedure TWorkWin.SpyTestLClick(Sender: TObject); +begin + SpyTestL.Caption := StrOfBool(SpyThread.Suspended, 'No Spy.', 'Spy active.'); +end; + +procedure TWorkWin.FocusForEditing; +begin + FocusControl(MainPC); +end; + +function TWorkWin.LoadBoolStr: Boolean; +var + SL: TStringList; + FileName: string; + i, p: Integer; +begin + Result := True; + + AddHint('Loading Boolean Strings...'); + + FileName := PlutoDir + BoolStrFileName; + if not FileEx(FileName) then begin + AddToLastHint('not found:'); + AddHint(FileName); + Result := False; + end else begin + SL := TStringList.Create; + try + SL.LoadFromFile(FileName); + DeleteCommentLines(SL); + BoolStr := nil; + SetLength(BoolStr, SL.Count); + for i := 0 to SL.Count-1 do begin + //Split the string by the '|'-sign + p := Pos('|', SL[i]); + BoolStr[i][False] := Copy(SL[i], 1, p-1); + BoolStr[i][True] := Copy(SL[i], p+1, Length(SL[i]) - p); + end; + finally + SL.Free; + AddToLastHint('OK'); + end; + end; +end; + +function TWorkWin.LoadSisyFilter: Boolean; +var + SL: TStringList; + FileName: string; + i: Integer; +begin + Result := True; + + FileName := PlutoDir + SisyFilterFileName; + if not FileEx(FileName) then + Result := False + else begin + AddHint('Loading Sisyphus Filter Settings...'); + SL := TStringList.Create; + try + SL.LoadFromFile(FileName); + DeleteCommentLines(SL, '#'); + for i := 0 to SL.Count-1 do + SL[i] := TrimLeft(SL[i]); + + SisyFilter.Clear; + SisyFilter.AddStrings(SL); + finally + SL.Free; + AddToLastHint('OK'); + end; + end; +end; + +procedure TWorkWin.SisyTVGetSelectedIndex(Sender: TObject; Node: TTreeNode); +begin + Node.SelectedIndex := Node.ImageIndex; +end; + +procedure TWorkWin.SisyTVDblClick(Sender: TObject); +var + Node: TTreeNode; + Path: string; +begin + Node := SisyTV.Selected; + if not Assigned(Node) then + Exit; + + Path := RootOfNode(Node).Text; + + if Node.Level > 0 then begin + if Node.Level = 2 then + Node := Node.Parent; + if Node.HasChildren then + Path := Path + '\\' + Node.Text //Value + else + Path := Path + '\' + Node.Text //SubKey + end; + + MainWin.GotoKey(Path); +end; + +procedure TWorkWin.DeleteChange(Node: TTreeNode); +var + SubNode: TTreeNode; + + procedure FreeSisyChangeNode(Node: TTreeNode); + begin + try + with (TObject(Node.Data) as TSisyChange) do + Free; + except + ReportFmt('errors', 'Context could not be freed: "%s"', [Node.Text]); + end; + + Node.Delete; + end; + +begin + if not Assigned(Node) then + Exit; + + if Node.Level = 2 then + Node := Node.Parent; + + if Node.Level = 0 then begin + SisyTV.Selected := GetNextBest(RootOfNode(Node)); + SubNode := Node.GetFirstChild; + while Assigned(SubNode) do begin + FreeSisyChangeNode(SubNode); + SubNode := Node.GetFirstChild; end; + Node.Delete; + end else begin + SisyTV.Selected := GetNextBest(Node); + FreeSisyChangeNode(Node); + end; +end; + +procedure TWorkWin.DeactivateChange(Node: TTreeNode); +begin + Node := RootOfNode(Node); + + if not Assigned(Node) then + Exit; + + if SisyChangeActivated(Node) then begin + SetSisyChangeState(Node, False); + Node.Cut := True; + end else begin + SetSisyChangeState(Node, True); + Node.Cut := False; + end; + SisyTV.Repaint; +end; + +procedure TWorkWin.CopySelectedChangeName; +var + Node: TTreeNode; +begin + Node := SisyTV.Selected; + if not Assigned(Node) then + Exit; + + Clipboard.AsText := Node.Text; +end; + +procedure TWorkWin.SisyTVKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +var + Node: TTreeNode; +begin + Node := RootOfNode(SisyTV.Selected); + if not Assigned(Node) then + Exit; + + {if Key = VK_RETURN then + SisyTVDblCLick(Sender); + + if Key = VK_DELETE then + if (ssCtrl in Shift) and (Key = VK_DELETE) then + DeactivateChange(Node) + else + DeleteChange(Node); + + if (ssCtrl in Shift) and (Char(Key) = 'C') then + CopySelectedChangeName;} +end; + +procedure TWorkWin.SisyCBClick(Sender: TObject); +begin + if not Started then + Exit; + + with TCheckBox(Sender), TSisyThread(Sisys[Tag]) do begin + if Checked then + Resume + else + Suspend; + end; +end; + +procedure TWorkWin.CurValueEEnter(Sender: TObject); +begin + CurValueE.Text := RealValueName(ValueList.ItemFocused); + CurValueE.SelectAll; +end; + +procedure TWorkWin.CurValueEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + + procedure RenameValue(NewName: string); + var + Item: TListItem; + begin + Item := ValueList.ItemFocused; + if ValuesWin.TryRenameValue(CurKey.Value, NewName) then + SetRealValueName(Item, NewName); + end; + +begin + if Key = VK_RETURN then begin + SpyThread.Suspend; + try + RenameValue(CurValueE.Text); + ValuesWin.ValueListDblClick(Self); + FocusControl(CurValueE); + finally + SpyThread.Restart := True; + SpyThread.Resume; + end; + Key := 0; + //CurValueE.SelectAll; + end else if Key = VK_ESCAPE then begin + ValuesWin.ValueListDblClick(Self); + end; +end; + +procedure TWorkWin.BinaryHMLineChange(NewLine: Cardinal); +begin + OffsetHE.Value := BinaryHM.Pos; + // BinaryAsIntL.Value := Integer(BinaryHM.CurentCard); +end; + +procedure TWorkWin.OffsetHEChange(Sender: TObject); +begin + BinaryHM.Pos := OffsetHE.Value; +end; + +procedure TWorkWin.SpyDelayIEChange(Sender: TObject); +begin + if Assigned(SpyThread) then + SpyThread.Delay := SpyDelayIE.Value; +end; + +procedure TWorkWin.SisyTVExpanded(Sender: TObject; Node: TTreeNode); +begin + if Node.ImageIndex = 8 then + Node.ImageIndex := 7; +end; + +procedure TWorkWin.ClearChanges; +var + Node: TTreeNode; +begin + with SisyTV.Items do begin + Node := GetFirstNode; + while Assigned(Node) do begin + DeleteChange(Node); + Node := GetFirstNode; + end; + end; +end; + +procedure TWorkWin.ClearChangesBClick(Sender: TObject); +begin + if mrOK <> MessageDlg('Do you really want to clear all changes?', + mtWarning, [mbOK, mbCancel], 0) then + Exit; + + ClearChanges; +end; + +procedure TWorkWin.FilterChangesBClick(Sender: TObject); +begin + NotePad(PlutoDir + SisyFilterFileName); + ShowMessage('Click OK when you finished editing.' + EOL + + '(Pluto will reload the filter settings then.)'); + LoadSisyFilter; +end; + +procedure TWorkWin.SisyTVPUPopup(Sender: TObject); +var + KeySelected: Boolean; + Node: TTreeNode; +begin + Node := SisyTV.Selected; + KeySelected := Assigned(Node); + + SisyGoToKeyMI.Enabled := KeySelected; + SisyDeleteChangeMI.Enabled := KeySelected; + SisyActivateChangeMI.Enabled := KeySelected; + SisyCopyPathMI.Enabled := KeySelected; + if not KeySelected then + Exit; + + SisyActivateChangeMI.Checked := SisyChangeActivated(RootOfNode(Node)); +end; + +procedure TWorkWin.SisyActivateChangeMIClick(Sender: TObject); +begin + DeactivateChange(SisyTV.Selected) +end; + +procedure TWorkWin.SisyDeleteChangeMIClick(Sender: TObject); +begin + DeleteChange(SisyTV.Selected) +end; + +procedure TWorkWin.SisyCopyPathMIClick(Sender: TObject); +begin + CopySelectedChangeName; +end; + +procedure TWorkWin.FileMIClick(Sender: TObject); +var + s: string; +begin + with FileOpenD do begin + s := ExtractPath(StringE.Text); + if s <> '' then + InitialDir := s + else + InitialDir := MyDir; + + s := ExtractFileName(StringE.Text); + s := DeleteChars(s, '/'); + if s <> '' then + FileName := s; + + if Execute then + StringE.Text := FileName; + end; +end; + +procedure TWorkWin.ExternalEditBClick(Sender: TObject); +var + FileName: string; +begin + FileName := TempDir + '~' + DeleteChars(CurValueE.Text, FileNameEnemies) + + '.bin'; + if SaveByteA(BinaryHM.Data, FileName) then + ExecFileWith(PrefWin.ExternalHexEditE.Text, FileName) + else + ShowMessage('Could not write into file:' + EOL + FileName); + + PipelineThread.FileName := FileName; +end; + +procedure TWorkWin.LoadExternalBClick(Sender: TObject); +var + FileName: string; + Data: TByteA; + i: Integer; +begin + Data := nil; + + FileName := TempDir + '~' + CurValueE.Text + '.bin'; + if not FileEx(FileName) then begin + {ShowMessage('File not found:' + EOL + + FileName);} + Exit; + end; + + Data := LoadByteA(FileName); + if Length(Data) = Length(BinaryHM.Data) then begin + for i := 0 to High(Data) do + if Data[i] <> BinaryHM.Data[i] then begin + BinaryHM.Data := Data; + Exit; + end; + end else + BinaryHM.Data := Data; +end; + +procedure TWorkWin.PipelineCBClick(Sender: TObject); +begin + with PipelineThread, PipelineCB do + if Checked then begin + if Suspended then + Resume; + end else + if not Suspended then + Suspend; +end; + +procedure TWorkWin.ReloadBClick(Sender: TObject); +begin + ValuesWin.ValueListDblClick(Self); +end; + +procedure TWorkWin.BinaryHMEnter(Sender: TObject); +begin + PipelineCB.Checked := False; +end; + +procedure TWorkWin.xUseExtendedModelCBClick(Sender: TObject); +begin + PrefWin.UseExtendedModelCB.Load; +end; + +procedure TWorkWin.SeparatorEChange(Sender: TObject); +begin + if not SeparatorE.Enabled then + Exit; + + if SeparatorE.Text = '' then begin + if StringE.Text = '' then + Exit + else + MultiStringM.Text := StringE.Text; + MultiStringTypeRG.Buttons[1].Enabled := False; + MultiStringTypeRG.ItemIndex := 0; + end else begin + if StringE.Text = '' then + StringE.Text := Join(MultiStringM.Lines, SeparatorE.Text); + MultiStringTypeRG.Buttons[1].Enabled := True; + MultiStringTypeRG.ItemIndex := 1; + Split(StringE.Text, SeparatorE.Text, MultiStringM.Lines, False); + end; +end; + +procedure TWorkWin.HintLBKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Key = Byte('C')) and (ssCtrl in Shift) then + with HintLb do + if ItemIndex >= 0 then + Clipboard.AsText := Items[ItemIndex]; +end; + +procedure TWorkWin.DWORDSpecialBClick(Sender: TObject); +begin + CardinalE.Value := StrToIntDef((Sender as TButton).Caption, 0); +end; + +procedure TWorkWin.Button1Click(Sender: TObject); +begin + ShowPC.SelectNextPage(True); +end; + +procedure TWorkWin.SisyPUPopup(Sender: TObject); +begin + with SisyPU, TSisyThread(Sisys[PopupComponent.Tag]) do + Items[Integer(Priority)].Checked := True; +end; + +procedure TWorkWin.SisyPriorityMIClick(Sender: TObject); +begin + with TSisyThread(Sisys[SisyPU.PopupComponent.Tag]) do begin + Priority := TThreadPriority(TMenuItem(Sender).MenuIndex); + if Priority <= tpNormal then + Uni.WriteInteger('Priority', Integer(Priority)); + end; +end; + +procedure TWorkWin.SisyShowCurrentPathMIClick(Sender: TObject); +begin + with SisyPU, TSisyThread(Sisys[PopupComponent.Tag]) do begin + Suspend; + ShowMessage(CurrentSpyKey.Path); + Resume; + end; +end; + +procedure TWorkWin.DropFileTargetDrop(Sender: TObject; + ShiftState: TShiftState; Point: TPoint; var Effect: Integer); +begin + StringE.Text := DropFileTarget.Files[0]; +end; + +procedure TWorkWin.FormClose(Sender: TObject; var Action: TCloseAction); +begin +// Action := caNone; + DropFileTarget.Unregister; + ClearChanges; +end; + +procedure TWorkWin.FormResize(Sender: TObject); +begin + Realign; +end; + +procedure TWorkWin.IconImageDblClick(Sender: TObject); +var + Filename: string; +begin + FileName := GetFileNew(StringE.Text); + if FileName <> '' then + ExecFile(FileName); +end; + +procedure TWorkWin.ShowValues(Reg: TXRegistry); +var + MainValueName: string; + ValueCommonType: TRegDataType; + + procedure ShowValueAsBinary(const ValueName: string; + Smart4BB: Boolean = True); + begin + if Smart4BB + and PrefWin.Smart4BBCB.Checked + and (Reg.GetDataSize(ValueName) = 4) then begin + CardinalE.Value := Reg.ReadCardinal(ValueName); + CardTypeRG.ItemIndex := 2; + ShowPC.ActivePage := IntPage; + Exit; end; + BinaryHM.Data := Reg.ReadBin(ValueName); + DataTypeComB.ItemIndex := ValueCommonType; + if IsValidDataType(ValueCommonType) then + DataTypeComB.ItemIndex := ValueCommonType + else begin + DataTypeComB.Text := IntToStr(ValueCommonType); + AddHint('Value has unknown data type (' + DataTypeComB.Text + '): ' + + Quote(ValueName)); + end; + ShowPC.ActivePage := BinaryPage; + end; + +begin + with ValuesWin do begin + if not Assigned(ValueNames) or (ValueNames.Count = 0) then + raise EReadError.Create('ValueNameList error'); + MainValueName := ValueNames[0]; + end; + ValueCommonType := ValuesWin.ValueCommonType; + + with CurValueE do begin + Enabled := True; + if ValuesWin.ValueNames.Count = 1 then + Text := MainValueName + else + Text := Copy(ValuesWin.ValueNames.CommaText, 1, 255); + + Font.Color := ColorOfDataType(ValueCommonType); + end; + + if KeyIsDown(VK_MENU) or ShowAsBinary then begin + ShowValueAsBinary(MainValueName, False); + end else if ValueCommonType in rdStringTypes then begin + StringE.Text := Reg.ReadString(MainValueName); + case ValueCommonType of + rdString: StringTypeRG.ItemIndex := 0; + rdExpandString: StringTypeRG.ItemIndex := 1; + end; + ShowPC.ActivePage := StringPage; + end else if ValueCommonType in rdCardTypes then begin + CardinalE.Value := Reg.ReadCardinal(MainValueName); + case ValueCommonType of + rdCardinal: StringTypeRG.ItemIndex := 0; + rdCardBigEndian: StringTypeRG.ItemIndex := 1; + end; + ShowPC.ActivePage := IntPage; + end else if ValueCommonType = rdMultiString then begin + MultiStringM.Clear; + Reg.ReadMultiString(MainValueName, MultiStringM.Lines, PrefWin.UseExtendedModelCB.Checked); + SeparatorEChange(Self); + MultiStringTypeRG.ItemIndex := 0; + ShowPC.ActivePage := MultiStringPage; + end else begin + ShowValueAsBinary(MainValueName); + end; + + ShowAsBinary := False; + + UpdateWriteButtons; +end; + +procedure TWorkWin.UpdateWriteButtons; +const + BtnTextOfMultiEdit: array[Boolean] of string = ('Write', 'Write all'); +var + BtnText: string; +begin + BtnText := BtnTextOfMultiEdit[ValuesWin.ValueNames.Count > 1]; + OKStringB.Caption := BtnText; + OKIntB.Caption := BtnText; + OKMultiStringB.Caption := BtnText; + OKBinaryB.Caption := BtnText; +end; + +procedure TWorkWin.EditData; +begin + AddHint('Edit'); + MainPC.ActivePage := WorkPage; + + with ShowPC do + if ActivePage = nil then + Exit + else if ActivePage = WorkWin.StringPage then begin + FocusControl(StringE); + StringE.SelectAll; + end + else if ActivePage = WorkWin.IntPage then + FocusControl(CardinalE) + else if ActivePage = WorkWin.MultiStringPage then + FocusControl(MultiStringM) + else if ActivePage = WorkWin.BinaryPage then + FocusControl(BinaryHM) + else + ShowMessage('Error: ShowPC.ActivePage!'); +end; + +procedure TWorkWin.SisyTVCustomDrawItem(Sender: TCustomTreeView; + Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); +begin + with TTreeView(Sender).Canvas.Font do begin + if Node.Cut then + Color := $AAAAAA + else + Color := clWhite; + end; +end; + +procedure TWorkWin.SisyTVMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +var + Node: TTreeNode; + RelX, RelY: Integer; +begin + with SisyTV do begin + RelX := ScreenToClient(Mouse.CursorPos).X; + RelY := ScreenToClient(Mouse.CursorPos).Y; + Node := GetNodeAt(RelX, RelY); + end; + if not Assigned(Node) then + Exit; + + if not Node.Selected then + Node.Selected := True; +end; + +procedure TWorkWin.OKCryptoBClick(Sender: TObject); +var + i: Integer; +begin + try + OpenCurKey; + with ValuesWin.ValueNames do + for i := 0 to Count-1 do begin + case CryptoTypeRG.ItemIndex of + 0: MainReg.WriteBin(Strings[i], EncodeScreenSaver(CryptoE.Text)); + 1: MainReg.WriteBin(Strings[i], EncodeSharedFolder(CryptoE.Text)); + end; + end; + ValuesWin.UpdateValues(True); + finally + MainReg.CloseKey; + end; + ValuesWin.ValueListDblClick(Sender); +end; + +procedure TWorkWin.CryptoEKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = VK_RETURN then begin + OKCryptoBClick(Sender); + ValuesWin.FocusControl(ValueList); + end; + if Key = VK_ESCAPE then + CancelBClick(Sender); +end; + +end. diff --git a/test/delphi/pluto.out.raydebug b/test/delphi/pluto.out.raydebug new file mode 100644 index 0000000..032e8d4 --- /dev/null +++ b/test/delphi/pluto.out.raydebug @@ -0,0 +1,10829 @@ +reserved(unit) ident(FindTH)operator(;) + +reserved(interface) + +reserved(uses) + ident(Classes)operator(,) ident(windows)operator(,) ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(CompEx)operator(,) ident(SysUtils)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) + ident(clock)operator(,) ident(plutoconst)operator(,) ident(StdCtrls)operator(,) ident(Masks)operator(,) ident(Forms)operator(,) ident(XReg)operator(;) + +reserved(const) + ident(RegMoleVersion) operator(=) stringoperator(;) + +reserved(type) + ident(TFindThreadProgress) operator(=) operator(()ident(fpNone)operator(,) ident(fpEvery512th)operator(,) ident(fpEach)operator(\);) + + ident(TRegFindThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) + directive(private) + ident(SearchText)operator(:) reserved(string)operator(;) + ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) + ident(Progress)operator(:) ident(TFindThreadProgress)operator(;) + ident(FindNodeText)operator(:) reserved(string)operator(;) + ident(TimeElapsed)operator(:) ident(Double)operator(;) + ident(syncIcon)operator(:) ident(Integer)operator(;) + ident(syncStatusText)operator(:) reserved(string)operator(;) + ident(CurrentPath)operator(:) reserved(string)operator(;) + ident(KeysScanned)operator(:) ident(Integer)operator(;) + ident(Mask)operator(:) ident(TMask)operator(;) + ident(dwordVal)operator(:) ident(DWORD)operator(;) + ident(SearchForValues)operator(:) ident(Boolean)operator(;) + + reserved(procedure) ident(Find)operator(;) + + comment(//Synchronizers) + reserved(procedure) ident(Start)operator(;) + reserved(procedure) ident(Add)operator(;) + reserved(procedure) ident(UpdateStatus)operator(;) + reserved(procedure) ident(Finish)operator(;) + directive(protected) + reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) + directive(public) + ident(SpecialPath)operator(:) reserved(string)operator(;) + ident(FindNode)operator(:) ident(TTreeNode)operator(;) + ident(ListTV)operator(:) ident(TTreeView)operator(;) + ident(ObjectsFound)operator(,) ident(KeysFound)operator(,) ident(ValuesFound)operator(,) ident(DataFound)operator(:) ident(Integer)operator(;) + ident(Ranges)operator(:) ident(TRanges)operator(;) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) ident(s)operator(:) reserved(string)operator(;) + ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) ident(Progress)operator(:) ident(TFindThreadProgress)operator(\);) + reserved(end)operator(;) + +reserved(implementation) + +reserved(uses) + ident(ValuesU)operator(,) ident(StrUtils)operator(;) + +comment({ TRegFindThread }) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(Add)operator(;) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + reserved(with) ident(ListTV) reserved(do) reserved(begin) + comment(//Items.BeginUpdate;) + ident(Node) operator(:=) ident(TTreeNode)operator(.)ident(Create)operator(()ident(Items)operator(\);) + ident(SetTNImage)operator(()ident(Node)operator(,) ident(syncIcon)operator(\);) + ident(Items)operator(.)ident(AddNode)operator(()ident(Node)operator(,) ident(FindNode)operator(,) ident(Copy)operator(()ident(CurrentPath)operator(,) integer(1)operator(,) integer(255)operator(\),) reserved(nil)operator(,) + ident(naAddChildFirst)operator(\);) + reserved(if) reserved(not) ident(FindNode)operator(.)ident(Expanded) reserved(and) operator(()ident(FindNode)operator(.)ident(Count) operator(=) integer(1)operator(\)) reserved(then) comment(//First Node) + ident(FindNode)operator(.)ident(Expand)operator(()ident(False)operator(\);) + comment(//Items.EndUpdate;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(constructor) ident(TRegFindThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) ident(s)operator(:) reserved(string)operator(;) + ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) ident(Progress)operator(:) ident(TFindThreadProgress)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(()ident(True)operator(\);) comment(// Create thread suspended) + ident(Priority) operator(:=) ident(PriorityLevel)operator(;) comment(// Set Priority Level) + ident(FreeOnTerminate) operator(:=) ident(True)operator(;) comment(// Thread Free Itself when terminated) + + ident(SearchText) operator(:=) ident(s)operator(;) + ident(Ranges) operator(:=) reserved(nil)operator(;) + ident(Self)operator(.)ident(SearchFor) operator(:=) ident(SearchFor)operator(;) + ident(Self)operator(.)ident(Progress) operator(:=) ident(Progress)operator(;) +reserved(end)operator(;) + +reserved(destructor) ident(TRegFindThread)operator(.)ident(Destroy)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(FindNode)operator(\)) reserved(then) + ident(FindNode)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(Execute)operator(;) +reserved(begin) + ident(Synchronize)operator(()ident(Start)operator(\);) + ident(Find)operator(;) + ident(Synchronize)operator(()ident(Finish)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(Find)operator(;) +reserved(var) + ident(SpecialKey)operator(:) ident(HKEY)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) reserved(const) ident(Icon)operator(:) ident(Integer)operator(\);) + reserved(var) + ident(zCurrentPath)operator(:) reserved(string)operator(;) + reserved(begin) + ident(zCurrentPath) operator(:=) ident(CurrentPath)operator(;) + + ident(CurrentPath) operator(:=) ident(Path)operator(;) + ident(syncIcon) operator(:=) ident(Icon)operator(;) + ident(Synchronize)operator(()ident(Self)operator(.)ident(Add)operator(\);) + + ident(CurrentPath) operator(:=) ident(zCurrentPath)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(AddValueName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Typ)operator(:) ident(TRegDataType)operator(\);) + reserved(begin) + ident(Add)operator(()ident(CurrentPath) operator(+) string operator(+) ident(ValueName)operator(,) ident(IconOfDataType)operator(()ident(Typ)operator(\)\);) + reserved(end)operator(;) + + reserved(procedure) ident(AddValueData)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\);) + reserved(begin) + ident(Add)operator(()ident(CurrentPath) operator(+) string operator(+) ident(ValueName) operator(+) string operator(+) ident(DataPreviewOfContext)operator(()ident(Context)operator(\),) + ident(IconOfDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\)\);) + reserved(end)operator(;) + + reserved(function) ident(FoundInStr)operator(()reserved(const) ident(Data)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(if) ident(SearchText) operator(=) string reserved(then) + ident(Exit)operator(;) + + reserved(if) operator(()ident(Data) operator(=) stringoperator(\)) reserved(and) reserved(not) operator(()ident(sfWildCards) reserved(in) ident(SearchFor)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(sfWildCards) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Mask)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Mask)operator(.)ident(Matches)operator(()ident(Data)operator(\);) + reserved(end) reserved(else) reserved(begin) + comment({if not (sfFileNames in SearchFor\) then begin + if TextBegin(SearchText, UntilChar(Data, '~'\)\) and FileExists(Data\) then + Result := SameFileName(SearchText, GetFileNew(Data\)\); + Exit; + end; }) + + reserved(if) operator([)ident(sfParts)operator(,) ident(sfIgnoreCase)operator(]) operator(<=) ident(SearchFor) reserved(then) + reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) + ident(Result) operator(:=) integer(0)operator(<)ident(PosEx)operator(()ident(SearchText)operator(,) ident(AnsiLowerCase)operator(()ident(Data)operator(\)\)) + reserved(else) + ident(Result) operator(:=) integer(0)operator(<)ident(PosExText)operator(()ident(SearchText)operator(,) ident(Data)operator(\)) + reserved(else) reserved(if) ident(sfParts) reserved(in) ident(SearchFor) reserved(then) + ident(Result) operator(:=) integer(0)operator(<)ident(PosEx)operator(()ident(SearchText)operator(,) ident(Data)operator(\)) + reserved(else) reserved(if) ident(sfIgnoreCase) reserved(in) ident(SearchFor) reserved(then) + reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) + ident(Result) operator(:=) operator(()ident(AnsiLowerCase)operator(()ident(Data)operator(\)) operator(=) ident(SearchText)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(SameText)operator(()ident(Data)operator(,) ident(SearchText)operator(\)) + reserved(else) + ident(Result) operator(:=) operator(()ident(SearchText) operator(=) ident(Data)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(function) ident(FoundInByteA)operator(()reserved(const) ident(Data)operator(:) ident(TByteA)operator(\):) ident(Boolean)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(FoundInStr)operator(()ident(StrOfByteA)operator(()ident(Data)operator(\)\);) + reserved(end)operator(;) + + reserved(procedure) ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\);) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(MaxLen)operator(,) ident(NameLen)operator(,) ident(Len)operator(,) ident(Typ)operator(:) ident(Cardinal)operator(;) + ident(Buffer)operator(:) ident(PByte)operator(;) + ident(ValueName)operator(:) ident(PChar)operator(;) + + reserved(procedure) ident(ScanValue)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) reserved(const) ident(Typ)operator(:) ident(TRegDataType)operator(;) + reserved(const) ident(Data)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) operator(()ident(sfSpecialTypes) reserved(in) ident(SearchFor)operator(\)) reserved(and) reserved(not) ident(InRanges)operator(()ident(Ranges)operator(,) ident(Typ)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(case) ident(Typ) reserved(of) + ident(rdString)operator(,) ident(rdExpandString)operator(:) reserved(if) ident(sfString) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + reserved(if) ident(FoundInStr)operator(()ident(Data)operator(\)) reserved(then) reserved(begin) + ident(Inc)operator(()ident(DataFound)operator(\);) + ident(AddValueData)operator(()ident(ValueName)operator(,) + ident(RegContext)operator(()ident(Typ)operator(,) ident(TByteA)operator(()ident(Copy)operator(()ident(Data)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Data)operator(\)-)integer(1)operator(\)\)\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(rdCardinal)operator(,) ident(rdCardBigEndian)operator(:) reserved(if) ident(sfDWord) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + reserved(if) operator(()ident(Length)operator(()ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(Cardinal)operator(\)\)) reserved(and) + operator(()ident(dwordVal) operator(=) ident(PCardinal)operator(()ident(Copy)operator(()ident(Data)operator(,) integer(1)operator(,) ident(SizeOf)operator(()ident(Cardinal)operator(\)\)\)^\)) reserved(then) reserved(begin) + ident(Inc)operator(()ident(DataFound)operator(\);) + ident(AddValueData)operator(()ident(ValueName)operator(,) + ident(RegContext)operator(()ident(Typ)operator(,) ident(ByteAOfStr)operator(()ident(Data)operator(\)\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(else) + reserved(if) ident(sfOtherTypes) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + reserved(if) ident(FoundInStr)operator(()ident(Data)operator(\)) reserved(then) reserved(begin) + ident(Inc)operator(()ident(DataFound)operator(\);) + ident(AddValueData)operator(()ident(ValueName)operator(,) + ident(RegContext)operator(()ident(Typ)operator(,) ident(ByteAOfStr)operator(()ident(Data)operator(\)\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(begin) + ident(MaxLen) operator(:=) ident(Info)operator(.)ident(MaxValueLen) operator(+) integer(1)operator(;) comment(//Include Nullbyte) + + ident(Buffer) operator(:=) reserved(nil)operator(;) + reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) + ident(GetMem)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\);) + + ident(GetMem)operator(()ident(ValueName)operator(,) ident(MaxLen)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumValues)operator(-)integer(1) reserved(do) reserved(begin) + ident(NameLen) operator(:=) ident(MaxLen)operator(;) + ident(Len) operator(:=) ident(Info)operator(.)ident(MaxDataLen)operator(;) + reserved(if) reserved(not) ident(Success)operator(()ident(RegEnumValue)operator(()ident(Key)operator(,) ident(i)operator(,) ident(ValueName)operator(,) ident(NameLen)operator(,) reserved(nil)operator(,) operator(@)ident(Typ)operator(,) + ident(Buffer)operator(,) operator(@)ident(Len)operator(\)\)) reserved(then) + ident(Continue)operator(;) + + reserved(if) ident(sfValueNames) reserved(in) ident(SearchFor) reserved(then) + reserved(if) ident(FoundInStr)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) + ident(Inc)operator(()ident(ValuesFound)operator(\);) + ident(AddValueName)operator(()ident(ValueName)operator(,) ident(Typ)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) + ident(ScanValue)operator(()ident(ValueName)operator(,) ident(Typ)operator(,) reserved(string)operator(()ident(Copy)operator(()ident(TByteA)operator(()ident(Buffer)operator(\),) integer(0)operator(,) ident(Len)operator(\)\)\);) + reserved(end)operator(;) + + ident(FreeMem)operator(()ident(ValueName)operator(,) ident(MaxLen)operator(\);) + reserved(if) ident(sfValueData) reserved(in) ident(SearchFor) reserved(then) + ident(FreeMem)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\);) + reserved(end)operator(;) + + reserved(procedure) ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\);) + reserved(var) + ident(p)operator(:) ident(PChar)operator(;) + ident(i)operator(,) ident(z)operator(:) ident(Integer)operator(;) + ident(l)operator(,) ident(Len)operator(:) ident(DWORD)operator(;) + ident(NewKey)operator(:) ident(HKEY)operator(;) + ident(Info)operator(:) ident(TRegKeyInfo)operator(;) + reserved(begin) + reserved(if) ident(Terminated) reserved(then) ident(Exit)operator(;) + + ident(Inc)operator(()ident(KeysScanned)operator(\);) + reserved(if) ident(Progress) operator(<>) ident(fpNone) reserved(then) + reserved(if) operator(()ident(Progress) operator(=) ident(fpEach)operator(\)) reserved(or) + operator((()ident(Progress) operator(=) ident(fpEvery512th)operator(\)) reserved(and) operator((()ident(KeysScanned) reserved(and) hex($1FF)operator(\)) operator(=) integer(0)operator(\)\)) reserved(then) reserved(begin) + ident(syncStatusText) operator(:=) char operator(+) ident(IntToStr)operator(()ident(KeysScanned)operator(\)) operator(+) string operator(+) ident(CurrentPath)operator(;) + ident(Synchronize)operator(()ident(UpdateStatus)operator(\);) + reserved(end)operator(;) + + reserved(with) ident(Info) reserved(do) + reserved(if) reserved(not) ident(Success)operator(()ident(RegQueryInfoKey)operator(()ident(Key)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) + operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) operator(@)ident(MaxDataLen)operator(,) + reserved(nil)operator(,) reserved(nil)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) operator(()ident(Info)operator(.)ident(NumValues) operator(>) integer(0)operator(\)) reserved(and) ident(SearchForValues) reserved(then) + ident(ScanValues)operator(()ident(Key)operator(,) ident(Info)operator(\);) + + reserved(if) ident(Info)operator(.)ident(NumSubKeys) operator(<=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Len) operator(:=) ident(Info)operator(.)ident(MaxSubKeyLen) operator(+) integer(1)operator(;) + ident(GetMem)operator(()ident(p)operator(,) ident(Len)operator(\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumSubKeys)operator(-)integer(1) reserved(do) reserved(begin) + ident(l) operator(:=) ident(Len)operator(;) + ident(RegEnumKeyEx)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(l)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(\);) + reserved(if) ident(sfKeys) reserved(in) ident(SearchFor) reserved(then) + reserved(if) ident(FoundInStr)operator(()ident(p)operator(\)) reserved(then) reserved(begin) + ident(Inc)operator(()ident(KeysFound)operator(\);) + ident(Add)operator(()ident(CurrentPath) operator(+) char operator(+) ident(p)operator(,) ident(iconKeyMiddle)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(Key)operator(,) ident(p)operator(,) ident(NewKey)operator(\)\)) reserved(then) reserved(begin) + ident(z) operator(:=) ident(Length)operator(()ident(CurrentPath)operator(\);) + ident(CurrentPath) operator(:=) ident(CurrentPath) operator(+) char operator(+) ident(p)operator(;) + + reserved(try) + ident(ScanKey)operator(()ident(NewKey)operator(,) ident(p)operator(\);) + reserved(finally) + ident(RegCloseKey)operator(()ident(NewKey)operator(\);) + reserved(end)operator(;) + + ident(SetLength)operator(()ident(CurrentPath)operator(,) ident(z)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Terminated) reserved(then) ident(Break)operator(;) + reserved(end)operator(;) + + ident(FreeMem)operator(()ident(p)operator(,) ident(Len)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) + ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) stringoperator(;) + + reserved(try) + reserved(if) ident(sfHKU) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + ident(CurrentPath) operator(:=) stringoperator(;) + ident(ScanKey)operator(()ident(HKEY_USERS)operator(\);) + reserved(end)operator(;) + reserved(if) ident(sfHKLM) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + ident(CurrentPath) operator(:=) stringoperator(;) + ident(ScanKey)operator(()ident(HKEY_LOCAL_MACHINE)operator(\);) + reserved(end)operator(;) + reserved(if) ident(sfHKDD) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + ident(CurrentPath) operator(:=) stringoperator(;) + ident(ScanKey)operator(()ident(HKEY_DYN_DATA)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(SpecialPath) operator(<>) string reserved(then) reserved(begin) + reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(SpecialPath)operator(\)\),) + ident(PChar)operator(()ident(ExRegKey)operator(()ident(SpecialPath)operator(\)\),) ident(SpecialKey)operator(\)\)) reserved(then) reserved(begin) + ident(CurrentPath) operator(:=) ident(LWPSolve)operator(()ident(SpecialPath)operator(\);) + ident(ScanKey)operator(()ident(SpecialKey)operator(\);) + ident(RegCloseKey)operator(()ident(SpecialKey)operator(\);) + reserved(end) reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + ident(Quote)operator(()ident(SpecialPath)operator(\)\);) + reserved(end)operator(;) + reserved(except) + ident(syncStatusText) operator(:=) char operator(+) ident(IntToStr)operator(()ident(KeysScanned)operator(\)) operator(+) string operator(+) ident(CurrentPath) operator(+) + string Terminated.)delimiter(')>operator(;) + ident(Synchronize)operator(()ident(UpdateStatus)operator(\);) + ident(Sleep)operator(()integer(1000)operator(\);) + reserved(end)operator(;) + + ident(TimeElapsed) operator(:=) ident(SecondsPassed)operator(;) + ident(Free)operator(;) reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrOfSearchOptions)operator(()reserved(const) ident(Options)operator(:) ident(TSearchOptions)operator(\):) reserved(string)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\);) + reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(s)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(AddOption)operator(()reserved(const) ident(Option)operator(:) reserved(string)operator(;) reserved(const) ident(Flag)operator(:) ident(TSearchVar)operator(;) + reserved(const) ident(Optional)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) + reserved(begin) + reserved(if) ident(Flag) reserved(in) ident(Options) reserved(then) + ident(Add)operator(()ident(Option)operator(\)) + reserved(else) + reserved(if) reserved(not) ident(Optional) reserved(then) + ident(Add)operator(()char operator(+) ident(Option)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + ident(Add)operator(()charoperator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfAsHex)operator(,) ident(True)operator(\);) + ident(AddOption)operator(()stringoperator(,) ident(sfWildcards)operator(,) ident(True)operator(\);) + + ident(AddOption)operator(()charoperator(,) ident(sfIgnoreCase)operator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfUseLocales)operator(\);) + ident(AddOption)operator(()stringoperator(,) ident(sfParts)operator(\);) + + ident(AddOption)operator(()charoperator(,) ident(sfKeys)operator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfValueNames)operator(\);) + ident(AddOption)operator(()stringoperator(,) ident(sfValueData)operator(\);) + + ident(AddOption)operator(()charoperator(,) ident(sfString)operator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfDWORD)operator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfOtherTypes)operator(\);) + ident(AddOption)operator(()charoperator(,) ident(sfSpecialTypes)operator(\);) + + ident(Add)operator(()stringoperator(\);) + + reserved(if) operator([)ident(sfHKU)operator(,) ident(sfHKLM)operator(,) ident(sfHKDD)operator(]) operator(<=) ident(Options) reserved(then) + ident(Add)operator(()stringoperator(\)) + reserved(else) reserved(begin) + ident(AddOption)operator(()stringoperator(,) ident(sfHKU)operator(,) ident(True)operator(\);) + ident(AddOption)operator(()stringoperator(,) ident(sfHKLM)operator(,) ident(True)operator(\);) + ident(AddOption)operator(()stringoperator(,) ident(sfHKDD)operator(,) ident(True)operator(\);) + ident(Result) operator(:=) ident(TrimRight)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Add)operator(()charoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(Start)operator(;) +reserved(begin) + ident(Mask) operator(:=) reserved(nil)operator(;) + ident(KeysFound) operator(:=) integer(0)operator(;) + ident(ValuesFound) operator(:=) integer(0)operator(;) + ident(DataFound) operator(:=) integer(0)operator(;) + ident(KeysScanned) operator(:=) integer(0)operator(;) + + comment(//Prepare for options) + reserved(if) ident(sfAsHex) reserved(in) ident(SearchFor) reserved(then) reserved(begin) + ident(SearchText) operator(:=) reserved(string)operator(()ident(ByteAOfHex)operator(()ident(SearchText)operator(\)\);) + ident(SearchFor) operator(:=) ident(SearchFor) operator(-) operator([)ident(sfDWord)operator(,) ident(sfIgnoreCase)operator(];) + reserved(end) reserved(else) reserved(begin) + reserved(if) ident(SfUseLocales) reserved(in) ident(SearchFor) reserved(then) + ident(SearchText) operator(:=) ident(AnsiLowerCase)operator(()ident(SearchText)operator(\);) + + ident(dwordVal) operator(:=) integer(0)operator(;) + reserved(if) ident(sfDWord) reserved(in) ident(SearchFor) reserved(then) + reserved(if) ident(IsValidInteger)operator(()ident(SearchText)operator(\)) reserved(then) + ident(dwordVal) operator(:=) ident(StrToInt)operator(()ident(SearchText)operator(\)) + reserved(else) + ident(Exclude)operator(()ident(SearchFor)operator(,) ident(sfDWord)operator(\);) + + reserved(if) ident(sfWildCards) reserved(in) ident(SearchFor) reserved(then) + reserved(try) + ident(Mask) operator(:=) ident(TMask)operator(.)ident(Create)operator(()ident(SearchText)operator(\);) + reserved(except) + ident(Mask)operator(.)ident(Free)operator(;) + ident(Mask) operator(:=) reserved(nil)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(SearchForValues) operator(:=) operator(()ident(sfValueNames) reserved(in) ident(SearchFor)operator(\)) + reserved(or) operator(()ident(sfValueData) reserved(in) ident(SearchFor)operator(\);) + + ident(FindNodeText) operator(:=) string operator(+) ident(Quote)operator(()ident(FriendlyStr)operator(()ident(SearchText)operator(\)\)) operator(+) char operator(+) + ident(StrOfSearchOptions)operator(()ident(SearchFor)operator(\);) + + reserved(with) ident(ListTV)operator(.)ident(Items) reserved(do) reserved(begin) + ident(BeginUpdate)operator(;) + ident(FindNode) operator(:=) ident(AddChildObject)operator(()reserved(nil)operator(,) ident(FindNodeText) operator(+) stringoperator(,) reserved(nil)operator(\);) + ident(FindNode)operator(.)ident(Data) operator(:=) ident(Self)operator(;) + ident(SetTNImage)operator(()ident(FindNode)operator(,) ident(iconHostReg)operator(\);) + ident(EndUpdate)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(UpdateStatus)operator(;) +reserved(begin) + ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) char operator(+) ident(syncStatusText)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegFindThread)operator(.)ident(Finish)operator(;) +reserved(var) + ident(Found)operator(:) reserved(string)operator(;) +reserved(begin) + ident(ObjectsFound) operator(:=) ident(KeysFound) operator(+) ident(ValuesFound) operator(+) ident(DataFound)operator(;) + + ident(Found) operator(:=) ident(StrNumerus)operator(()ident(ObjectsFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + reserved(if) ident(ObjectsFound) operator(<) integer(2) reserved(then) + ident(Found) operator(:=) ident(Found) operator(+) string + reserved(else) reserved(begin) + ident(Found) operator(:=) ident(Found) operator(+) stringoperator(;) + reserved(if) ident(KeysFound) operator(>) integer(0) reserved(then) + ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(KeysFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + reserved(if) ident(ValuesFound) operator(>) integer(0) reserved(then) + ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(ValuesFound)operator(,) stringoperator(,) stringoperator(,) + stringoperator(\);) + reserved(if) ident(DataFound) operator(>) integer(0) reserved(then) + ident(Found) operator(:=) ident(Found) operator(+) ident(StrNumerus)operator(()ident(DataFound)operator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + + reserved(if) ident(RightStr)operator(()ident(Found)operator(,) integer(2)operator(\)) operator(=) string reserved(then) + ident(Delete)operator(()ident(Found)operator(,) ident(Length)operator(()ident(Found)operator(\)) operator(-) integer(1)operator(,) integer(2)operator(\);) + reserved(end)operator(;) + + ident(FindNode)operator(.)ident(Text) operator(:=) ident(FindNodeText) operator(+) ident(Format)operator(()stringoperator(,) + operator([)ident(TimeElapsed)operator(,) ident(Found)operator(]\);) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(FindWinU)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) + ident(ComCtrls)operator(,) ident(StdCtrls)operator(,) ident(ExtCtrls)operator(,) ident(Clipbrd)operator(,) ident(NewPanels)operator(,) ident(plutoconst)operator(,) ident(FindTH)operator(,) ident(YTools)operator(,) + ident(PrefTools)operator(,) ident(Menus)operator(,) ident(XReg)operator(,) ident(RangeEdit)operator(;) + +reserved(type) + ident(TFindWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(ListTV)operator(:) ident(TTreeView)operator(;) + ident(FindP)operator(:) ident(TPanel)operator(;) + ident(FindE)operator(:) ident(TEdit)operator(;) + ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) + ident(ResultsPopup)operator(:) ident(TPopupMenu)operator(;) + ident(Copy1)operator(:) ident(TMenuItem)operator(;) + ident(ColorPanel2)operator(:) ident(TColorPanel)operator(;) + ident(FindPrefP)operator(:) ident(TPanel)operator(;) + ident(CommonGB)operator(:) ident(TGroupBox)operator(;) + ident(Label4)operator(:) ident(TLabel)operator(;) + ident(SfWildCardsCB)operator(:) ident(TCheckBox)operator(;) + ident(SfPartsCB)operator(:) ident(TCheckBox)operator(;) + ident(SfIgnoreCaseCB)operator(:) ident(TCheckBox)operator(;) + ident(SfAsHexCB)operator(:) ident(TCheckBox)operator(;) + ident(SfAsDWord)operator(:) ident(TCheckBox)operator(;) + ident(SfUseLocalesCB)operator(:) ident(TCheckBox)operator(;) + ident(FindGB)operator(:) ident(TGroupBox)operator(;) + ident(SfHKUCB)operator(:) ident(TCheckBox)operator(;) + ident(SfHKLMCB)operator(:) ident(TCheckBox)operator(;) + ident(SfHKDDCB)operator(:) ident(TCheckBox)operator(;) + ident(SfRootKeyRB)operator(:) ident(TRadioButton)operator(;) + ident(SfCurKeyRB)operator(:) ident(TRadioButton)operator(;) + ident(SfCLSIDCB)operator(:) ident(TCheckBox)operator(;) + ident(SfInterfaceCB)operator(:) ident(TCheckBox)operator(;) + ident(SfKeysCb)operator(:) ident(TCheckBox)operator(;) + ident(SfValuesCB)operator(:) ident(TCheckBox)operator(;) + ident(SfDataCB)operator(:) ident(TCheckBox)operator(;) + ident(SfStringCB)operator(:) ident(TCheckBox)operator(;) + ident(SfOtherCB)operator(:) ident(TCheckBox)operator(;) + ident(SfDWordCB)operator(:) ident(TCheckBox)operator(;) + ident(Panel2)operator(:) ident(TPanel)operator(;) + ident(GroupBox1)operator(:) ident(TGroupBox)operator(;) + ident(Label1)operator(:) ident(TLabel)operator(;) + ident(ThreadPriorityComB)operator(:) ident(TComboBox)operator(;) + ident(ProgressRG)operator(:) ident(TRadioGroup)operator(;) + ident(Panel5)operator(:) ident(TPanel)operator(;) + ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) + ident(MoleLogoI)operator(:) ident(TImage)operator(;) + ident(TypeRangeE)operator(:) ident(TRangeEdit)operator(;) + ident(SfTypesCB)operator(:) ident(TCheckBox)operator(;) + ident(Panel1)operator(:) ident(TPanel)operator(;) + ident(TransparentCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(StayOnTopCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(FindB)operator(:) ident(TButton)operator(;) + ident(FindPrefB)operator(:) ident(TButton)operator(;) + reserved(procedure) ident(FindBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ListTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(FindEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(SfWildCardsCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StayOnTopCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SfRootKeysUpdate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FindPrefBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(CloseFindPrefP)operator(;) + reserved(procedure) ident(OpenFindPrefP)operator(;) + reserved(procedure) ident(FindEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SfDataCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ListTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SfAsHexCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Copy1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SfIgnoreCaseCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SfTypesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(end)operator(;) + +reserved(const) + ident(fpbOpen) operator(=) integer(0)operator(;) + ident(fpbCloseCaption) operator(=) stringoperator(;) + + ident(fpbClosed) operator(=) integer(1)operator(;) + ident(fpbOpenCaption) operator(=) string>)delimiter(')>operator(;) + +reserved(var) + ident(FindWin)operator(:) ident(TFindWin)operator(;) + +reserved(implementation) + +reserved(uses) ident(plutomain)operator(,) ident(PrefU)operator(,) ident(ValuesU)operator(;) + +preprocessor({$R *.DFM}) + +reserved(procedure) ident(TFindWin)operator(.)ident(FindBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(SearchFor)operator(:) ident(TSearchOptions)operator(;) + ident(FindThread)operator(:) ident(TRegFindThread)operator(;) + + reserved(procedure) ident(AddOption)operator(()ident(CheckBox)operator(:) ident(TCustomCheckBox)operator(;) ident(Flag)operator(:) ident(TSearchVar)operator(\);) + reserved(begin) + reserved(with) ident(CheckBox) reserved(as) ident(TCheckBox) reserved(do) + reserved(if) ident(Enabled) reserved(and) ident(Checked) reserved(then) + ident(Include)operator(()ident(SearchFor)operator(,) ident(Flag)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(SearchFor) operator(:=) operator([];) + + ident(AddOption)operator(()ident(SfKeysCB)operator(,) ident(sfKeys)operator(\);) + + ident(AddOption)operator(()ident(SfValuesCB)operator(,) ident(sfValueNames)operator(\);) + ident(AddOption)operator(()ident(SfDataCB)operator(,) ident(sfValueData)operator(\);) + + ident(AddOption)operator(()ident(SfStringCB)operator(,) ident(sfString)operator(\);) + ident(AddOption)operator(()ident(SfDWordCB)operator(,) ident(sfDWord)operator(\);) + ident(AddOption)operator(()ident(SfOtherCB)operator(,) ident(sfOtherTypes)operator(\);) + + reserved(if) ident(SfRootKeyRB)operator(.)ident(Checked) reserved(then) reserved(begin) + ident(AddOption)operator(()ident(SfHKUCB)operator(,) ident(sfHKU)operator(\);) + ident(AddOption)operator(()ident(SfHKLMCB)operator(,) ident(sfHKLM)operator(\);) + ident(AddOption)operator(()ident(SfHKDDCB)operator(,) ident(sfHKDD)operator(\);) + reserved(end)operator(;) + + ident(AddOption)operator(()ident(SfAsHexCB)operator(,) ident(sfAsHex)operator(\);) + ident(AddOption)operator(()ident(SfWildCardsCB)operator(,) ident(sfWildCards)operator(\);) + ident(AddOption)operator(()ident(SfPartsCB)operator(,) ident(sfParts)operator(\);) + ident(AddOption)operator(()ident(SfIgnoreCaseCB)operator(,) ident(sfIgnoreCase)operator(\);) + ident(AddOption)operator(()ident(SfUseLocalesCB)operator(,) ident(sfUseLocales)operator(\);) + + comment({AddOption(SfCLSIDCB, sfCLSID\); + AddOption(SfInterfaceCB, sfInterface\);}) + + reserved(if) ident(SfTypesCB)operator(.)ident(Checked) reserved(and) reserved(not) ident(TypeRangeE)operator(.)ident(RangeMaximal) reserved(then) + ident(Include)operator(()ident(SearchFor)operator(,) ident(sfSpecialTypes)operator(\);) + + ident(FindThread) operator(:=) ident(TRegFindThread)operator(.)ident(CreateIt)operator(() + ident(TThreadPriority)operator(()ident(ThreadPriorityComB)operator(.)ident(ItemIndex)operator(\),) ident(FindE)operator(.)ident(Text)operator(,) ident(SearchFor)operator(,) + ident(TFindThreadProgress)operator(()ident(ProgressRG)operator(.)ident(ItemIndex)operator(\)\);) + + ident(FindThread)operator(.)ident(ListTV) operator(:=) ident(ListTV)operator(;) + + reserved(if) ident(sfSpecialTypes) reserved(in) ident(SearchFor) reserved(then) + ident(FindThread)operator(.)ident(Ranges) operator(:=) ident(TypeRangeE)operator(.)ident(Value)operator(;) + + reserved(if) ident(SfCurKeyRB)operator(.)ident(Checked) reserved(then) + ident(FindThread)operator(.)ident(SpecialPath) operator(:=) + ident(LWPSolve)operator(()ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\)\)\);) + + ident(FindThread)operator(.)ident(Resume)operator(;) + ident(CloseFindPrefP)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(ListTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + + reserved(procedure) ident(TerminateFindThread)operator(;) + reserved(var) + ident(FindThread)operator(:) ident(TRegFindThread)operator(;) + reserved(begin) + reserved(if) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) + ident(FindThread) operator(:=) ident(TRegFindThread)operator(()ident(Node)operator(.)ident(Data)operator(\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(FindThread)operator(\)) reserved(then) + ident(Node)operator(.)ident(Delete) + reserved(else) + reserved(try) + ident(FindThread)operator(.)ident(Terminate)operator(;) + reserved(except) + ident(Node)operator(.)ident(Text) operator(:=) stringoperator(;) + reserved(end)operator(;) + reserved(end) reserved(else) + ident(Node)operator(.)ident(Delete)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(case) ident(Key) reserved(of) + ident(VK_F12)operator(:) reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) + ident(Node)operator(.)ident(Parent)operator(.)ident(AlphaSort)operator(;) + + ident(VK_RETURN)operator(:) ident(ListTVDblClick)operator(()ident(Sender)operator(\);) + + ident(VK_DELETE)operator(:) ident(TerminateFindThread)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FindEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) + ident(FindBClick)operator(()ident(Sender)operator(\);) + + reserved(if) ident(Key) operator(=) ident(VK_UP) reserved(then) reserved(begin) + ident(CloseFindPrefP)operator(;) + ident(Key) operator(:=) integer(0)operator(;) + reserved(end) reserved(else) reserved(if) ident(Key) operator(=) ident(VK_Down) reserved(then) reserved(begin) + ident(OpenFindPrefP)operator(;) + ident(Key) operator(:=) integer(0)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(DeActivateThis)operator(()ident(ActiveControl)operator(\);) + + ident(AlphaBlend) operator(:=) ident(TransparentCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(ActivateThis)operator(()ident(ActiveControl)operator(\);) + + ident(AlphaBlend) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(Close)operator(;) + ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfWildCardsCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SfPartsCB)operator(.)ident(Enabled) operator(:=) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) + ident(SfIgnoreCaseCB)operator(.)ident(Enabled) operator(:=) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) + ident(SfUseLocalesCB)operator(.)ident(Enabled) operator(:=) ident(SfIgnoreCaseCB)operator(.)ident(Checked) reserved(and) reserved(not) ident(SfWildcardsCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(StayOnTopCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(StayOnTopCB)operator(.)ident(Checked) reserved(then) + ident(FormStyle) operator(:=) ident(fsStayOnTop) + reserved(else) + ident(FormStyle) operator(:=) ident(fsNormal)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfRootKeysUpdate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SfRootKeyRB) reserved(do) reserved(begin) + ident(SfHKLMCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + ident(SfHKUCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + ident(SfHKDDCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FindPrefBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(case) ident(FindPrefB)operator(.)ident(Tag) reserved(of) + ident(fpbOpen)operator(:) + ident(CloseFindPrefP)operator(;) + ident(fpbClosed)operator(:) + ident(OpenFindPrefP)operator(;) + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(CloseFindPrefP)operator(;) +reserved(begin) + reserved(with) ident(FindPrefB) reserved(do) reserved(begin) + ident(Tag) operator(:=) ident(fpbClosed)operator(;) + ident(Caption) operator(:=) ident(fpbOpenCaption)operator(;) + reserved(end)operator(;) + ident(FindPrefP)operator(.)ident(Visible) operator(:=) ident(False)operator(;) + ident(ListTV)operator(.)ident(Repaint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(OpenFindPrefP)operator(;) +reserved(begin) + reserved(with) ident(FindPrefB) reserved(do) reserved(begin) + ident(Tag) operator(:=) ident(fpbOpen)operator(;) + ident(Caption) operator(:=) ident(fpbCloseCaption)operator(;) + reserved(end)operator(;) + ident(FindPrefP)operator(.)ident(Visible) operator(:=) ident(True)operator(;) + ident(ListTV)operator(.)ident(Repaint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FindEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(IsValidInteger)operator(()ident(FindE)operator(.)ident(Text)operator(\)) reserved(then) + ident(SfDWORDCB)operator(.)ident(Caption) operator(:=) string + reserved(else) + ident(SfDWORDCB)operator(.)ident(Caption) operator(:=) stringoperator(;) + + ident(SfAsHexCB)operator(.)ident(Enabled) operator(:=) operator(()ident(FindE)operator(.)ident(Text) operator(<>) stringoperator(\)) + reserved(and) reserved(not) ident(CharIn)operator(()ident(FindE)operator(.)ident(Text)operator(,) ident(AllChars) operator(-) ident(HexadecimalChars) operator(-) operator([)charoperator(]\);) + ident(SfAsDWord)operator(.)ident(Enabled) operator(:=) ident(SfAsHexCB)operator(.)ident(Enabled) reserved(and) operator(()ident(Length)operator(()ident(TrimAll)operator(()ident(FindE)operator(.)ident(Text)operator(\)\)) operator(<) integer(8)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfDataCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SfDataCB) reserved(do) reserved(begin) + ident(SfStringCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + ident(SfDWordCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + ident(SfOtherCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(ListTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(or) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(MainWin)operator(.)ident(GotoKey)operator(()ident(UntilLastChar)operator(()ident(Node)operator(.)ident(Text)operator(,) charoperator(\)\)) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfAsHexCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SfAsHexCB) reserved(do) reserved(begin) + ident(SfIgnoreCaseCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + ident(SfWildCardsCB)operator(.)ident(Enabled) operator(:=) ident(Checked)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(Copy1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(ListTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Node)operator(.)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfIgnoreCaseCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SfUseLocalesCB)operator(.)ident(Enabled) operator(:=) ident(SfIgnoreCaseCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(ImageFile)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Caption) operator(:=) string operator(+) ident(RegMoleVersion) operator(+) + stringoperator(;) + + ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) ident(FileExists)operator(()ident(ImageFile)operator(\)) reserved(then) + ident(MoleLogoI)operator(.)ident(Picture)operator(.)ident(LoadFromFile)operator(()ident(ImageFile)operator(\);) + + ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) operator(-) integer(100)operator(;) + + ident(CloseFindPrefP)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Top) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) integer(450)operator(;) + ident(Height) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) ident(Top)operator(;) + ident(Left) operator(:=) operator(()ident(Screen)operator(.)ident(WorkAreaWidth) operator(-) ident(Width)operator(\)) reserved(div) integer(2)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFindWin)operator(.)ident(SfTypesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(TypeRangeE)operator(.)ident(Enabled) operator(:=) ident(SfTypesCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(Plutoconst)operator(;) + +reserved(interface) + +reserved(uses) ident(ComCtrls)operator(,) ident(Classes)operator(,) ident(XReg)operator(,) ident(UniKey)operator(,) ident(YTools)operator(;) + +reserved(var) + ident(Started)operator(:) ident(Boolean) operator(=) ident(False)operator(;) + ident(MurphyMode)operator(:) ident(Boolean) operator(=) ident(False)operator(;) + ident(PlutoKey)operator(:) ident(TUniKey)operator(;) + +reserved(const) + ident(Version) operator(=) stringoperator(;) + ident(Overnight) operator(=) ident(True)operator(;) + ident(Codename) operator(=) stringoperator(;) + comment(//Generation.Version-Release-Beta) + comment(// GG.VVRRBB) + ident(VersionNum)operator(:) ident(Double) operator(=) float(1.600000)operator(;) + comment(//Must be Double!) + +reserved(const) + ident(iconKey) operator(=) integer(0)operator(;) + + ident(iconFirstHKEY) operator(=) integer(2)operator(;) + ident(iconHKLM) operator(=) ident(iconFirstHKEY)operator(;) + ident(iconHKU) operator(=) ident(iconFirstHKEY) operator(+) integer(2)operator(;) + + ident(iconFirstShortcut) operator(=) ident(iconFirstHKEY) operator(+) integer(4)operator(;) + ident(iconHKCC) operator(=) ident(iconFirstShortcut)operator(;) + ident(iconHKCU) operator(=) ident(iconFirstShortcut) operator(+) integer(2)operator(;) + ident(iconHKCR) operator(=) ident(iconFirstShortcut) operator(+) integer(4)operator(;) + ident(iconHKDD) operator(=) ident(iconFirstShortcut) operator(+) integer(6)operator(;) + ident(iconHKPD) operator(=) ident(iconFirstShortcut) operator(+) integer(8)operator(;) + ident(iconHKWM) operator(=) ident(iconFirstShortcut) operator(+) integer(10)operator(;) + ident(iconHKWU) operator(=) ident(iconFirstShortcut) operator(+) integer(12)operator(;) + ident(iconShortcut) operator(=) ident(iconFirstShortcut) operator(+) integer(14)operator(;) + ident(nHKeyIcons) operator(=) integer(16)operator(;) + + ident(iconFirstType) operator(=) ident(iconFirstShortcut) operator(+) ident(nHKeyIcons)operator(;) + ident(iconNone) operator(=) ident(iconFirstType) operator(+) integer(0)operator(;) + ident(iconString) operator(=) ident(iconFirstType) operator(+) integer(1)operator(;) + ident(iconExpandString) operator(=)ident(iconFirstType) operator(+) integer(2)operator(;) + ident(iconBinary) operator(=) ident(iconFirstType) operator(+) integer(3)operator(;) + ident(iconCardinal) operator(=) ident(iconFirstType) operator(+) integer(4)operator(;) + ident(iconCardBigEndian)operator(=)ident(iconFirstType) operator(+) integer(5)operator(;) + ident(iconLink) operator(=) ident(iconFirstType) operator(+) integer(6)operator(;) + ident(iconMultiString) operator(=) ident(iconFirstType) operator(+) integer(7)operator(;) + ident(iconResList) operator(=) ident(iconFirstType) operator(+) integer(8)operator(;) + ident(iconFullResDesc) operator(=) ident(iconFirstType) operator(+) integer(9)operator(;) + ident(iconResReqList) operator(=) ident(iconFirstType) operator(+) integer(10)operator(;) + ident(iconUnknownType) operator(=) ident(iconFirstType) operator(+) integer(11)operator(;) + ident(nTypeIcons) operator(=) integer(12)operator(;) + + ident(iconFirstValue) operator(=) ident(iconFirstType) operator(+) ident(nTypeIcons)operator(;) + ident(iconValueElse) operator(=) ident(iconFirstValue)operator(;) + ident(iconValueEdit) operator(=) ident(iconFirstValue) operator(+) integer(1)operator(;) + ident(iconValueEditBinary) operator(=) ident(iconFirstValue) operator(+) integer(2)operator(;) + ident(iconValueZeromize) operator(=) ident(iconFirstValue) operator(+) integer(3)operator(;) + ident(iconValueDublicate) operator(=) ident(iconFirstValue) operator(+) integer(4)operator(;) + ident(iconMainValue) operator(=) ident(iconFirstValue) operator(+) integer(5)operator(;) + ident(iconTakeAsMainValue) operator(=) ident(iconFirstValue) operator(+) integer(6)operator(;) + ident(nValueIcons) operator(=) integer(7)operator(;) + + ident(iconFirstKey) operator(=) ident(iconFirstValue) operator(+) ident(nValueIcons)operator(;) + ident(iconKeyInfos) operator(=) ident(iconFirstKey)operator(;) + ident(iconSubKey) operator(=) ident(iconFirstKey) operator(+) integer(1)operator(;) + ident(iconKeyDublicate) operator(=) ident(iconFirstKey) operator(+) integer(2)operator(;) + ident(iconKeyFind) operator(=) ident(iconFirstKey) operator(+) integer(3)operator(;) + ident(iconKeyTrace) operator(=) ident(iconFirstKey) operator(+) integer(4)operator(;) + ident(nKeyIcons) operator(=) integer(5)operator(;) + + ident(iconFirstContextMenues) operator(=) ident(iconFirstKey) operator(+) ident(nKeyIcons)operator(;) + ident(iconRename) operator(=) ident(iconFirstContextMenues)operator(;) + ident(iconDelete) operator(=) ident(iconFirstContextMenues) operator(+) integer(1)operator(;) + ident(nContextMenuesIcon) operator(=) integer(2)operator(;) + + ident(iconFirstIni) operator(=) ident(iconFirstContextMenues) operator(+) ident(nContextMenuesIcon)operator(;) + ident(iconIniSection) operator(=) ident(iconFirstIni)operator(;) + ident(nIniIcons) operator(=) integer(1)operator(;) + + ident(iconFirstHost) operator(=) ident(iconFirstIni) operator(+) ident(nIniIcons)operator(;) + ident(iconHostReg) operator(=) ident(iconFirstHost)operator(;) + ident(iconHostIni) operator(=) ident(iconFirstHost) operator(+) integer(1)operator(;) + ident(iconHostUni) operator(=) ident(iconFirstHost) operator(+) integer(2)operator(;) + ident(iconHostUni2) operator(=) ident(iconFirstHost) operator(+) integer(3)operator(;) + ident(nHostIcons) operator(=) integer(4)operator(;) + + ident(iconFirstOther) operator(=) ident(iconFirstHost) operator(+) ident(nHostIcons)operator(;) + + ident(iconSortArrowAsc) operator(=) ident(iconFirstOther) operator(+) integer(0)operator(;) + ident(iconSortArrowDesc) operator(=) ident(iconFirstOther) operator(+) integer(1)operator(;) + ident(iconKeyMiddle) operator(=) ident(iconFirstOther) operator(+) integer(2)operator(;) + ident(iconLock) operator(=) ident(iconFirstOther) operator(+) integer(3)operator(;) + + comment(//iconDefect = iconFirstOther;) + + comment({ WorkWin.ChangeImages }) + ident(iconFirstChange) operator(=) integer(0)operator(;) + ident(iconCKeyPlus) operator(=) ident(iconFirstChange)operator(;) + ident(iconCKeyMinus) operator(=) ident(iconFirstChange) operator(+) integer(1)operator(;) + ident(iconCValuePlus) operator(=) ident(iconFirstChange) operator(+) integer(2)operator(;) + ident(iconCValueMinus) operator(=) ident(iconFirstChange) operator(+) integer(3)operator(;) + ident(iconCContext) operator(=) ident(iconFirstChange) operator(+) integer(4)operator(;) + ident(iconOldContext) operator(=) ident(iconFirstChange) operator(+) integer(5)operator(;) + ident(iconNewContext) operator(=) ident(iconFirstChange) operator(+) integer(6)operator(;) + ident(iconGroup) operator(=) ident(iconFirstChange) operator(+) integer(7)operator(;) + ident(iconGroupBlinking) operator(=) ident(iconFirstChange) operator(+) integer(8)operator(;) + ident(nChangeIcons) operator(=) integer(7)operator(;) + + ident(DefaultValueFlag) operator(=) ident(Pointer)operator(()integer(1)operator(\);) + ident(MultiEditFlag) operator(=) ident(Pointer)operator(()integer(2)operator(\);) + + ident(NoValueCaption) operator(=) stringoperator(;) + + ident(EditControlFlag) operator(=) integer(100)operator(;) + + ident(MaxPreviewLen) operator(=) integer(255)operator(;) + ident(RegMaxDataSize) operator(=) hex($FFFF)operator(;) comment(//64 KB) + +reserved(const) + ident(BoolStrFileName) operator(=) stringoperator(;) + ident(ShortcutsFileName) operator(=) stringoperator(;) + ident(StandardShortcutsFileName) operator(=) stringoperator(;) + ident(SisyFilterFileName) operator(=) stringoperator(;) + + ident(clDarkGray) operator(=) hex($00404040)operator(;) + ident(clBrightRed) operator(=) hex($00BBBBFF)operator(;) + ident(clVeryBrightRed) operator(=) hex($00DDDDFF)operator(;) + ident(clBrightBlue) operator(=) hex($00FFBBBB)operator(;) + ident(clBrightGreen) operator(=) hex($00BBFFBB)operator(;) + ident(clCyan) operator(=) hex($00FFFF44)operator(;) + ident(clBrightCyan) operator(=) hex($00FFFFBB)operator(;) + ident(clVeryBrightCyan) operator(=) hex($00FFFFDD)operator(;) + ident(clBrightYellow) operator(=) hex($00BBFFFF)operator(;) + ident(clVeryBrightYellow) operator(=) hex($00DDFFFF)operator(;) + ident(clBrightPurple) operator(=) hex($00FFBBFF)operator(;) + ident(clBrightSilver) operator(=) hex($00DDDDDD)operator(;) + ident(clGold) operator(=) hex($0055CCEE)operator(;) + + ident(clVeryBrightBlue) operator(=) hex($00FFDDDD)operator(;) + +reserved(type) + ident(TValueListColumn) operator(=) operator(()ident(vlcName)operator(,) ident(vlcSize)operator(,) ident(vlcType)operator(,) ident(vlcData)operator(\);) + +reserved(const) + ident(ValueListColumnRange) operator(=) operator([)ident(Low)operator(()ident(TValueListColumn)operator(\)..)ident(High)operator(()ident(TValueListColumn)operator(\)];) + +reserved(type) + ident(TSearchVar) operator(=) operator(()ident(sfKeys)operator(,) ident(sfValueNames)operator(,) ident(sfValueData)operator(,) + ident(sfAsHex)operator(,) ident(sfAsDWord)operator(,) + ident(sfWildCards)operator(,) ident(sfParts)operator(,) ident(sfIgnoreCase)operator(,) ident(SfUseLocales)operator(,) + ident(sfHKU)operator(,) ident(sfHKLM)operator(,) ident(sfHKDD)operator(,//) ident(sfCLSID)operator(,) ident(sfInterface)operator(,) + ident(sfString)operator(,) ident(sfDWord)operator(,) ident(sfOtherTypes)operator(,) ident(sfSpecialTypes)operator(\);) + + ident(TSearchOptions) operator(=) reserved(set) reserved(of) ident(TSearchVar)operator(;) + + comment(//be carefull: used in with!) + ident(TKeyShortcut) operator(=) reserved(record) + ident(Alias)operator(:) reserved(string)operator(;) + ident(RealPath)operator(:) reserved(string)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(end)operator(;) + ident(PKeyShortcut) operator(=) operator(^)ident(TKeyShortcut)operator(;) + ident(TShortcutA) operator(=) reserved(array) reserved(of) ident(TKeyShortcut)operator(;) + + ident(TOpenNode) operator(=) reserved(function) operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) + ident(TCheckNode) operator(=) reserved(procedure) operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(\);) + + comment(//NodeInfo System) + ident(TNodeFlag) operator(=) operator(()ident(nfDefect)operator(,) ident(nfReadOnly)operator(,) ident(nfChecked)operator(,) + ident(nfCopy)operator(,) ident(nfCut)operator(,) ident(nfPaste)operator(\);) + ident(TNodeFlags) operator(=) reserved(set) reserved(of) ident(TNodeFlag)operator(;) + + ident(TUniHostType) operator(=) operator(()ident(uhNone)operator(,) + ident(uhReg)operator(,) ident(uhIni)operator(,) ident(uhRegFile)operator(,) + ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(,) ident(uhSystemShortcut)operator(\);) + ident(TUniHostTypes) operator(=) reserved(set) reserved(of) ident(TUniHostType)operator(;) + +reserved(const) + ident(uhShortcuts) operator(=) operator([)ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(,) ident(uhSystemShortcut)operator(];) + ident(uhNonSystemShortcuts) operator(=) operator([)ident(uhUserShortcut)operator(,) ident(uhStandardShortcut)operator(];) + + ident(NodeFlagStrings)operator(:) reserved(array)operator([)ident(TNodeFlag)operator(]) reserved(of) reserved(string) operator(=) operator(() + stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(\);) + + ident(HostTypeStrings)operator(:) reserved(array)operator([)ident(TUniHostType)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(\);) + +reserved(type) + ident(TNodeInfo) operator(=) reserved(packed) reserved(class) + directive(public) + ident(HostType)operator(:) ident(TUniHostType)operator(;) + ident(Flags)operator(:) ident(TNodeFlags)operator(;) + reserved(constructor) ident(Create)operator(()ident(HostType)operator(:) ident(TUniHostType) operator(=) ident(uhNone)operator(;) ident(Flags)operator(:) ident(TNodeFlags) operator(=) operator([]\);) + + reserved(procedure) ident(IncludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\);) + reserved(procedure) ident(ExcludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\);) + + reserved(function) ident(IsHost)operator(:) ident(Boolean)operator(;) + reserved(function) ident(IsShortcut)operator(:) ident(Boolean)operator(;) + + reserved(function) ident(ReadOnly)operator(:) ident(Boolean)operator(;) + reserved(function) ident(Checked)operator(:) ident(Boolean)operator(;) + reserved(function) ident(Defect)operator(:) ident(Boolean)operator(;) + reserved(end)operator(;) + +reserved(function) ident(NodeInfo)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(TNodeInfo)operator(;) +reserved(procedure) ident(ReportStatus)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\);) + +reserved(const) + ident(PlatformStrings)operator(:) reserved(array)operator([)integer(0)operator(..)integer(2)operator(]) reserved(of) reserved(string) operator(=) + operator(()stringoperator(,) stringoperator(,) stringoperator(\);) + +reserved(var) + ident(PlutoDir)operator(:) reserved(string) operator(=) stringoperator(;) + +reserved(implementation) + +reserved(uses) ident(SysUtils)operator(;) + +reserved(function) ident(NodeInfo)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(TNodeInfo)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) reserved(nil)operator(;) + ident(Exit) reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(.)ident(Data)operator(\)) reserved(then) + ident(Node)operator(.)ident(Data) operator(:=) ident(TNodeInfo)operator(.)ident(Create)operator(;) + ident(Result) operator(:=) ident(TNodeInfo)operator(()ident(Node)operator(.)ident(Data)operator(\);) +reserved(end)operator(;) + +comment({ TNodeInfo }) + +reserved(constructor) ident(TNodeInfo)operator(.)ident(Create)operator(()ident(HostType)operator(:) ident(TUniHostType)operator(;) ident(Flags)operator(:) ident(TNodeFlags)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(;) + ident(Self)operator(.)ident(HostType) operator(:=) ident(HostType)operator(;) + ident(Self)operator(.)ident(Flags) operator(:=) ident(Flags)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TNodeInfo)operator(.)ident(Checked)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(nfChecked) reserved(in) ident(Flags)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TNodeInfo)operator(.)ident(ReadOnly)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(nfReadOnly) reserved(in) ident(Flags)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TNodeInfo)operator(.)ident(Defect)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(nfDefect) reserved(in) ident(Flags)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TNodeInfo)operator(.)ident(IncludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\);) +reserved(begin) + ident(Include)operator(()ident(Flags)operator(,) ident(Flag)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TNodeInfo)operator(.)ident(ExcludeFlag)operator(()ident(Flag)operator(:) ident(TNodeFlag)operator(\);) +reserved(begin) + ident(Exclude)operator(()ident(Flags)operator(,) ident(Flag)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TNodeInfo)operator(.)ident(IsHost)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(HostType) operator(<>) ident(uhNone)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TNodeInfo)operator(.)ident(IsShortcut)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(HostType) reserved(in) ident(uhShortcuts)operator(;) +reserved(end)operator(;) + +reserved(function) ident(GetPlutoDir)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(LWPSlash)operator(()ident(GetParam)operator(()stringoperator(,) ident(MyDir)operator(\)\);) + reserved(if) reserved(not) ident(DirectoryExists)operator(()ident(Result)operator(\)) reserved(then) reserved(begin) + ident(ReportStatus)operator(()string operator(+) ident(Result) operator(+) string setting to default (MyDir\).)delimiter(')>operator(\);) + ident(Result) operator(:=) ident(MyDir)operator(;) + reserved(end)operator(;) + ident(ReportStatus)operator(()string operator(+) ident(Result)operator(\);) +reserved(end)operator(;) + +reserved(var) + ident(ReportSL)operator(:) ident(TStringList)operator(;) + ident(ReportFileName)operator(:) reserved(string)operator(;) + +reserved(procedure) ident(ReportStatus)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(ReportSL)operator(.)ident(Add)operator(()ident(s)operator(\);) + reserved(try) + ident(ReportSL)operator(.)ident(SaveToFile)operator(()ident(ReportFileName)operator(\);) + reserved(except) reserved(end)operator(;) +reserved(end)operator(;) + +reserved(initialization) + ident(ReportFileName) operator(:=) ident(MyDir) operator(+) stringoperator(;) + ident(ReportSL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(PlutoDir) operator(:=) ident(GetPlutoDir)operator(;) + +reserved(end)operator(.) +comment(//winampviscolor :) +reserved(unit) ident(plutomain)operator(;) +preprocessor({$DEFINE UNIKEY}) +preprocessor({$DEFINE CYCFS}) + +comment({=============================================================================== + + cYcnus.Pluto 1.57 Beta 14 + by Murphy + + ©2000-2003 by cYcnus + visit www.cYcnus.de + + murphy@cYcnus.de (Kornelius Kalnbach\) + + this programm is published under the terms of the GPL + +===============================================================================}) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) + ident(StdCtrls)operator(,) ident(ImgList)operator(,) ident(ComCtrls)operator(,) ident(ExtCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(IniFiles)operator(,) + ident(ShellAPI)operator(,) ident(Grids)operator(,) + comment(//Components) + ident(NewPanels)operator(,) + comment(//Units) + ident(YTools)operator(,) ident(YTypes)operator(,) ident(UniKey)operator(,) ident(XReg)operator(,) + comment(//Pluto) + ident(Plutoconst)operator(,) + ident(SpyTH)operator(,) ident(SisyphusTH)operator(;) + +reserved(const) + ident(NoPreBlinkHint) operator(=) char(#1)operator(;) + +reserved(type) + ident(TMainWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(StatusBar)operator(:) ident(TStatusBar)operator(;) + ident(StatusBarPU)operator(:) ident(TPopupMenu)operator(;) + ident(CopyPath)operator(:) ident(TMenuItem)operator(;) + ident(InsertPath)operator(:) ident(TMenuItem)operator(;) + ident(ShowRealPathMI)operator(:) ident(TMenuItem)operator(;) + ident(PathP)operator(:) ident(TPanel)operator(;) + ident(N1)operator(:) ident(TMenuItem)operator(;) + ident(MainMenu1)operator(:) ident(TMainMenu)operator(;) + ident(Desktop1)operator(:) ident(TMenuItem)operator(;) + ident(Pluto1)operator(:) ident(TMenuItem)operator(;) + ident(RegEdit1)operator(:) ident(TMenuItem)operator(;) + ident(Free1)operator(:) ident(TMenuItem)operator(;) + ident(BigVal1)operator(:) ident(TMenuItem)operator(;) + ident(Hilfe1)operator(:) ident(TMenuItem)operator(;) + ident(History1)operator(:) ident(TMenuItem)operator(;) + ident(SplashScreen1)operator(:) ident(TMenuItem)operator(;) + ident(wwwcYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(Credits1)operator(:) ident(TMenuItem)operator(;) + ident(Optionen1)operator(:) ident(TMenuItem)operator(;) + ident(PrefMI)operator(:) ident(TMenuItem)operator(;) + ident(EditBoolStrMI)operator(:) ident(TMenuItem)operator(;) + ident(N4)operator(:) ident(TMenuItem)operator(;) + ident(ImageList1)operator(:) ident(TImageList)operator(;) + ident(Plutoini1)operator(:) ident(TMenuItem)operator(;) + ident(About1)operator(:) ident(TMenuItem)operator(;) + ident(kornycYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(ools1)operator(:) ident(TMenuItem)operator(;) + ident(NotePad1)operator(:) ident(TMenuItem)operator(;) + ident(RegEdit2)operator(:) ident(TMenuItem)operator(;) + ident(SysEdit1)operator(:) ident(TMenuItem)operator(;) + ident(WordPad1)operator(:) ident(TMenuItem)operator(;) + ident(N3)operator(:) ident(TMenuItem)operator(;) + ident(N5)operator(:) ident(TMenuItem)operator(;) + ident(Suchen1)operator(:) ident(TMenuItem)operator(;) + ident(Find1)operator(:) ident(TMenuItem)operator(;) + ident(File1)operator(:) ident(TMenuItem)operator(;) + ident(ExitPluto1)operator(:) ident(TMenuItem)operator(;) + ident(OpenProgramFolder1)operator(:) ident(TMenuItem)operator(;) + ident(N6)operator(:) ident(TMenuItem)operator(;) + ident(OpenWinDir1)operator(:) ident(TMenuItem)operator(;) + ident(HintBlinkT)operator(:) ident(TTimer)operator(;) + ident(FindCLSID1)operator(:) ident(TMenuItem)operator(;) + ident(Clipboard1)operator(:) ident(TMenuItem)operator(;) + ident(GotoCLSID1)operator(:) ident(TMenuItem)operator(;) + ident(CommandLineParameters1)operator(:) ident(TMenuItem)operator(;) + ident(plutocYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(N7)operator(:) ident(TMenuItem)operator(;) + ident(heinzcYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(kornycYcnusde2)operator(:) ident(TMenuItem)operator(;) + ident(N8)operator(:) ident(TMenuItem)operator(;) + ident(ExternalHexEditMI)operator(:) ident(TMenuItem)operator(;) + ident(Cleanup1)operator(:) ident(TMenuItem)operator(;) + ident(DeleteTempFolder1)operator(:) ident(TMenuItem)operator(;) + ident(Debug1)operator(:) ident(TMenuItem)operator(;) + ident(CurrentDir1)operator(:) ident(TMenuItem)operator(;) + ident(RepairPluto155bBug1)operator(:) ident(TMenuItem)operator(;) + ident(BackupRegistryscanreg1)operator(:) ident(TMenuItem)operator(;) + ident(Username1)operator(:) ident(TMenuItem)operator(;) + ident(SupportMI)operator(:) ident(TMenuItem)operator(;) + ident(MurphyMI)operator(:) ident(TMenuItem)operator(;) + ident(ToDoMI)operator(:) ident(TMenuItem)operator(;) + ident(Beta1)operator(:) ident(TMenuItem)operator(;) + ident(UniKeycYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(YToolscYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(YPanelscYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(Usedenginescomponents1)operator(:) ident(TMenuItem)operator(;) + ident(PrefToolscYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(BugReportsRequests1)operator(:) ident(TMenuItem)operator(;) + ident(murphycYcnusde1)operator(:) ident(TMenuItem)operator(;) + ident(Credits2)operator(:) ident(TMenuItem)operator(;) + ident(News1)operator(:) ident(TMenuItem)operator(;) + ident(cYcnus1)operator(:) ident(TMenuItem)operator(;) + ident(Contact1)operator(:) ident(TMenuItem)operator(;) + ident(N2)operator(:) ident(TMenuItem)operator(;) + ident(IjustwantCONTACT1)operator(:) ident(TMenuItem)operator(;) + ident(N9)operator(:) ident(TMenuItem)operator(;) + ident(AnotherPluto1)operator(:) ident(TMenuItem)operator(;) + ident(UniKeyDemoMI)operator(:) ident(TMenuItem)operator(;) + ident(Path1)operator(:) ident(TMenuItem)operator(;) + ident(RegisterPlugIns1)operator(:) ident(TMenuItem)operator(;) + ident(UniPluginOD)operator(:) ident(TOpenDialog)operator(;) + ident(SwapLM_CUB)operator(:) ident(TButton)operator(;) + ident(PathE)operator(:) ident(TEdit)operator(;) + ident(ShowLoadreport1)operator(:) ident(TMenuItem)operator(;) + ident(KillPluto1)operator(:) ident(TMenuItem)operator(;) + ident(ShowPlatform1)operator(:) ident(TMenuItem)operator(;) + ident(MSConfig1)operator(:) ident(TMenuItem)operator(;) + ident(TimetoRelaxMI)operator(:) ident(TMenuItem)operator(;) + ident(N10)operator(:) ident(TMenuItem)operator(;) + + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) + reserved(procedure) ident(InsertPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(StatusBarResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StatusBarDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StatusBarUpdate)operator(;) + reserved(procedure) ident(CopyPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(SetStatus)operator(;) + reserved(procedure) ident(GotoKey)operator(()ident(Key)operator(:) reserved(string)operator(\);) + reserved(procedure) ident(FindCLSID)operator(;) + reserved(procedure) ident(GotoCLSID)operator(;) + reserved(procedure) ident(UserGotoKey)operator(;) + reserved(procedure) ident(ShowRealPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(PathEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(PathEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(PathEExit)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(AppActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(PathEKeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Pluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Free1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BigVal1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SplashScreen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HistoryClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Credits1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(function) ident(Greeting)operator(()ident(Name)operator(:) reserved(string) operator(=) ident(NoPreBlinkHint)operator(\):) reserved(string)operator(;) + reserved(procedure) ident(PrefMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(EditBoolStrMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormCloseQuery)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(CanClose)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(SisyTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OnSisyChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) + reserved(procedure) ident(OnSisyValuePlus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) + reserved(procedure) ident(OnSisyValueMinus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) + reserved(procedure) ident(OnSisyContextChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) + + reserved(procedure) ident(Plutoini1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegEdit2Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SysEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NotePad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(WordPad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OpenWinDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OpenProgramFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ExitPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Find1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormPaint)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(Load)operator(;) + reserved(procedure) ident(StatusBarDrawPanel)operator(()ident(StatusBar)operator(:) ident(TStatusBar)operator(;) + ident(Panel)operator(:) ident(TStatusPanel)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(\);) + reserved(procedure) ident(PathEKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\);) + reserved(procedure) ident(HintBlinkTTimer)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FindCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(GotoCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CommandLineParameters1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(WebLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DeleteTempFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CurrentDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RepairPluto155bBug1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BackupRegistryscanreg1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyStarted)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StopHintBlinking)operator(;) + reserved(procedure) ident(Username1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SupportMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ToDoMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MailLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(IjustwantCONTACT1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ExternalHexEditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(AnotherPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Path1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegisterPlugIns1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SwapLM_CUBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowLoadreport1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(KillPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowPlatform1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MSConfig1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(TimetoRelaxMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + directive(private) + ident(DoAutoComplete)operator(:) ident(Boolean)operator(;) + ident(MainWinLoaded)operator(:) ident(Boolean)operator(;) + ident(DontSavePrefs)operator(:) ident(Boolean)operator(;) + ident(PreBlinkHint)operator(:) reserved(string)operator(;) + reserved(end)operator(;) + +reserved(var) + ident(MainWin)operator(:) ident(TMainWin)operator(;) + + ident(StatusBar)operator(:) ident(TStatusBar)operator(;) + ident(MainReg)operator(:) ident(TXRegistry)operator(;) + + ident(SpyThread)operator(:) ident(TRegSpyThread)operator(;) + ident(Sisys)operator(:) ident(TList)operator(;) + +reserved(function) ident(TempDir)operator(:) reserved(string)operator(;) +reserved(function) ident(PlutoUniPath)operator(:) reserved(string)operator(;) +reserved(function) ident(PlutoIniFileName)operator(:) reserved(string)operator(;) + +reserved(function) ident(PathOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) reserved(string)operator(;) +reserved(function) ident(CurKey)operator(()ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) operator([]\):) ident(TRegPath)operator(;) + +reserved(procedure) ident(ArrangePlutoStyle)operator(;) +reserved(procedure) ident(ArrangeRegEdStyle)operator(;) +reserved(procedure) ident(ArrangeFreeStyle)operator(;) +reserved(procedure) ident(ArrangeBigValStyle)operator(;) + +reserved(procedure) ident(ActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(procedure) ident(DeActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + +reserved(procedure) ident(SwapFonts)operator(()ident(Sender)operator(:) ident(TWinControl)operator(\);) + +reserved(procedure) ident(AddHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(;) ident(Blinking)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) +reserved(procedure) ident(AddToLastHint)operator(()ident(Appendix)operator(:) reserved(string)operator(\);) +reserved(procedure) ident(ChangeLastHint)operator(()ident(NewHint)operator(:) reserved(string)operator(\);) + +reserved(implementation) + +reserved(uses) + comment(//Forms) + ident(FindWinU)operator(,) ident(valuesU)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(splash)operator(,) ident(PrefU)operator(,) + comment(//Units) + ident(Clock)operator(,) ident(Start)operator(,) ident(keybrd)operator(,) ident(CompEx)operator(,) ident(Colors)operator(,) ident(FindAllThread)operator(,) + ident(PrefTools)operator(;) + +preprocessor({$R *.DFM}) + +reserved(var) + ident(SavedPlutoIniFileName)operator(:) reserved(string) operator(=) stringoperator(;) + +reserved(procedure) ident(AddHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(;) ident(Blinking)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(WorkWin)operator(\)) reserved(then) + ident(WorkWin)operator(.)ident(AddAHint)operator(()ident(Hint)operator(\);) + + reserved(with) ident(MainWin) reserved(do) reserved(begin) + ident(StopHintBlinking)operator(;) + + reserved(if) ident(Blinking) reserved(then) reserved(begin) + ident(HintBlinkT)operator(.)ident(Enabled) operator(:=) ident(True)operator(;) + reserved(if) ident(PreBlinkHint) operator(=) ident(NoPreBlinkHint) reserved(then) + ident(PreBlinkHint) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text)operator(;) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text) operator(:=) ident(WorkWin)operator(.)ident(LastHint)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(AddToLastHint)operator(()ident(Appendix)operator(:) reserved(string)operator(\);) +reserved(begin) + reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(if) ident(Count) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(+) ident(Appendix)operator(;) + reserved(end)operator(;) + ident(Application)operator(.)ident(ProcessMessages)operator(;) +comment(// Sleep(1000\);) +reserved(end)operator(;) + +reserved(procedure) ident(ChangeLastHint)operator(()ident(NewHint)operator(:) reserved(string)operator(\);) +reserved(begin) + reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(if) ident(Count) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(NewHint)operator(;) + reserved(end)operator(;) + ident(Application)operator(.)ident(ProcessMessages)operator(;) +comment(// Sleep(1000\);) +reserved(end)operator(;) + +reserved(function) ident(CurKey)operator(()ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) operator([]\):) ident(TRegPath)operator(;) +reserved(var) + ident(s)operator(:) reserved(string)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) reserved(begin) + ident(s) operator(:=) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\);) + reserved(if) ident(AllowedShortcutTypes) operator(<>) operator([]) reserved(then) + ident(s) operator(:=) ident(TraceKey)operator(()ident(s)operator(,) ident(AllowedShortcutTypes)operator(\);) + ident(Result)operator(.)ident(Root) operator(:=) ident(ExRegRoot)operator(()ident(s)operator(\);) + ident(Result)operator(.)ident(Key) operator(:=) ident(ExRegKey)operator(()ident(s)operator(\);) + + ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) + ident(Result)operator(.)ident(Value) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\);) + ident(Result)operator(.)ident(ValueSet) operator(:=) ident(Assigned)operator(()ident(Item)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PathOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) + ident(Result) operator(:=) ident(LWPSlash)operator(()ident(PathOfNode)operator(()ident(Node)operator(.)ident(Parent)operator(\)\)) operator(+) ident(Node)operator(.)ident(Text) + reserved(else) + ident(Result) operator(:=) ident(Node)operator(.)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(AppActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(ActForm)operator(:) ident(TCustomForm)operator(;) + + reserved(procedure) ident(TryShow)operator(()ident(Win)operator(:) ident(TCustomForm)operator(\);) + reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Win)operator(\)) reserved(and) ident(Win)operator(.)ident(Visible) reserved(then) + ident(Win)operator(.)ident(Show)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(ActForm) operator(:=) ident(Screen)operator(.)ident(ActiveCustomForm)operator(;) comment(//LastActiveForm;) + ident(TryShow)operator(()ident(ValuesWin)operator(\);) + ident(TryShow)operator(()ident(WorkWin)operator(\);) + ident(TryShow)operator(()ident(TreeWin)operator(\);) + ident(TryShow)operator(()ident(FindWin)operator(\);) + ident(TryShow)operator(()ident(SplashWin)operator(\);) + ident(TryShow)operator(()ident(MainWin)operator(\);) + ident(TryShow)operator(()ident(ActForm)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(InitHKEYString)operator(()reserved(var) ident(H)operator(:) ident(THKEYString)operator(;) reserved(const) ident(Long)operator(,) ident(Short)operator(:) reserved(string)operator(;) + ident(Handle)operator(:) ident(Integer) operator(=) integer(0)operator(;) ident(IsDefault)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) + reserved(begin) + ident(H)operator(.)ident(Long) operator(:=) ident(Long)operator(;) + ident(H)operator(.)ident(Short) operator(:=) ident(Short)operator(;) + ident(H)operator(.)ident(Handle) operator(:=) ident(Handle)operator(;) + ident(H)operator(.)ident(IsDefault) operator(:=) ident(IsDefault)operator(;) + reserved(end)operator(;) + +reserved(begin) +preprocessor({$IFDEF UNIKEY}) +preprocessor({$IFDEF CYCFS}) + ident(RegisterUniClass)operator(()stringoperator(\);) +preprocessor({$ENDIF}) +preprocessor({$ENDIF}) + + ident(Application)operator(.)ident(OnActivate) operator(:=) ident(AppActivate)operator(;) + ident(PlutoMain)operator(.)ident(StatusBar) operator(:=) ident(StatusBar)operator(;) + + comment(//Creating) + ident(MainReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + + comment(//Initialize) + ident(Caption) operator(:=) string operator(+) ident(Version)operator(;) + ident(PreBlinkHint) operator(:=) ident(NoPreBlinkHint)operator(;) + + ident(SetLength)operator(()ident(HKEYStrings)operator(,) ident(Length)operator(()ident(HKEYStrings)operator(\)) operator(+) integer(2)operator(\);) + ident(InitHKEYString)operator(()ident(HKEYStrings)operator([)ident(LastDefaultHKEYString) operator(+) integer(1)operator(],) + stringoperator(,) stringoperator(\);) + + ident(InitHKEYString)operator(()ident(HKEYStrings)operator([)ident(LastDefaultHKEYString) operator(+) integer(2)operator(],) + stringoperator(,) stringoperator(\);) + + ident(Application)operator(.)ident(HintHidePause) operator(:=) operator(-)integer(1)operator(;) comment(//that's approximately 136 years :D) + + ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Width) operator(:=) ident(Screen)operator(.)ident(Width) reserved(div) integer(6)operator(;) + + ident(MurphyMI)operator(.)ident(Visible) operator(:=) ident(MurphyMode)operator(;) + +preprocessor({$IFDEF UNIKEY}) + ident(UniPluginOD)operator(.)ident(InitialDir) operator(:=) ident(MyDir)operator(;) +preprocessor({$ELSE}) + ident(UniKeyDemoMI)operator(.)ident(Visible) operator(:=) ident(False)operator(;) +preprocessor({$ENDIF}) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(GotoKey)operator(()ident(Key)operator(:) reserved(string)operator(\);) +reserved(var) + ident(Full)operator(:) ident(TregPath)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(keySA)operator(:) ident(TStrA)operator(;) + ident(i)operator(:) ident(integer)operator(;) + + reserved(function) ident(NodeOfRoot)operator(()ident(Root)operator(:) reserved(string)operator(\):) ident(TTreeNode)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(Result) operator(:=) reserved(nil)operator(;) + ident(Root) operator(:=) ident(LongHKEY)operator(()ident(Root)operator(\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(RootNodes)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(SameText)operator(()ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(]\).)ident(Text)operator(,) ident(Root)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(]\);) + ident(Break)operator(;) reserved(end)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) + reserved(if) ident(SameText)operator(()ident(Shortcuts)operator([)ident(i)operator(].)ident(Alias)operator(,) ident(Full)operator(.)ident(Root)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Shortcuts)operator([)ident(i)operator(].)ident(Node)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(keySA) operator(:=) reserved(nil)operator(;) + + comment(//Get FullPath of the Key) + ident(Key) operator(:=) ident(TrimLeft)operator(()ident(Key)operator(\);) + reserved(if) ident(TextAtPos)operator(()ident(Key)operator(,) integer(1)operator(,) stringoperator(\)) reserved(then) + ident(Key) operator(:=) ident(TrimLeft)operator(()ident(FromChar)operator(()ident(Key)operator(,) charoperator(\)\);) + ident(Key) operator(:=) ident(UnQuote)operator(()ident(Key)operator(\);) + + ident(Full) operator(:=) ident(RegPathOfStr)operator(()ident(Key)operator(\);) + reserved(if) ident(Trim)operator(()ident(Full)operator(.)ident(Root)operator(\)) operator(=) string reserved(then) reserved(begin) + ident(AddHint)operator(()stringoperator(,) ident(True)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + comment(//Get Root Node) + ident(Node) operator(:=) ident(NodeOfRoot)operator(()ident(Full)operator(.)ident(Root)operator(\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) + ident(AddHint)operator(()string operator(+) ident(EOL) operator(+) ident(Key)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + comment(//Create an array of all SubKeys) + ident(keySA) operator(:=) ident(Split)operator(()ident(Full)operator(.)ident(Key)operator(,) charoperator(\);) + + comment(//Avoid SmartExpand) + ident(TreeWin)operator(.)ident(DoSmartExpand) operator(:=) ident(False)operator(;) reserved(begin) + + comment(//Open all SubKeys) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(keySA)operator(\)) reserved(do) reserved(begin) + comment(//Open the Node if neccessary) + reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + comment(//TreeWin.RegTVChange(Self, Node\);) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + reserved(end)operator(;) + + comment(//Get Node of the SubKey) + ident(Node) operator(:=) ident(FindNodeText)operator(()ident(Node)operator(,) ident(keySA)operator([)ident(i)operator(]\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) + ident(AddHint)operator(()string operator(+) ident(KeySA)operator([)ident(i)operator(],) ident(True)operator(\);) + ident(Exit)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(end)operator(;) ident(TreeWin)operator(.)ident(DoSmartExpand) operator(:=) ident(True)operator(;) + + reserved(if) ident(Node) operator(<>) ident(RegTV)operator(.)ident(Selected) reserved(then) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) + ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\);) + reserved(end)operator(;) + + ident(Application)operator(.)ident(ProcessMessages)operator(;) + + reserved(if) ident(Full)operator(.)ident(ValueSet) reserved(then) + ident(ValuesWin)operator(.)ident(FocusItem)operator(()ident(Full)operator(.)ident(Value)operator(,) reserved(not) operator(()ident(Active) reserved(and) ident(PathE)operator(.)ident(Focused)operator(\)\)) + reserved(else) reserved(begin) + reserved(if) reserved(not) operator(()ident(Active) reserved(and) ident(PathE)operator(.)ident(Focused)operator(\)) reserved(then) comment(//if not user is currently editing the path) + ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\);) + + reserved(if) ident(LastChar)operator(()ident(Full)operator(.)ident(Key)operator(\)) operator(=) char reserved(then) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(SwapFonts)operator(()ident(Sender)operator(:) ident(TWinControl)operator(\);) + + reserved(function) ident(OtherFont)operator(()ident(N)operator(:) ident(TFontName)operator(\):) ident(TFontName)operator(;) + reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(if) ident(N) operator(=) ident(Result) reserved(then) + ident(Result) operator(:=) stringoperator(;) + reserved(end)operator(;) + +reserved(begin) + ident(TEdit)operator(()ident(Sender)operator(\).)ident(Font)operator(.)ident(Name) operator(:=) ident(OtherFont)operator(()ident(TTreeView)operator(()ident(Sender)operator(\).)ident(Font)operator(.)ident(Name)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(ActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Sender)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(TEdit)operator(()ident(Sender)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(Tag) operator(<>) ident(EditControlFlag) reserved(then) + ident(Exit)operator(;) + ident(Color) operator(:=) ident(RealColor)operator(()ident(clVeryBrightBlue)operator(\);) + ident(Font)operator(.)ident(Color) operator(:=) ident(clBlack)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(DeActivateThis)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Sender)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(TEdit)operator(()ident(Sender)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(Tag) operator(<>) ident(EditControlFlag) reserved(then) + ident(Exit)operator(;) + ident(Color) operator(:=) ident(RealColor)operator(()ident(clDarkGray)operator(\);) + ident(Font)operator(.)ident(Color) operator(:=) ident(clWhite)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(CreateSisyThreads)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(CreateSisyThread)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string)operator(;) + ident(Key)operator(:) ident(HKEY)operator(;) ident(StatusLabel)operator(:) ident(TLabel)operator(\);) + reserved(var) + ident(Sisy)operator(:) ident(TSisyThread)operator(;) + reserved(begin) + ident(ChangeLastHint)operator(()string operator(+) ident(Name) operator(+) stringoperator(\);) + ident(Sisy) operator(:=) ident(TSisyThread)operator(.)ident(CreateIt)operator(()ident(Name)operator(,) ident(KeyName)operator(,) ident(Key)operator(,) ident(StatusLabel)operator(,) ident(PlutoKey)operator(\);) + ident(Sisy)operator(.)ident(OnChange) operator(:=) ident(MainWin)operator(.)ident(OnSisyChange)operator(;) +comment(// Sisy.OnSpecialChange[cValuePlus] := MainWin.OnSisyValuePlus;) +comment(// Sisy.OnSpecialChange[cValueMinus] := MainWin.OnSisyValueMinus;) +comment(// Sisy.OnSpecialChange[cContextChange] := MainWin.OnSisyContextChange;) + ident(Sisys)operator(.)ident(Add)operator(()ident(Sisy)operator(\);) + ident(AddToLastHint)operator(()stringoperator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(AddHint)operator(()string operator(+) ident(SisyVersion) operator(+) stringoperator(\);) + + ident(Sisys) operator(:=) ident(TSisyList)operator(.)ident(Create)operator(;) + ident(WorkWin)operator(.)ident(LoadSisyFilter)operator(;) + + ident(CreateSisyThread)operator(()stringoperator(,) stringoperator(,) ident(HKU)operator(,) ident(WorkWin)operator(.)ident(SisyHKUL)operator(\);) + ident(CreateSisyThread)operator(()stringoperator(,) stringoperator(,) ident(HKLM)operator(,) ident(WorkWin)operator(.)ident(SisyHKLML)operator(\);) + + ident(ChangeLastHint)operator(()stringoperator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(with) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(]\)) reserved(do) reserved(begin) + reserved(if) ident(Name) operator(=) string reserved(then) + reserved(with) ident(WorkWin)operator(.)ident(SisyHKUCB) reserved(do) reserved(begin) + ident(Settings)operator(.)ident(KeyName) operator(:=) ident(StrOfUni)operator(()ident(Uni)operator(.)ident(Path)operator(\);) + ident(Settings)operator(.)ident(Load)operator(;) + ident(Settings)operator(.)ident(AutoSave) operator(:=) ident(True)operator(;) + reserved(if) ident(Checked) reserved(then) + ident(Resume)operator(;) + reserved(end) + reserved(else) reserved(if) ident(Name) operator(=) string reserved(then) + reserved(with) ident(WorkWin)operator(.)ident(SisyHKLMCB) reserved(do) reserved(begin) + ident(Settings)operator(.)ident(KeyName) operator(:=) ident(StrOfUni)operator(()ident(Uni)operator(.)ident(Path)operator(\);) + ident(Settings)operator(.)ident(Load)operator(;) + ident(Settings)operator(.)ident(AutoSave) operator(:=) ident(True)operator(;) + reserved(if) ident(Checked) reserved(then) + ident(Resume)operator(;) + reserved(end)operator(;) + ident(OnStarted) operator(:=) ident(MainWin)operator(.)ident(SisyStarted)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(CreateSpyThread)operator(;) +reserved(begin) + ident(AddHint)operator(()stringoperator(\);) + ident(SpyThread) operator(:=) ident(TRegSpyThread)operator(.)ident(CreateIt)operator(()ident(tpLowest)operator(\);) + ident(WorkWin)operator(.)ident(SpyDelayIEChange)operator(()ident(MainWin)operator(\);) + ident(WorkWin)operator(.)ident(SpyTestLClick)operator(()ident(MainWin)operator(\);) + ident(AddToLastHint)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(ShowParams)operator(;) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + reserved(if) ident(Switch)operator(()stringoperator(\)) reserved(then) reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(GetParams)operator(()ident(SL)operator(\);) + ident(ShowMessage)operator(()ident(SL)operator(.)ident(Text)operator(\);) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(GotoParamKey)operator(;) +reserved(var) + ident(s)operator(:) reserved(string)operator(;) +reserved(begin) + ident(s) operator(:=) ident(ParamStr)operator(()integer(1)operator(\);) + reserved(if) operator(()ident(s) operator(<>) stringoperator(\)) + reserved(and) operator(()ident(s)operator([)integer(1)operator(]) operator(<>) charoperator(\)) reserved(then) reserved(begin) comment(//Params have '-' as prefix) + ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(s)operator(\)) operator(+) stringoperator(\);) + ident(MainWin)operator(.)ident(GotoKey)operator(()ident(s)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(RegTV)operator(.)ident(TopItem)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Load)operator(;) +reserved(begin) + ident(TreeWin)operator(.)ident(Load)operator(;) + ident(WorkWin)operator(.)ident(LoadBoolStr)operator(;) + + ident(CreateSpyThread)operator(;) + ident(CreateSisyThreads)operator(;) + + ident(AddHint)operator(()ident(Greeting)operator(,) ident(True)operator(\);) + + ident(ShowParams)operator(;) + ident(GotoParamKey)operator(;) + + reserved(if) ident(Assigned)operator(()ident(SplashWin)operator(\)) reserved(and) ident(SplashWin)operator(.)ident(Visible) reserved(then) + ident(SplashWin)operator(.)ident(SetFocus)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(].)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) operator(()ident(ssAlt) reserved(in) ident(shift)operator(\)) reserved(and) operator(()ident(Key) operator(=) ident(VK_F4)operator(\)) reserved(then) reserved(begin) + ident(Key) operator(:=) integer(0)operator(;) + ident(Close)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(ssCtrl) reserved(in) ident(Shift) reserved(then) + reserved(case) ident(Key) reserved(of) + ident(Byte)operator(()charoperator(\):) reserved(begin) + ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(WorkPage)operator(;) + reserved(if) ident(Assigned)operator(()ident(MainPC)operator(.)ident(ActivePage)operator(\)) reserved(then) + ident(WorkWin)operator(.)ident(FocusControl)operator(()ident(TWinControl)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(.)ident(Tag)operator(\)\)) + reserved(end)operator(;) + + ident(Byte)operator(()charoperator(\):) ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(HintPage)operator(;) + + ident(Byte)operator(()charoperator(\):) ident(MainWin)operator(.)ident(FindCLSID)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Shift) operator(=) operator([]) reserved(then) + reserved(case) ident(Key) reserved(of) + ident(VK_F6)operator(:) ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\);) + + ident(VK_F7)operator(:) reserved(with) ident(ValueList) reserved(do) reserved(begin) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(if) operator(()ident(Selected) operator(=) reserved(nil)operator(\)) reserved(and) operator(()ident(Items)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(then) reserved(begin) + ident(Selected) operator(:=) ident(Items)operator([)integer(0)operator(];) + ident(ItemFocused) operator(:=) ident(Selected)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(VK_F8)operator(:) ident(WorkWin)operator(.)ident(FocusControl)operator(()ident(MainPC)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) reserved(begin) + ident(TreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) + ident(ValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(StatusBar) reserved(do) + ident(Panels)operator([)integer(1)operator(].)ident(Width) operator(:=) + ident(Width) operator(-) operator(()ident(Panels)operator([)integer(0)operator(].)ident(Width) operator(+) ident(Panels)operator([)integer(2)operator(].)ident(Width) operator(+) ident(Panels)operator([)integer(3)operator(].)ident(Width)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowRealPathMIClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(InsertPathClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(GotoKey)operator(()ident(Clipboard)operator(.)ident(AsText)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SetStatus)operator(;) +reserved(begin) + ident(StatusBarUpdate)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarUpdate)operator(;) +reserved(var) + ident(Inf)operator(:) ident(TRegKeyInfo)operator(;) +reserved(begin) + ident(OpenCurKey)operator(;) + ident(MainReg)operator(.)ident(GetKeyInfo)operator(()ident(Inf)operator(\);) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + + ident(StatusBar)operator(.)ident(Panels)operator([)integer(2)operator(].)ident(Text) operator(:=) ident(StrNumerus)operator(()ident(Inf)operator(.)ident(NumSubKeys)operator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(3)operator(].)ident(Text) operator(:=) ident(StrNumerus)operator(()ident(Inf)operator(.)ident(NumValues)operator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + + reserved(if) ident(ShowRealPathMI)operator(.)ident(Checked) reserved(then) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(].)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhShortcuts)operator(\)\)) + reserved(else) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(1)operator(].)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\)\);) + + reserved(if) reserved(not) ident(PathE)operator(.)ident(Focused) reserved(then) + ident(PathE)operator(.)ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ShowRealPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowRealPathMI)operator(.)ident(Checked) operator(:=) reserved(not) ident(ShowRealPathMI)operator(.)ident(Checked)operator(;) + ident(StatusBarUpdate)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(var) + ident(Pos)operator(:) ident(Integer)operator(;) + ident(s)operator(:) reserved(string)operator(;) +reserved(begin) + ident(DoAutoComplete) operator(:=) reserved(not) operator(()ident(Key) reserved(in) operator([)ident(VK_DELETE)operator(,) ident(VK_BACK)operator(,) ident(VK_ESCAPE)operator(]\);) + + reserved(case) ident(Key) reserved(of) + ident(VK_BACK)operator(:) + reserved(begin) + ident(s) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) + ident(Pos) operator(:=) ident(PathE)operator(.)ident(SelStart)operator(;) + + reserved(if) ident(ssCtrl) reserved(in) ident(Shift) reserved(then) + reserved(repeat) + ident(Dec)operator(()ident(Pos)operator(\);) + reserved(until) operator(()ident(Pos) operator(<) integer(1)operator(\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\)) + reserved(else) reserved(if) ident(PathE)operator(.)ident(SelLength) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(PathE)operator(.)ident(Text) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(1)operator(,) ident(Pos)operator(\);) + ident(PathE)operator(.)ident(SelStart) operator(:=) ident(Length)operator(()ident(s)operator(\);) + ident(Key) operator(:=) integer(0)operator(;) + ident(UserGotoKey)operator(;) + reserved(end)operator(;) + + ident(VK_ESCAPE)operator(:) + reserved(with) ident(PathE) reserved(do) reserved(begin) + reserved(if) ident(SelLength) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + ident(Text) operator(:=) ident(StrOfRegPath)operator(()ident(CurKey)operator(\);) + ident(SelStart) operator(:=) ident(Length)operator(()ident(Text)operator(\);) + reserved(end)operator(;) + + ident(VK_RETURN)operator(:) reserved(begin) + reserved(if) ident(CurKey)operator(.)ident(ValueSet) reserved(then) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\);) + ident(Key) operator(:=) integer(0)operator(;) + reserved(end)operator(;) + + ident(VK_RIGHT)operator(:) reserved(begin) + reserved(if) reserved(not) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Key) operator(:=) integer(0)operator(;) + + ident(s) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) + ident(Pos) operator(:=) ident(PathE)operator(.)ident(SelStart) operator(+) integer(1)operator(;) + reserved(repeat) + ident(Inc)operator(()ident(Pos)operator(\);) + reserved(until) operator(()ident(Pos) operator(>) ident(Length)operator(()ident(s)operator(\)\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\);) + + ident(PathE)operator(.)ident(SelStart) operator(:=) ident(Pos) operator(-) integer(1)operator(;) + reserved(end)operator(;) + + ident(VK_LEFT)operator(:) reserved(begin) + reserved(if) reserved(not) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(PathE) reserved(do) reserved(begin) + ident(Key) operator(:=) integer(0)operator(;) + + ident(s) operator(:=) ident(Text)operator(;) + ident(Pos) operator(:=) ident(SelStart)operator(;) + reserved(repeat) + ident(Dec)operator(()ident(Pos)operator(\);) + reserved(until) operator(()ident(Pos) operator(<) integer(1)operator(\)) reserved(or) operator(()ident(s)operator([)ident(Pos)operator(]) operator(=) charoperator(\);) + + reserved(if) ident(Pos) operator(<) integer(1) reserved(then) + ident(Pos) operator(:=) integer(1)operator(;) + + ident(SelStart) operator(:=) ident(Pos) operator(-) integer(1)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(UserGotoKey)operator(;) +reserved(begin) + ident(GotoKey)operator(()ident(PathE)operator(.)ident(Text)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PathEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Prefix)operator(,) ident(Suffix)operator(,) ident(Key)operator(,) ident(Path)operator(,) ident(Root)operator(:) reserved(string)operator(;) + ident(i)operator(,) ident(p)operator(,) ident(Len)operator(:) ident(Integer)operator(;) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(CompleteKind)operator(:) operator(()ident(ckRoots)operator(,) ident(ckKeys)operator(,) ident(ckValues)operator(\);) + + reserved(procedure) ident(GetRootNames)operator(()ident(Strings)operator(:) ident(TStrings)operator(\);) + reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(begin) + ident(SL)operator(.)ident(Clear)operator(;) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(GetFirstNode)operator(;) + reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) + ident(SL)operator(.)ident(Add)operator(()ident(Node)operator(.)ident(Text)operator(\);) + ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) ident(DoAutoComplete) reserved(then) + ident(Exit)operator(;) + + ident(Key) operator(:=) ident(PathE)operator(.)ident(Text)operator(;) + ident(Root) operator(:=) ident(TraceKey)operator(()ident(ExRegRoot)operator(()ident(Key)operator(\)\);) + + reserved(if) reserved(not) ident(CharIn)operator(()ident(Key)operator(,) charoperator(\)) reserved(then) + ident(CompleteKind) operator(:=) ident(ckRoots) + reserved(else) reserved(if) ident(ExRegValueSet)operator(()ident(Key)operator(\)) reserved(then) + ident(CompleteKind) operator(:=) ident(ckValues) + reserved(else) + ident(CompleteKind) operator(:=) ident(ckKeys)operator(;) + + reserved(case) ident(CompleteKind) reserved(of) + ident(ckRoots)operator(:) reserved(begin) + ident(Prefix) operator(:=) stringoperator(;) + ident(Suffix) operator(:=) ident(Key)operator(;) + reserved(end)operator(;) + + ident(ckKeys)operator(:) reserved(begin) + ident(Path) operator(:=) ident(ExRegFullKey)operator(()ident(Key)operator(\);) + ident(Prefix) operator(:=) ident(UntilLastChar)operator(()ident(Path)operator(,) charoperator(\);) + ident(Suffix) operator(:=) ident(FromLastChar)operator(()ident(Path)operator(,) charoperator(\);) + reserved(end)operator(;) + + ident(ckValues)operator(:) reserved(begin) + ident(p) operator(:=) ident(Pos)operator(()stringoperator(,) ident(Key)operator(\);) + ident(Prefix) operator(:=) ident(Copy)operator(()ident(Key)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\);) + ident(Suffix) operator(:=) ident(Copy)operator(()ident(Key)operator(,) ident(p) operator(+) integer(2)operator(,) ident(Length)operator(()ident(Key)operator(\)) operator(-) ident(p) operator(-) integer(1)operator(\);) + reserved(end)operator(;) + + reserved(else) + reserved(end)operator(;) + + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + + reserved(if) ident(CompleteKind) reserved(in) operator([)ident(ckKeys)operator(,) ident(ckValues)operator(]) reserved(then) + reserved(with) ident(MainReg) reserved(do) reserved(begin) + ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Root)operator(\)\);) + ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Root)operator(\)\);) + ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Prefix)operator(\)\);) + + reserved(if) ident(CompleteKind) operator(=) ident(ckValues) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(HasValues) reserved(then) + ident(Exit)operator(;) + ident(GetValueNames)operator(()ident(SL)operator(\);) + reserved(end) reserved(else) reserved(if) ident(CompleteKind) operator(=) ident(ckKeys) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(HasSubKeys) reserved(then) + ident(Exit)operator(;) + ident(GetKeyNames)operator(()ident(SL)operator(\);) + reserved(end)operator(;) + + ident(CloseKey)operator(;) + reserved(end) + reserved(else) reserved(begin) + ident(GetRootNames)operator(()ident(SL)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Suffix) operator(=) string reserved(then) reserved(begin) + reserved(if) operator(()ident(SL)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(and) reserved(not) ident(StrIn)operator(()ident(SL)operator(,) stringoperator(\)) reserved(then) + ident(Suffix) operator(:=) ident(SL)operator([)integer(0)operator(];) + reserved(end) reserved(else) reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(TextAtBegin)operator(()ident(SL)operator([)ident(i)operator(],) ident(Suffix)operator(\)) reserved(then) reserved(begin) + ident(Suffix) operator(:=) ident(SL)operator([)ident(i)operator(];) + ident(Break)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + ident(Len) operator(:=) ident(Length)operator(()ident(PathE)operator(.)ident(Text)operator(\);) + + reserved(if) ident(CompleteKind) operator(=) ident(ckValues) reserved(then) + ident(Prefix) operator(:=) ident(Prefix) operator(+) string + reserved(else) reserved(if) ident(CompleteKind) operator(=) ident(ckKeys) reserved(then) + ident(Prefix) operator(:=) ident(Prefix) operator(+) charoperator(;) + + reserved(with) ident(PathE) reserved(do) reserved(begin) + ident(DoAutoComplete) operator(:=) ident(False)operator(;) comment(//Avoid Recursion) + ident(Text) operator(:=) ident(Prefix) operator(+) ident(Suffix)operator(;) + ident(DoAutoComplete) operator(:=) ident(True)operator(;) + + ident(SelStart) operator(:=) ident(Len)operator(;) + ident(SelLength) operator(:=) ident(Length)operator(()ident(Text)operator(\)) operator(-) ident(Len)operator(;) + reserved(end)operator(;) + + ident(SL)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PathEExit)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeActivateThis)operator(()ident(PathE)operator(\);) + ident(DoAutoComplete) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(ArrangePlutoStyle)operator(;) +reserved(begin) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) reserved(div) integer(3)operator(;) + ident(Top) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) operator(-) ident(Height) operator(-) integer(43)operator(;) + ident(Left) operator(:=) integer(0)operator(;) + ident(Width) operator(:=) ident(MainWin)operator(.)ident(ClientWidth) operator(-) integer(4)operator(;) + comment(//Align := alBottom;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) reserved(begin) + ident(Top) operator(:=) integer(0)operator(;) + ident(Width) operator(:=) ident(Max)operator(()ident(MainWin)operator(.)ident(ClientWidth) reserved(div) integer(3)operator(,) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinWidth)operator(\);) + ident(Left) operator(:=) ident(ValuesWin)operator(.)ident(Width) operator(-) ident(Width)operator(;) + ident(Height) operator(:=) ident(MainWin)operator(.)ident(ClientHeight) operator(-) integer(43) operator(-) ident(ValuesWin)operator(.)ident(Height)operator(;) + comment(//Align := alRight;) + reserved(end)operator(;) + + reserved(with) ident(TreeWin) reserved(do) reserved(begin) + ident(Top) operator(:=) integer(0)operator(;) + ident(Height) operator(:=) ident(WorkWin)operator(.)ident(Height)operator(;) + ident(Left) operator(:=) integer(0)operator(;) + ident(Width) operator(:=) ident(ValuesWin)operator(.)ident(Width) operator(-) ident(WorkWin)operator(.)ident(Width)operator(;) + reserved(end)operator(;) + + comment({TreeWin.Align := alNone; + WorkWin.Align := alNone; + ValuesWin.Align := alNone;}) +reserved(end)operator(;) + +reserved(procedure) ident(ArrangeFreeStyle)operator(;) +reserved(const) + ident(Space) operator(=) integer(10)operator(;) +reserved(begin) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(Screen)operator(.)ident(Height) reserved(div) integer(3)operator(;) + ident(Align) operator(:=) ident(alBottom)operator(;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) reserved(begin) + ident(Width) operator(:=) ident(Max)operator(()ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(3)operator(,) ident(Constraints)operator(.)ident(MinWidth) operator(+) integer(2) operator(*) ident(Space)operator(\);) + ident(Align) operator(:=) ident(alRight)operator(;) + reserved(end)operator(;) + + reserved(with) ident(TreeWin) reserved(do) reserved(begin) + ident(Align) operator(:=) ident(alClient)operator(;) + reserved(end)operator(;) + + ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) + ident(WorkWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) + ident(ValuesWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) + + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(Height) operator(-) integer(2) operator(*) ident(Space)operator(;) + ident(Width) operator(:=) ident(Width) operator(-) integer(2) operator(*) ident(Space)operator(;) + ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) + ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) + reserved(end)operator(;) + + reserved(with) ident(TreeWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(Height) operator(-) integer(1) operator(*) ident(Space)operator(;) + ident(Width) operator(:=) ident(Width) operator(-) integer(1) operator(*) ident(Space)operator(;) + ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) + ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(Height) operator(-) integer(1) operator(*) ident(Space)operator(;) + ident(Width) operator(:=) ident(Width) operator(-) integer(2) operator(*) ident(Space)operator(;) + ident(Top) operator(:=) ident(Top) operator(+) ident(Space)operator(;) + ident(Left) operator(:=) ident(Left) operator(+) ident(Space)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(ArrangeBigValStyle)operator(;) +reserved(var) + ident(MinHeight)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(MinHeight) operator(:=) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinHeight) operator(+) + ident(MainWin)operator(.)ident(Constraints)operator(.)ident(MinHeight)operator(;) + + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Height) operator(:=) ident(Screen)operator(.)ident(WorkAreaHeight) operator(-) ident(Max)operator(()ident(Screen)operator(.)ident(Height) reserved(div) integer(3)operator(,) ident(MinHeight)operator(\);) + ident(Align) operator(:=) ident(alBottom)operator(;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) reserved(begin) + ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(3)operator(;) + ident(Align) operator(:=) ident(alRight)operator(;) + reserved(end)operator(;) + + reserved(with) ident(TreeWin) reserved(do) reserved(begin) + ident(Align) operator(:=) ident(alClient)operator(;) + reserved(end)operator(;) + + ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) + ident(WorkWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) + ident(ValuesWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(ArrangeRegEdStyle)operator(;) +reserved(begin) + reserved(with) ident(TreeWin) reserved(do) reserved(begin) + ident(Width) operator(:=) ident(Screen)operator(.)ident(WorkAreaWidth) reserved(div) integer(4)operator(;) + ident(Align) operator(:=) ident(alLeft)operator(;) + reserved(end)operator(;) + + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Align) operator(:=) ident(alClient)operator(;) + ident(Align) operator(:=) ident(alNone)operator(;) + ident(Height) operator(:=) ident(Height) operator(-) ident(WorkWin)operator(.)ident(Constraints)operator(.)ident(MinHeight)operator(;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) reserved(begin) + ident(Top) operator(:=) ident(ValuesWin)operator(.)ident(Top) operator(+) ident(ValuesWin)operator(.)ident(Height)operator(;) + ident(Left) operator(:=) ident(ValuesWin)operator(.)ident(Left)operator(;) + ident(Height) operator(:=) ident(Constraints)operator(.)ident(MinHeight)operator(;) + ident(Width) operator(:=) ident(ValuesWin)operator(.)ident(Width)operator(;) + reserved(end)operator(;) + + ident(TreeWin)operator(.)ident(Align) operator(:=) ident(alNone)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) reserved(not) operator(()ident(Key) reserved(in) operator([)ident(VK_DELETE)operator(,) ident(VK_BACK)operator(,) ident(VK_ESCAPE)operator(]\)) reserved(then) + ident(UserGotoKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(ActivateThis)operator(()ident(ActiveControl)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(DeActivateThis)operator(()ident(ActiveControl)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Pluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangePlutoStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(RegEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeRegEdStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Free1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeFreeStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(BigVal1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeBigValStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SplashScreen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SplashWin)operator(.)ident(Show)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(HistoryClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(WebLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Browse)operator(()string operator(+) ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(Caption)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SupportMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Browse)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Credits1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(FileName)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) + ident(ExecFile)operator(()ident(FileName)operator(\)) + reserved(else) reserved(begin) + ident(FileName) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) + ident(ExecFile)operator(()ident(FileName)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(GetCLSIDFromClipboard)operator(:) reserved(string)operator(;) +reserved(var) + ident(CLSID)operator(:) reserved(string)operator(;) +reserved(begin) + ident(CLSID) operator(:=) ident(BetweenChars)operator(()ident(Clipboard)operator(.)ident(AsText)operator(,) charoperator(,) charoperator(,) ident(True)operator(\);) + reserved(if) ident(CLSID) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Clipboard)operator(.)ident(AsText)operator(;) + ident(InputQuery)operator(()stringoperator(,) + string operator(+) ident(EOL) operator(+) + stringoperator(,) ident(Result)operator(\);) + ident(Exit)operator(;) reserved(end) reserved(else) + ident(Result) operator(:=) ident(CLSID)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FindCLSID)operator(;) +reserved(var) + ident(CLSID)operator(,) ident(Desc)operator(:) reserved(string)operator(;) +reserved(begin) + ident(CLSID) operator(:=) ident(GetCLSIDFromClipboard)operator(;) + ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(CLSID)operator(\);) + reserved(if) ident(Desc) operator(<>) string reserved(then) + ident(InputQuery)operator(()stringoperator(,) ident(CLSID)operator(,) ident(Desc)operator(\)) + reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(CLSID) operator(+) charoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(GotoCLSID)operator(;) +reserved(var) + ident(CLSID)operator(,) ident(Desc)operator(:) reserved(string)operator(;) +reserved(begin) + ident(CLSID) operator(:=) ident(GetCLSIDFromClipboard)operator(;) + ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(CLSID)operator(\);) + reserved(if) ident(Desc) operator(<>) string reserved(then) reserved(begin) + ident(GotoKey)operator(()string operator(+) ident(CLSID)operator(\);) + ident(TreeWin)operator(.)ident(FocusControl)operator(()ident(RegTV)operator(\);) + reserved(end) reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(CLSID) operator(+) charoperator(\);) +reserved(end)operator(;) + +reserved(function) ident(TMainWin)operator(.)ident(Greeting)operator(()ident(Name)operator(:) reserved(string) operator(=) ident(NoPreBlinkHint)operator(\):) reserved(string)operator(;) +reserved(const) + ident(Alias)operator(:) reserved(array)operator([)integer(0)operator(..)integer(4)operator(]) reserved(of) reserved(string) operator(=) + operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\);) + ident(RealNames)operator(:) reserved(array)operator([)integer(0)operator(..)integer(4)operator(]) reserved(of) reserved(string) operator(=) + operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(s)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(Name) operator(=) ident(NoPreBlinkHint) reserved(then) + ident(Name) operator(:=) ident(PrefWin)operator(.)ident(UserNameE)operator(.)ident(Text)operator(;) + + reserved(if) ident(Trim)operator(()ident(Name)operator(\)) operator(=) string reserved(then) + ident(s) operator(:=) string + reserved(else) reserved(if) ident(SameText)operator(()ident(Trim)operator(()ident(Name)operator(\),) stringoperator(\)) reserved(then) + ident(s) operator(:=) string + reserved(else) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) integer(4) reserved(do) + reserved(if) ident(SameText)operator(()ident(Name)operator(,) ident(Alias)operator([)ident(i)operator(]\)) reserved(then) reserved(begin) + ident(s) operator(:=) string operator(+) ident(RealNames)operator([)ident(i)operator(]) operator(+) stringoperator(;) + ident(Break)operator(;) reserved(end) + reserved(else) reserved(if) ident(Length)operator(()ident(Name)operator(\)) operator(>) integer(20) reserved(then) + ident(s) operator(:=) string operator(+) ident(Name) operator(+) + string + reserved(else) + ident(s) operator(:=) string operator(+) ident(Name) operator(+) charoperator(;) + + ident(Result) operator(:=) ident(s)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PrefMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PrefWin)operator(.)ident(Show)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TempDir)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) reserved(not) operator(()ident(DirectoryExists)operator(()ident(Result)operator(\)) reserved(or) ident(CreateDir)operator(()ident(Result)operator(\)\)) reserved(then) + ident(Result) operator(:=) ident(PlutoDir)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PlutoIniFileName)operator(:) reserved(string)operator(;) + + reserved(function) ident(Default)operator(:) reserved(string)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(MyDir) operator(+) stringoperator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) ident(SavedPlutoIniFileName)operator(;) + reserved(if) ident(Result) operator(<>) string reserved(then) + ident(Exit)operator(;) + +comment(// Result := Params.ReadString('ini', ''\);) + + reserved(if) ident(IsValidFileName)operator(()ident(Result)operator(\)) reserved(then) + ident(Result) operator(:=) ident(PlutoDir) operator(+) ident(Result) + reserved(else) + ident(Result) operator(:=) ident(Default)operator(;) + + ident(SavedPlutoIniFileName) operator(:=) ident(Result)operator(;) comment(//Faster in future calls) +reserved(end)operator(;) + +reserved(function) ident(PlutoUniPath)operator(:) reserved(string)operator(;) +reserved(begin) + comment(//Result := 'Reg: HKCU\\Software\\Pluto\\';) + ident(Result) operator(:=) string operator(+) ident(PlutoIniFileName) operator(+) string:)delimiter(')>operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(EditBoolStrMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoDir) operator(+) ident(BoolStrFileName)operator(\);) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + stringoperator(\);) + ident(WorkWin)operator(.)ident(LoadBoolStr)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SisyStarted)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +comment({var + NextSisyIndex: Integer; + NextSisy: TSisyThread; }) +reserved(begin) + comment({NextSisy := nil; + + with TSisyThread(Sender\) do begin + //AddHint(Format('%s started after %0.1f seconds', [Name, SecsPerRound]\), True\); + + with Sisys do begin + NextSisyIndex := IndexOf(Sender\) + 1; + if NextSisyIndex < Count then + NextSisy := Items[NextSisyIndex]; + end; + + if Assigned(NextSisy\) then + with NextSisy do + if not Started and Suspended then + Resume; + end; }) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SisyTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) + ident(Sisys)operator(.)ident(Delete)operator(()ident(Sisys)operator(.)ident(IndexOf)operator(()ident(Sender)operator(\)\);) + ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(TSisyThread)operator(()ident(Sender)operator(\).)ident(Name)operator(\)) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormCloseQuery)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(CanClose)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(TerminateThread)operator(()ident(Thread)operator(:) ident(TThread)operator(;) ident(Name)operator(:) reserved(string)operator(\);) + reserved(const) + ident(ThreadTimeOut) operator(=) integer(3000)operator(;) + reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Thread)operator(\)) reserved(then) + reserved(with) ident(Thread) reserved(do) reserved(begin) + ident(Priority) operator(:=) ident(tpNormal)operator(;) + ident(Terminate)operator(;) + reserved(while) ident(Suspended) reserved(do) ident(Resume)operator(;) comment(// ensure running) + reserved(if) integer(0) operator(<>) ident(WaitForSingleObject)operator(()ident(Handle)operator(,) ident(ThreadTimeOut)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(Name) operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(\);) + ident(Windows)operator(.)ident(TerminateThread)operator(()ident(Handle)operator(,) integer(0)operator(\);) + reserved(end) reserved(else) + ident(Thread)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(CanClose) operator(:=) ident(False)operator(;) + + reserved(try) + ident(AddHint)operator(()stringoperator(\);) + reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(]\).)ident(Suspend)operator(;) + ident(AddToLastHint)operator(()stringoperator(\);) + + ident(AddHint)operator(()stringoperator(\);) + ident(TerminateThread)operator(()ident(SpyThread)operator(,) stringoperator(\);) + ident(AddToLastHint)operator(()stringoperator(\);) + + ident(AddHint)operator(()stringoperator(\);) + reserved(if) ident(Assigned)operator(()ident(Sisys)operator(\)) reserved(then) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Sisys)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(ChangeLastHint)operator(()string operator(+) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(]\).)ident(Name)operator(\);) + ident(TerminateThread)operator(()ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(]\),) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(i)operator(]\).)ident(Name)operator(\);) + reserved(end)operator(;) + ident(ChangeLastHint)operator(()stringoperator(\);) + reserved(except) + reserved(with) ident(WorkWin)operator(.)ident(HintLB)operator(.)ident(Items) reserved(do) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(Strings)operator([)ident(Count) operator(-) integer(1)operator(]\);) + ident(CanClose) operator(:=) ident(True)operator(;) + reserved(end)operator(;) + + ident(AddHint)operator(()stringoperator(\);) + ident(CanClose) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) + + reserved(procedure) ident(TryClose)operator(()ident(Win)operator(:) ident(TCustomForm)operator(\);) + reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Win)operator(\)) reserved(and) ident(Win)operator(.)ident(Visible) reserved(then) + ident(Win)operator(.)ident(Close)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(MainReg)operator(.)ident(Free)operator(;) + + ident(Action) operator(:=) ident(caFree)operator(;) + + reserved(if) ident(DontSavePrefs) reserved(then) + ident(Exit)operator(;) + + ident(AddHint)operator(()stringoperator(\);) + + reserved(try) + ident(TryClose)operator(()ident(WorkWin)operator(\);) + ident(TryClose)operator(()ident(ValuesWin)operator(\);) + ident(TryClose)operator(()ident(TreeWin)operator(\);) + ident(TryClose)operator(()ident(FindWin)operator(\);) + ident(TryClose)operator(()ident(SplashWin)operator(\);) + ident(TryClose)operator(()ident(PrefWin)operator(\);) + reserved(except) + ident(DontSavePrefs) operator(:=) ident(True)operator(;) comment(//try again without pref saving) + reserved(end)operator(;) + + reserved(with) ident(PlutoKey)operator(.)ident(GetKey)operator(()stringoperator(\)) reserved(do) + reserved(try) + ident(WriteBool)operator(()stringoperator(,) ident(WindowState) operator(=) ident(wsMaximized)operator(\);) + reserved(if) ident(WindowState) operator(=) ident(wsNormal) reserved(then) reserved(begin) + ident(WriteInteger)operator(()stringoperator(,) ident(Left)operator(\);) + ident(WriteInteger)operator(()stringoperator(,) ident(Top)operator(\);) + ident(WriteInteger)operator(()stringoperator(,) ident(Width)operator(\);) + ident(WriteInteger)operator(()stringoperator(,) ident(Height)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Plutoini1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoIniFileName)operator(\);) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(PlutoIniFileName) operator(+) charoperator(\);) + ident(PrefWin)operator(.)ident(PrefHost)operator(.)ident(Load)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(RegEdit2Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(RegEdit)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SysEdit1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SysEdit)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(NotePad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(WordPad1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(WordPad)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OpenWinDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExploreFolder)operator(()ident(WinDir)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OpenProgramFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExploreFolder)operator(()ident(MyDir)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ExitPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Close)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Find1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FindWin)operator(.)ident(SfRootKeyRB)operator(.)ident(Checked) operator(:=) ident(True)operator(;) + ident(FindWin)operator(.)ident(Show)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormPaint)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Started) reserved(and) reserved(not) ident(MainWinLoaded) reserved(then) reserved(begin) + ident(MainWinLoaded) operator(:=) ident(True)operator(;) + ident(Load)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(StatusBarDrawPanel)operator(()ident(StatusBar)operator(:) ident(TStatusBar)operator(;) + ident(Panel)operator(:) ident(TStatusPanel)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(\);) +reserved(begin) + reserved(with) ident(StatusBar)operator(.)ident(Canvas) reserved(do) reserved(begin) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clBlack)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + reserved(with) ident(Font) reserved(do) reserved(begin) + ident(Name) operator(:=) stringoperator(;) + ident(Style) operator(:=) operator([];) + reserved(case) ident(Panel)operator(.)ident(Index) reserved(of) + integer(0)operator(:) reserved(if) ident(HintBlinkT)operator(.)ident(Enabled) reserved(then) + ident(Color) operator(:=) ident(clBrightRed) + reserved(else) + ident(Color) operator(:=) ident(clBrightSilver)operator(;) + integer(1)operator(:) ident(Color) operator(:=) ident(clWhite)operator(;) + integer(2)operator(:) ident(Color) operator(:=) ident(clCyan)operator(;) + integer(3)operator(:) ident(Color) operator(:=) ident(clBrightPurple)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Panel)operator(.)ident(Alignment) operator(=) ident(taRightJustify) reserved(then) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Right) operator(-) ident(TextWidth)operator(()ident(Panel)operator(.)ident(Text)operator(\),) ident(Rect)operator(.)ident(Top)operator(,) ident(Panel)operator(.)ident(Text)operator(\)) + reserved(else) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left)operator(,) ident(Rect)operator(.)ident(Top)operator(,) ident(Panel)operator(.)ident(Text)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(PathEKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) char(#127) reserved(then) comment(//Silly key management) + ident(Key) operator(:=) char(#0)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(HintBlinkTTimer)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text) operator(:=) stringoperator(;) + ident(StopHintBlinking)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(StopHintBlinking)operator(;) +reserved(begin) + ident(HintBlinkT)operator(.)ident(Enabled) operator(:=) ident(False)operator(;) + ident(PreBlinkHint) operator(:=) ident(NoPreBlinkHint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FindCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FindCLSID)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(GotoCLSID1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(GotoCLSID)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(CommandLineParameters1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(DeleteTempFolder1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(mrYes) operator(=) ident(MessageDlg)operator(()string operator(+) ident(Quote)operator(()ident(TempDir) operator(+) string operator(+) ident(EOL)operator(,) charoperator(\)) operator(+) + stringoperator(,) ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) + ident(DeleteFiles)operator(()ident(TempDir) operator(+) stringoperator(,) ident(False)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(CurrentDir1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(MyDir) operator(+) ident(EOL) operator(+) + string operator(+) ident(PlutoDir) operator(+) ident(EOL) operator(+) + string operator(+) ident(GetCurrentDir) operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(GetParams)operator(()ident(EOL)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(RepairPluto155bBug1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Msg)operator(:) reserved(string)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) +reserved(begin) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + + reserved(try) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKCU)operator(;) + ident(Reg)operator(.)ident(OpenKey)operator(()stringoperator(\);) + ident(Msg) operator(:=) stringoperator(;) + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) + ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) + ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) + ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) reserved(then) + ident(Msg) operator(:=) ident(Msg) operator(+) string operator(+) ident(EOL)operator(;) + reserved(if) ident(Msg) operator(=) string reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Msg) operator(:=) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + ident(Msg) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(;) + + reserved(case) ident(MessageDlg)operator(()ident(Msg)operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(,) ident(mbYesToAll)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(of) + ident(mrYes)operator(:) reserved(begin) + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) + reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)\)) reserved(then) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) + reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)\)) reserved(then) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) + reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)\)) reserved(then) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + + reserved(if) ident(Reg)operator(.)ident(KeyExists)operator(()stringoperator(\)) + reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(()stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)\)) reserved(then) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + reserved(end)operator(;) + + ident(mrYesToAll)operator(:) reserved(begin) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + ident(Reg)operator(.)ident(DeleteKey)operator(()stringoperator(\);) + reserved(end)operator(;) + + ident(mrNo)operator(:) reserved(begin) + ident(TreeWin)operator(.)ident(SetFocus)operator(;) + ident(GotoKey)operator(()stringoperator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(BackupRegistryscanreg1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExecFile)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Username1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowMessage)operator(()ident(UserName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ToDoMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoDir) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(MailLinkMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MailTo)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(Caption)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(IjustwantCONTACT1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MailTo)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ExternalHexEditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExecFile)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(AnotherPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExecFile)operator(()ident(Application)operator(.)ident(ExeName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(Path1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) +preprocessor({$IFDEF UNIKEY}) + ident(UserUniPath) operator(:=) ident(InputBox)operator(()stringoperator(,) string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string:)delimiter(')> operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(MyDir) operator(+) string:)delimiter(')> operator(+) ident(EOL) operator(+) + string operator(+) ident(MyDir) operator(+) string:[View])delimiter(')> operator(+) ident(EOL)operator(,) + ident(UserUniPath)operator(\);) +preprocessor({$ENDIF}) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(RegisterPlugIns1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) +preprocessor({$IFDEF UNIKEY}) + reserved(if) ident(UniPluginOD)operator(.)ident(Execute) reserved(then) + ident(RegisterUniClass)operator(()ident(UniPluginOD)operator(.)ident(FileName)operator(\);) +preprocessor({$ENDIF}) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeIcons)operator(;) + ident(ArrangePlutoStyle)operator(;) + ident(WorkWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) + ident(ValuesWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) + ident(TreeWin)operator(.)ident(WindowState) operator(:=) ident(wsNormal)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(SwapLM_CUBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Path)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Path) operator(:=) ident(TraceKey)operator(()ident(PathE)operator(.)ident(Text)operator(,) ident(uhShortcuts)operator(\);) + reserved(if) ident(SwapHKU_HKLM)operator(()ident(Path)operator(\)) reserved(then) reserved(begin) + ident(PathE)operator(.)ident(Text) operator(:=) ident(Path)operator(;) + ident(UserGotoKey)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ShowLoadreport1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(MyDir) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(KillPluto1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Application)operator(.)ident(Terminate)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(ShowPlatform1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowMessage)operator(()ident(Format)operator(()string operator(+) ident(EOL) operator(+) + stringoperator(,) + operator([)ident(PlatformStrings)operator([)ident(Win32Platform)operator(],) + ident(Win32MajorVersion)operator(,) ident(Win32MinorVersion)operator(,) ident(Win32BuildNumber)operator(]\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(MSConfig1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ExecFile)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(TimetoRelaxMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(RelaxFile)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(with) ident(PlutoKey)operator(.)ident(GetKey)operator(()stringoperator(\)) reserved(do) + reserved(try) + ident(RelaxFile) operator(:=) ident(ReadString)operator(()stringoperator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) + + reserved(if) ident(RelaxFile) operator(=) string reserved(then) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(\)) + reserved(else) + ident(ExecFile)operator(()ident(RelaxFile)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) + + reserved(procedure) ident(UpdateValue)operator(;) + reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Index)operator(:) ident(Integer)operator(;) + reserved(begin) + reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\),) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\)\)) reserved(then) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) reserved(begin) + reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cValueMinus) reserved(then) + ident(ValueList)operator(.)ident(Items)operator(.)ident(Delete)operator(()ident(Index)operator(\)) + reserved(else) reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cContextChange) reserved(then) + ident(UpdateValue)operator(()ident(Reg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(Index)operator(]\);) + reserved(end) reserved(else) reserved(if) ident(Change)operator(.)ident(Typ) operator(=) ident(cValuePlus) reserved(then) + ident(AddValue)operator(()ident(Reg)operator(,) ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(AddHint)operator(()ident(Sender)operator(.)ident(Name) operator(+) string operator(+) ident(Change)operator(.)ident(Path)operator(\);) + reserved(if) ident(Change)operator(.)ident(Typ) reserved(in) operator([)ident(cValueMinus)operator(,) ident(cValuePlus)operator(,) ident(cContextChange)operator(]) reserved(then) + ident(UpdateValue)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyValuePlus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) +reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\),) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\)\)) reserved(then) + ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyValueMinus)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) +reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Index)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\),) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\)\)) reserved(then) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) + ident(ValueList)operator(.)ident(Items)operator(.)ident(Delete)operator(()ident(Index)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TMainWin)operator(.)ident(OnSisyContextChange)operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\);) +reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Index)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(SameRegPath)operator(()ident(ExRegFullKey)operator(()ident(Change)operator(.)ident(Path)operator(\),) ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Reg)operator(.)ident(OpenKey)operator(()ident(ExRegKey)operator(()ident(Change)operator(.)ident(Path)operator(\)\)) reserved(then) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(Index) operator(:=) ident(FindItemByRealName)operator(()ident(ExRegValue)operator(()ident(Change)operator(.)ident(Path)operator(\)\);) + reserved(if) ident(Index) operator(>) operator(-)integer(1) reserved(then) + ident(UpdateValue)operator(()ident(Reg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(Index)operator(]\);) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(PrefU)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) + ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(ExtCtrls)operator(,) ident(StdCtrls)operator(,) ident(PlutoConst)operator(,) ident(NewPanels)operator(,) ident(PrefTools)operator(,) + ident(YTools)operator(,) ident(YTypes)operator(,) ident(start)operator(,) ident(XReg)operator(,) ident(LinkLabel)operator(;) + +reserved(type) + ident(TPrefWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(PrefPC)operator(:) ident(TPageControl)operator(;) + ident(CommonPage)operator(:) ident(TTabSheet)operator(;) + ident(KeyPage)operator(:) ident(TTabSheet)operator(;) + ident(DataPage)operator(:) ident(TTabSheet)operator(;) + ident(KeysBP)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox3)operator(:) ident(TGroupBox)operator(;) + ident(MainPrevBP)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox4)operator(:) ident(TGroupBox)operator(;) + ident(BorderPanel6)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox6)operator(:) ident(TGroupBox)operator(;) + ident(SortKeysCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(PrefHost)operator(:) ident(TPrefHost)operator(;) + ident(MainPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(SplashScreenCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(PrefValuesPC)operator(:) ident(TPageControl)operator(;) + ident(StringPage)operator(:) ident(TTabSheet)operator(;) + ident(MultiStringPage)operator(:) ident(TTabSheet)operator(;) + ident(IntPage)operator(:) ident(TTabSheet)operator(;) + ident(BinaryPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel8)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox8)operator(:) ident(TGroupBox)operator(;) + ident(ShowDwordAsHex)operator(:) ident(TPrefCheckBox)operator(;) + ident(BorderPanel7)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox7)operator(:) ident(TGroupBox)operator(;) + ident(CountZeroByteCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox2)operator(:) ident(TGroupBox)operator(;) + ident(UseExtendedModelCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(BorderPanel2)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox1)operator(:) ident(TGroupBox)operator(;) + ident(ShowAsBinaryCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ShowBinaryAsRG)operator(:) ident(TPrefRadioGroup)operator(;) + ident(Smart4BBCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(DWordPreviewL)operator(:) ident(TLabel)operator(;) + ident(Label4)operator(:) ident(TLabel)operator(;) + ident(Label5)operator(:) ident(TLabel)operator(;) + ident(Label6)operator(:) ident(TLabel)operator(;) + ident(Label7)operator(:) ident(TLabel)operator(;) + ident(UserNameE)operator(:) ident(TPrefEdit)operator(;) + ident(Label8)operator(:) ident(TLabel)operator(;) + ident(MainPreviewE)operator(:) ident(TPrefEdit)operator(;) + ident(Label12)operator(:) ident(TLabel)operator(;) + ident(DefaultIconPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(KeyInfoPreviewCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(SelectExternalHexEditOD)operator(:) ident(TOpenDialog)operator(;) + ident(BorderPanel3)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox9)operator(:) ident(TGroupBox)operator(;) + ident(IntegrationPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel4)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox5)operator(:) ident(TGroupBox)operator(;) + ident(Label11)operator(:) ident(TLabel)operator(;) + ident(SelectExternalHexEditB)operator(:) ident(TButton)operator(;) + ident(RunExternalHexEditB)operator(:) ident(TButton)operator(;) + ident(ExternalHexEditE)operator(:) ident(TPrefEdit)operator(;) + ident(Label13)operator(:) ident(TLabel)operator(;) + ident(BorderPanel5)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox10)operator(:) ident(TGroupBox)operator(;) + ident(Label15)operator(:) ident(TLabel)operator(;) + ident(RegisterAppCB)operator(:) ident(TCheckBox)operator(;) + ident(Label3)operator(:) ident(TLabel)operator(;) + ident(Memo1)operator(:) ident(TMemo)operator(;) + ident(ExpandStringsRG)operator(:) ident(TPrefRadioGroup)operator(;) + ident(QuotersE)operator(:) ident(TPrefEdit)operator(;) + ident(Label1)operator(:) ident(TLabel)operator(;) + ident(StringPreviewL)operator(:) ident(TLabel)operator(;) + ident(ShowLineCountCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ShowTreeViewLinesCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ValuePage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel10)operator(:) ident(TBorderPanel)operator(;) + ident(GroupBox12)operator(:) ident(TGroupBox)operator(;) + ident(ShowListViewGridCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(Label9)operator(:) ident(TLabel)operator(;) + ident(DefaultValueNameE)operator(:) ident(TPrefEdit)operator(;) + ident(Label10)operator(:) ident(TLabel)operator(;) + ident(GotoPlutoKeyB)operator(:) ident(TButton)operator(;) + ident(ColorPanel2)operator(:) ident(TColorPanel)operator(;) + ident(LinkLabel1)operator(:) ident(TLinkLabel)operator(;) + ident(SmartExpandCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(KeysSingleClickCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ValuesSingleClickCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ShowProgressCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) + ident(Label2)operator(:) ident(TLabel)operator(;) + ident(ReloadB)operator(:) ident(TButton)operator(;) + ident(DefaultB)operator(:) ident(TButton)operator(;) + ident(SaveB)operator(:) ident(TButton)operator(;) + reserved(procedure) ident(PrefPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) + ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(PrefHostLoaded)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StandardPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DataPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(UserNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(PrefValuesPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) + ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ShowDwordAsHexClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MainPreviewEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RunExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SelectExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ExternalHexEditEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DefaultBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegisterAppCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SaveBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StringPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowTreeViewLinesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowListViewGridCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DefaultValueNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(LoadPrefs)operator(;) + reserved(procedure) ident(UseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(IntegrationPageShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(GotoPlutoKeyBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(KeysSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ValuesSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(QuotersEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SaveBMouseMove)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) + ident(Y)operator(:) ident(Integer)operator(\);) + directive(public) + ident(StringQuoterBegin)operator(,) ident(StringQuoterEnd)operator(:) reserved(string)operator(;) + reserved(end)operator(;) + +reserved(var) + ident(PrefWin)operator(:) ident(TPrefWin)operator(;) + +reserved(implementation) + +reserved(uses) + ident(TreeU)operator(,) ident(ValuesU)operator(,) ident(Splash)operator(,) ident(plutomain)operator(,) ident(WorkU)operator(;) + +preprocessor({$R *.dfm}) + +reserved(procedure) ident(TPrefWin)operator(.)ident(PrefPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) + ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(PC)operator(:) ident(TPageControl)operator(;) + ident(Page)operator(:) ident(TTabSheet)operator(;) +reserved(begin) + ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\);) + ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(];) + reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clWhite) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightCyan) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightPurple) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightBlue) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightYellow) + reserved(else) + ident(Color) operator(:=) ident(clWhite)operator(;) + reserved(end)operator(;) + + reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) + reserved(if) ident(Active) reserved(then) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(PrefHostLoaded)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PrefHost)operator(.)ident(KeyName) operator(:=) ident(PlutoUniPath)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(StandardPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Started) reserved(then) + ident(RegTV)operator(.)ident(Repaint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(DataPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + + ident(ValuesWin)operator(.)ident(UpdateValues)operator(;) + ident(RegTV)operator(.)ident(Repaint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(UserNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text) operator(:=) ident(MainWin)operator(.)ident(Greeting)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(Close)operator(;) + + reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) + ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag) reserved(then) + ident(DeActivateThis)operator(()ident(ActiveControl)operator(\);) + + ident(AlphaBlendValue) operator(:=) integer(127)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Started) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(ActivateThis)operator(()ident(ActiveControl)operator(\);) + + ident(AlphaBlendValue) operator(:=) integer(255)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(PrefValuesPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) + ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(PC)operator(:) ident(TPageControl)operator(;) + ident(Page)operator(:) ident(TTabSheet)operator(;) +reserved(begin) + ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\);) + ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(];) + reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Page) operator(=) ident(StringPage) reserved(then) + ident(Color) operator(:=) ident(clBrightRed) + reserved(else) reserved(if) ident(Page) operator(=) ident(MultiStringPage) reserved(then) + ident(Color) operator(:=) ident(clBrightPurple) + reserved(else) reserved(if) ident(Page) operator(=) ident(IntPage) reserved(then) + ident(Color) operator(:=) ident(clBrightBlue) + reserved(else) reserved(if) ident(Page) operator(=) ident(BinaryPage) reserved(then) + ident(Color) operator(:=) ident(clBrightGreen)operator(;) + reserved(end)operator(;) + + reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) + reserved(if) ident(Active) reserved(then) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(4)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ShowDwordAsHexClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DWordPreviewL)operator(.)ident(Caption) operator(:=) string operator(+) ident(ValuesU)operator(.)ident(DataPreviewOfContext)operator(() + ident(RegContext)operator(()ident(rdCardinal)operator(,) ident(Reverse)operator(()ident(ByteAOfHex)operator(()ident(HexOfCard)operator(()integer(1234567890)operator(,) integer(8)operator(\)\)\)\)\);) + ident(DataPreviewChange)operator(()ident(Self)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(MainPreviewEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(MainPreviewE)operator(.)ident(Text) operator(=) string reserved(then) + ident(MainPreviewCB)operator(.)ident(Caption) operator(:=) string + reserved(else) + ident(MainPreviewCB)operator(.)ident(Caption) operator(:=) string operator(+) + ident(Quote)operator(()ident(MainPreviewE)operator(.)ident(Text)operator(\);) + + ident(StandardPreviewChange)operator(()ident(Self)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(UserNameE)operator(.)ident(DefaultValue) operator(:=) ident(UserName)operator(;) + ident(MainPreviewEChange)operator(()ident(Self)operator(\);) + ident(PrefPC)operator(.)ident(ActivePageIndex) operator(:=) integer(0)operator(;) + ident(PrefValuesPC)operator(.)ident(ActivePageIndex) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(LoadPrefs)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(RunExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(FileName)operator(,) ident(TestValue)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(TempDir) operator(+) stringoperator(;) + ident(TestValue) operator(:=) string operator(+) ident(EOL) operator(+) + stringoperator(;) + reserved(if) ident(SaveByteA)operator(()ident(ByteAOfStr)operator(()ident(TestValue)operator(\),) ident(FileName)operator(\)) reserved(then) + ident(ExecFileWith)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(,) ident(FileName)operator(\)) + reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(SelectExternalHexEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SelectExternalHexEditOD) reserved(do) reserved(begin) + ident(InitialDir) operator(:=) ident(ExtractPath)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\);) + ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\);) + reserved(if) ident(Execute) reserved(and) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) + ident(ExternalHexEditE)operator(.)ident(Text) operator(:=) ident(FileName)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ExternalHexEditEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(RunExternalHexEditB)operator(.)ident(Enabled) operator(:=) ident(FileExists)operator(()ident(ExternalHexEditE)operator(.)ident(Text)operator(\);) + reserved(if) ident(Assigned)operator(()ident(WorkWin)operator(\)) reserved(then) + ident(WorkWin)operator(.)ident(ExternalEditB)operator(.)ident(Enabled) operator(:=) ident(RunExternalHexEditB)operator(.)ident(Enabled)operator(;) + reserved(if) ident(Assigned)operator(()ident(MainWin)operator(\)) reserved(then) + ident(MainWin)operator(.)ident(ExternalHexEditMI)operator(.)ident(Enabled) operator(:=) ident(RunExternalHexEditB)operator(.)ident(Enabled)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(DefaultBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(mrYes)operator(=)ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) reserved(begin) + ident(CopyFile)operator(()ident(PChar)operator(()ident(PlutoIniFileName)operator(\),) ident(PChar)operator(()ident(PlutoIniFileName) operator(+) stringoperator(\),) ident(False)operator(\);) + comment(//PrefHost.KeyName := 'Ini <' + PlutoIniFileName + '.backup>:';) + comment(//PrefHost.Save;) + comment(//PrefHost.KeyName := PlutoUniPath;) + ident(PrefHost)operator(.)ident(BackUp)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(RegisterAppCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(TXRegistry)operator(.)ident(Create) reserved(do) + reserved(try) + ident(RootKey) operator(:=) ident(HKLM)operator(;) + ident(OpenKey)operator(()stringoperator(\);) + reserved(if) ident(RegisterAppCB)operator(.)ident(Checked) reserved(then) reserved(begin) + ident(OpenKey)operator(()stringoperator(,) ident(True)operator(\);) + ident(WriteString)operator(()stringoperator(,) ident(GetFileNew)operator(()ident(Application)operator(.)ident(ExeName)operator(\)\);) + reserved(end) reserved(else) + ident(DeleteKey)operator(()stringoperator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(SaveBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PrefHost)operator(.)ident(Save)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(StringPreviewChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StringPreviewL)operator(.)ident(Caption) operator(:=) string operator(+) ident(ValuesU)operator(.)ident(DataPreviewOfContext)operator(() + ident(RegContext)operator(()ident(rdString)operator(,) ident(ByteAOfStr)operator(()stringoperator(\)\)\);) + ident(DataPreviewChange)operator(()ident(Self)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ShowTreeViewLinesCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(RegTV) reserved(do) reserved(begin) + ident(ShowLines) operator(:=) ident(ShowTreeViewLinesCB)operator(.)ident(Checked)operator(;) + ident(ShowButtons) operator(:=) ident(ShowLines)operator(;) + reserved(end)operator(;) + ident(StandardPreviewChange)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ShowListViewGridCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValueList)operator(.)ident(GridLines) operator(:=) ident(ShowListViewGridCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(DefaultValueNameEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DefaultValueCaption) operator(:=) ident(DefaultValueNameE)operator(.)ident(Text)operator(;) + reserved(if) ident(Started) reserved(then) + ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(LoadPrefs)operator(;) +reserved(begin) + ident(PrefHost)operator(.)ident(Load)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(UseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(WorkWin)operator(.)ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) ident(Integer)operator(()ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\);) + ident(DataPreviewChange)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(IntegrationPageShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(TXRegistry)operator(.)ident(Create) reserved(do) + reserved(try) + ident(RootKey) operator(:=) ident(HKLM)operator(;) + ident(OpenKey)operator(()stringoperator(\);) + ident(RegisterAppCB)operator(.)ident(Checked) operator(:=) ident(SameFileName)operator(()ident(GetFileNew)operator(()ident(ReadString)operator(()stringoperator(\)\),) + ident(GetFileNew)operator(()ident(Application)operator(.)ident(ExeName)operator(\)\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(GotoPlutoKeyBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MainWin)operator(.)ident(GotoKey)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PrefHost)operator(.)ident(Load)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(KeysSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(TreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(ValuesSingleClickCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(QuotersEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(QBegin)operator(,) ident(QEnd)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(with) ident(QuotersE) reserved(do) reserved(begin) + reserved(if) ident(Text) operator(=) string reserved(then) + ident(QBegin) operator(:=) string + reserved(else) + ident(QBegin) operator(:=) ident(Text)operator([)integer(1)operator(];) + reserved(if) ident(Length)operator(()ident(Text)operator(\)) operator(<) integer(2) reserved(then) + ident(QEnd) operator(:=) ident(QBegin) + reserved(else) + ident(QEnd) operator(:=) ident(Text)operator([)integer(2)operator(];) + reserved(end)operator(;) + + reserved(if) operator(()ident(QBegin) operator(<>) ident(StringQuoterBegin)operator(\)) reserved(or) operator(()ident(QEnd) operator(<>) ident(StringQuoterEnd)operator(\)) reserved(then) reserved(begin) + ident(StringQuoterBegin) operator(:=) ident(QBegin)operator(;) + ident(StringQuoterEnd) operator(:=) ident(QEnd)operator(;) + ident(StringPreviewChange)operator(()ident(Self)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Started) reserved(and) ident(Assigned)operator(()ident(SplashWin)operator(\)) reserved(then) + ident(SplashWin)operator(.)ident(SplashScreenCB)operator(.)ident(Checked) operator(:=) ident(SplashScreenCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TPrefWin)operator(.)ident(SaveBMouseMove)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) + ident(Y)operator(:) ident(Integer)operator(\);) +reserved(begin) + ident(Label2)operator(.)ident(Font)operator(.)ident(Color) operator(:=) ident(clBrightRed)operator(;) + ident(Application)operator(.)ident(ProcessMessages)operator(;) + ident(Sleep)operator(()integer(200)operator(\);) + ident(Label2)operator(.)ident(Font)operator(.)ident(Color) operator(:=) ident(clWhite)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(RegScanner)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(SysUtils)operator(,) ident(Dialogs)operator(,) ident(Classes)operator(,) + ident(YTools)operator(,) ident(YTypes)operator(,) ident(XReg)operator(,) ident(Clock)operator(;) + +reserved(type) + ident(TRegScanThread) operator(=) reserved(class)operator(;) + + ident(TRegScanKeyEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TRegScanThread)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string)operator(;) ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\)) reserved(of) reserved(object)operator(;) + ident(TRegScanValueEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TRegScanThread)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\)) reserved(of) reserved(object)operator(;) + + ident(TRegScanTask) operator(=) reserved(record) + ident(Root)operator(:) reserved(string)operator(;) + ident(Key)operator(:) ident(HKEY)operator(;) + reserved(end)operator(;) + ident(TRegScanTasks) operator(=) reserved(array) reserved(of) ident(TRegScanTask)operator(;) + + ident(TRegScanThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) + directive(private) + ident(Keys)operator(,) ident(KeysOK)operator(,) ident(Values)operator(,) ident(ValuesOK)operator(:) ident(Integer)operator(;) + ident(DoScanValues)operator(:) ident(Boolean)operator(;) + ident(FOnKey)operator(:) ident(TRegScanKeyEvent)operator(;) + ident(FOnValue)operator(:) ident(TRegScanValueEvent)operator(;) + ident(FOnFaileKey)operator(:) ident(TRegScanKeyEvent)operator(;) + directive(protected) + reserved(procedure) ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\);) directive(virtual)operator(;) + reserved(procedure) ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\);) directive(virtual)operator(;) + + directive(public) + ident(Path)operator(:) reserved(string)operator(;) + ident(CurrentTask)operator(:) ident(TRegScanTask)operator(;) + ident(Tasks)operator(:) ident(TRegScanTasks)operator(;) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) + reserved(procedure) ident(ScanAll)operator(;) + reserved(function) ident(CurrentPath)operator(:) reserved(string)operator(;) + directive(published) + reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) + ident(DoScanValues)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Tasks)operator(:) ident(TRegScanTasks) operator(=) reserved(nil)operator(\);) + + reserved(property) ident(OnKey)operator(:) ident(TRegScanKeyEvent) directive(read) ident(FOnKey) directive(write) ident(FOnKey)operator(;) + reserved(property) ident(OnValue)operator(:) ident(TRegScanValueEvent) directive(read) ident(FOnValue) directive(write) ident(FOnValue)operator(;) + reserved(property) ident(OnFaileKey)operator(:) ident(TRegScanKeyEvent) directive(read) ident(FOnFaileKey) directive(write) ident(FOnFaileKey)operator(;) + reserved(end)operator(;) + +reserved(implementation) + +comment({ TRegScanThread }) + +reserved(constructor) ident(TRegScanThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(;) + ident(DoScanValues)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Tasks)operator(:) ident(TRegScanTasks) operator(=) reserved(nil)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(()ident(True)operator(\);) + ident(Priority) operator(:=) ident(PriorityLevel)operator(;) + ident(FreeOnTerminate) operator(:=) ident(False)operator(;) + ident(Self)operator(.)ident(DoScanValues) operator(:=) ident(DoScanValues)operator(;) + ident(Self)operator(.)ident(Tasks) operator(:=) ident(Tasks)operator(;) +reserved(end)operator(;) + +reserved(destructor) ident(TRegScanThread)operator(.)ident(Destroy)operator(;) +reserved(begin) + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanAll)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Keys) operator(:=) integer(0)operator(;) + ident(KeysOK) operator(:=) integer(0)operator(;) + ident(Values) operator(:=) integer(0)operator(;) + ident(ValuesOK) operator(:=) integer(0)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Tasks)operator(\)) reserved(do) reserved(begin) + ident(CurrentTask) operator(:=) ident(Tasks)operator([)ident(i)operator(];) + reserved(with) ident(CurrentTask) reserved(do) reserved(begin) + ident(Inc)operator(()ident(Keys)operator(\);) + ident(ScanKey)operator(()ident(Key)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Terminated) reserved(then) ident(Break)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanValues)operator(()ident(Key)operator(:) ident(HKEY)operator(;) ident(Info)operator(:) ident(TRegKeyInfo)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(MaxLen)operator(,) ident(NameLen)operator(,) ident(Len)operator(,) ident(Typ)operator(:) ident(Cardinal)operator(;) + ident(p)operator(:) ident(PChar)operator(;) + ident(Buffer)operator(:) ident(TByteA)operator(;) + + reserved(procedure) ident(ScanValue)operator(()ident(ValueName)operator(:) reserved(string)operator(;) ident(Typ)operator(:) ident(TRegDataType)operator(;) ident(Data)operator(:) ident(TByteA)operator(\);) + reserved(begin) + reserved(if) ident(Assigned)operator(()ident(OnValue)operator(\)) reserved(then) + ident(OnValue)operator(()ident(Self)operator(,) ident(ValueName)operator(,) ident(RegContext)operator(()ident(Typ)operator(,) ident(Data)operator(\)\);) + ident(Inc)operator(()ident(ValuesOK)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(MaxLen) operator(:=) ident(Info)operator(.)ident(MaxValueLen) operator(+) integer(1)operator(;) comment(//Include Nullbyte) + ident(SetLength)operator(()ident(Buffer)operator(,) ident(Info)operator(.)ident(MaxDataLen)operator(\);) + ident(GetMem)operator(()ident(p)operator(,) ident(MaxLen)operator(\);) + + ident(Inc)operator(()ident(Values)operator(,) ident(Info)operator(.)ident(NumValues)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Info)operator(.)ident(NumValues)operator(-)integer(1) reserved(do) reserved(begin) + ident(NameLen) operator(:=) ident(MaxLen)operator(;) + ident(Len) operator(:=) ident(Info)operator(.)ident(MaxDataLen)operator(;) + reserved(if) ident(Success)operator(()ident(RegEnumValue)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(NameLen)operator(,) reserved(nil)operator(,) operator(@)ident(Typ)operator(,) ident(Pointer)operator(()ident(Buffer)operator(\),) + operator(@)ident(Len)operator(\)\)) reserved(then) + ident(ScanValue)operator(()ident(Copy)operator(()ident(p)operator(,) integer(0)operator(,) ident(NameLen)operator(\),) ident(Typ)operator(,) ident(Copy)operator(()ident(Buffer)operator(,) integer(0)operator(,) ident(Len)operator(\)\)) + reserved(else) + ident(Yield)operator(;) + reserved(end)operator(;) + ident(FreeMem)operator(()ident(p)operator(,) ident(MaxLen)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TRegScanThread)operator(.)ident(ScanKey)operator(()ident(Key)operator(:) ident(HKEY)operator(;) reserved(const) ident(KeyName)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(NewHKEY)operator(:) ident(HKEY)operator(;) + ident(Info)operator(:) ident(TRegKeyInfo)operator(;) + ident(l)operator(,) ident(Len)operator(:) ident(DWORD)operator(;) + ident(p)operator(:) ident(PChar)operator(;) + ident(z)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Terminated) reserved(then) ident(Exit)operator(;) + + reserved(with) ident(Info) reserved(do) reserved(begin) + reserved(if) reserved(not) ident(Success)operator(()ident(RegQueryInfoKey)operator(()ident(Key)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) + operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) operator(@)ident(MaxDataLen)operator(,) + reserved(nil)operator(,) reserved(nil)operator(\)\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Assigned)operator(()ident(OnKey)operator(\)) reserved(then) + ident(OnKey)operator(()ident(Self)operator(,) ident(KeyName)operator(,) ident(Key)operator(,) ident(Info)operator(\);) + reserved(if) ident(DoScanValues) reserved(and) operator(()ident(NumValues) operator(>) integer(0)operator(\)) reserved(then) + ident(ScanValues)operator(()ident(Key)operator(,) ident(Info)operator(\);) + + reserved(if) ident(Info)operator(.)ident(NumSubKeys) operator(>) integer(0) reserved(then) reserved(begin) + ident(Inc)operator(()ident(Keys)operator(,) ident(NumSubKeys)operator(\);) + + ident(Len) operator(:=) ident(MaxSubKeyLen) operator(+) integer(1)operator(;) + ident(GetMem)operator(()ident(p)operator(,) ident(Len)operator(\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(NumSubKeys)operator(-)integer(1) reserved(do) reserved(begin) + ident(l) operator(:=) ident(Len)operator(;) + ident(RegEnumKeyEx)operator(()ident(Key)operator(,) ident(i)operator(,) ident(p)operator(,) ident(l)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(\);) + reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(Key)operator(,) ident(p)operator(,) ident(NewHKEY)operator(\)\)) reserved(then) reserved(begin) + ident(z) operator(:=) ident(Length)operator(()ident(Path)operator(\);) + ident(Path) operator(:=) ident(Path) operator(+) char operator(+) ident(p)operator(;) + ident(ScanKey)operator(()ident(NewHKEY)operator(,) ident(p)operator(\);) + ident(RegCloseKey)operator(()ident(NewHKEY)operator(\);) + ident(SetLength)operator(()ident(Path)operator(,) ident(z)operator(\);) + reserved(end) reserved(else) + reserved(if) ident(Assigned)operator(()ident(OnFaileKey)operator(\)) reserved(then) + ident(OnFaileKey)operator(()ident(Self)operator(,) ident(p)operator(,) ident(Key)operator(,) ident(Info)operator(\);) + + reserved(if) ident(Terminated) reserved(then) + ident(Break)operator(;) + reserved(end)operator(;) + ident(FreeMem)operator(()ident(p)operator(,) ident(Len)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(Inc)operator(()ident(KeysOK)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TRegScanThread)operator(.)ident(Execute)operator(;) +reserved(var) + ident(Secs)operator(:) ident(Double)operator(;) +reserved(begin) + reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) + ident(ScanAll)operator(;) + ident(Secs) operator(:=) ident(SecondsPassed)operator(;) + ident(Free)operator(;) + reserved(end)operator(;) + + ident(WriteLn)operator(()stringoperator(\);) + ident(WriteLn)operator(() ident(Format)operator(()stringoperator(,) operator([)ident(Keys)operator(,) ident(Keys) operator(-) ident(KeysOK)operator(]\)\);) + reserved(if) ident(DoScanValues) reserved(then) + ident(WriteLn)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Values)operator(,) ident(Values) operator(-) ident(ValuesOK)operator(]\)\);) + ident(WriteLn)operator(()string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(Secs)operator(]\)) operator(+) stringoperator(\);) + reserved(if) ident(Secs) operator(>) integer(0) reserved(then) + ident(WriteLn)operator(()string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(Keys) operator(/) ident(Secs)operator(]\)) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(function) ident(TRegScanThread)operator(.)ident(CurrentPath)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(CurrentTask)operator(.)ident(Root) operator(+) ident(Path)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(RegTV)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) + ident(ComCtrls)operator(;) + +reserved(type) + ident(TRegTV) operator(=) reserved(class)operator(()ident(TTreeView)operator(\)) + directive(private) + comment({ Private-Deklarationen }) + directive(protected) + comment({ Protected-Deklarationen }) + directive(public) + comment({ Public-Deklarationen }) + directive(published) + comment({ Published-Deklarationen }) + reserved(end)operator(;) + +reserved(procedure) ident(Register)operator(;) + +reserved(implementation) + +reserved(procedure) ident(Register)operator(;) +reserved(begin) + ident(RegisterComponents)operator(()stringoperator(,) operator([)ident(TRegTV)operator(]\);) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(Sisyphus)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Classes)operator(,) ident(SysUtils)operator(,) ident(XReg)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) ident(Clock)operator(;) + +reserved(type) + ident(TSpyValue) operator(=) reserved(class) + ident(Name)operator(:) reserved(string)operator(;) + ident(Next)operator(:) ident(TSpyValue)operator(;) + comment(//DIC: TByteA;) + ident(Typ)operator(:) ident(TXRegDataType)operator(;) + ident(Data)operator(:) ident(TByteA)operator(;) + reserved(constructor) ident(Create)operator(()ident(AName)operator(:) reserved(string)operator(\);) + reserved(end)operator(;) + + ident(TSpyKey) operator(=) reserved(class) + directive(public) + ident(Parent)operator(:) ident(TSpyKey)operator(;) + ident(Name)operator(:) reserved(string)operator(;) + ident(Next)operator(:) ident(TSpyKey)operator(;) + ident(Keys)operator(:) ident(TSpyKey)operator(;) + ident(Values)operator(:) ident(TSpyValue)operator(;) + reserved(procedure) ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(\);) + reserved(function) ident(Path)operator(:) reserved(string)operator(;) + reserved(constructor) ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\);) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(end)operator(;) + +reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(HKLMSpyKey)operator(,) ident(HKUSpyKey)operator(:) ident(TSpyKey)operator(;) + ident(Started)operator(:) ident(Boolean) operator(=) ident(False)operator(;) + +reserved(implementation) + +reserved(uses) + ident(Plutomain)operator(;) + +reserved(procedure) ident(AddChange)operator(()ident(M)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(Yield)operator(;) + comment(//AddHint(M\);) +reserved(end)operator(;) + +comment({ TSpyValue }) + +reserved(constructor) ident(TSpyValue)operator(.)ident(Create)operator(()ident(AName)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(Name) operator(:=) ident(AName)operator(;) + ident(Next) operator(:=) reserved(nil)operator(;) +reserved(end)operator(;) + +comment({ TSpyKey }) + +reserved(constructor) ident(TSpyKey)operator(.)ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(Name) operator(:=) ident(AName)operator(;) + ident(Parent) operator(:=) ident(AParent)operator(;) + + ident(Next) operator(:=) reserved(nil)operator(;) + ident(Keys) operator(:=) reserved(nil)operator(;) + ident(Values) operator(:=) reserved(nil)operator(;) +reserved(end)operator(;) + +reserved(destructor) ident(TSpyKey)operator(.)ident(Destroy)operator(;) +reserved(var) + ident(Value)operator(,) ident(NextValue)operator(:) ident(TSpyValue)operator(;) + ident(Key)operator(,) ident(NextKey)operator(:) ident(TSpyKey)operator(;) +reserved(begin) + ident(Value) operator(:=) ident(Values)operator(;) + reserved(while) ident(Value) operator(<>) reserved(nil) reserved(do) reserved(begin) + ident(NextValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + ident(Value)operator(.)ident(Free)operator(;) + ident(Value) operator(:=) ident(NextValue)operator(;) + reserved(end)operator(;) + + ident(Key) operator(:=) ident(Keys)operator(;) + reserved(while) ident(Key) operator(<>) reserved(nil) reserved(do) reserved(begin) + ident(NextKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + ident(Key)operator(.)ident(Free)operator(;) + ident(Key) operator(:=) ident(NextKey)operator(;) + reserved(end)operator(;) + + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TSpyKey)operator(.)ident(Path)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Parent)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Parent)operator(.)ident(Path) operator(+) char + reserved(else) + ident(Result) operator(:=) stringoperator(;) + + ident(Result) operator(:=) ident(Result) operator(+) ident(Name)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSpyKey)operator(.)ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + + reserved(procedure) ident(CompareValues)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Value)operator(,) ident(LastValue)operator(,) ident(NewValue)operator(,) ident(SearchValue)operator(:) ident(TSpyValue)operator(;) + reserved(begin) + comment(//OK, this part is a little bit complicate. So I will comment very much.) + comment(//First, two terms are important:) + comment(// means the list of values that will be read from the registry now:) + ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\);) + comment(//So is TStringList.) + + comment(// means the image that was saved before.) + comment(//Here, it is a linear list of TSpyValue objects. That means that you can) + comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) + comment(//some comments.) + + comment(//!!! Comparing means: Make fit !!!) + + comment(//If wasn't saved before, it is just empty.) + + comment(//!!! There is no difference in comparing and saving in this method !!!) + + comment(//Building means: Comparing with an empty image.) + + comment(//We go through and make fit it) + + comment(//The following rules are important:) + comment(//Value = "The currently interesting value.) + comment(//LastValue = "The value with X.Next = Value" = "Value.Pref") + + ident(LastValue) operator(:=) reserved(nil)operator(;) comment(// := "Values.Prev") + ident(Value) operator(:=) ident(Values)operator(;) comment(// := "LastValue.Next") + + comment(//Now compare step by step) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Value)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) + comment(//cV= Normally (0.9999\) everything's the same) + ident(LastValue) operator(:=) ident(Value)operator(;) + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) + comment(//Because the list finally must exactly fit SL, the "SL[i] value" hast) + comment(//to be inserted right here. But first let's look...) + + comment(//Maybe it was just moved? So search for it...) + ident(NewValue) operator(:=) reserved(nil)operator(;) + reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(then) reserved(begin) + ident(SearchValue) operator(:=) ident(Value)operator(;) + reserved(while) ident(Assigned)operator(()ident(SearchValue)operator(.)ident(Next)operator(\)) reserved(do) + reserved(if) operator(()ident(SearchValue)operator(.)ident(Next)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]\)) reserved(then) reserved(begin) + comment(//cV\\) + ident(NewValue) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) + ident(AddChange)operator(()string operator(+) ident(Path)operator(\);) + ident(SearchValue)operator(.)ident(Next) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(.)ident(Next)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(NewValue)operator(\)) reserved(then) reserved(begin) + comment(//cV+ No, not found! So it is new...) + ident(NewValue) operator(:=) ident(TSpyValue)operator(.)ident(Create)operator(()ident(SL)operator([)ident(i)operator(]\);) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(NewValue)operator(.)ident(Name)operator(\);) + reserved(with) ident(NewValue) reserved(do) reserved(begin) + ident(Typ) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(SL)operator([)ident(i)operator(]\);) + ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(SL)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//The new object now must be placed after the last value) + reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) reserved(begin) + ident(LastValue)operator(.)ident(Next) operator(:=) ident(NewValue)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//If it's the first value, we don't have LastValue defined) + comment(//So we have to set the "Root" to it) + ident(Values) operator(:=) ident(NewValue)operator(;) + reserved(end)operator(;) + comment(//Now the rest of has to be placed after the new value) + ident(NewValue)operator(.)ident(Next) operator(:=) ident(Value)operator(;) + comment(//And LastValue also has to refreshed: It is "Value.Pref" = NewValue!) + ident(LastValue) operator(:=) ident(NewValue)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//Because the whole before Value is exactly , the rest) + comment(//(if there is one\) must have been deleted!) + + comment(//So first let's ensure that ends here:) + reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) reserved(begin) + ident(LastValue)operator(.)ident(Next) operator(:=) reserved(nil)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//Another time: is empty now, so set Values instead) + ident(Values) operator(:=) reserved(nil)operator(;) + reserved(end)operator(;) + + comment(//Now, the first value that maybe was "cut" off is Value:) + reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) + comment(//cV- So, here really something HAS been deleted) + ident(LastValue) operator(:=) ident(Value)operator(;) + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(LastValue)operator(.)ident(Name)operator(\);) + ident(LastValue)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(CompareData)operator(;) + reserved(var) + ident(Value)operator(:) ident(TSpyValue)operator(;) + ident(Typ)operator(:) ident(TXRegDataType)operator(;) + ident(Data)operator(:) ident(TByteA)operator(;) + reserved(begin) + comment(//So, finally = . That means we now can compare the data:) + ident(Value) operator(:=) ident(Values)operator(;) + reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) + ident(Typ) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(Value)operator(.)ident(Name)operator(\);) + ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(Value)operator(.)ident(Name)operator(\);) + reserved(if) ident(Typ) operator(<>) ident(Value)operator(.)ident(Typ) reserved(then) reserved(begin) + comment(//cT#) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(\);) + ident(Value)operator(.)ident(Typ) operator(:=) ident(Typ)operator(;) + reserved(end)operator(;) + reserved(if) reserved(not) ident(SameByteA)operator(()ident(Data)operator(,) ident(Value)operator(.)ident(Data)operator(\)) reserved(then) reserved(begin) + comment(//cD#) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(\);) + ident(Value)operator(.)ident(Data) operator(:=) ident(Data)operator(;) + reserved(end)operator(;) + + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(CompareKeys)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Key)operator(,) ident(LastKey)operator(,) ident(NewKey)operator(,) ident(SearchKey)operator(:) ident(TSpyKey)operator(;) + ident(NewHKEY)operator(:) ident(HKEY)operator(;) + reserved(begin) + comment(//OK, this part is a little bit complicate. So I will comment very much.) + comment(//First, two terms are important:) + comment(// means the list of keys that will be read from the registry now:) + ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\);) + comment(//So is TStringList.) + + comment(// means the image that was saved before.) + comment(//Here, it is a linear list of TSpyKey objects. That means that you can) + comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) + comment(//some comments.) + + comment(//!!! Comparing means: Make fit !!!) + + comment(//If wasn't saved before, it is just empty.) + + comment(//!!! There is no difference in comparing and saving in this method !!!) + + comment(//Building means: Comparing with an empty image.) + + comment(//We go through and make fit it) + + comment(//The following rules are important:) + comment(//Key = "The currently interesting key.) + comment(//LastKey = "The key with X.Next = Key" = "Key.Pref") + + ident(LastKey) operator(:=) reserved(nil)operator(;) comment(// := "Keys.Prev") + ident(Key) operator(:=) ident(Keys)operator(;) comment(// := "LastKey.Next") + + comment(//Now compare step by step) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Key)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) + comment(//cK= Normally (0.9999\) everything's the same) + ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(]\),) ident(NewHKEY)operator(\);) + ident(Key)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(\);) + ident(LastKey) operator(:=) ident(Key)operator(;) + ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) + comment(//Because the list finally must exactly fit SL, the "SL[i] key" hast) + comment(//to be inserted right here. But first let's look...) + + comment(//Maybe it was just moved? So search for it...) + ident(NewKey) operator(:=) reserved(nil)operator(;) + reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(then) reserved(begin) + ident(SearchKey) operator(:=) ident(Key)operator(;) + reserved(while) ident(Assigned)operator(()ident(SearchKey)operator(.)ident(Next)operator(\)) reserved(do) + reserved(if) operator(()ident(SearchKey)operator(.)ident(Next)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]\)) reserved(then) reserved(begin) + comment(//cK\\) + ident(NewKey) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) + ident(AddChange)operator(()string operator(+) ident(Path)operator(\);) + ident(SearchKey)operator(.)ident(Next) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(.)ident(Next)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(NewKey)operator(\)) reserved(then) reserved(begin) + comment(//cK+ No, not found! So it is new...) + ident(NewKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()ident(Self)operator(,) ident(SL)operator([)ident(i)operator(]\);) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) char operator(+) ident(NewKey)operator(.)ident(Name)operator(\);) + + ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(]\),) ident(NewHKEY)operator(\);) + ident(NewKey)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(\);) + reserved(end)operator(;) + + comment(//The new object now must be placed after the last key) + reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) reserved(begin) + ident(LastKey)operator(.)ident(Next) operator(:=) ident(NewKey)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//If it's the first key, we don't have LastKey defined) + comment(//So we have to set the "Root" to it) + ident(Keys) operator(:=) ident(NewKey)operator(;) + reserved(end)operator(;) + comment(//Now the rest of has to be placed after the new key) + ident(NewKey)operator(.)ident(Next) operator(:=) ident(Key)operator(;) + comment(//And LastKey also has to refreshed: It is "Key.Pref" = NewKey!) + ident(LastKey) operator(:=) ident(NewKey)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//Because the whole before Key is exactly , the rest) + comment(//(if there is one\) must have been deleted!) + + comment(//So first let's ensure that ends here:) + reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) reserved(begin) + ident(LastKey)operator(.)ident(Next) operator(:=) reserved(nil)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//Another time: is empty now, so set Keys instead) + ident(Keys) operator(:=) reserved(nil)operator(;) + reserved(end)operator(;) + + comment(//Now, the first key that maybe was "cut" off is Key:) + reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) + comment(//cV- So, here really something HAS been deleted) + ident(LastKey) operator(:=) ident(Key)operator(;) + ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + ident(AddChange)operator(()string operator(+) ident(Path) operator(+) char operator(+) ident(LastKey)operator(.)ident(Name)operator(\);) + ident(LastKey)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + +reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + + reserved(try) + ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) + + ident(CompareValues)operator(;) + + ident(CompareData)operator(;) + + ident(CompareKeys)operator(;) + + reserved(finally) + ident(RegCloseKey)operator(()ident(AHKEY)operator(\);) + reserved(end)operator(;) + + ident(SL)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(initialization) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + ident(HKLMSpyKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) stringoperator(\);) + ident(HKUSpyKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) stringoperator(\);) + +reserved(finalization) + ident(Reg)operator(.)ident(Free)operator(;) + ident(HKLMSpyKey)operator(.)ident(Free)operator(;) + ident(HKUSpyKey)operator(.)ident(Free)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(SisyphusTH)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Classes)operator(,) ident(StdCtrls)operator(,) ident(Dialogs)operator(,) ident(SysUtils)operator(,) ident(XReg)operator(,) ident(YTools)operator(,) ident(YTypes)operator(,) ident(Clock)operator(,) + ident(ComCtrls)operator(,) ident(PlutoConst)operator(,) ident(UniKey)operator(,) ident(CompEx)operator(;) + +reserved(const) + ident(SisyVersion) operator(=) stringoperator(;) + ident(StatusPoints) operator(=) integer(25)operator(;) + +reserved(type) + ident(TSisyChangeType) operator(=) operator(()ident(cNone)operator(,) ident(cError)operator(,) + ident(cKeyPlus)operator(,) ident(cKeyMinus)operator(,) + ident(cValuePlus)operator(,) ident(cValueMinus)operator(,) + ident(cContextChange)operator(\);) + +reserved(const) + ident(SisyChangeStrings)operator(:) reserved(array)operator([)ident(TSisyChangeType)operator(]) reserved(of) reserved(string) operator(=) + operator(()charoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) + stringoperator(\);) + +reserved(type) + ident(TSpyValue) operator(=) reserved(class) + ident(Name)operator(:) reserved(string)operator(;) + ident(Next)operator(:) ident(TSpyValue)operator(;) + ident(Context)operator(:) ident(TRegContext)operator(;) + reserved(constructor) ident(Create)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\);) + reserved(end)operator(;) + + ident(TSisyThread) operator(=) reserved(class)operator(;) + + ident(TSpyKey) operator(=) reserved(class) + directive(public) + ident(Parent)operator(:) ident(TSpyKey)operator(;) + ident(Name)operator(:) reserved(string)operator(;) + ident(Next)operator(:) ident(TSpyKey)operator(;) + ident(Keys)operator(:) ident(TSpyKey)operator(;) + ident(Values)operator(:) ident(TSpyValue)operator(;) + reserved(procedure) ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\);) + reserved(function) ident(Path)operator(:) reserved(string)operator(;) + reserved(constructor) ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\);) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(end)operator(;) + + ident(TSisyChange) operator(=) reserved(class) + directive(public) + ident(Typ)operator(:) ident(TSisyChangeType)operator(;) + ident(Path)operator(:) reserved(string)operator(;) + ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(;) + reserved(constructor) ident(Create)operator(()ident(ATyp)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(APath)operator(:) reserved(string)operator(;) + ident(AOldContext)operator(:) ident(TRegContext)operator(;) ident(ANewContext)operator(:) ident(TRegContext)operator(\);) + reserved(procedure) ident(ReportToPluto)operator(;) + reserved(end)operator(;) + + ident(TSisyChangeEvent) operator(=) reserved(procedure) operator(()ident(Sender)operator(:) ident(TSisyThread)operator(;) ident(Change)operator(:) ident(TSisyChange)operator(\)) reserved(of) reserved(object)operator(;) + ident(TSisyThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) + directive(private) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Key)operator(:) ident(TSpyKey)operator(;) + ident(KeyHKEY)operator(:) ident(HKEY)operator(;) + ident(CurrentChange)operator(:) ident(TSisyChange)operator(;) + ident(FOnChange)operator(:) ident(TSisyChangeEvent)operator(;) + ident(FOnSpecialChanges)operator(:) reserved(array)operator([)ident(TSisyChangeType)operator(]) reserved(of) ident(TSisyChangeEvent)operator(;) + reserved(procedure) ident(FreeKey)operator(;) + reserved(procedure) ident(IncKeyCount)operator(;) + reserved(procedure) ident(IncKeyIndex)operator(;) + reserved(function) ident(GetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(\):) ident(TSisyChangeEvent)operator(;) + reserved(procedure) ident(SetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(;) + reserved(const) ident(Value)operator(:) ident(TSisyChangeEvent)operator(\);) + directive(protected) + reserved(procedure) ident(AddValueChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(;) + ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(\);) + reserved(procedure) ident(AddKeyChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(\);) + reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) + reserved(procedure) ident(ShowInfo)operator(;) + reserved(procedure) ident(NotifyChange)operator(;) + reserved(procedure) ident(ReportCurrentChange)operator(;) + directive(public) + ident(CurrentSpyKey)operator(:) ident(TSpyKey)operator(;) + ident(StatusLabel)operator(:) ident(TLabel)operator(;) + ident(Name)operator(:) reserved(string)operator(;) + ident(Started)operator(:) ident(Boolean)operator(;) + ident(DoReport)operator(:) ident(Boolean)operator(;) + ident(SecsPerRound)operator(:) ident(Double)operator(;) + ident(InfoForShow)operator(:) reserved(string)operator(;) + ident(OnStarted)operator(:) ident(TNotifyEvent)operator(;) + ident(KeyCount)operator(:) ident(Integer)operator(;) + ident(PrevKeyCount)operator(:) ident(Integer)operator(;) + ident(KeyIndex)operator(:) ident(Integer)operator(;) + ident(TheClock)operator(:) ident(TClock)operator(;) + ident(Uni)operator(:) ident(TUniKey)operator(;) + ident(MaxValueCountToScan)operator(,) ident(MaxKeyCountToScan)operator(,) ident(MaxDataLenToScan)operator(:) ident(Cardinal)operator(;) + reserved(constructor) ident(CreateIt)operator(()reserved(const) ident(AName)operator(,) ident(AKeyName)operator(:) reserved(string)operator(;) ident(AHKEY)operator(:) ident(HKEY)operator(;) + ident(ALabel)operator(:) ident(TLabel)operator(;) ident(AUniKey)operator(:) ident(TUniKey)operator(\);) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + + reserved(property) ident(OnChange)operator(:) ident(TSisyChangeEvent) directive(read) ident(FOnChange) directive(write) ident(FOnChange)operator(;) + reserved(property) ident(OnSpecialChange)operator([)ident(ChangeType)operator(:) ident(TSisyChangeType)operator(]:) ident(TSisyChangeEvent) + directive(read) ident(GetSpecialChange) directive(write) ident(SetSpecialChange)operator(;) + reserved(end)operator(;) + + ident(TSisyList) operator(=) reserved(class)operator(()ident(TList)operator(\)) + directive(protected) + reserved(function) ident(GetSisy)operator(()ident(Index)operator(:) ident(Integer)operator(\):) ident(TSisyThread)operator(;) + reserved(procedure) ident(PutSisy)operator(()ident(Index)operator(:) ident(Integer)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\);) + directive(public) + reserved(procedure) ident(Suspend)operator(;) + reserved(procedure) ident(Resume)operator(;) + reserved(property) ident(Items)operator([)ident(Index)operator(:) ident(Integer)operator(]:) ident(TSisyThread) directive(read) ident(GetSisy) directive(write) ident(PutSisy)operator(;) ident(default)operator(;) + reserved(end)operator(;) + +reserved(procedure) ident(SetSisyChangeState)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(function) ident(SisyChangeActivated)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) + +reserved(var) + ident(SisyFilter)operator(:) ident(TStringList)operator(;) + +reserved(implementation) + +reserved(uses) ident(plutomain)operator(,) ident(workU)operator(,) ident(ValuesU)operator(;) + +reserved(procedure) ident(SetSisyChangeState)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(begin) + ident(Node)operator(.)ident(Data) operator(:=) ident(Pointer)operator(()reserved(not) ident(Active)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(SisyChangeActivated)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Node)operator(.)ident(Data) operator(=) ident(Pointer)operator(()ident(False)operator(\);) +reserved(end)operator(;) + +comment({ TSisyThread }) + +reserved(constructor) ident(TSisyThread)operator(.)ident(CreateIt)operator(()reserved(const) ident(AName)operator(,) ident(AKeyName)operator(:) reserved(string)operator(;) + ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(ALabel)operator(:) ident(TLabel)operator(;) ident(AUniKey)operator(:) ident(TUniKey)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(()ident(True)operator(\);) comment(// Create thread suspended) + + ident(Started) operator(:=) ident(False)operator(;) + ident(DoReport) operator(:=) ident(True)operator(;) + ident(KeyCount) operator(:=) integer(0)operator(;) + ident(FreeOnTerminate) operator(:=) ident(False)operator(;) comment(// Thread frees itself not when terminated) + + ident(KeyHKEY) operator(:=) ident(AHKEY)operator(;) + ident(Name) operator(:=) ident(AName)operator(;) + ident(StatusLabel) operator(:=) ident(ALabel)operator(;) + ident(StatusLabel)operator(.)ident(Caption) operator(:=) stringoperator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + ident(TheClock) operator(:=) ident(TClock)operator(.)ident(Create)operator(;) + + ident(Uni) operator(:=) ident(AUniKey)operator(.)ident(GetKey)operator(()ident(Name)operator(\);) + ident(Priority) operator(:=) ident(TThreadPriority)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) ident(Integer)operator(()ident(tpLowest)operator(\)\)\);) + ident(PrevKeyCount) operator(:=) ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) integer(0)operator(\);) + + ident(MaxKeyCountToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\)\);) + ident(MaxValueCountToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\)\);) + ident(MaxDataLenToScan) operator(:=) ident(Cardinal)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()stringoperator(,) operator(-)integer(1)operator(\)\);) + + ident(Key) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()reserved(nil)operator(,) ident(AKeyName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(FreeKey)operator(;) +reserved(begin) + ident(Reg)operator(.)ident(Free)operator(;) + ident(TheClock)operator(.)ident(Free)operator(;) + ident(Key)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(destructor) ident(TSisyThread)operator(.)ident(Destroy)operator(;) +reserved(begin) + ident(Synchronize)operator(()ident(FreeKey)operator(\);) + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(Execute)operator(;) +reserved(begin) + ident(InfoForShow) operator(:=) ident(Name) operator(+) stringoperator(;) + ident(Synchronize)operator(()ident(ShowInfo)operator(\);) + + ident(TheClock)operator(.)ident(Restart)operator(;) + ident(Started) operator(:=) ident(False)operator(;) + reserved(while) reserved(not) ident(Terminated) reserved(do) + reserved(try) + ident(KeyIndex) operator(:=) integer(0)operator(;) + + comment({ ===================== }) + ident(Key)operator(.)ident(Spy)operator(()ident(KeyHKEY)operator(,) ident(Self)operator(\);) + comment({ ===================== }) + + reserved(if) ident(Terminated) reserved(then) + ident(Continue)operator(;) comment(//= Exit) + + ident(SecsPerRound) operator(:=) ident(TheClock)operator(.)ident(SecondsPassed)operator(;) + ident(TheClock)operator(.)ident(Restart)operator(;) + reserved(if) reserved(not) ident(Started) reserved(then) reserved(begin) + ident(Started) operator(:=) ident(True)operator(;) + ident(Uni)operator(.)ident(WriteInteger)operator(()stringoperator(,) ident(KeyCount)operator(\);) + reserved(if) ident(Assigned)operator(()ident(OnStarted)operator(\)) reserved(then) + ident(OnStarted)operator(()ident(Self)operator(\);) + reserved(end)operator(;) + reserved(except) + ident(ShowMessage)operator(()stringoperator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(AddValueChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(;) + ident(Old)operator(,) ident(New)operator(:) ident(TRegContext)operator(\);) + + reserved(procedure) ident(TryNotify)operator(()ident(Event)operator(:) ident(TSisyCHangeEvent)operator(\);) + reserved(begin) + + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) operator(()ident(Started) reserved(and) ident(DoReport)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(CurrentChange) operator(:=) ident(TSisyChange)operator(.)ident(Create)operator(()ident(Typ)operator(,) ident(Path)operator(,) ident(Old)operator(,) ident(New)operator(\);) + ident(Synchronize)operator(()ident(ReportCurrentChange)operator(\);) + ident(Synchronize)operator(()ident(NotifyChange)operator(\);) + +comment(// CurrentChange.Free; //this makes Pluto itself) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(AddKeyChange)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(Path)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(AddValueChange)operator(()ident(Typ)operator(,) ident(Path)operator(,) ident(ZeroRegContext)operator(,) ident(ZeroRegContext)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(ShowInfo)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(StatusLabel)operator(\)) reserved(then) + ident(StatusLabel)operator(.)ident(Caption) operator(:=) ident(InfoForShow)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(ReportCurrentChange)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(CurrentChange)operator(\)) reserved(then) + ident(CurrentChange)operator(.)ident(ReportToPluto)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(IncKeyCount)operator(;) +reserved(var) + ident(c)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Started) reserved(then) + ident(Exit)operator(;) + + ident(Inc)operator(()ident(KeyCount)operator(\);) + + reserved(if) operator(()ident(KeyCount) reserved(and) hex($1FF)operator(\)) operator(=) integer(0) reserved(then) reserved(begin) + reserved(if) ident(KeyCount) operator(>) ident(PrevKeyCount) reserved(then) + ident(PrevKeyCount) operator(:=) ident(KeyCount)operator(;) + + ident(c) operator(:=) integer(0)operator(;) + reserved(if) ident(PrevkeyCount) operator(>) integer(0) reserved(then) + ident(c) operator(:=) ident(Round)operator((()ident(KeyCount) operator(*) ident(StatusPoints)operator(\)) operator(/) ident(PrevKeyCount)operator(\);) + ident(InfoForShow) operator(:=) char operator(+) ident(MulStr)operator(()charoperator(,) ident(c)operator(\)) operator(+) ident(MulStr)operator(()charoperator(,) ident(StatusPoints) operator(-) ident(c)operator(\)) operator(+) char operator(+) + ident(Format)operator(()stringoperator(,) + operator([)ident(TheClock)operator(.)ident(SecondsPassed)operator(,) ident(KeyCount)operator(,) ident(PrevKeyCount)operator(]\);) + + ident(Synchronize)operator(()ident(ShowInfo)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(IncKeyIndex)operator(;) +reserved(var) + ident(c)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + + ident(Inc)operator(()ident(KeyIndex)operator(\);) + + reserved(if) operator((()ident(KeyIndex) reserved(and) hex($1FF)operator(\)) operator(=) integer(0)operator(\)) reserved(and) operator(()ident(KeyCount) operator(>) integer(0)operator(\)) reserved(then) reserved(begin) + reserved(if) ident(KeyIndex) operator(>) ident(KeyCount) reserved(then) + ident(KeyCount) operator(:=) ident(KeyIndex)operator(;) + + ident(c) operator(:=) integer(0)operator(;) + reserved(if) ident(KeyCount) operator(>) integer(0) reserved(then) + ident(c) operator(:=) ident(Round)operator((()ident(KeyIndex) operator(*) ident(StatusPoints)operator(\)) operator(/) ident(KeyCount)operator(\);) + + ident(InfoForShow) operator(:=) char operator(+) ident(MulStr)operator(()charoperator(,) ident(c)operator(\)) operator(+) ident(MulStr)operator(()charoperator(,) ident(StatusPoints) operator(-) ident(c)operator(\)) operator(+) char operator(+) + ident(Format)operator(()stringoperator(,) operator([)ident(SecsPerRound)operator(,) ident(KeyIndex)operator(,) ident(KeyCount)operator(]\);) + + ident(Synchronize)operator(()ident(ShowInfo)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TSisyThread)operator(.)ident(GetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(\):) + ident(TSisyChangeEvent)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(FOnSpecialChanges)operator([)ident(ChangeType)operator(];) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(SetSpecialChange)operator(()ident(ChangeType)operator(:) ident(TSisyChangeType)operator(;) + reserved(const) ident(Value)operator(:) ident(TSisyChangeEvent)operator(\);) +reserved(begin) + ident(FOnSpecialChanges)operator([)ident(ChangeType)operator(]) operator(:=) ident(Value)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyThread)operator(.)ident(NotifyChange)operator(;) +reserved(var) + ident(Event)operator(:) ident(TSisyChangeEvent)operator(;) +reserved(begin) + ident(Event) operator(:=) ident(FOnSpecialChanges)operator([)ident(CurrentChange)operator(.)ident(Typ)operator(];) + reserved(if) ident(Assigned)operator(()ident(Event)operator(\)) reserved(then) + ident(Event)operator(()ident(Self)operator(,) ident(CurrentChange)operator(\);) + + reserved(if) ident(Assigned)operator(()ident(FOnChange)operator(\)) reserved(then) + ident(FOnChange)operator(()ident(Self)operator(,) ident(CurrentChange)operator(\);) +reserved(end)operator(;) + +comment({ TSpyValue }) + +reserved(constructor) ident(TSpyValue)operator(.)ident(Create)operator(()reserved(const) ident(Name)operator(:) reserved(string)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\);) +reserved(begin) + ident(Self)operator(.)ident(Name) operator(:=) ident(Name)operator(;) + ident(Next) operator(:=) reserved(nil)operator(;) + ident(Self)operator(.)ident(Context) operator(:=) ident(Context)operator(;) +reserved(end)operator(;) + +comment({ TSpyKey }) + +reserved(constructor) ident(TSpyKey)operator(.)ident(Create)operator(()ident(AParent)operator(:) ident(TSpyKey)operator(;) ident(AName)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(Name) operator(:=) ident(AName)operator(;) + ident(Parent) operator(:=) ident(AParent)operator(;) + + ident(Next) operator(:=) reserved(nil)operator(;) + ident(Keys) operator(:=) reserved(nil)operator(;) + ident(Values) operator(:=) reserved(nil)operator(;) +reserved(end)operator(;) + +reserved(destructor) ident(TSpyKey)operator(.)ident(Destroy)operator(;) +reserved(var) + ident(Value)operator(,) ident(NextValue)operator(:) ident(TSpyValue)operator(;) + ident(Key)operator(,) ident(NextKey)operator(:) ident(TSpyKey)operator(;) +reserved(begin) + ident(Value) operator(:=) ident(Values)operator(;) + reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) + ident(NextValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + ident(Value)operator(.)ident(Free)operator(;) + ident(Value) operator(:=) ident(NextValue)operator(;) + reserved(end)operator(;) + + ident(Key) operator(:=) ident(Keys)operator(;) + reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) + ident(NextKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + ident(Key)operator(.)ident(Free)operator(;) + ident(Key) operator(:=) ident(NextKey)operator(;) + reserved(end)operator(;) + + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TSpyKey)operator(.)ident(Path)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Parent)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Parent)operator(.)ident(Path) operator(+) char + reserved(else) + ident(Result) operator(:=) stringoperator(;) + + ident(Result) operator(:=) ident(Result) operator(+) ident(Name)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSpyKey)operator(.)ident(Spy)operator(()ident(AHKEY)operator(:) ident(HKEY)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(LastKey)operator(:) ident(TSpyKey)operator(;) + + reserved(procedure) ident(CompareValues)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Value)operator(,) ident(LastValue)operator(,) ident(NewValue)operator(,) ident(SearchValue)operator(,) ident(SearchValue_Prev)operator(:) ident(TSpyValue)operator(;) + reserved(begin) + comment(//OK, this part is a little bit complicate. So I will comment very much.) + comment(//First, two terms are important:) + comment(// means the list of values that will be read from the registry now:) + ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\);) + reserved(if) ident(Cardinal)operator(()ident(SL)operator(.)ident(Count)operator(\)) operator(>) ident(Sisy)operator(.)ident(MaxValueCountToScan) reserved(then) + ident(Exit)operator(;) + comment(//So is TStringList.) + + comment(// means the image that was saved before.) + comment(//Here, it is a linear list of TSpyValue objects. That means that you can) + comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) + comment(//some comments.) + + comment(//!!! Comparing means: Make fit !!!) + + comment(//If wasn't saved before, it is just empty.) + + comment(//!!! There is no difference in comparing and saving in this method !!!) + + comment(//Building means: Comparing with an empty image.) + + comment(//We go through and make fit it) + + comment(//The following rules are important:) + comment(//Value = "The currently interesting value.) + comment(//LastValue = "The value with X.Next = Value" = "Value.Pref") + + ident(LastValue) operator(:=) reserved(nil)operator(;) comment(// := "Values.Prev") + ident(Value) operator(:=) ident(Values)operator(;) comment(// := "LastValue.Next") + + comment(//Now compare step by step) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Value)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) + comment(//cV= Normally (0.9999\) everything's the same) + ident(LastValue) operator(:=) ident(Value)operator(;) + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) + comment(//Because the list finally must exactly fit SL, the "SL[i] value" hast) + comment(//to be inserted right here. But first let's look...) + + comment(//Maybe it was just moved? So search for it...) + ident(NewValue) operator(:=) reserved(nil)operator(;) + reserved(if) ident(Assigned)operator(()ident(Value)operator(\)) reserved(then) reserved(begin) + ident(SearchValue_Prev) operator(:=) ident(Value)operator(;) + ident(SearchValue) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + reserved(while) ident(Assigned)operator(()ident(SearchValue)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(SearchValue)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]) reserved(then) reserved(begin) comment(//we found our moved value) + ident(SearchValue_Prev)operator(.)ident(Next) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) comment(//delete it from ) + ident(NewValue) operator(:=) ident(SearchValue)operator(;) comment(//save that we found it) + ident(Break) reserved(end)operator(;) + ident(SearchValue_Prev) operator(:=) ident(SearchValue)operator(;) + ident(SearchValue) operator(:=) ident(SearchValue)operator(.)ident(Next)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(NewValue)operator(\)) reserved(then) reserved(begin) + comment(//cV+ No, not found! So it is new...) + ident(NewValue) operator(:=) ident(TSpyValue)operator(.)ident(Create)operator(()ident(SL)operator([)ident(i)operator(],) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ReadContext)operator(()ident(SL)operator([)ident(i)operator(]\)\);) + comment({ ================ cV+ ================ }) + reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(SL)operator([)ident(i)operator(]\)) reserved(then) + ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cValuePlus)operator(,) ident(Path) operator(+) string operator(+) ident(NewValue)operator(.)ident(Name)operator(,) + ident(ZeroRegContext)operator(,) ident(NewValue)operator(.)ident(Context)operator(\);) + reserved(end)operator(;) + + comment(//The new object now must be placed after the last value) + reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) + ident(LastValue)operator(.)ident(Next) operator(:=) ident(NewValue) + reserved(else) + comment(//If it's the first value, we don't have LastValue defined) + comment(//So we have to set the "Root" to it) + ident(Values) operator(:=) ident(NewValue)operator(;) + + comment(//Now the rest of has to be placed after the new value) + ident(NewValue)operator(.)ident(Next) operator(:=) ident(Value)operator(;) + comment(//And LastValue also has to refreshed: It is "Value.Pref" = NewValue!) + ident(LastValue) operator(:=) ident(NewValue)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//Because the whole before Value is exactly , the rest) + comment(//(if there is one\) must have been deleted!) + + comment(//So first let's ensure that ends here:) + reserved(if) ident(Assigned)operator(()ident(LastValue)operator(\)) reserved(then) + ident(LastValue)operator(.)ident(Next) operator(:=) reserved(nil) + reserved(else) + comment(//Another time: is empty now, so set Values instead) + ident(Values) operator(:=) reserved(nil)operator(;) + + comment(//Now, the first value that maybe was "cut" off is Value:) + reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(do) reserved(begin) + comment(//cV- So, here really something HAS been deleted) + ident(LastValue) operator(:=) ident(Value)operator(;) + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + comment({ ================ cV- ================ }) + reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(LastValue)operator(.)ident(Name)operator(\)) reserved(then) + ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cValueMinus)operator(,) ident(Path) operator(+) string operator(+) ident(LastValue)operator(.)ident(Name)operator(,) + ident(LastValue)operator(.)ident(Context)operator(,) ident(ZeroRegContext)operator(\);) + ident(LastValue)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(CompareData)operator(;) + reserved(var) + ident(Value)operator(:) ident(TSpyValue)operator(;) + ident(Context)operator(:) ident(TRegContext)operator(;) + ident(Size)operator(:) ident(Cardinal)operator(;) + reserved(begin) + ident(Context) operator(:=) ident(ZeroRegContext)operator(;) comment(//Initialize) + comment(//So, finally = . That means we now can compare the data:) + ident(Value) operator(:=) ident(Values)operator(;) + reserved(while) ident(Assigned)operator(()ident(Value)operator(\)) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Terminated) reserved(do) reserved(begin) + ident(Size) operator(:=) ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetDataSize)operator(()ident(Value)operator(.)ident(Name)operator(\);) + reserved(if) operator(()ident(Size) operator(=) ident(Cardinal)operator((-)integer(1)operator(\)\)) reserved(or) + operator(()ident(Size) operator(<=) ident(Sisy)operator(.)ident(MaxDataLenToScan)operator(\)) reserved(then) reserved(begin) + ident(Context) operator(:=) ident(Sisy)operator(.)ident(Reg)operator(.)ident(ReadContext)operator(()ident(Value)operator(.)ident(Name)operator(\);) + reserved(if) reserved(not) ident(SameContext)operator(()ident(Context)operator(,) ident(Value)operator(.)ident(Context)operator(\)) reserved(then) reserved(begin) + comment({ ================ cC ================ }) + ident(Sisy)operator(.)ident(AddValueChange)operator(()ident(cContextChange)operator(,) ident(Path) operator(+) string operator(+) ident(Value)operator(.)ident(Name)operator(,) + ident(Value)operator(.)ident(Context)operator(,) ident(Context)operator(\);) + ident(Value)operator(.)ident(Context) operator(:=) ident(Context)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(Value) operator(:=) ident(Value)operator(.)ident(Next)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(CompareKeys)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Key)operator(,) ident(LastKey)operator(,) ident(NewKey)operator(,) ident(SearchKey)operator(,) ident(SearchKey_Prev)operator(:) ident(TSpyKey)operator(;) + ident(SavedDoReport)operator(:) ident(Boolean)operator(;) + ident(NewHKEY)operator(:) ident(HKEY)operator(;) + reserved(begin) + comment(//OK, this part is a little bit complicate. So I will comment very much.) + comment(//First, two terms are important:) + comment(// means the list of keys that will be read from the registry now:) + + ident(Sisy)operator(.)ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\);) + reserved(if) ident(Cardinal)operator(()ident(SL)operator(.)ident(Count)operator(\)) operator(>) ident(Sisy)operator(.)ident(MaxKeyCountToScan) reserved(then) + ident(Exit)operator(;) + comment(//So is TStringList.) + + comment(// means the image that was saved before.) + comment(//Here, it is a linear list of TSpyKey objects. That means that you can) + comment(//only get X.Next and not X.Prev! However, I use "X.Prev" to simplify) + comment(//some comments.) + + comment(//!!! Comparing means: Make fit !!!) + + comment(//If wasn't saved before, it is just empty.) + + comment(//!!! There is no difference in comparing and saving in this method !!!) + + comment(//Building means: Comparing with an empty image.) + + comment(//We go through and make fit it) + + comment(//The following rules are important:) + comment(//Key = "The currently interesting key.) + comment(//LastKey = "The key with X.Next = Key" = "Key.Pref") + + ident(LastKey) operator(:=) reserved(nil)operator(;) comment(// := "Keys.Prev") + ident(Key) operator(:=) ident(Keys)operator(;) comment(// := "LastKey.Next") + + comment(//Now compare step by step) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(and) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) ident(Key)operator(.)ident(Name)operator(\)) reserved(then) reserved(begin) + comment(//cK= Normally (0.9999\) everything's the same) + reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(]\),) ident(NewHKEY)operator(\)\)) reserved(then) + reserved(try) + ident(Key)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(,) ident(Sisy)operator(\);) + reserved(finally) + ident(RegCloseKey)operator(()ident(NewHKEY)operator(\);) + reserved(end)operator(;) + reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(then) + ident(Exit)operator(;) + + ident(LastKey) operator(:=) ident(Key)operator(;) + ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + reserved(end) reserved(else) reserved(begin) comment(//Something's different? Yes, the IMPORTANT rest (0.0001\)\)) + comment(//Because the list finally must exactly fit SL, the "SL[i] key" has) + comment(//to be inserted right here. But first let's look...) + + comment(//Maybe it was just moved? So search for it...) + ident(NewKey) operator(:=) reserved(nil)operator(;) + reserved(if) ident(Assigned)operator(()ident(Key)operator(\)) reserved(then) reserved(begin) + ident(SearchKey_Prev) operator(:=) ident(Key)operator(;) + ident(SearchKey) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + reserved(while) ident(Assigned)operator(()ident(SearchKey)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(SearchKey)operator(.)ident(Name) operator(=) ident(SL)operator([)ident(i)operator(]) reserved(then) reserved(begin) comment(//we found our moved key) + ident(SearchKey_Prev)operator(.)ident(Next) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) comment(//delete it from ) + ident(NewKey) operator(:=) ident(SearchKey)operator(;) comment(//save that we found it) + ident(Break) reserved(end)operator(;) + ident(SearchKey_Prev) operator(:=) ident(SearchKey)operator(;) + ident(SearchKey) operator(:=) ident(SearchKey)operator(.)ident(Next)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(NewKey)operator(\)) reserved(then) reserved(begin) comment(//if we didn't find it) + comment(//cK+ No, not found! So it is new...) + ident(NewKey) operator(:=) ident(TSpyKey)operator(.)ident(Create)operator(()ident(Self)operator(,) ident(SL)operator([)ident(i)operator(]\);) + ident(Sisy)operator(.)ident(IncKeyCount)operator(;) + ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) + comment({ ================ cK+ ================ }) + reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) ident(Sisy)operator(.)ident(Reg)operator(.)ident(KeyExists)operator(()ident(SL)operator([)ident(i)operator(]\)) reserved(then) + ident(Sisy)operator(.)ident(AddKeyChange)operator(()ident(cKeyPlus)operator(,) ident(Path) operator(+) char operator(+) ident(NewKey)operator(.)ident(Name)operator(\);) + + ident(SavedDoReport) operator(:=) ident(Sisy)operator(.)ident(DoReport)operator(;) + reserved(if) ident(Success)operator(()ident(RegOpenKey)operator(()ident(AHKEY)operator(,) ident(PChar)operator(()ident(SL)operator([)ident(i)operator(]\),) ident(NewHKEY)operator(\)\)) reserved(then) + reserved(try) + ident(Sisy)operator(.)ident(DoReport) operator(:=) ident(False)operator(;) + ident(NewKey)operator(.)ident(Spy)operator(()ident(NewHKEY)operator(,) ident(Sisy)operator(\);) comment(//<-- recursion itself) + reserved(finally) + ident(RegCloseKey)operator(()ident(NewHKEY)operator(\);) + ident(Sisy)operator(.)ident(DoReport) operator(:=) ident(SavedDoReport)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + + comment(//The new key now must be placed after the last key) + reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) + ident(LastKey)operator(.)ident(Next) operator(:=) ident(NewKey) + reserved(else) + comment(//If it's the first key, we don't have LastKey defined) + comment(//So we have to set the "Root" to it) + ident(Keys) operator(:=) ident(NewKey)operator(;) + + comment(//Now the rest of has to be placed after the new key) + ident(NewKey)operator(.)ident(Next) operator(:=) ident(Key)operator(;) + comment(//And LastKey also has to refreshed: It is "Key.Pref" = NewKey!) + ident(LastKey) operator(:=) ident(NewKey)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//Because the whole before Key is exactly , the rest) + comment(//(if there is one\) must have been deleted!) + + comment(//So first let's ensure that ends here:) + reserved(if) ident(Assigned)operator(()ident(LastKey)operator(\)) reserved(then) + ident(LastKey)operator(.)ident(Next) operator(:=) reserved(nil) + reserved(else) + comment(//Another time: is empty now, so set Keys instead) + ident(Keys) operator(:=) reserved(nil)operator(;) + + comment(//Now, the first key that maybe was "cut" off is Key:) + reserved(while) ident(Assigned)operator(()ident(Key)operator(\)) reserved(do) reserved(begin) + comment(//cV- So, here really something HAS been deleted) + ident(LastKey) operator(:=) ident(Key)operator(;) + ident(Key) operator(:=) ident(Key)operator(.)ident(Next)operator(;) + ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) + comment({ ================ cK- ================ }) + reserved(if) ident(Sisy)operator(.)ident(Started) reserved(and) reserved(not) ident(Sisy)operator(.)ident(Reg)operator(.)ident(KeyExists)operator(()ident(LastKey)operator(.)ident(Name)operator(\)) reserved(then) + ident(Sisy)operator(.)ident(AddKeyChange)operator(()ident(cKeyMinus)operator(,) ident(Path) operator(+) char operator(+) ident(LastKey)operator(.)ident(Name)operator(\);) + ident(LastKey)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + +reserved(begin) + reserved(if) ident(Sisy)operator(.)ident(Terminated) reserved(or) operator(()ident(AHKEY) operator(=) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + ident(LastKey) operator(:=) ident(Sisy)operator(.)ident(CurrentSpyKey)operator(;) + ident(Sisy)operator(.)ident(CurrentSpyKey) operator(:=) ident(Self)operator(;) + + ident(Sisy)operator(.)ident(IncKeyIndex)operator(;) + + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) ident(AHKEY)operator(;) + ident(CompareValues)operator(;) + reserved(if) ident(Sisy)operator(.)ident(Started) reserved(then) ident(CompareData)operator(;) + ident(CompareKeys)operator(;) + reserved(finally) + ident(Sisy)operator(.)ident(Reg)operator(.)ident(CurrentKey) operator(:=) integer(0)operator(;) + ident(SL)operator(.)ident(Free)operator(;) + ident(Sisy)operator(.)ident(CurrentSpyKey) operator(:=) ident(LastKey)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +comment({ TSisyChange }) + +reserved(constructor) ident(TSisyChange)operator(.)ident(Create)operator(()ident(ATyp)operator(:) ident(TSisyChangeType)operator(;) reserved(const) ident(APath)operator(:) reserved(string)operator(;) + ident(AOldContext)operator(:) ident(TRegContext)operator(;) ident(ANewContext)operator(:) ident(TRegContext)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(;) + ident(Typ) operator(:=) ident(ATyp)operator(;) + ident(Path) operator(:=) ident(APath)operator(;) + ident(Old) operator(:=) ident(AOldContext)operator(;) + ident(New) operator(:=) ident(ANewContext)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyChange)operator(.)ident(ReportToPluto)operator(;) +reserved(var) + ident(Node)operator(,) ident(RootNode)operator(:) ident(TTreeNode)operator(;) + ident(Root)operator(,) ident(SubPath)operator(:) reserved(string)operator(;) + ident(NewNode)operator(:) ident(Boolean)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(function) ident(IconOfSisyChangeType)operator(()ident(Typ)operator(:) ident(TSisyChangeType)operator(\):) ident(Integer)operator(;) + reserved(begin) + ident(Result) operator(:=) operator(-)integer(1)operator(;) + reserved(case) ident(Typ) reserved(of) + comment(//cNone, cError: Result := -1;) + ident(cKeyPlus)operator(..)ident(cContextChange)operator(:) ident(Result) operator(:=) ident(Integer)operator(()ident(Typ)operator(\)) operator(-) integer(2)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(function) ident(FindNode)operator(()ident(Text)operator(:) reserved(string)operator(\):) ident(TTreeNode)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(WorkWin)operator(.)ident(SisyTV)operator(.)ident(Items)operator(.)ident(GetFirstNode)operator(;) + reserved(while) ident(Assigned)operator(()ident(Result)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(SameText)operator(()ident(Result)operator(.)ident(Text)operator(,) ident(Text)operator(\)) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) ident(Result)operator(.)ident(GetNextSibling)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) ident(WorkWin)operator(.)ident(SisyListCB)operator(.)ident(Checked) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Typ) reserved(in) operator([)ident(cContextChange)operator(,) ident(cValueMinus)operator(,) ident(cValuePlus)operator(]) reserved(then) reserved(begin) + ident(Root) operator(:=) ident(ExRegFullKey)operator(()ident(Path)operator(\);) + ident(SubPath) operator(:=) ident(ExRegValue)operator(()ident(Path)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Root) operator(:=) ident(UntilLastChar)operator(()ident(ExRegFullKey)operator(()ident(Path)operator(\),) charoperator(\);) + ident(SubPath) operator(:=) ident(FromLastChar)operator(()ident(ExRegFullKey)operator(()ident(Path)operator(\),) charoperator(\);) + reserved(end)operator(;) + + reserved(with) ident(WorkWin) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SisyFilter)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(TextAtPos)operator(()ident(Root)operator(,) integer(1)operator(,) ident(SisyFilter)operator([)ident(i)operator(]\)) reserved(then) reserved(begin) + comment(//show that it's working) + reserved(with) ident(FilterChangesB) reserved(do) reserved(begin) + ident(Caption) operator(:=) stringoperator(;) + ident(Repaint)operator(;) + ident(Caption) operator(:=) stringoperator(;) + ident(Repaint)operator(;) + reserved(end)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + reserved(with) ident(WorkWin)operator(.)ident(SisyTV)operator(.)ident(Items) reserved(do) reserved(begin) + ident(BeginUpdate)operator(;) + reserved(try) + ident(RootNode) operator(:=) ident(FindNode)operator(()ident(Root)operator(\);) + ident(NewNode) operator(:=) reserved(not) ident(Assigned)operator(()ident(RootNode)operator(\);) + reserved(if) ident(NewNode) reserved(then) reserved(begin) + ident(RootNode) operator(:=) ident(AddChild)operator(()reserved(nil)operator(,) ident(Root)operator(\);) + ident(RootNode)operator(.)ident(ImageIndex) operator(:=) ident(iconGroup)operator(;) + reserved(end) reserved(else) reserved(if) reserved(not) ident(SisyChangeActivated)operator(()ident(RootNode)operator(\)) reserved(then) reserved(begin) + ident(EndUpdate)operator(;) + ident(Exit) reserved(end)operator(;) + + ident(Node) operator(:=) ident(AddChildObject)operator(()ident(RootNode)operator(,) ident(SubPath)operator(,) ident(Self)operator(\);) + ident(Node)operator(.)ident(ImageIndex) operator(:=) ident(IconOfSisyChangeType)operator(()ident(Typ)operator(\);) + reserved(if) ident(Typ) operator(=) ident(cContextChange) reserved(then) reserved(begin) + ident(AddChild)operator(()ident(Node)operator(,) ident(DataPreviewOfContext)operator(()ident(Old)operator(\)\).)ident(ImageIndex) operator(:=) ident(iconOldContext)operator(;) + ident(AddChild)operator(()ident(Node)operator(,) ident(DataPreviewOfContext)operator(()ident(New)operator(\)\).)ident(ImageIndex) operator(:=) ident(iconNewContext)operator(;) + reserved(end)operator(;) + reserved(finally) + ident(EndUpdate)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(NewNode) reserved(and) ident(WorkWin)operator(.)ident(SisyExpandGroupsCB)operator(.)ident(Checked) reserved(then) + ident(RootNode)operator(.)ident(Expand)operator(()ident(False)operator(\);) + + reserved(if) reserved(not) ident(RootNode)operator(.)ident(Expanded) reserved(then) + ident(RootNode)operator(.)ident(ImageIndex) operator(:=) ident(iconGroupBlinking)operator(;) +reserved(end)operator(;) + +comment({ TSisyList }) + +reserved(function) ident(TSisyList)operator(.)ident(GetSisy)operator(()ident(Index)operator(:) ident(Integer)operator(\):) ident(TSisyThread)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Get)operator(()ident(Index)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyList)operator(.)ident(PutSisy)operator(()ident(Index)operator(:) ident(Integer)operator(;) ident(Sisy)operator(:) ident(TSisyThread)operator(\);) +reserved(begin) + ident(Put)operator(()ident(Index)operator(,) ident(Sisy)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyList)operator(.)ident(Resume)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(Items)operator([)ident(i)operator(].)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSisyList)operator(.)ident(Suspend)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(Items)operator([)ident(i)operator(].)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(initialization) + ident(SisyFilter) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(SisyFilter)operator(.)ident(Sorted) operator(:=) ident(True)operator(;) + ident(SisyFilter)operator(.)ident(Duplicates) operator(:=) ident(dupIgnore)operator(;) + +reserved(finalization) + ident(SisyFilter)operator(.)ident(Free)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(splash)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) ident(Dialogs)operator(,) + ident(ExtCtrls)operator(,) ident(StdCtrls)operator(,) ident(ImgList)operator(,) ident(YTools)operator(,) ident(IniFiles)operator(,) ident(LinkLabel)operator(,) ident(PrefTools)operator(,) + ident(PlutoConst)operator(;) + +reserved(type) + ident(TSplashWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(Image1)operator(:) ident(TImage)operator(;) + ident(StartB)operator(:) ident(TButton)operator(;) + ident(SplashScreenCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(LinkLabel1)operator(:) ident(TLinkLabel)operator(;) + ident(LinkLabel2)operator(:) ident(TLinkLabel)operator(;) + ident(LogoL)operator(:) ident(TLabel)operator(;) + reserved(procedure) ident(StartBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormHide)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(end)operator(;) + +reserved(var) + ident(SplashWin)operator(:) ident(TSplashWin)operator(;) + +reserved(implementation) + +reserved(uses) ident(plutomain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(;) + +preprocessor({$R *.DFM}) + +reserved(procedure) ident(TSplashWin)operator(.)ident(StartBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Close)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSplashWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(const) + ident(Messages)operator(:) reserved(array)operator([)integer(0)operator(..)integer(12)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + string + operator(\);) +reserved(var) + ident(ImageFile)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Left) operator(:=) operator(()ident(Screen)operator(.)ident(Width) operator(-) ident(Width)operator(\)) reserved(div) integer(2)operator(;) + ident(Top) operator(:=) operator(()ident(Screen)operator(.)ident(Height) operator(-) ident(Height)operator(\)) reserved(div) integer(2)operator(;) + + ident(StartB)operator(.)ident(Caption) operator(:=) ident(Messages)operator([)ident(Random)operator(()ident(Length)operator(()ident(Messages)operator(\)\)];) + ident(SplashWin)operator(.)ident(SplashScreenCB)operator(.)ident(Load)operator(;) + + ident(Caption) operator(:=) string operator(+) ident(Version) operator(+) string operator(+) ident(MainWin)operator(.)ident(Greeting)operator(;) + + reserved(try) + ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) ident(FileEx)operator(()ident(ImageFile)operator(\)) reserved(then) reserved(begin) + reserved(with) ident(Image1)operator(.)ident(Picture) reserved(do) + reserved(if) ident(Graphic) operator(=) reserved(nil) reserved(then) + ident(LoadFromFile)operator(()ident(ImageFile)operator(\);) + reserved(if) reserved(not) ident(Switch)operator(()stringoperator(\)) reserved(then) + ident(LogoL)operator(.)ident(Visible) operator(:=) ident(False)operator(;) + ident(Exit)operator(;) + reserved(end)operator(;) + + ident(ImageFile) operator(:=) ident(PlutoDir) operator(+) stringoperator(;) + reserved(if) ident(FileEx)operator(()ident(ImageFile)operator(\)) reserved(then) reserved(begin) + reserved(with) ident(Image1)operator(.)ident(Picture) reserved(do) + reserved(if) ident(Graphic) operator(=) reserved(nil) reserved(then) + ident(LoadFromFile)operator(()ident(ImageFile)operator(\);) + reserved(end)operator(;) + reserved(except) + ident(ShowMessage)operator(()stringoperator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSplashWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Hide)operator(;) + ident(Randomize)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSplashWin)operator(.)ident(FormHide)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + comment(//Image1.Picture.Bitmap.FreeImage;) +reserved(end)operator(;) + +reserved(procedure) ident(TSplashWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(Close)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TSplashWin)operator(.)ident(SplashScreenCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Started) reserved(then) + ident(PrefWin)operator(.)ident(SplashScreenCB)operator(.)ident(Checked) operator(:=) ident(SplashScreenCB)operator(.)ident(Checked)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(SpyTH)operator(;) + +reserved(interface) + +reserved(uses) + ident(Classes)operator(,) ident(Windows)operator(,) ident(Dialogs)operator(,) ident(ComCtrls)operator(,) ident(CompEx)operator(,) ident(SysUtils)operator(,) ident(YTools)operator(,) ident(clock)operator(,) + ident(plutoconst)operator(,) ident(StdCtrls)operator(,) ident(forms)operator(,) ident(XReg)operator(,) ident(stringcomp)operator(;) + +reserved(type) + ident(TChildren) operator(=) reserved(array) reserved(of) ident(TTreeNode)operator(;) + + ident(TRegSpyThread) operator(=) reserved(class)operator(()ident(TThread)operator(\)) + directive(private) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(CurNode)operator(:) ident(TTreeNode)operator(;) + ident(Dead)operator(:) ident(Boolean)operator(;) + ident(Dif)operator(:) ident(TSLComp)operator(;) + ident(CurChildren)operator(:) ident(TChildren)operator(;) + directive(protected) + reserved(procedure) ident(Execute)operator(;) directive(override)operator(;) + + reserved(procedure) ident(SaveCheckNode)operator(;) + reserved(procedure) ident(SaveGetDif)operator(;) + reserved(procedure) ident(SaveDeleteDead)operator(;) + reserved(procedure) ident(SaveGetChildren)operator(;) + reserved(procedure) ident(SaveAddNew)operator(;) + directive(public) + ident(Restart)operator(:) ident(Boolean)operator(;) + ident(Mess)operator(:) reserved(string)operator(;) + ident(Delay)operator(:) ident(Integer)operator(;) + reserved(function) ident(Alive)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) + reserved(procedure) ident(Spy)operator(;) + reserved(procedure) ident(Reload)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(ReloadValues)operator(;) + reserved(procedure) ident(AddTrace)operator(()ident(Trace)operator(:) reserved(string)operator(\);) + reserved(constructor) ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(\);) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(end)operator(;) + +reserved(implementation) + +reserved(uses) ident(plutomain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(ValuesU)operator(;) + +comment({ TRegSpyThread }) + +reserved(constructor) ident(TRegSpyThread)operator(.)ident(CreateIt)operator(()ident(PriorityLevel)operator(:) ident(TThreadPriority)operator(\);) +reserved(begin) + reserved(inherited) ident(Create)operator(()ident(True)operator(\);) comment(// Create thread suspended) + ident(Priority) operator(:=) ident(PriorityLevel)operator(;) comment(// Set Priority Level) + ident(FreeOnTerminate) operator(:=) ident(False)operator(;) comment(// Thread frees itself when terminated) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + ident(Delay) operator(:=) integer(100)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(Execute)operator(;) +reserved(begin) + reserved(while) reserved(not) ident(Terminated) reserved(do) reserved(begin) + ident(Restart) operator(:=) ident(False)operator(;) + reserved(try) + reserved(if) reserved(not) ident(Terminated) reserved(then) + ident(Sleep)operator(()ident(Delay)operator(\);) + reserved(if) reserved(not) ident(Terminated) reserved(then) + ident(Spy)operator(;) + reserved(except) reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TRegSpyThread)operator(.)ident(Alive)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + + reserved(if) ident(Restart) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + reserved(try) + reserved(if) operator(()ident(Node)operator(.)ident(Text) operator(=) stringoperator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) ident(True)operator(;) + reserved(except) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveCheckNode)operator(;) +reserved(begin) + ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\);) + reserved(if) ident(Dead) reserved(then) + ident(Exit)operator(;) + + ident(CheckNode)operator(()ident(CurNode)operator(,) ident(False)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveGetDif)operator(;) +reserved(var) + ident(Real)operator(,) ident(Cur)operator(:) ident(TStringList)operator(;) +reserved(begin) + ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\);) + reserved(if) ident(Dead) reserved(then) + ident(Exit)operator(;) + + ident(dif) operator(:=) reserved(nil)operator(;) + + reserved(if) reserved(not) ident(CurNode)operator(.)ident(Expanded) reserved(then) reserved(begin) + ident(Dead) operator(:=) ident(True)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) reserved(not) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(CurNode)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Real) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + + ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(Real)operator(\);) + ident(Reg)operator(.)ident(CloseKey)operator(;) + + ident(Cur) operator(:=) ident(GetChildNames)operator(()ident(CurNode)operator(\);) + + reserved(if) operator(()ident(Cur)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(and) operator(()ident(Real)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) + ident(Dead) operator(:=) ident(True)operator(;) + + ident(dif) operator(:=) ident(TSLComp)operator(.)ident(Create)operator(()ident(Cur)operator(,) ident(Real)operator(,) ident(False)operator(\);) + + ident(Cur)operator(.)ident(Free)operator(;) + ident(Real)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveDeleteDead)operator(;) +reserved(var) + ident(TN)operator(:) ident(TTreeNode)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\);) + reserved(if) ident(Dead) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(dif)operator(\)) reserved(or) reserved(not) ident(Assigned)operator(()ident(dif)operator(.)ident(OnlyA)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(CurNode)operator(.)ident(Expanded) reserved(then) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(dif)operator(.)ident(OnlyA)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(TN) operator(:=) ident(FindNode)operator(()ident(CurNode)operator(,) ident(dif)operator(.)ident(OnlyA)operator([)ident(i)operator(]\);) + reserved(if) ident(Assigned)operator(()ident(TN)operator(\)) reserved(then) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(TN)operator(\);) + ident(TN)operator(.)ident(Delete)operator(;) + ident(AddTrace)operator(()string operator(+) ident(dif)operator(.)ident(OnlyA)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + reserved(end) + reserved(else) + ident(Exit)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveGetChildren)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(TN)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\);) + reserved(if) ident(Dead) reserved(then) + ident(Exit)operator(;) + + ident(CurChildren) operator(:=) reserved(nil)operator(;) + ident(SetLength)operator(()ident(CurChildren)operator(,) ident(CurNode)operator(.)ident(Count)operator(\);) + + ident(i) operator(:=) integer(0)operator(;) + ident(TN) operator(:=) ident(CurNode)operator(.)ident(GetFirstChild)operator(;) + reserved(while) ident(Assigned)operator(()ident(TN)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(i) operator(<=) ident(High)operator(()ident(CurChildren)operator(\)) reserved(then) + ident(CurChildren)operator([)ident(i)operator(]) operator(:=) ident(TN) + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) + ident(Inc)operator(()ident(i)operator(\);) + ident(TN) operator(:=) ident(CurNode)operator(.)ident(GetNextChild)operator(()ident(TN)operator(\)) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(SaveAddNew)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Dead) operator(:=) reserved(not) ident(Alive)operator(()ident(CurNode)operator(\);) + reserved(if) ident(Dead) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Dif)operator(\)) reserved(or) reserved(not) ident(Assigned)operator(()ident(Dif)operator(.)ident(OnlyB)operator(\)) reserved(or) operator(()ident(Dif)operator(.)ident(OnlyB)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Dif)operator(.)ident(OnlyB)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Erstellt/hinbenannt) + ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(CurNode)operator(,) ident(Dif)operator(.)ident(OnlyB)operator([)ident(i)operator(]\);) + ident(AddTrace)operator(()string operator(+) ident(dif)operator(.)ident(OnlyB)operator([)ident(i)operator(]\);) + ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) + comment(//AddHint('Neuer Schlüssel: ' + CurNode.Text + '\\' + Dif.OnlyB[i]\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(Reload)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(TN)operator(:) ident(TTreeNode)operator(;) + ident(zCurNode)operator(:) ident(TTreeNode)operator(;) + ident(MyChildren)operator(:) ident(TChildren)operator(;) +reserved(begin) + reserved(if) ident(Terminated) reserved(or) ident(Restart) reserved(then) + ident(Exit)operator(;) + + ident(CurNode) operator(:=) ident(Node)operator(;) + + ident(zCurNode) operator(:=) ident(CurNode)operator(;) + reserved(try) + comment(//Mess := 'SaveCheckNode';) + ident(Synchronize)operator(()ident(SaveCheckNode)operator(\);) + reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + comment(//Mess := 'SaveGetDif';) + ident(Synchronize)operator(()ident(SaveGetDif)operator(\);) + reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + comment(//Mess := 'SaveDeleteDead';) + ident(Synchronize)operator(()ident(SaveDeleteDead)operator(\);) + reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + comment(//Mess := 'SaveGetChildren';) + ident(Synchronize)operator(()ident(SaveGetChildren)operator(\);) + reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + comment(//Mess := 'SaveGetChildren';) + ident(Synchronize)operator(()ident(SaveAddNew)operator(\);) + reserved(if) ident(Dead) reserved(or) ident(Terminated) reserved(then) + ident(Exit)operator(;) + + ident(Dif)operator(.)ident(Free)operator(;) + + comment(//Mess := 'MyChildren';) + ident(SetLength)operator(()ident(MyChildren)operator(,) ident(Length)operator(()ident(CurChildren)operator(\)\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(MyChildren)operator(\)) reserved(do) + ident(MyChildren)operator([)ident(i)operator(]) operator(:=) ident(CurChildren)operator([)ident(i)operator(];) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(MyChildren)operator(\)) reserved(do) reserved(begin) + ident(TN) operator(:=) ident(MyChildren)operator([)ident(i)operator(];) + reserved(if) ident(Alive)operator(()ident(TN)operator(\)) reserved(then) + comment(//if TN.Expanded then) + comment(//if NodeVisible(TN\) then) + ident(Reload)operator(()ident(TN)operator(\);) + comment(//else) + comment(//Break;) + reserved(if) ident(Restart) reserved(or) ident(Terminated) reserved(then) + ident(Break)operator(;) + reserved(end)operator(;) + ident(MyChildren) operator(:=) reserved(nil)operator(;) + + reserved(except) + reserved(if) ident(Terminated) reserved(then) + ident(Exit)operator(;) + ident(AddHint)operator(()string operator(+) ident(Mess)operator(\);) + ident(WorkWin)operator(.)ident(Label7)operator(.)ident(Caption) operator(:=) stringoperator(;) + reserved(end)operator(;) + ident(CurNode) operator(:=) ident(zCurNode)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FindItemByRealName)operator(()ident(LV)operator(:) ident(TListView)operator(;) ident(Text)operator(:) reserved(string)operator(\):) ident(TListItem)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) reserved(nil)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(LV)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(].)ident(Caption) operator(=) ident(Text) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(];) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(LV)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(SameText)operator(()ident(RealValueName)operator(()ident(LV)operator(.)ident(Items)operator([)ident(i)operator(]\),) ident(Text)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(LV)operator(.)ident(Items)operator([)ident(i)operator(];) + ident(Break)operator(;) reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(ReloadValues)operator(;) +reserved(var) + ident(Item)operator(:) ident(TListItem)operator(;) + ident(Real)operator(,) ident(Cur)operator(:) ident(TStringList)operator(;) + ident(Dif)operator(:) ident(TSLComp)operator(;) + ident(i)operator(:) ident(integer)operator(;) +reserved(begin) + reserved(if) ident(Terminated) reserved(or) ident(Restart) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Real) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(Reg)operator(.)ident(GetValueNames)operator(()ident(Real)operator(\);) + + ident(Cur) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(Cur)operator(.)ident(Add)operator(()ident(RealValueName)operator(()ident(Item)operator([)ident(i)operator(]\)\);) + + ident(Dif) operator(:=) ident(TSLComp)operator(.)ident(Create)operator(()ident(Cur)operator(,) ident(Real)operator(,) ident(False)operator(\);) + ident(Real)operator(.)ident(Free)operator(;) + ident(Cur)operator(.)ident(Free)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Dif)operator(.)ident(OnlyA)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Gelöscht/wegbenannt) + ident(Item) operator(:=) ident(FindItemByRealName)operator(()ident(ValueList)operator(,) ident(Dif)operator(.)ident(OnlyA)operator([)ident(i)operator(]\);) + reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) reserved(begin) + ident(Item)operator(.)ident(Delete)operator(;) + ident(AddTrace)operator(()string operator(+) ident(Dif)operator(.)ident(OnlyA)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Daten) + ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(];) + comment({if Item.SubItems.Count < 2 then begin + ShowMessage('Fehler in Sync.'\); + Exit end; }) + reserved(if) ident(ValuesWin)operator(.)ident(UpdateValue)operator(()ident(Reg)operator(,) ident(Item)operator(\)) reserved(then) + ident(AddTrace)operator(()string operator(+) ident(Item)operator(.)ident(Caption) operator(+) string operator(+) + ident(ValueDataPreview)operator(()ident(Reg)operator(.)ident(ReadContext)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)\)\);) + reserved(end)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(dif)operator(.)ident(OnlyB)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) comment(//Erstellt/hinbenannt) + ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(dif)operator(.)ident(OnlyB)operator([)ident(i)operator(]\);) + ident(AddTrace)operator(()string operator(+) ident(Dif)operator(.)ident(OnlyB)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + + ident(Reg)operator(.)ident(CloseKey)operator(;) + ident(Dif)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(Spy)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(a)operator(:) ident(Real)operator(;) +reserved(begin) + reserved(with) ident(TClock)operator(.)ident(Create) reserved(do) reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(RootNodes)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(Reload)operator(()ident(TTreeNode)operator(()ident(RootNodes)operator([)ident(i)operator(]\)\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) + ident(Reload)operator(()ident(Shortcuts)operator([)ident(i)operator(].)ident(Node)operator(\);) + ident(Synchronize)operator(()ident(ReloadValues)operator(\);) + ident(a) operator(:=) ident(SecondsPassed) operator(*) integer(1000)operator(;) + ident(Free)operator(;) reserved(end)operator(;) + + reserved(if) ident(a) operator(>) integer(0) reserved(then) + ident(WorkWin)operator(.)ident(Label7)operator(.)ident(Caption) operator(:=) string operator(+) ident(Format)operator(()stringoperator(,) operator([)ident(a)operator(]\)) operator(+) stringoperator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TRegSpyThread)operator(.)ident(AddTrace)operator(()ident(Trace)operator(:) reserved(string)operator(\);) +reserved(begin) + reserved(with) ident(WorkWin) reserved(do) + reserved(if) ident(ListTracesCB)operator(.)ident(Checked) reserved(then) + ident(SpyLB)operator(.)ident(Items)operator(.)ident(Add)operator(()ident(Trace)operator(\);) +reserved(end)operator(;) + +reserved(destructor) ident(TRegSpyThread)operator(.)ident(Destroy)operator(;) +reserved(begin) + ident(Dif)operator(.)ident(Free)operator(;) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(TreeU)operator(;) +preprocessor({$DEFINE UNIKEY}) +preprocessor({$DEFINE CYCFS}) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) + ident(ComCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(keybrd)operator(,) ident(Dialogs)operator(,) ident(YTools)operator(,) ident(PlutoConst)operator(,) ident(CompEx)operator(,) + ident(IniFiles)operator(,) ident(XReg)operator(,) ident(Colors)operator(,) ident(Clock)operator(,) + ident(ToolWin)operator(,) ident(RegFiles) preprocessor({$IFDEF UNIKEY})operator(,) ident(UniKey)operator(,) ident(ImgList) preprocessor({$ENDIF})operator(;) + +reserved(type) + ident(TTreeWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(RegTVPU)operator(:) ident(TPopupMenu)operator(;) + ident(NewSubKeyMI)operator(:) ident(TMenuItem)operator(;) + ident(NewKeyMI)operator(:) ident(TMenuItem)operator(;) + ident(CreateShortcutMI)operator(:) ident(TMenuItem)operator(;) + ident(TraceMI)operator(:) ident(TMenuItem)operator(;) + ident(N3)operator(:) ident(TMenuItem)operator(;) + ident(DeleteMI)operator(:) ident(TMenuItem)operator(;) + ident(DublicateMI)operator(:) ident(TMenuItem)operator(;) + ident(N4)operator(:) ident(TMenuItem)operator(;) + ident(FindMI)operator(:) ident(TMenuItem)operator(;) + ident(RegTV)operator(:) ident(TTreeView)operator(;) + ident(PastePathMI)operator(:) ident(TMenuItem)operator(;) + ident(N1)operator(:) ident(TMenuItem)operator(;) + ident(InsertPathMI)operator(:) ident(TMenuItem)operator(;) + ident(RenameMI)operator(:) ident(TMenuItem)operator(;) + ident(CopyPathMI)operator(:) ident(TMenuItem)operator(;) + ident(CutPathMI)operator(:) ident(TMenuItem)operator(;) + ident(EditShortcutMI)operator(:) ident(TMenuItem)operator(;) + ident(N2)operator(:) ident(TMenuItem)operator(;) + ident(Export1)operator(:) ident(TMenuItem)operator(;) + ident(SubKeylist1)operator(:) ident(TMenuItem)operator(;) + ident(ValueNameslist1)operator(:) ident(TMenuItem)operator(;) + ident(KeyInfosMI)operator(:) ident(TMenuItem)operator(;) + ident(N5)operator(:) ident(TMenuItem)operator(;) + ident(ExportAsReg)operator(:) ident(TMenuItem)operator(;) + ident(ExportD)operator(:) ident(TSaveDialog)operator(;) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(RegTVChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVCollapsing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowCollapse)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(RegTVDragDrop)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(RegTVDragOver)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TDragState)operator(;) reserved(var) ident(Accept)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(S)operator(:) ident(String)operator(\);) + reserved(procedure) ident(RegTVEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVEndDrag)operator(()ident(Sender)operator(,) ident(Target)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(RegTVEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(RegTVExpanding)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(AllowExpansion)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RegTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(RegTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(RegTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(RegTVStartDrag)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(DragObject)operator(:) ident(TDragObject)operator(\);) + + reserved(function) ident(CreateKey)operator(()ident(Subkey)operator(:) ident(Boolean)operator(\):) ident(Boolean)operator(;) + reserved(procedure) ident(CloneKey)operator(;) + reserved(procedure) ident(DeleteKey)operator(;) + reserved(procedure) ident(NewShortcut)operator(;) + reserved(procedure) ident(MoveKey)operator(()reserved(const) ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(MoveValues)operator(()ident(SrcNode)operator(,) ident(TrgNode)operator(:) ident(TTreeNode)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\);) + + reserved(procedure) ident(NewSubKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CreateShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(TraceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FindMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(RegTVKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\);) + reserved(procedure) ident(RegTVAdvancedCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) ident(Stage)operator(:) ident(TCustomDrawStage)operator(;) + reserved(var) ident(PaintImages)operator(,) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(InsertPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RegTVGetImageIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(CheckRegTVHotTrack)operator(;) + reserved(procedure) ident(PasteKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CutPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(OpenNextLevel)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(EditShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SubKeylist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ValueNameslist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(KeyInfosMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(function) ident(GetKeyInfos)operator(:) reserved(string)operator(;) + reserved(procedure) ident(ExportAsRegClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) + + reserved(procedure) ident(Load)operator(;) + reserved(procedure) ident(Reg4WriterTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + directive(private) + ident(DragNode)operator(:) ident(TTreeNode)operator(;) + ident(NoAsterisk)operator(:) ident(Boolean)operator(;) comment(//To prevent NumPadMULTIPLY and asterisk errors) + ident(UserCopyKeyFlag)operator(:) ident(Boolean)operator(;) + ident(SpaceCount)operator(:) ident(Integer)operator(;) comment(//EasterEgg) + directive(public) + ident(CantWrite)operator(:) ident(Boolean)operator(;) + ident(DoSmartExpand)operator(:) ident(Boolean)operator(;) + reserved(end)operator(;) + +reserved(procedure) ident(CheckNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(TakeNodeSelected)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) + +reserved(function) ident(AddShortcut)operator(()ident(Alias)operator(,) ident(RealPath)operator(:) reserved(string)operator(;) ident(Icon)operator(:) ident(Integer)operator(;) + ident(AHostType)operator(:) ident(TUniHostType) operator(=) ident(uhUserShortcut)operator(;) ident(WriteIni)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(TTreeNode)operator(;) +reserved(function) ident(ShortcutIndex)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Integer)operator(;) + +reserved(function) ident(TraceKey)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) + ident(uhNonSystemShortcuts)operator(\):) reserved(string)operator(;) + +reserved(type) + ident(TOpenNodeMode) operator(=) operator(()ident(onNodeNil)operator(,) ident(onError)operator(,) ident(onReadOnly)operator(,) ident(onFull)operator(\);) + +reserved(const) + ident(onOK) operator(=) operator([)ident(onFull)operator(,) ident(onReadOnly)operator(];) + +reserved(function) ident(OpenNode)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(TOpenNodeMode)operator(;) +reserved(function) ident(OpenNodeOK)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(OpenCurKey)operator(:) ident(Boolean)operator(;) +reserved(function) ident(OpenCurParent)operator(:) ident(Boolean)operator(;) + +reserved(var) + ident(TreeWin)operator(:) ident(TTreeWin)operator(;) + + ident(RegTV)operator(:) ident(TTreeView)operator(;) comment(//Shortcut for other units, equals TreeWin.RegTV) + +preprocessor({$IFDEF UNIKEY}) + ident(UserUniPath)operator(:) reserved(string) preprocessor({$IFDEF CYCFS}) operator(=) string)delimiter(')>preprocessor({$ENDIF})operator(;) +preprocessor({$ENDIF}) + ident(Shortcuts)operator(:) ident(TShortcutA)operator(;) + ident(RootNodes)operator(:) ident(TList)operator(;) comment(//list of TTreeNode;) + +reserved(implementation) + +reserved(uses) + ident(PlutoMain)operator(,) ident(ValuesU)operator(,) ident(FindWinU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(,) ident(ShellEx)operator(,) ident(Types)operator(;) + +preprocessor({$R *.dfm}) + +preprocessor({$IFDEF UNIKEY}) +reserved(function) ident(UniOfNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(TUniKey)operator(;) +reserved(var) + ident(UniPath)operator(:) ident(TUniPath)operator(;) +reserved(begin) + ident(UniPath) operator(:=) ident(UniOfStr)operator(()ident(UserUniPath)operator(\);) + ident(UniPath)operator(.)ident(Path) operator(:=) ident(Join)operator(()ident(Copy)operator(()ident(NodePath)operator(()ident(Node)operator(\),) integer(1)operator(,) ident(MaxInt)operator(\),) charoperator(\);) + ident(Result) operator(:=) ident(TUniKey)operator(.)ident(CreateU)operator(()ident(UniPath)operator(,) ident(reTryToSolve)operator(\);) +reserved(end)operator(;) +preprocessor({$ENDIF}) + +reserved(procedure) ident(TTreeWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(TreeU)operator(.)ident(RegTV) operator(:=) ident(RegTV)operator(;) + + ident(DragNode) operator(:=) reserved(nil)operator(;) + ident(NoAsterisk) operator(:=) ident(False)operator(;) + ident(DoSmartExpand) operator(:=) ident(True)operator(;) + ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) + ident(SpaceCount) operator(:=) integer(0)operator(;) comment(//EasterEgg) + + ident(RegTV)operator(.)ident(Items)operator(.)ident(Clear)operator(;) + ident(CheckRegTVHotTrack)operator(;) + + ident(KeyInfosMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyInfos)operator(;) + + ident(NewSubKeyMI)operator(.)ident(ImageIndex) operator(:=) ident(iconSubKey)operator(;) + ident(NewKeyMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKey)operator(;) + ident(CreateShortcutMI)operator(.)ident(ImageIndex) operator(:=) ident(iconShortcut)operator(;) + + ident(RenameMI)operator(.)ident(ImageIndex) operator(:=) ident(iconRename)operator(;) + ident(DeleteMI)operator(.)ident(ImageIndex) operator(:=) ident(iconDelete)operator(;) + ident(DublicateMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyDublicate)operator(;) + + ident(FindMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyFind)operator(;) + ident(TraceMI)operator(.)ident(ImageIndex) operator(:=) ident(iconKeyTrace)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)) reserved(then) reserved(begin) + ident(TraceMIClick)operator(()ident(Sender)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(var) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(OpenRe)operator(:) ident(TOpenNodeMode)operator(;) + +preprocessor({$IFDEF UNIKEY}) + ident(Uni)operator(:) ident(TUniKey)operator(;) + ident(ValueNames)operator(:) ident(TStringList)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(AppendSubItemData)operator(()ident(SubItems)operator(:) ident(TStrings)operator(;) ident(Uni)operator(:) ident(TUniKey)operator(;) + reserved(const) ident(ValueName)operator(:) reserved(string)operator(\);) + reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(s)operator(:) reserved(string)operator(\);) + reserved(begin) + ident(SubItems)operator(.)ident(Append)operator(()ident(s)operator(\);) + reserved(end)operator(;) + + reserved(begin) + ident(SL) operator(:=) reserved(nil)operator(;) + reserved(try) + ident(Add)operator(()stringoperator(\);) + + reserved(case) ident(Uni)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\)) reserved(of) + + ident(udString)operator(,) ident(udExpandString)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + ident(Add)operator(()ident(Uni)operator(.)ident(ReadString)operator(()ident(ValueName)operator(\)\);) + reserved(end)operator(;) + + ident(udCardinal)operator(,) ident(udCardBigEndian)operator(,) ident(udInteger)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + ident(Add)operator(()ident(IntToStr)operator(()ident(Uni)operator(.)ident(ReadInteger)operator(()ident(ValueName)operator(\)\)\);) + reserved(end)operator(;) + + ident(udBinary)operator(,) ident(udNone)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + ident(Add)operator(()ident(FriendlyStr)operator(()ident(Uni)operator(.)ident(ReadBinary)operator(()ident(ValueName)operator(\)\)\);) + reserved(end)operator(;) + + ident(udBoolean)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + ident(Add)operator(()ident(StrOfBool)operator(()ident(Uni)operator(.)ident(ReadBool)operator(()ident(ValueName)operator(\)\)\);) + reserved(end)operator(;) + + ident(udStringList)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(SL)operator(\)) reserved(then) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create) + reserved(else) + ident(SL)operator(.)ident(Clear)operator(;) + ident(Uni)operator(.)ident(ReadStringList)operator(()ident(ValueName)operator(,) ident(SL)operator(\);) + ident(Add)operator(()ident(Join)operator(()ident(SL)operator(,) ident(MultiStringSeparator)operator(\)\);) + reserved(end)operator(;) + + ident(udColor)operator(:) reserved(begin) + ident(Add)operator(()stringoperator(\);) + ident(Add)operator(()ident(ColorToString)operator(()ident(Uni)operator(.)ident(ReadColor)operator(()ident(ValueName)operator(\)\)\);) + reserved(end)operator(;) + + reserved(else) + ident(Add)operator(()string operator(+) + ident(IntToStr)operator(()ident(Cardinal)operator(()ident(Uni)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\)\)\)\);) + reserved(end)operator(;) comment(//case) + + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + +preprocessor({$ENDIF}) + +reserved(begin) + ident(SpaceCount) operator(:=) integer(0)operator(;) comment(//Easteregg) + + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + ident(CantWrite) operator(:=) ident(False)operator(;) + + reserved(try) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + +preprocessor({$IFDEF UNIKEY}) + reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\).)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) + ident(ValueNames) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(ValueList)operator(.)ident(Clear)operator(;) + + ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\);) + comment({Uni := CreateUniSubKey(UserUniPath, Copy(NodePath(Node\), 1, MaxInt\), + reFaile\); }) + reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) + reserved(try) + ident(Uni)operator(.)ident(GetValueNames)operator(()ident(ValueNames)operator(\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueNames)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(Item) operator(:=) ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(ValueNames)operator([)ident(i)operator(],) ident(False)operator(\);) + ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(iconHostUni2)operator(;) + ident(AppendSubItemData)operator(()ident(Item)operator(.)ident(SubItems)operator(,) ident(Uni)operator(,) ident(ValueNames)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + + reserved(finally) + ident(Uni)operator(.)ident(Free)operator(;) + ident(ValueNames)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(end) reserved(else) reserved(begin) +preprocessor({$ENDIF}) + + ident(OpenRe) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\);) + reserved(if) ident(OpenRe) reserved(in) ident(onOK) reserved(then) reserved(begin) + ident(ValuesWin)operator(.)ident(LoadValues)operator(()ident(Reg)operator(\);) + reserved(if) ident(OpenRe) operator(=) ident(onReadOnly) reserved(then) reserved(begin) + ident(AddHint)operator(()stringoperator(,) ident(True)operator(\);) + ident(CantWrite) operator(:=) ident(True)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) reserved(if) ident(OpenRe) operator(=) ident(onError) reserved(then) reserved(begin) + ident(ValueList)operator(.)ident(Clear)operator(;) + ident(CantWrite) operator(:=) ident(True)operator(;) + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) + ident(AddHint)operator(()stringoperator(,) ident(True)operator(\);) + reserved(end) reserved(else) + ident(AddHint)operator(()string operator(+) ident(Node)operator(.)ident(Text)operator(,) ident(True)operator(\);) + reserved(end)operator(;) + +preprocessor({$IFDEF UNIKEY}) + reserved(end)operator(;) +preprocessor({$ENDIF}) + + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + ident(CantWrite) operator(:=) ident(CantWrite) reserved(or) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) + reserved(or) ident(NodeInfo)operator(() ident(Node) operator(\).)ident(ReadOnly) comment(//Node itself) + reserved(or) ident(NodeInfo)operator(()ident(RootOfNode)operator(()ident(Node)operator(\)\).)ident(ReadOnly) comment(//or host) + reserved(or) operator(()ident(SameText)operator(()ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\).)ident(Root)operator(,) stringoperator(\)\);) + + ident(MainWin)operator(.)ident(SetStatus)operator(;) + ident(WorkWin)operator(.)ident(InfoMemo)operator(.)ident(Text) operator(:=) ident(GetKeyInfos)operator(;) + reserved(finally) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) +reserved(begin) + ident(CantWrite) operator(:=) ident(False)operator(;) + ident(AllowChange) operator(:=) ident(Assigned)operator(()ident(Node)operator(\);) + comment(// CheckNode(Node, True\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVCollapsing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(var) ident(AllowCollapse)operator(:) ident(Boolean)operator(\);) +reserved(begin) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(Node)operator(.)ident(DeleteChildren)operator(;) + ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(Info)operator(:) ident(TNodeInfo)operator(;) +reserved(begin) + comment({if Node.Text = '' then begin + ShowMessage('Error: Key has empty name.'\); + Node.Delete; + Exit; end;}) + + ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\);) + reserved(with) ident(TTreeView)operator(()ident(Sender)operator(\).)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Info)operator(.)ident(Defect) reserved(then) reserved(begin) + ident(Style) operator(:=) operator([];) + ident(Color) operator(:=) hex($AAAAAA) + reserved(end) reserved(else) reserved(begin) + reserved(case) ident(Info)operator(.)ident(HostType) reserved(of) + + ident(uhReg)operator(:) reserved(begin) + ident(Style) operator(:=) operator([)ident(fsBold)operator(];) + ident(Color) operator(:=) ident(clCyan)operator(;) + reserved(end)operator(;) + + comment({uhIni: begin + Style := [fsBold]; + Color := clBrightYellow; + end; + + uhRegFile: begin + Style := [fsBold]; + Color := clBrightGreen; + end; }) + + ident(uhSystemShortcut)operator(:) reserved(begin) + ident(Style) operator(:=) operator([];) + ident(Color) operator(:=) ident(clBrightCyan)operator(;) + reserved(end)operator(;) + + ident(uhStandardShortcut)operator(:) reserved(begin) + ident(Style) operator(:=) operator([)ident(fsBold)operator(];) + ident(Color) operator(:=) hex($EEEEEE)operator(;) + reserved(end)operator(;) + + ident(uhUserShortcut)operator(:) reserved(begin) + ident(Style) operator(:=) operator([];) + ident(Color) operator(:=) hex($EEEEEE)operator(;) + reserved(end)operator(;) + + reserved(else) + ident(Style) operator(:=) operator([];) + reserved(if) ident(Info)operator(.)ident(ReadOnly) reserved(then) + ident(Color) operator(:=) ident(clBrightRed) + reserved(else) + ident(Color) operator(:=) ident(clWhite)operator(;) + reserved(end)operator(;) + + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(MouseX)operator(:) ident(Integer)operator(;) + ident(NodeRect)operator(:) ident(TRect)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(MouseX) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\).)ident(X)operator(;) + ident(NodeRect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\);) + reserved(if) ident(MouseX) operator(>) ident(NodeRect)operator(.)ident(Right) reserved(then) reserved(begin) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + ident(FocusItem)operator(()ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(\);) + ident(ValueListDblClick)operator(()ident(Self)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + reserved(if) ident(Node)operator(.)ident(Selected) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\);) + ident(NodeInfo)operator(()ident(Node)operator(\).)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDragDrop)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + + reserved(procedure) ident(DragKey)operator(;) + reserved(var) + ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(begin) + ident(Src) operator(:=) ident(RegPathOfStr)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(DragNode)operator(\)\)\);) + ident(Trg) operator(:=) ident(RegPathOfStr)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(DropTarget)operator(\)\)\);) + ident(Trg)operator(.)ident(Key) operator(:=) ident(Trg)operator(.)ident(Key) operator(+) char operator(+) ident(DragNode)operator(.)ident(Text)operator(;) + + ident(MoveKey)operator(()ident(Src)operator(,) ident(Trg)operator(,) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)\);) + + ident(Node) operator(:=) ident(RegTV)operator(.)ident(DropTarget)operator(;) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\);) + ident(Node)operator(.)ident(Expanded) operator(:=) ident(False)operator(;) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(,) ident(True)operator(\);) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + reserved(end)operator(;) + + reserved(procedure) ident(DragValues)operator(;) + reserved(begin) + ident(MoveValues)operator(()ident(RegTV)operator(.)ident(Selected)operator(,) ident(RegTV)operator(.)ident(DropTarget)operator(,) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(Source) reserved(is) ident(TTreeView) reserved(then) + ident(DragKey) + reserved(else) reserved(if) ident(Source) reserved(is) ident(TListView) reserved(then) + ident(DragValues)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVDragOver)operator(()ident(Sender)operator(,) ident(Source)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(;) + ident(State)operator(:) ident(TDragState)operator(;) reserved(var) ident(Accept)operator(:) ident(Boolean)operator(\);) +reserved(begin) + ident(Accept) operator(:=) ident(False)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(RegTV)operator(.)ident(DropTarget)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Source) reserved(is) ident(TTreeView) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(DragNode)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(if) reserved(not) ident(KeyIsDown)operator(()ident(VK_CONTROL)operator(\)) reserved(then) reserved(begin) + reserved(if) operator(()ident(DragNode) operator(=) ident(RegTV)operator(.)ident(DropTarget)operator(\)) + reserved(or) ident(RegTV)operator(.)ident(DropTarget)operator(.)ident(HasAsParent)operator(()ident(DragNode)operator(\)) reserved(then) + ident(Exit)operator(;) comment(//avoid recursive moving) + reserved(end)operator(;) + reserved(end) reserved(else) reserved(if) ident(Source) reserved(is) ident(TListView) reserved(then) reserved(begin) + comment(//accept) + reserved(end)operator(;) + ident(Accept) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) reserved(var) ident(S)operator(:) reserved(string)operator(\);) +reserved(var) + ident(old)operator(,) ident(tmp)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(Shortcut)operator(:) ident(PKeyShortcut)operator(;) +reserved(begin) + reserved(if) ident(s) operator(=) ident(Node)operator(.)ident(Text) reserved(then) + ident(Exit)operator(;) + + ident(Old) operator(:=) ident(Node)operator(.)ident(Text)operator(;) + + reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\).)ident(HostType) operator(=) ident(uhUserShortcut) reserved(then) reserved(begin) + ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\);) + reserved(if) ident(i) operator(=) operator(-)integer(1) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(s) operator(:=) ident(old)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Shortcut) operator(:=) operator(@)ident(Shortcuts)operator([)ident(i)operator(];) + ident(Shortcut)operator(.)ident(Alias) operator(:=) ident(s)operator(;) + + reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) + reserved(try) + ident(DeleteKey)operator(()stringoperator(,) ident(Old)operator(\);) + ident(WriteString)operator(()stringoperator(,) ident(Shortcut)operator(.)ident(Alias)operator(,) ident(Shortcut)operator(.)ident(RealPath)operator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) + ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) + ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(s) operator(=) string reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(s) operator(:=) ident(old)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) + + reserved(if) ident(Length)operator(()ident(s)operator(\)) operator(>) ident(RegMaxKeyLen) reserved(then) reserved(begin) + ident(s) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(1)operator(,) ident(RegMaxKeyLen)operator(\);) + reserved(if) ident(MessageDlg)operator(() + string operator(+) ident(IntToStr)operator(()ident(RegMaxKeyLen)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(Quote)operator(()ident(StringWrap)operator(()ident(s)operator(,) integer(80)operator(\)\),) + ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) operator(<>) ident(mrOK) reserved(then) reserved(begin) + ident(s) operator(:=) ident(Old)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + ident(Exit)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(CharIn)operator(()ident(s)operator(,) operator([)char(#0)operator(..)char(#31)operator(,) charoperator(]\)) reserved(then) reserved(begin) + ident(s) operator(:=) ident(ReplaceChars)operator(()ident(s)operator(,) operator([)char(#0)operator(..)char(#31)operator(],) charoperator(\);) + ident(s) operator(:=) ident(ReplaceChars)operator(()ident(s)operator(,) charoperator(,) charoperator(\);) + + reserved(if) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(Quote)operator(()charoperator(\)) operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(s) operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)) operator(<>) ident(mrYes) reserved(then) reserved(begin) + ident(s) operator(:=) ident(Old)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + ident(Exit)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(try) + ident(OpenCurParent)operator(;) + reserved(if) reserved(not) ident(SameText)operator(()ident(s)operator(,) ident(Old)operator(\)) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(s)operator(\)) reserved(or) + operator(()ident(mrIgnore) operator(=) ident(MessageDlg)operator(() + string operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbCancel)operator(,) ident(mbIgnore)operator(],) integer(0)operator(\)) + operator(\)) reserved(then) reserved(begin) + ident(MainReg)operator(.)ident(DeleteKey)operator(()ident(s)operator(\);) + ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Old)operator(,) ident(s)operator(,) ident(True)operator(\);) + ident(Node)operator(.)ident(Text) operator(:=) ident(Old)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(s) operator(:=) ident(Old)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) reserved(begin) comment(//change CharCase) + ident(tmp) operator(:=) ident(MainReg)operator(.)ident(GetFreeKeyName)operator(;) + ident(AddHint)operator(()string operator(+) ident(Quote)operator(()ident(tmp)operator(\)\);) + ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Old)operator(,) ident(tmp)operator(,) ident(True)operator(\);) + ident(MainReg)operator(.)ident(MoveKey)operator(()ident(tmp)operator(,) ident(s)operator(,) ident(True)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + + ident(Node)operator(.)ident(Text) operator(:=) ident(s)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\);) +reserved(begin) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + reserved(if) ident(RegTV)operator(.)ident(Selected) operator(<>) ident(Node) reserved(then) + ident(Exit)operator(;) + ident(AllowEdit) operator(:=) operator(()ident(NodeInfo)operator(()ident(Node)operator(\).)ident(HostType) reserved(in) operator([)ident(uhNone)operator(,) ident(uhUserShortcut)operator(]\)) + reserved(and) operator(()reserved(not) ident(CantWrite)operator(\)) + reserved(and) ident(OpenCurKey)operator(;) + ident(MainReg)operator(.)ident(CloseKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEndDrag)operator(()ident(Sender)operator(,) ident(Target)operator(:) ident(TObject)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) +reserved(begin) + ident(DragNode) operator(:=) reserved(nil)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + ident(ValueList)operator(.)ident(ItemFocused) operator(:=) reserved(nil)operator(;) + ident(MainWin)operator(.)ident(SetStatus)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(DoSmartExpand) reserved(or) reserved(not) ident(PrefWin)operator(.)ident(SmartExpandCB)operator(.)ident(Checked) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(RegTVChange)operator(()ident(Sender)operator(,) ident(Node)operator(\);) + + comment(//SmartExpand) + reserved(if) operator(()ident(Node)operator(.)ident(Count) operator(>) integer(0)operator(\)) reserved(and) operator(()ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) + ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Node)operator(.)ident(Count) operator(=) integer(1) reserved(then) + ident(Node)operator(.)ident(GetFirstChild)operator(.)ident(Expand)operator(()ident(False)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVExpanding)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(var) ident(AllowExpansion)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Clock)operator(:) ident(TClock)operator(;) +preprocessor({$IFDEF UNIKEY}) + ident(Uni)operator(:) ident(TUniKey)operator(;) +preprocessor({$ENDIF}) + + reserved(procedure) ident(AddKeys)operator(()ident(TreeView)operator(:) ident(TTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) ident(SL)operator(:) ident(TStrings)operator(\);) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(TreeView)operator(.)ident(Items)operator(.)ident(AddNode)operator(()ident(TTreeNode)operator(.)ident(Create)operator(()ident(TreeView)operator(.)ident(Items)operator(\),) ident(Node)operator(,) ident(SL)operator([)ident(i)operator(],) + reserved(nil)operator(,) ident(naAddChild)operator(\);) + reserved(end)operator(;) + + reserved(procedure) ident(AddKeysProgressive)operator(()ident(TreeView)operator(:) ident(TTreeView)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(SL)operator(:) ident(TStrings)operator(\);) + reserved(var) + ident(i)operator(,) ident(delta)operator(:) ident(Integer)operator(;) + ident(GaugeRect)operator(,) ident(FullRect)operator(:) ident(TRect)operator(;) + ident(GaugeWidth)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(delta) operator(:=) ident(SL)operator(.)ident(Count) reserved(div) integer(100)operator(;) + ident(GaugeWidth) operator(:=) integer(100)operator(;) + reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) + ident(FullRect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\);) + reserved(with) ident(FullRect) reserved(do) reserved(begin) + ident(Left) operator(:=) ident(Right) operator(+) integer(40)operator(;) + ident(Right) operator(:=) ident(Left) operator(+) ident(GaugeWidth) operator(+) integer(2)operator(;) + ident(Inc)operator(()ident(Top)operator(,) integer(5)operator(\);) + ident(Dec)operator(()ident(Bottom)operator(,) integer(5)operator(\);) + reserved(end)operator(;) + reserved(with) ident(Pen) reserved(do) reserved(begin) + ident(Width) operator(:=) integer(1)operator(;) + ident(Style) operator(:=) ident(psSolid)operator(;) + reserved(end)operator(;) + ident(Pen)operator(.)ident(Color) operator(:=) ident(clBrightBlue)operator(;) + ident(Brush)operator(.)ident(Style) operator(:=) ident(bsClear)operator(;) + ident(Rectangle)operator(()ident(FullRect)operator(\);) + ident(Pen)operator(.)ident(Style) operator(:=) ident(psClear)operator(;) + reserved(end)operator(;) + + ident(GaugeRect) operator(:=) ident(FullRect)operator(;) + reserved(with) ident(GaugeRect) reserved(do) reserved(begin) + ident(Inc)operator(()ident(Left)operator(\);) + ident(Inc)operator(()ident(Top)operator(\);) + ident(Dec)operator(()ident(Bottom)operator(\);) + reserved(end)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(TreeView)operator(.)ident(Items)operator(.)ident(AddNode)operator(()ident(TTreeNode)operator(.)ident(Create)operator(()ident(TreeView)operator(.)ident(Items)operator(\),) ident(Node)operator(,) ident(SL)operator([)ident(i)operator(],) + reserved(nil)operator(,) ident(naAddChild)operator(\);) + + reserved(if) operator((()ident(i) operator(+) integer(1)operator(\)) reserved(mod) ident(delta)operator(\)) operator(=) integer(0) reserved(then) reserved(begin) + reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) + ident(GaugeRect)operator(.)ident(Right) operator(:=) ident(GaugeRect)operator(.)ident(Left) operator(+) operator(()ident(GaugeWidth) operator(*) ident(i)operator(\)) reserved(div) ident(SL)operator(.)ident(Count)operator(;) + ident(Brush)operator(.)ident(Color) operator(:=) ident(GadientAqua)operator(()integer(90) operator(+) ident(Round)operator(()integer(100) operator(*) operator((()ident(i)operator(+)integer(1)operator(\)) operator(/) ident(SL)operator(.)ident(Count)operator(\)\)\);) + ident(FillRect)operator(()ident(GaugeRect)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(with) ident(TreeView)operator(.)ident(Canvas) reserved(do) reserved(begin) + ident(Pen)operator(.)ident(Color) operator(:=) ident(clVeryBrightBlue)operator(;) + ident(Pen)operator(.)ident(Style) operator(:=) ident(psSolid)operator(;) + ident(Brush)operator(.)ident(Color) operator(:=) ident(GadientAqua)operator(()integer(200)operator(\);) + ident(Rectangle)operator(()ident(FullRect)operator(\);) + ident(Brush)operator(.)ident(Style) operator(:=) ident(bsClear)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(Exit)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(Clock) operator(:=) ident(TClock)operator(.)ident(Create)operator(;) + + reserved(try) + +preprocessor({$IFDEF UNIKEY}) + reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\).)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) + ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\);) + reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) + reserved(try) + ident(Uni)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\);) + reserved(finally) + ident(Uni)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(end) reserved(else) reserved(begin) +preprocessor({$ENDIF}) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) + ident(Reg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\);) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + +preprocessor({$IFDEF UNIKEY}) + reserved(end)operator(;) +preprocessor({$ENDIF}) + + ident(Node)operator(.)ident(DeleteChildren)operator(;) + reserved(if) ident(PrefWin)operator(.)ident(ShowProgressCB)operator(.)ident(Checked) reserved(and) operator(()ident(SL)operator(.)ident(Count) operator(>) integer(100)operator(\)) reserved(then) + ident(AddKeysProgressive)operator(()ident(RegTV)operator(,) ident(Node)operator(,) ident(SL)operator(\)) + reserved(else) + ident(AddKeys)operator(()ident(RegTV)operator(,) ident(Node)operator(,) ident(SL)operator(\);) + + reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) + ident(Node)operator(.)ident(AlphaSort)operator(;) + + reserved(if) ident(MurphyMode) reserved(then) reserved(begin) + ident(Clock)operator(.)ident(Stop)operator(;) + ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Clock)operator(.)ident(SecondsPassed)operator(]\)\);) + reserved(end)operator(;) + reserved(finally) + ident(Clock)operator(.)ident(Free)operator(;) + ident(SL)operator(.)ident(Free)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + ident(Node)operator(.)ident(SelectedIndex) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_SCROLL) reserved(then) + ident(CheckRegTVHotTrack)operator(;) + + reserved(if) ident(RegTV)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(ssShift) reserved(in) ident(Shift) reserved(then) + reserved(case) ident(Key) reserved(of) + ident(VK_DOWN)operator(:) reserved(begin) + ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) + reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_UP)operator(:) reserved(begin) + ident(Node) operator(:=) ident(Node)operator(.)ident(GetPrevSibling)operator(;) + reserved(if) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_RIGHT)operator(:) ident(Key) operator(:=) ident(VK_MULTIPLY)operator(;) + ident(VK_LEFT)operator(:) ident(Key) operator(:=) ident(VK_DIVIDE)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) reserved(begin) + reserved(case) ident(Key) reserved(of) + ident(VK_END)operator(:) + reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(.)ident(GetLastChild)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_HOME)operator(:) + reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(.)ident(GetFirstChild)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(case) ident(Key) reserved(of) + integer(0)operator(:) ident(Exit)operator(;) + ident(VK_RETURN)operator(:) ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + ident(VK_DELETE)operator(:) ident(DeleteMIClick)operator(()ident(Sender)operator(\);) + ident(VK_SPACE)operator(:) reserved(begin) + ident(JumpToSel)operator(()ident(RegTV)operator(\);) + ident(Inc)operator(()ident(SpaceCount)operator(\);) + reserved(if) ident(SpaceCount) operator(>) integer(10) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(SpaceCount) operator(:=) integer(0)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + ident(VK_F9)operator(:) ident(SwapFonts)operator(()ident(RegTV)operator(\);) + + ident(VK_F12)operator(:) + reserved(if) ident(ssShift) reserved(in) ident(Shift) reserved(then) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) ident(Node)operator(.)ident(Parent)operator(.)ident(AlphaSort)operator(;) + reserved(end) reserved(else) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) ident(Node)operator(.)ident(AlphaSort)operator(;) + + ident(VK_LEFT)operator(,) ident(VK_SUBTRACT)operator(:) + reserved(begin) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\)) + reserved(else) reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_RIGHT)operator(,) ident(VK_ADD)operator(:) + reserved(begin) + reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(TreeWin)operator(.)ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\);) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(.)ident(GetFirstChild) + reserved(else) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_MULTIPLY)operator(:) + reserved(begin) + ident(NoAsterisk) operator(:=) ident(True)operator(;) + ident(OpenNextLevel)operator(()ident(Node)operator(\);) + ident(JumpToSel)operator(()ident(RegTV)operator(\);) + ident(AddHint)operator(()stringoperator(\);) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + + ident(VK_DIVIDE)operator(:) + reserved(begin) + ident(DoSmartExpand) operator(:=) ident(False)operator(;) + ident(Node)operator(.)ident(Collapse)operator(()ident(true)operator(\);) + ident(DoSmartExpand) operator(:=) ident(True)operator(;) + ident(Key) operator(:=) integer(0)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(ssctrl) reserved(in) ident(Shift) reserved(then) + reserved(case) ident(Key) reserved(of) + ident(Ord)operator(()charoperator(\):) ident(CopyPathMIClick)operator(()ident(Sender)operator(\);) + ident(Ord)operator(()charoperator(\):) ident(CutPathMIClick)operator(()ident(Sender)operator(\);) + ident(Ord)operator(()charoperator(\):) ident(PasteKeyMIClick)operator(()ident(Sender)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(RelX)operator(,) ident(RelY)operator(:) ident(Integer)operator(;) + ident(NodeRect)operator(:) ident(TRect)operator(;) +reserved(begin) + ident(CheckRegTVHotTrack)operator(;) + + reserved(if) reserved(not) ident(Active) reserved(then) + ident(Exit)operator(;) + + ident(RelX) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\).)ident(X)operator(;) + ident(RelY) operator(:=) ident(RegTV)operator(.)ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\).)ident(Y)operator(;) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(GetNodeAt)operator(()ident(RelX)operator(,) ident(RelY)operator(\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) + ident(Node)operator(.)ident(Selected) operator(:=) ident(True)operator(;) + + reserved(if) ident(Button) operator(=) ident(mbLeft) reserved(then) reserved(begin) + ident(NodeRect) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(.)ident(DisplayRect)operator(()ident(True)operator(\);) + reserved(if) ident(RegTV)operator(.)ident(HotTrack) + reserved(or) operator(()ident(RelX) operator(<) ident(NodeRect)operator(.)ident(Left)operator(\)) reserved(and) operator(()ident(RelX) operator(>) ident(NodeRect)operator(.)ident(Left) operator(-) integer(20)operator(\)) reserved(then) reserved(begin) + comment(//4px more to the left (friendlier for the user\)) + reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\);) + ident(DoSmartExpand) operator(:=) ident(False)operator(;) + reserved(with) ident(Node) reserved(do) + reserved(if) reserved(not) ident(Expanded) reserved(then) + ident(Expand)operator(()ident(False)operator(\)) + reserved(else) + ident(Collapse)operator(()ident(False)operator(\);) + ident(DoSmartExpand) operator(:=) ident(True)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVStartDrag)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(DragObject)operator(:) ident(TDragObject)operator(\);) +reserved(begin) + ident(DragNode) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) ident(NodeInfo)operator(()ident(DragNode)operator(\).)ident(IsHost) reserved(then) + ident(DragNode) operator(:=) reserved(nil)operator(;) +reserved(end)operator(;) + +reserved(function) ident(OpenNodeError)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(;) + reserved(out) ident(Mode)operator(:) ident(TOpenNodeMode)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(Key)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(ERROR_SUCCESS)operator(;) + ident(Mode) operator(:=) ident(onNodeNil)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Reg)operator(.)ident(CloseKey)operator(;) + ident(Key) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\);) + ident(Reg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(ExRegRoot)operator(()ident(Key)operator(\)\);) + ident(Result) operator(:=) ident(Reg)operator(.)ident(OpenKeyError)operator(()ident(ExRegKey)operator(()ident(Key)operator(\),) ident(False)operator(,) ident(True)operator(\);) + reserved(if) ident(Success)operator(()ident(Result)operator(\)) reserved(then) + reserved(if) ident(Reg)operator(.)ident(RootKey) operator(=) ident(HKDD) reserved(then) + ident(Mode) operator(:=) ident(onReadOnly) + reserved(else) + ident(Mode) operator(:=) ident(onFull) + reserved(else) reserved(if) ident(Reg)operator(.)ident(OpenKeyReadOnly)operator(()ident(ExRegKey)operator(()ident(Key)operator(\)\)) reserved(then) + ident(Mode) operator(:=) ident(onReadOnly) + reserved(else) + ident(Mode) operator(:=) ident(onError)operator(;) +reserved(end)operator(;) + +reserved(function) ident(OpenNode)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(TOpenNodeMode)operator(;) +reserved(begin) + ident(OpenNodeError)operator(()ident(Reg)operator(,) ident(Node)operator(,) ident(Result)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(OpenNodeOK)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(in) ident(onOK)operator(;) +reserved(end)operator(;) + +reserved(function) ident(OpenCurKey)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(OpenNodeOK)operator(()ident(MainReg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(OpenCurParent)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Assigned)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) + reserved(and) ident(OpenNodeOK)operator(()ident(MainReg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(.)ident(Parent)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TTreeWin)operator(.)ident(CreateKey)operator(()ident(Subkey)operator(:) ident(Boolean)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(Node)operator(,) ident(NewNode)operator(:) ident(TTreeNode)operator(;) + ident(KeyName)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + + reserved(if) ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Subkey) reserved(then) reserved(begin) + comment(//key shall be created on same level...) + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\)) operator(<>) ident(PathOfNode)operator(()ident(Node)operator(\)) reserved(then) + comment(//check for shortcut: shortcuts are unequal to their trace) + reserved(if) ident(mrOK) operator(=) ident(MessageDlg)operator(() + string operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) reserved(begin) + ident(MainWin)operator(.)ident(GotoKey)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\)\);) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(.)ident(Parent)operator(;) + reserved(end) reserved(else) ident(Exit) + reserved(else) reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + stringoperator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(end) reserved(else) + ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) comment(//set reference key to parent) + reserved(end)operator(;) + + reserved(try) + + reserved(case) ident(OpenNode)operator(()ident(MainReg)operator(,) ident(Node)operator(\)) reserved(of) + + ident(onFull)operator(:) reserved(begin) + ident(KeyName) operator(:=) stringoperator(;) comment(//find best free name) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(KeyName)operator(\)) reserved(do) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(KeyName) operator(:=) string operator(+) ident(IntToStr)operator(()ident(i)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(MainReg)operator(.)ident(CreateKey)operator(()ident(KeyName)operator(\)) reserved(and) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(KeyName)operator(\);) + comment(// ^-- CREATE KEY) + + reserved(if) reserved(not) ident(Result) reserved(then) comment(// <-- FAILED) + ident(ShowMessage)operator(()stringoperator(\);) + reserved(end)operator(;) + + ident(onReadOnly)operator(:) ident(ShowMessage)operator(()stringoperator(\);) + + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) + + reserved(end)operator(;) comment(//case) + + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Result) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) comment(//find the node, if Parent not Expanded) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + ident(DoSmartExpand) operator(:=) ident(False)operator(;) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + ident(DoSmartExpand) operator(:=) ident(True)operator(;) + ident(NewNode) operator(:=) ident(FindNode)operator(()ident(Node)operator(,) ident(KeyName)operator(\);) + reserved(end) reserved(else) + ident(NewNode) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) ident(KeyName)operator(\);) comment(//else create a new node) + + ident(Result) operator(:=) ident(Assigned)operator(()ident(NewNode)operator(\);) + reserved(if) reserved(not) ident(Result) reserved(then) + ident(ShowMessage)operator(()stringoperator(\);) + + reserved(if) ident(Result) reserved(then) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(NewNode)operator(;) + ident(RegTV)operator(.)ident(Selected)operator(.)ident(EditText)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(CloneKey)operator(;) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(Full)operator(:) ident(TRegPath)operator(;) + ident(MainKey)operator(,) ident(SubKey)operator(,) ident(NewKey)operator(,) ident(zKey)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(integer)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + + reserved(if) ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\).)ident(IsHost) reserved(then) + ident(Exit)operator(;) + + ident(Full) operator(:=) ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\);) + ident(MainKey) operator(:=) ident(LWPSolve)operator(()ident(Full)operator(.)ident(Key)operator(\);) + ident(SubKey) operator(:=) ident(FromLastChar)operator(()ident(MainKey)operator(,) charoperator(\);) + ident(MainKey) operator(:=) ident(UntilLastChar)operator(()ident(MainKey)operator(,) charoperator(\);) + reserved(if) ident(SubKey) operator(=) string reserved(then) reserved(begin) comment(//Directly beyound HKEY) + ident(SubKey) operator(:=) ident(MainKey)operator(;) + ident(MainKey) operator(:=) stringoperator(;) + reserved(end)operator(;) + + reserved(try) + ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Full)operator(.)ident(Root)operator(\);) + reserved(if) reserved(not) ident(MainReg)operator(.)ident(OpenKey)operator(()ident(MainKey)operator(,) ident(False)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(MainKey)operator(\);) + ident(Exit) reserved(end)operator(;) + reserved(if) ident(Copy)operator(()ident(SubKey)operator(,) integer(1)operator(,) integer(3)operator(\)) operator(<>) string reserved(then) + ident(NewKey) operator(:=) string operator(+) ident(SubKey) + reserved(else) + ident(NewKey) operator(:=) ident(SubKey)operator(;) + + ident(zKey) operator(:=) ident(Trim)operator(()ident(FromLastChar)operator(()ident(NewKey)operator(,) charoperator(\)\);) + + ident(i) operator(:=) ident(StrToIntDef)operator(()ident(zKey)operator(,) integer(0)operator(\);) + reserved(if) ident(IsValidInteger)operator(()ident(zKey)operator(\)) reserved(then) + ident(zKey) operator(:=) ident(Trim)operator(()ident(UntilLastChar)operator(()ident(NewKey)operator(,) charoperator(\)\)) + reserved(else) + ident(zKey) operator(:=) ident(NewKey)operator(;) + + reserved(while) ident(MainReg)operator(.)ident(KeyExists)operator(()ident(NewKey)operator(\)) reserved(do) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(NewKey) operator(:=) ident(zKey) operator(+) char operator(+) ident(IntToStr)operator(()ident(i)operator(\);) + reserved(end)operator(;) + + ident(MainReg)operator(.)ident(MoveKey)operator(()ident(SubKey)operator(,) ident(NewKey)operator(,) ident(False)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(Add)operator(()ident(Node)operator(,) ident(NewKey)operator(\);) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node)operator(;) + ident(Node)operator(.)ident(EditText)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(NewShortcut)operator(;) +reserved(var) + ident(Node)operator(,) ident(ShortCutNode)operator(:) ident(TTreeNode)operator(;) + ident(ScName)operator(,) ident(ScRealPath)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) + ident(ScName) operator(:=) string operator(+) ident(Node)operator(.)ident(Text) + reserved(else) + ident(ScName) operator(:=) string operator(+) ident(Node)operator(.)ident(Text)operator(;) + + ident(ScRealPath) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\);) + reserved(if) reserved(not) ident(InputQuery)operator(()stringoperator(,) ident(ScRealPath)operator(,) ident(ScName)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(ShortCuts)operator(\)) reserved(do) + reserved(if) ident(SameText)operator(()ident(ScName)operator(,) ident(ShortCuts)operator([)ident(i)operator(].)ident(Alias)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(NewShortcut)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(ShortCutNode) operator(:=) ident(AddShortcut)operator(()ident(ScName)operator(,) ident(ScRealPath)operator(,) ident(iconShortcut)operator(,) ident(uhUserShortcut)operator(,) + ident(True)operator(\);) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(ShortCutNode)operator(;) +reserved(end)operator(;) + +reserved(function) ident(AddShortcut)operator(()ident(Alias)operator(,) ident(RealPath)operator(:) reserved(string)operator(;) ident(Icon)operator(:) ident(Integer)operator(;) + ident(AHostType)operator(:) ident(TUniHostType) operator(=) ident(uhUserShortcut)operator(;) + ident(WriteIni)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(TTreeNode)operator(;) +reserved(var) + ident(Last)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(RealPath) operator(:=) ident(TraceKey)operator(()ident(RealPath)operator(\);) comment(//Important: do this BEFORE adding a new,) + comment(//empty shortcut to ShortCuts) + + ident(SetLength)operator(()ident(ShortCuts)operator(,) ident(Length)operator(()ident(ShortCuts)operator(\)) operator(+) integer(1)operator(\);) + ident(Last) operator(:=) ident(High)operator(()ident(Shortcuts)operator(\);) + ident(ShortCuts)operator([)ident(Last)operator(].)ident(Alias) operator(:=) ident(Alias)operator(;) + ident(ShortCuts)operator([)ident(Last)operator(].)ident(RealPath) operator(:=) ident(RealPath)operator(;) + + ident(Result) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(Add)operator(()reserved(nil)operator(,) ident(Alias)operator(\);) + ident(ShortCuts)operator([)ident(Last)operator(].)ident(Node) operator(:=) ident(Result)operator(;) + + reserved(if) ident(Alias) operator(=) string reserved(then) + ident(Icon) operator(:=) ident(iconHKWM) + reserved(else) reserved(if) ident(Alias) operator(=) string reserved(then) + ident(Icon) operator(:=) ident(iconHKWU)operator(;) + ident(SetTNImage)operator(()ident(Result)operator(,) ident(Icon)operator(\);) + + ident(NodeInfo)operator(()ident(Result)operator(\).)ident(HostType) operator(:=) ident(AHostType)operator(;) + + reserved(if) ident(WriteIni) reserved(then) + reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) + reserved(try) + ident(WriteString)operator(()stringoperator(,) ident(Alias)operator(,) ident(RealPath)operator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(DeleteKey)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Node)operator(,) ident(Node2)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + + + ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\);) + reserved(if) operator(()ident(i) operator(>) operator(-)integer(1)operator(\)) reserved(then) reserved(begin) + reserved(if) operator(()ident(mrYes) operator(=) ident(MessageDlg)operator(()stringchar(#13)char(#10) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)\)) reserved(then) reserved(begin) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) + reserved(try) + ident(DeleteKey)operator(()stringoperator(,) ident(Shortcuts)operator([)ident(i)operator(].)ident(Alias)operator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) + ident(Shortcuts)operator([)ident(i)operator(]) operator(:=) ident(Shortcuts)operator([)ident(High)operator(()ident(Shortcuts)operator(\)];) + ident(SetLength)operator(()ident(Shortcuts)operator(,) ident(Length)operator(()ident(Shortcuts)operator(\)-)integer(1)operator(\);) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\);) + ident(Node)operator(.)ident(Delete)operator(;) + ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) + ident(SpyThread)operator(.)ident(Resume)operator(;) + reserved(end)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\).)ident(IsHost) reserved(then) + ident(Exit)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + + ident(Node2) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\);) + + reserved(if) ident(MessageDlg)operator(()stringoperator(,) ident(mtConfirmation)operator(,) + operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) operator(=) ident(mrYes) reserved(then) + reserved(try) + reserved(if) ident(OpenCurParent) reserved(then) reserved(begin) + reserved(if) reserved(not) ident(MainReg)operator(.)ident(DeleteKey)operator(()ident(Node)operator(.)ident(Text)operator(\)) reserved(then) comment(//<-- DELETE KEY) + ident(ShowMessage)operator(()stringoperator(\)) + reserved(else) reserved(begin) + ident(RegTV)operator(.)ident(Selected) operator(:=) ident(Node2)operator(;) + reserved(if) ident(Assigned)operator(()ident(Node)operator(.)ident(Parent)operator(\)) reserved(and) operator(()ident(Node2) operator(=) ident(Node)operator(.)ident(Parent)operator(\)) reserved(then) + ident(Node)operator(.)ident(Parent)operator(.)ident(Collapse)operator(()ident(False)operator(\);) + ident(Node)operator(.)ident(Delete)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + + ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node2)operator(\);) + + ident(SpyThread)operator(.)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(MoveKey)operator(()reserved(const) ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) ident(CopyWanted)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(TrgReg)operator(:) ident(TXRegistry)operator(;) +reserved(begin) + reserved(with) ident(MainReg) reserved(do) reserved(begin) + ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Src)operator(.)ident(Root)operator(\);) + ident(OpenKey)operator(()stringoperator(\);) + + reserved(if) reserved(not) ident(KeyExists)operator(()ident(Src)operator(.)ident(Key)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + ident(TrgReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(with) ident(TrgReg) reserved(do) reserved(begin) + ident(RootKey) operator(:=) ident(HKEYOfStr)operator(()ident(Trg)operator(.)ident(Root)operator(\);) + ident(OpenKey)operator(()stringoperator(\);) + reserved(if) ident(KeyExists)operator(()ident(Trg)operator(.)ident(Key)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(TrgReg)operator(.)ident(Free)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(CopyWanted) reserved(then) + reserved(if) ident(mrYes) operator(<>) ident(MessageDlg)operator(()string operator(+) ident(StrOfRegPath)operator(()ident(Src)operator(\)) operator(+) ident(EOL) operator(+) + string operator(+) ident(StrOfRegPath)operator(()ident(Trg)operator(\)) operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) + reserved(then) + ident(Exit)operator(;) + + reserved(try) + ident(MainReg)operator(.)ident(MoveKey)operator(()ident(Src)operator(.)ident(Key)operator(,) ident(TrgReg)operator(,) ident(Trg)operator(.)ident(Key)operator(,) reserved(not) ident(CopyWanted)operator(\);) comment(//<-- MOVE KEY) + reserved(except) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(TrgReg)operator(.)ident(OpenKey)operator(()ident(Trg)operator(.)ident(Key)operator(,) ident(False)operator(\)) reserved(then) + ident(ShowMessage)operator(()stringoperator(\)) + reserved(else) + reserved(if) reserved(not) ident(CopyWanted) reserved(then) + ident(DragNode)operator(.)ident(Delete)operator(;) + + + ident(TrgReg)operator(.)ident(Free)operator(;) + + ident(MainReg)operator(.)ident(CloseKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(MoveValues)operator(()ident(SrcNode)operator(,) ident(TrgNode)operator(:) ident(TTreeNode)operator(;) + ident(CopyWanted)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(SrcReg)operator(,) ident(TrgReg)operator(:) ident(TXRegistry)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(ValueName)operator(:) reserved(string)operator(;) + ident(AnswerToAll)operator(:) ident(Integer)operator(;) + + reserved(function) ident(AskForReplacing)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) + reserved(begin) + reserved(if) ident(AnswerToAll) operator(=) operator(-)integer(1) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(MessageDlg)operator(() + string operator(+) ident(Quote)operator(()ident(ValueName)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbNo)operator(,) ident(mbYes)operator(,) ident(mbNoToAll)operator(,) ident(mbYesToAll)operator(,) ident(mbAbort)operator(],) integer(0)operator(\);) + reserved(if) ident(Result) reserved(in) operator([)ident(mrNoToAll)operator(,) ident(mrYesToAll)operator(]) reserved(then) reserved(begin) + reserved(if) ident(Result) operator(=) ident(mrYesToAll) reserved(then) + ident(Result) operator(:=) ident(mrYes) + reserved(else) reserved(if) ident(Result) operator(=) ident(mrNoToAll) reserved(then) + ident(Result) operator(:=) ident(mrNo)operator(;) + ident(AnswerToAll) operator(:=) ident(Result)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) ident(Result) operator(:=) ident(AnswerToAll)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(AnswerToAll) operator(:=) operator(-)integer(1)operator(;) + + reserved(if) reserved(not) ident(CopyWanted) reserved(then) + reserved(if) ident(mrYes)operator(<>)ident(MessageDlg)operator(() + ident(Format)operator(() + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(,) + operator([)ident(StrNumerus)operator(()ident(ValueList)operator(.)ident(SelCount)operator(,) stringoperator(,) stringoperator(\),) + ident(PathOfNode)operator(()ident(SrcNode)operator(\),) ident(PathOfNode)operator(()ident(TrgNode)operator(\)]) + operator(\),) ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbAbort)operator(],) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(SrcReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) reserved(not) operator(()ident(OpenNode)operator(()ident(SrcReg)operator(,) ident(SrcNode)operator(\)) reserved(in) ident(onOK)operator(\)) reserved(then) + ident(MessageDlg)operator(()string operator(+) ident(PathOfNode)operator(()ident(SrcNode)operator(\),) + ident(mtError)operator(,) operator([)ident(mbOK)operator(],) integer(0)operator(\);) + + ident(TrgReg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) reserved(not) operator(()ident(OpenNode)operator(()ident(TrgReg)operator(,) ident(TrgNode)operator(\)) reserved(in) ident(onOK)operator(\)) reserved(then) + ident(MessageDlg)operator(()string operator(+) ident(PathOfNode)operator(()ident(TrgNode)operator(\),) + ident(mtError)operator(,) operator([)ident(mbOK)operator(],) integer(0)operator(\);) + + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) reserved(not) ident(Item)operator([)ident(i)operator(].)ident(Selected) reserved(then) + ident(Continue)operator(;) + ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator([)ident(i)operator(]\);) + + reserved(if) ident(TrgReg)operator(.)ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) + reserved(case) ident(AskForReplacing)operator(()ident(ValueName)operator(\)) reserved(of) + ident(mrYes)operator(:) operator(;) + ident(mrNo)operator(:) ident(Continue)operator(;) + ident(mrAbort)operator(:) ident(Break)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(TrgReg)operator(.)ident(WriteContext)operator(()ident(ValueName)operator(,) ident(SrcReg)operator(.)ident(ReadContext)operator(()ident(ValueName)operator(\)\);) + reserved(if) reserved(not) ident(CopyWanted) reserved(then) + ident(SrcReg)operator(.)ident(DeleteValue)operator(()ident(ValueName)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(finally) + ident(TrgReg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(finally) + ident(SrcReg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(CopyWanted) reserved(then) + ident(ValuesWin)operator(.)ident(Reload)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(NewSubKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateKey)operator(()ident(True)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(NewKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateKey)operator(()ident(False)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(CreateShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NewShortcut)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(TraceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(NodeInfo)operator(()ident(RegTV)operator(.)ident(Selected)operator(\).)ident(IsShortcut) reserved(then) + ident(MainWin)operator(.)ident(GotoKey)operator(()ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(RegTV)operator(.)ident(IsEditing) reserved(then) + ident(DeleteKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CloneKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(FindMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FindWin)operator(.)ident(SfCurKeyRB)operator(.)ident(Checked) operator(:=) ident(True)operator(;) + ident(FindWin)operator(.)ident(Show)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) + reserved(with) ident(NodeInfo)operator(()ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(do) reserved(begin) + ident(NewSubKeyMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite)operator(;) + ident(NewKeyMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) operator(()reserved(not) ident(IsHost) reserved(or) ident(IsShortcut)operator(\);) + ident(DublicateMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) reserved(not) ident(IsHost)operator(;) + + reserved(with) ident(DeleteMI) reserved(do) + reserved(if) ident(HostType) operator(=) ident(uhUserShortcut) reserved(then) reserved(begin) + ident(Caption) operator(:=) stringoperator(;) + ident(Enabled) operator(:=) ident(True)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(Caption) operator(:=) stringoperator(;) + ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) reserved(not) ident(IsHost)operator(;) + reserved(end)operator(;) + + ident(RenameMI)operator(.)ident(Enabled) operator(:=) reserved(not) ident(CantWrite) reserved(and) operator(()ident(HostType) reserved(in) operator([)ident(uhNone)operator(,) ident(uhUserShortcut)operator(]\);) + ident(TraceMI)operator(.)ident(Visible) operator(:=) ident(IsShortcut)operator(;) + ident(EditShortcutMI)operator(.)ident(Visible) operator(:=) ident(HostType) operator(=) ident(uhUserShortcut)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(CheckNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(;) ident(OnlyOnce)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(TakeNodeSelected)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) +reserved(var) + ident(CurIcon)operator(,) ident(NewIcon)operator(:) ident(Integer)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(OpenMode)operator(:) ident(TOpenNodeMode)operator(;) + ident(Info)operator(:) ident(TNodeInfo)operator(;) +preprocessor({$IFDEF UNIKEY}) + ident(Uni)operator(:) ident(TUniKey)operator(;) +preprocessor({$ENDIF}) + ident(KeyHasChildren)operator(:) ident(Boolean)operator(;) + + reserved(procedure) ident(SetShortcutIcon)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(var) + ident(Full)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(Full) operator(:=) ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\);) + reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(Shortcuts)operator(\)) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) + reserved(if) ident(Full) operator(=) ident(Shortcuts)operator([)ident(i)operator(].)ident(RealPath) reserved(then) reserved(begin) + ident(CurIcon) operator(:=) ident(Shortcuts)operator([)ident(i)operator(].)ident(Node)operator(.)ident(ImageIndex)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(if) ident(Node)operator(.)ident(ImageIndex) reserved(in) operator([)ident(iconShortcut)operator(,) ident(iconShortcut) operator(+) integer(1)operator(]) reserved(then) + ident(CurIcon) operator(:=) ident(iconKey) operator(+) operator(()ident(CurIcon) operator(-) ident(iconShortcut)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\);) + reserved(if) ident(OnlyOnce) reserved(and) ident(Info)operator(.)ident(Checked) reserved(then) + ident(Exit)operator(;) + + ident(CurIcon) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) + reserved(if) operator(()ident(CurIcon) operator(>) ident(iconFirstType)operator(\)) reserved(then) reserved(begin) +preprocessor({$IFDEF UNIKEY}) + reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\).)ident(ImageIndex) operator(<>) ident(iconHostUni) reserved(then) reserved(begin) + ident(SetShortcutIcon)operator(()ident(Node)operator(\);) + ident(CurIcon) operator(:=) operator(()ident(CurIcon) reserved(div) integer(2)operator(\)) operator(*) integer(2)operator(;) + reserved(end)operator(;) +preprocessor({$ELSE}) + ident(Exit)operator(;) +preprocessor({$ENDIF}) + reserved(end) reserved(else) reserved(begin) + ident(SetShortcutIcon)operator(()ident(Node)operator(\);) + ident(CurIcon) operator(:=) operator(()ident(CurIcon) reserved(div) integer(2)operator(\)) operator(*) integer(2)operator(;) + reserved(end)operator(;) + ident(NewIcon) operator(:=) ident(CurIcon)operator(;) + + ident(Info)operator(.)ident(ExcludeFlag)operator(()ident(nfDefect)operator(\);) + ident(Info)operator(.)ident(ExcludeFlag)operator(()ident(nfReadOnly)operator(\);) + +preprocessor({$IFDEF UNIKEY}) + ident(KeyHasChildren) operator(:=) ident(False)operator(;) + + reserved(if) ident(RootOfNode)operator(()ident(Node)operator(\).)ident(ImageIndex) operator(=) ident(iconHostUni) reserved(then) reserved(begin) + ident(Uni) operator(:=) ident(UniOfNode)operator(()ident(Node)operator(\);) + reserved(if) ident(Assigned)operator(()ident(Uni)operator(\)) reserved(then) + reserved(try) + ident(KeyHasChildren) operator(:=) ident(Uni)operator(.)ident(HasKeys)operator(;) + reserved(if) ident(usReadOnly) operator(>=) ident(Uni)operator(.)ident(Skills) reserved(then) + ident(OpenMode) operator(:=) ident(onReadOnly) + reserved(else) + ident(OpenMode) operator(:=) ident(onFull)operator(;) + reserved(finally) + ident(Uni)operator(.)ident(Free)operator(;) + reserved(end) + reserved(else) + ident(OpenMode) operator(:=) ident(onError)operator(;) + reserved(end) reserved(else) reserved(begin) +preprocessor({$ENDIF}) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + ident(OpenMode) operator(:=) ident(OpenNode)operator(()ident(Reg)operator(,) ident(Node)operator(\);) + ident(KeyHasChildren) operator(:=) ident(Reg)operator(.)ident(HasSubKeys)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +preprocessor({$IFDEF UNIKEY}) + reserved(end)operator(;) +preprocessor({$ENDIF}) + + reserved(if) ident(OpenMode) operator(=) ident(onReadOnly) reserved(then) + ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfReadOnly)operator(\);) + + reserved(if) ident(OpenMode) reserved(in) ident(onOK) reserved(then) reserved(begin) + comment(//OK, could open) + reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) reserved(begin) comment(//Collapsed) + reserved(if) ident(KeyHasChildren) reserved(then) reserved(begin) comment(//HasSubKeys) + reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) reserved(begin) + comment(//Update: Ensure HasChildren) + reserved(if) ident(TakeNodeSelected) reserved(or) ident(Node)operator(.)ident(Selected) reserved(then) + ident(TreeWin)operator(.)ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(Node)operator(,) stringoperator(\);) + reserved(end)operator(;) + comment(//Ensure Plus-Icon) + ident(NewIcon) operator(:=) ident(CurIcon) operator(+) integer(1)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//Has still Children?) + reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(Node)operator(.)ident(DeleteChildren)operator(;) + reserved(end)operator(;) + + reserved(end) reserved(else) reserved(begin) comment(//Expanded) + comment(//HasSubKeys?) + reserved(if) ident(KeyHasChildren) reserved(then) reserved(begin) + comment(//OK) + ident(NewIcon) operator(:=) ident(CurIcon) operator(+) integer(1)operator(;) + reserved(end) reserved(else) reserved(begin) + comment(//not OK --> update) + ident(Node)operator(.)ident(Collapse)operator(()ident(True)operator(\);) + ident(Node)operator(.)ident(DeleteChildren)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + comment(//not OK, couldn't open) + reserved(end) reserved(else) reserved(begin) comment(//defect) + reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(Node)operator(.)ident(DeleteChildren)operator(;) + ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfDefect)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Node)operator(.)ident(ImageIndex) operator(<>) ident(iconHostUni) reserved(then) comment(//don't change icon of UniHosts) + ident(Node)operator(.)ident(ImageIndex) operator(:=) ident(NewIcon)operator(;) + + ident(Info)operator(.)ident(IncludeFlag)operator(()ident(nfChecked)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(ShortcutIndex)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Integer)operator(;) +comment(//If Node is a Shortcut,) +comment(//S. returns its index in the Shortcuts array) +comment(//else -1) +reserved(begin) + reserved(if) ident(Node)operator(.)ident(Level) operator(>) integer(0) reserved(then) reserved(begin) + ident(Result) operator(:=) operator(-)integer(1)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Shortcuts)operator(\)) reserved(do) + reserved(if) ident(Shortcuts)operator([)ident(Result)operator(].)ident(Node) operator(=) ident(Node) reserved(then) reserved(begin) + ident(Exit)operator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TraceKey)operator(()reserved(const) ident(Path)operator(:) reserved(string)operator(;) ident(AllowedShortcutTypes)operator(:) ident(TUniHostTypes) operator(=) + ident(uhNonSystemShortcuts)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(isAim)operator(:) ident(Boolean)operator(;) + + reserved(function) ident(NodeOkForTracing)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\):) ident(Boolean)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(Assigned)operator(()ident(Node)operator(\)) reserved(and) + operator(()ident(NodeInfo)operator(()ident(Node)operator(\).)ident(HostType) reserved(in) ident(AllowedShortcutTypes)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) ident(MakeLongHKEY)operator(()ident(Path)operator(\);) + reserved(repeat) + ident(isAim) operator(:=) ident(True)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(ShortCuts)operator(\)) reserved(do) reserved(begin) + reserved(with) ident(Shortcuts)operator([)ident(i)operator(]) reserved(do) + reserved(if) ident(NodeOkForTracing)operator(()ident(Node)operator(\)) reserved(and) + ident(SameText)operator(()ident(UntilChar)operator(()ident(Result)operator(,) charoperator(\),) ident(Alias)operator(\)) reserved(then) reserved(begin) + reserved(if) ident(Alias) operator(=) ident(RealPath) reserved(then) + ident(Break)operator(;) + ident(Delete)operator(()ident(Result)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Alias)operator(\)\);) + ident(Result) operator(:=) ident(RealPath) operator(+) ident(Result)operator(;) + ident(isAim) operator(:=) ident(False)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + reserved(until) ident(isAim)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVKeyPress)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Char)operator(\);) +reserved(begin) + reserved(if) operator(()ident(Key) operator(=) charoperator(\)) reserved(and) ident(NoAsterisk) reserved(then) reserved(begin) + ident(Key) operator(:=) char(#0)operator(;) + ident(NoAsterisk) operator(:=) ident(False)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVAdvancedCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) ident(Stage)operator(:) ident(TCustomDrawStage)operator(;) + reserved(var) ident(PaintImages)operator(,) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(Rect)operator(:) ident(TRect)operator(;) + ident(MainValueName)operator(:) reserved(string)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Info)operator(:) ident(TRegKeyInfo)operator(;) + ident(PreviewPosX)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(DefaultIconPreview)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\);) + reserved(var) + ident(Icon)operator(:) ident(HICON)operator(;) + ident(IconFile)operator(:) reserved(string)operator(;) + reserved(begin) + reserved(if) operator(()ident(Node)operator(.)ident(Level) operator(=) integer(0)operator(\)) reserved(and) reserved(not) ident(RegTV)operator(.)ident(ShowLines) reserved(then) + ident(Exit)operator(;) + + ident(IconFile) operator(:=) ident(Reg)operator(.)ident(ReadDefaultIcon)operator(;) + reserved(if) ident(IconFile) operator(=) string reserved(then) + ident(Exit)operator(;) + + ident(Icon) operator(:=) ident(GetIconFromFile)operator(()ident(ExpandString)operator(()ident(IconFile)operator(\)\);) + reserved(if) ident(Icon) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(Rect) reserved(do) reserved(begin) + ident(Dec)operator(()ident(Left)operator(,) ident(TTreeView)operator(()ident(Sender)operator(\).)ident(Indent) operator(+) integer(16)operator(\);) + ident(DrawIconEx)operator(()ident(Sender)operator(.)ident(Canvas)operator(.)ident(Handle)operator(,) ident(Left)operator(,) ident(Top)operator(,) + ident(Icon)operator(,) integer(16)operator(,) integer(16)operator(,) + integer(0)operator(,) integer(0)operator(,) ident(DI_NORMAL)operator(\);) + ident(DestroyIcon)operator(()ident(Icon)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(AddPreview)operator(()reserved(const) ident(PreviewText)operator(:) reserved(string)operator(;) ident(Color)operator(:) ident(TColor)operator(\);) + reserved(begin) + reserved(with) ident(Sender)operator(.)ident(Canvas) reserved(do) reserved(begin) + ident(SetTextColor)operator(()ident(Handle)operator(,) ident(Color)operator(\);) + ident(ExtTextOut)operator(()ident(Handle)operator(,) ident(PreviewPosX)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(TextFlags)operator(,) reserved(nil)operator(,) + ident(PChar)operator(()ident(PreviewText)operator(\),) ident(Length)operator(()ident(PreviewText)operator(\),) reserved(nil)operator(\);) + ident(Inc)operator(()ident(PreviewPosX)operator(,) ident(TextWidth)operator(()ident(PreviewText)operator(\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(Stage) operator(<>) ident(cdPostPaint) reserved(then) + ident(Exit)operator(;) + + ident(MainValueName) operator(:=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) + + ident(Rect) operator(:=) ident(Node)operator(.)ident(DisplayRect)operator(()ident(True)operator(\);) + ident(PreviewPosX) operator(:=) ident(Rect)operator(.)ident(Right) operator(+) integer(5)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(()ident(KEY_READ)operator(\);) + reserved(try) + reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) reserved(begin) +comment(// Sender.Canvas.Font.Style := [];) + reserved(if) ident(PrefWin)operator(.)ident(KeyInfoPreviewCB)operator(.)ident(Checked) reserved(and) ident(Reg)operator(.)ident(GetKeyInfo)operator(()ident(Info)operator(\)) reserved(then) + reserved(with) ident(Info) reserved(do) reserved(begin) + reserved(if) ident(NumSubKeys) operator(>) integer(0) reserved(then) + ident(AddPreview)operator(()ident(IntToStr)operator(()ident(NumSubKeys)operator(\)) operator(+) stringoperator(,) ident(clCyan)operator(\);) + reserved(if) ident(NumValues) operator(>) integer(0) reserved(then) + ident(AddPreview)operator(()ident(IntToStr)operator(()ident(NumValues)operator(\)) operator(+) stringoperator(,) ident(clBrightPurple)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(PrefWin)operator(.)ident(MainPreviewCB)operator(.)ident(Checked) reserved(then) + reserved(if) ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(MainValueName)operator(\)) reserved(then) + ident(AddPreview)operator(()ident(DataPreviewOfContext)operator(()ident(Reg)operator(.)ident(ReadContext)operator(()ident(MainValueName)operator(\)\),) hex($00AAFFFF)operator(\);) + comment({clBrightYellow}) + reserved(if) ident(PrefWin)operator(.)ident(DefaultIconPreviewCB)operator(.)ident(Checked) reserved(then) + ident(DefaultIconPreview)operator(()ident(Reg)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + comment({if nfCopy in NodeInfo(Node\).Flags then begin + //Node.StateIndex := 2; + Brush.Style := bsClear; + with Font do begin + Style := [fsItalic, fsBold]; + Color := clRed; + end; + //TextOut(Rect.Left - 10, Rect.Top + 3, 'c'\); + end;}) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(RegTV)operator(.)ident(Selected)operator(.)ident(EditText)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) + ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(InsertPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MainWin)operator(.)ident(InsertPathClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(RegTVGetImageIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(NodeInfo)operator(()ident(Node)operator(\).)ident(Checked) reserved(then) + ident(CheckNode)operator(()ident(Node)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(CheckRegTVHotTrack)operator(;) +reserved(const) + ident(FindCursorOfSwitch)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) ident(TCursor) operator(=) operator(()ident(crArrow)operator(,) ident(crHandPoint)operator(\);) +reserved(var) + ident(NewHotTrack)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(NewHotTrack) operator(:=) ident(ScrollON) reserved(xor) ident(PrefWin)operator(.)ident(KeysSingleClickCB)operator(.)ident(Checked)operator(;) + reserved(if) ident(NewHotTrack) operator(=) ident(RegTV)operator(.)ident(HotTrack) reserved(then) ident(Exit)operator(;) + + reserved(with) ident(RegTV) reserved(do) reserved(begin) + ident(HotTrack) operator(:=) ident(NewHotTrack)operator(;) + ident(Cursor) operator(:=) ident(FindCursorOfSwitch)operator([)ident(HotTrack)operator(];) + ident(Mouse)operator(.)ident(CursorPos) operator(:=) ident(Mouse)operator(.)ident(CursorPos)operator(;) comment(//update cursor) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(PasteKeyMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Src)operator(,) ident(Trg)operator(:) ident(TRegPath)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Src) operator(:=) ident(RegPathOfStr)operator(()ident(Clipboard)operator(.)ident(AsText)operator(\);) + ident(Trg) operator(:=) ident(CurKey)operator(()ident(uhNonSystemShortcuts)operator(\);) + ident(Trg)operator(.)ident(Key) operator(:=) ident(Trg)operator(.)ident(Key) operator(+) char operator(+) ident(FromLastChar)operator(()ident(Src)operator(.)ident(Key)operator(,) charoperator(,) ident(True)operator(\);) + + ident(MoveKey)operator(()ident(Src)operator(,) ident(Trg)operator(,) ident(UserCopyKeyFlag)operator(\);) + + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\);) + ident(Node)operator(.)ident(Expanded) operator(:=) ident(False)operator(;) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(\);) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\);) + + reserved(if) reserved(not) ident(UserCopyKeyFlag) reserved(then) + ident(RegTV)operator(.)ident(Repaint)operator(;) comment(// CheckNode(Node, False\);) + + ident(UserCopyKeyFlag) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(CutPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(UserCopyKeyFlag) operator(:=) ident(False)operator(;) + ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(OpenNextLevel)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + + reserved(procedure) ident(ExpandKeys)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(begin) + ident(CheckNode)operator(()ident(Node)operator(,) ident(False)operator(,) ident(True)operator(\);) + reserved(if) reserved(not) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(Exit)operator(;) + reserved(if) reserved(not) ident(Node)operator(.)ident(Expanded) reserved(then) + ident(Node)operator(.)ident(Expand)operator(()ident(False)operator(\)) + reserved(else) reserved(begin) + ident(Node) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) + reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) + ident(ExpandKeys)operator(()ident(Node)operator(\);) + ident(Node) operator(:=) ident(Node)operator(.)ident(GetNextSibling)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(DoSmartExpand) operator(:=) ident(False)operator(;) + ident(ExpandKeys)operator(()ident(Node)operator(\);) + ident(DoSmartExpand) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(EditShortcutMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(NewPath)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(Shortcut)operator(:) ident(PKeyShortcut)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(if) ident(NodeInfo)operator(()ident(Node)operator(\).)ident(HostType) operator(<>) ident(uhUserShortcut) reserved(then) + ident(Exit)operator(;) + + ident(i) operator(:=) ident(ShortcutIndex)operator(()ident(Node)operator(\);) + reserved(if) ident(i) operator(=) operator(-)integer(1) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) + reserved(try) + ident(NewPath) operator(:=) ident(ReadString)operator(()stringoperator(,) ident(Shortcuts)operator([)ident(i)operator(].)ident(Alias)operator(,) stringoperator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(InputQuery)operator(()stringoperator(,) stringoperator(,) ident(NewPath)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Node)operator(.)ident(Collapse)operator(()ident(False)operator(\);) + ident(Shortcut) operator(:=) operator(@)ident(Shortcuts)operator([)ident(i)operator(];) + ident(Shortcut)operator(.)ident(RealPath) operator(:=) ident(TraceKey)operator(()ident(NewPath)operator(\);) + reserved(with) ident(TIniFile)operator(.)ident(Create)operator(()ident(PlutoDir) operator(+) stringoperator(\)) reserved(do) + reserved(try) + ident(WriteString)operator(()stringoperator(,) ident(Shortcut)operator(.)ident(Alias)operator(,) ident(Shortcut)operator(.)ident(RealPath)operator(\);) + reserved(finally) + ident(Free)operator(;) + reserved(end)operator(;) + + ident(RegTVChange)operator(()ident(Self)operator(,) ident(Node)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(SubKeylist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(if) ident(OpenCurKey) reserved(then) + reserved(try) + ident(MainReg)operator(.)ident(GetKeyNames)operator(()ident(SL)operator(\);) + reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) + ident(SL)operator(.)ident(Sort)operator(;) + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(SL)operator(.)ident(Text)operator(;) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(ValueNameslist1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(if) ident(OpenCurKey) reserved(then) + reserved(try) + ident(MainReg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\);) + reserved(if) ident(PrefWin)operator(.)ident(SortKeysCB)operator(.)ident(Checked) reserved(then) + ident(SL)operator(.)ident(Sort)operator(;) + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(SL)operator(.)ident(Text)operator(;) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(KeyInfosMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MessageDlg)operator(()ident(GetKeyInfos)operator(,) ident(mtInformation)operator(,) operator([)ident(mbOK)operator(],) integer(0)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TTreeWin)operator(.)ident(GetKeyInfos)operator(:) reserved(string)operator(;) +reserved(const) + ident(sErrorMsg) operator(=) stringoperator(;) + +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + ident(Mode)operator(:) ident(TOpenNodeMode)operator(;) + ident(Error)operator(:) ident(Integer)operator(;) + ident(Info)operator(:) ident(TNodeInfo)operator(;) + ident(Flag)operator(:) ident(TNodeFlag)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator(;) + reserved(end)operator(;) + + reserved(procedure) ident(AddLn)operator(()reserved(const) ident(S)operator(:) reserved(string) operator(=) stringoperator(\);) + reserved(begin) + ident(Add)operator(()ident(S) operator(+) ident(EOL)operator(\);) + reserved(end)operator(;) + + reserved(procedure) ident(AddNodeInfo)operator(()ident(Key)operator(:) ident(HKEY)operator(\);) + reserved(var) + ident(KeyInfo)operator(:) ident(TRegKeyInfo)operator(;) + ident(Res)operator(:) ident(Integer)operator(;) + ident(KeyAge)operator(:) ident(TDateTime)operator(;) + reserved(begin) + ident(FillChar)operator(()ident(KeyInfo)operator(,) ident(SizeOf)operator(()ident(TRegKeyInfo)operator(\),) integer(0)operator(\);) + reserved(with) ident(KeyInfo) reserved(do) reserved(begin) + ident(Res) operator(:=) ident(RegQueryInfoKey)operator(()ident(Reg)operator(.)ident(CurrentKey)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) reserved(nil)operator(,) operator(@)ident(NumSubKeys)operator(,) + operator(@)ident(MaxSubKeyLen)operator(,) reserved(nil)operator(,) operator(@)ident(NumValues)operator(,) operator(@)ident(MaxValueLen)operator(,) + operator(@)ident(MaxDataLen)operator(,) reserved(nil)operator(,) operator(@)ident(LastWriteTime)operator(\);) + + reserved(if) ident(Res) operator(=) ident(ERROR_SUCCESS) reserved(then) reserved(begin) + ident(Add)operator(()ident(Format)operator(() + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(,) + operator([)ident(NumSubKeys)operator(,) ident(MaxSubKeyLen)operator(,) ident(NumValues)operator(,) ident(MaxValueLen)operator(,) ident(MaxDataLen)operator(]\)\);) + ident(KeyAge) operator(:=) ident(DateTimeOfFileTime)operator(()ident(LastWriteTime)operator(\);) + reserved(if) ident(KeyAge) operator(>) integer(0) reserved(then) + ident(AddLn)operator(()string operator(+) ident(DateTimeToStr)operator(()ident(KeyAge)operator(\)\);) + reserved(end) reserved(else) + ident(AddLn)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(IntToStr)operator(()ident(Res)operator(\)) operator(+) ident(EOL) operator(+) + string operator(+) ident(SysErrorMessage)operator(()ident(Res)operator(\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(()ident(KEY_READ)operator(\);) + reserved(try) + reserved(try) + ident(Error) operator(:=) ident(OpenNodeError)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(,) ident(Mode)operator(\);) + + reserved(case) ident(Mode) reserved(of) + ident(onFull)operator(:) ident(AddLn)operator(()stringoperator(\);) + ident(onReadOnly)operator(:) ident(AddLn)operator(()stringoperator(\);) + ident(onError)operator(:) + ident(AddLn)operator(()ident(Format)operator(()ident(sErrorMsg)operator(,) operator([)ident(Error)operator(,) ident(SysErrorMessage)operator(()ident(Error)operator(\)]\)\);) + ident(onNodeNil)operator(:) ident(AddLn)operator(()stringoperator(\);) + + reserved(else) + ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Integer)operator(()ident(Mode)operator(\)\)\);) + reserved(end)operator(;) + + reserved(if) ident(Mode) reserved(in) ident(onOK) reserved(then) + ident(AddNodeInfo)operator(()ident(Reg)operator(.)ident(CurrentKey)operator(\);) + + reserved(except) + directive(on) ident(E)operator(:) ident(Exception) reserved(do) reserved(begin) + ident(Error) operator(:=) ident(GetLastError)operator(;) + reserved(if) ident(Error) operator(<>) ident(ERROR_SUCCESS) reserved(then) + ident(AddLn)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Error)operator(,) ident(SysErrorMessage)operator(()ident(Error)operator(\)]\)\)) + reserved(else) + ident(AddLn)operator(()ident(E)operator(.)ident(Message)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(if) ident(MurphyMode) reserved(then) reserved(begin) + ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Node)operator(.)ident(ImageIndex)operator(\)\);) + ident(Info) operator(:=) ident(NodeInfo)operator(()ident(Node)operator(\);) + + reserved(if) ident(Info)operator(.)ident(HostType) reserved(in) operator([)ident(uhNone)operator(..)ident(High)operator(()ident(HostTypeStrings)operator(\)]) reserved(then) + ident(AddLn)operator(()string operator(+) ident(HostTypeStrings)operator([)ident(Info)operator(.)ident(HostType)operator(]\)) + reserved(else) + ident(AddLn)operator(()string operator(+) ident(IntToStr)operator(()ident(Integer)operator(()ident(Info)operator(.)ident(HostType)operator(\)\)\);) + ident(Add)operator(()stringoperator(\);) + reserved(for) ident(Flag) operator(:=) ident(Low)operator(()ident(TNodeFlag)operator(\)) reserved(to) ident(High)operator(()ident(TNodeFlag)operator(\)) reserved(do) + reserved(if) ident(Flag) reserved(in) ident(Info)operator(.)ident(Flags) reserved(then) + ident(Add)operator(()ident(NodeFlagStrings)operator([)ident(Flag)operator(]) operator(+) charoperator(\);) + ident(AddLn)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(ExportAsRegClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + + reserved(procedure) ident(ExportAsReg4)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(\);) + reserved(var) + ident(Reg4Writer)operator(:) ident(TReg4Writer)operator(;) + reserved(begin) + ident(Reg4Writer) operator(:=) ident(TReg4Writer)operator(.)ident(Create)operator(()ident(tpNormal)operator(,) ident(FileName)operator(,) + ident(TraceKey)operator(()ident(PathOfNode)operator(()ident(Node)operator(\)\),) ident(Reg)operator(.)ident(DeliverKey)operator(\);) + reserved(with) ident(Reg4Writer) reserved(do) reserved(begin) + ident(OnTerminate) operator(:=) ident(Reg4WriterTerminate)operator(;) + reserved(try) + ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) + operator([)ident(Root) operator(+) char operator(+) ident(Path)operator(]\)\);) + ident(Resume)operator(;) + reserved(except) + ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + ident(AddToLastHint)operator(()stringoperator(\);) + reserved(end)operator(;) + + + reserved(procedure) ident(ExportAsHive)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) ident(Reg)operator(.)ident(SaveKey)operator(()stringoperator(,) ident(FileName)operator(\)) reserved(then) + ident(AddHint)operator(()stringoperator(\)) + reserved(else) + ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) + operator([)ident(SysErrorMessage)operator(()ident(LastSuccessRes)operator(\)]\)\);) + reserved(end)operator(;) + +reserved(begin) + ident(Node) operator(:=) ident(RegTV)operator(.)ident(Selected)operator(;) + reserved(with) ident(ExportD) reserved(do) reserved(begin) + ident(FileName) operator(:=) ident(MakeValidFileName)operator(()ident(Node)operator(.)ident(Text)operator(,) stringoperator(\);) + + reserved(if) ident(Execute) reserved(then) reserved(begin) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(Node)operator(\)) reserved(then) reserved(begin) + reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(and) operator(()ident(mrYes)operator(=)ident(MessageDlg)operator(() + string operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)\)) reserved(then) reserved(begin) + ident(FileSetAttr)operator(()ident(FileName)operator(,) integer(0)operator(\);) + ident(DeleteFile)operator(()ident(FileName)operator(\);) + reserved(end)operator(;) + reserved(case) ident(FilterIndex) reserved(of) + integer(1)operator(:) ident(ExportAsReg4)operator(()ident(Reg)operator(,) ident(FileName)operator(\);) + integer(2)operator(:) ident(ExportAsHive)operator(()ident(Reg)operator(,) ident(FileName)operator(\);) + reserved(else) + ident(ShowMessage)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(FilterIndex)operator(]\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) +reserved(begin) +comment(// Action := caNone;) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(Load)operator(;) +reserved(var) + ident(NodeHKLM)operator(,) ident(NodeHKU)operator(,) ident(NodeHKDD)operator(,) ident(NodeHKPD)operator(:) ident(TTreeNode)operator(;) + ident(NodeHostReg)operator(:) ident(TTreeNode)operator(;) + + reserved(procedure) ident(LoadShortcuts)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(HostType)operator(:) ident(TUniHostType)operator(\);) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(ShortcutIni)operator(:) ident(TIniFile)operator(;) + reserved(begin) + reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) + ident(AddToLastHint)operator(()stringoperator(\);) + ident(AddHint)operator(()ident(FileName)operator(\);) + ident(Exit) reserved(end)operator(;) + + ident(ShortcutIni) operator(:=) ident(TIniFile)operator(.)ident(Create)operator(()ident(FileName)operator(\);) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + + reserved(try) + ident(ShortcutIni)operator(.)ident(ReadSectionValues)operator(()stringoperator(,) ident(SL)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(AddShortcut)operator(()ident(SL)operator(.)ident(Names)operator([)ident(i)operator(],) ident(SL)operator(.)ident(Values)operator([)ident(SL)operator(.)ident(Names)operator([)ident(i)operator(]],) ident(iconShortcut)operator(,) + ident(HostType)operator(\);) + ident(AddToLastHint)operator(()stringoperator(\);) + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + ident(ShortcutIni)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(NodeHostReg) operator(:=) reserved(nil)operator(;) + + ident(AddHint)operator(()stringoperator(\);) + ident(RootNodes) operator(:=) ident(TList)operator(.)ident(Create)operator(;) + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(NodeHKLM) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(NodeHostReg)operator(,) stringoperator(\);) + ident(SetTNImage)operator(()ident(NodeHKLM)operator(,) ident(iconHKLM)operator(\);) + ident(NodeInfo)operator(()ident(NodeHKLM)operator(\).)ident(HostType) operator(:=) ident(uhReg)operator(;) + ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKLM)operator(\);) + + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(NodeHKU) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()ident(NodeHostReg)operator(,) stringoperator(\);) + ident(SetTNImage)operator(()ident(NodeHKU)operator(,) ident(iconHKU)operator(\);) + ident(NodeInfo)operator(()ident(NodeHKU)operator(\).)ident(HostType) operator(:=) ident(uhReg)operator(;) + ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKU)operator(\);) + + ident(ChangeLastHint)operator(()stringoperator(\);) + reserved(if) ident(RegRealPath)operator(()stringoperator(\)) operator(=) string reserved(then) + comment(//could not dereference hkcu) + ident(AddShortcut)operator(()stringoperator(,) stringoperator(,) + ident(iconHKCU)operator(,) ident(uhReg)operator(\)) + reserved(else) + ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\),) + ident(iconHKCU)operator(,) ident(uhSystemShortcut)operator(\);) + + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\),) + ident(iconHKCC)operator(,) ident(uhSystemShortcut)operator(\);) + + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(AddShortcut)operator(()stringoperator(,) ident(RegRealPath)operator(()stringoperator(\),) + ident(iconHKCR)operator(,) ident(uhSystemShortcut)operator(\);) + + ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEY_DYN_DATA)operator(;) + reserved(if) ident(MainReg)operator(.)ident(OpenKeyReadOnly)operator(()stringoperator(\)) reserved(then) reserved(begin) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(NodeHKDD) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()reserved(nil)operator(,) stringoperator(\);) + ident(NodeInfo)operator(()ident(NodeHKDD)operator(\).)ident(HostType) operator(:=) ident(uhReg)operator(;) + ident(NodeInfo)operator(()ident(NodeHKDD)operator(\).)ident(IncludeFlag)operator(()ident(nfReadOnly)operator(\);) + ident(SetTNImage)operator(()ident(NodeHKDD)operator(,) ident(iconHKDD)operator(\);) + ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKDD)operator(\);) + reserved(end)operator(;) + + ident(MainReg)operator(.)ident(RootKey) operator(:=) ident(HKEY_PERFORMANCE_DATA)operator(;) + reserved(if) ident(MainReg)operator(.)ident(OpenKeyReadOnly)operator(()stringoperator(\)) reserved(then) reserved(begin) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + ident(ChangeLastHint)operator(()stringoperator(\);) + ident(NodeHKPD) operator(:=) ident(RegTV)operator(.)ident(Items)operator(.)ident(AddChild)operator(()reserved(nil)operator(,) stringoperator(\);) + ident(NodeInfo)operator(()ident(NodeHKPD)operator(\).)ident(HostType) operator(:=) ident(uhReg)operator(;) + ident(SetTNImage)operator(()ident(NodeHKPD)operator(,) ident(iconHKPD)operator(\);) + ident(RootNodes)operator(.)ident(Add)operator(()ident(NodeHKPD)operator(\);) + reserved(end)operator(;) + + ident(ChangeLastHint)operator(()stringoperator(\);) + + ident(AddHint)operator(()stringoperator(\);) + ident(LoadShortcuts)operator(()ident(PlutoDir) operator(+) ident(StandardShortcutsFileName)operator(,) ident(uhStandardShortcut)operator(\);) + + ident(AddHint)operator(()stringoperator(\);) + ident(LoadShortcuts)operator(()ident(PlutoDir) operator(+) ident(ShortcutsFileName)operator(,) ident(uhUserShortcut)operator(\);) + +preprocessor({$IFDEF UNIKEY}) + ident(AddShortcut)operator(()stringoperator(,) stringoperator(,) ident(iconHostUni)operator(\);) +preprocessor({$ENDIF}) +reserved(end)operator(;) + +reserved(procedure) ident(TTreeWin)operator(.)ident(Reg4WriterTerminate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(Sender) reserved(as) ident(TRegFileWriter) reserved(do) + ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) + operator([)ident(Clk)operator(.)ident(SecsPassed)operator(,) ident(Root) operator(+) char operator(+) ident(Path)operator(]\)\);) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(valuesU)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) + ident(ComCtrls)operator(,) ident(Menus)operator(,) ident(Clipbrd)operator(,) ident(XReg)operator(,) ident(CompEx)operator(,) ident(Math)operator(,) ident(YTools)operator(,) ident(Dialogs)operator(,) ident(YTypes)operator(,) + ident(PlutoConst)operator(,) ident(keybrd)operator(,) ident(ImgList)operator(,) ident(clock)operator(;) + +reserved(type) + ident(TValuesWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(ValueListPU)operator(:) ident(TPopupMenu)operator(;) + ident(NewStringMI)operator(:) ident(TMenuItem)operator(;) + ident(NewDWORDMI)operator(:) ident(TMenuItem)operator(;) + ident(NewBinaryMI)operator(:) ident(TMenuItem)operator(;) + ident(ConvertToMI)operator(:) ident(TMenuItem)operator(;) + ident(ConvStringMI)operator(:) ident(TMenuItem)operator(;) + ident(ConvDWORDMI)operator(:) ident(TMenuItem)operator(;) + ident(ConvBinaryMI)operator(:) ident(TMenuItem)operator(;) + ident(ValueList)operator(:) ident(TListView)operator(;) + ident(DeleteMI)operator(:) ident(TMenuItem)operator(;) + ident(N1)operator(:) ident(TMenuItem)operator(;) + ident(RenameMI)operator(:) ident(TMenuItem)operator(;) + ident(NewElseMI)operator(:) ident(TMenuItem)operator(;) + ident(NewMultiStringMI)operator(:) ident(TMenuItem)operator(;) + ident(REGNONE1)operator(:) ident(TMenuItem)operator(;) + ident(LINK1)operator(:) ident(TMenuItem)operator(;) + ident(NewExpandStringMI)operator(:) ident(TMenuItem)operator(;) + ident(N3BINARY1)operator(:) ident(TMenuItem)operator(;) + ident(N4DWORD1)operator(:) ident(TMenuItem)operator(;) + ident(N4DWORDLITTLEEDIAN1)operator(:) ident(TMenuItem)operator(;) + ident(NewBigEndianMI)operator(:) ident(TMenuItem)operator(;) + ident(N6LINK1)operator(:) ident(TMenuItem)operator(;) + ident(N7MULTISZ1)operator(:) ident(TMenuItem)operator(;) + ident(RESOURCELIST1)operator(:) ident(TMenuItem)operator(;) + ident(N9FULLRESOURCEDESCRIPTOR1)operator(:) ident(TMenuItem)operator(;) + ident(ARESOURCEREQUIREMENTSLIST1)operator(:) ident(TMenuItem)operator(;) + ident(NewDefaultValueMI)operator(:) ident(TMenuItem)operator(;) + ident(EditMI)operator(:) ident(TMenuItem)operator(;) + ident(EditBinaryMI)operator(:) ident(TMenuItem)operator(;) + ident(N3)operator(:) ident(TMenuItem)operator(;) + ident(CopyDataPreviewMI)operator(:) ident(TMenuItem)operator(;) + ident(DublicateMI)operator(:) ident(TMenuItem)operator(;) + ident(MultiString1)operator(:) ident(TMenuItem)operator(;) + ident(ZeromizeMI)operator(:) ident(TMenuItem)operator(;) + ident(N4)operator(:) ident(TMenuItem)operator(;) + ident(CopyPathMI)operator(:) ident(TMenuItem)operator(;) + ident(TakeAsMainValueMI)operator(:) ident(TMenuItem)operator(;) + ident(SelectAllMI)operator(:) ident(TMenuItem)operator(;) + ident(InvertSelectionMI)operator(:) ident(TMenuItem)operator(;) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(InitListColumnTags)operator(;) + + reserved(procedure) ident(NewStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewDWORDMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ConvertValue)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(CreateValue)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\);) + reserved(procedure) ident(ZeromizeValue)operator(;) + reserved(procedure) ident(DeleteValue)operator(;) + reserved(procedure) ident(CloneValue)operator(;) + reserved(function) ident(TryRenameValue)operator(()ident(OldName)operator(:) reserved(string)operator(;) reserved(var) ident(NewName)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + + reserved(procedure) ident(ValueListChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(Change)operator(:) ident(TItemChange)operator(\);) + reserved(procedure) ident(ValueListCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ValueListDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ValueListEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ValueListEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) reserved(var) ident(S)operator(:) ident(String)operator(\);) + reserved(procedure) ident(ValueListKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(ValueListResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(function) ident(UpdateValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) + reserved(procedure) ident(UpdateValues)operator(()ident(SelectedOnly)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) + reserved(procedure) ident(Reload)operator(()ident(JumpToNewValue)operator(:) ident(Boolean) operator(=) ident(False)operator(;) ident(ValueName)operator(:) reserved(string) operator(=) stringoperator(\);) + reserved(procedure) ident(LoadValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\);) + + reserved(function) ident(AddValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(AppendInfos)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(TListItem)operator(;) + reserved(procedure) ident(ValueListPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(ValueListDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(\);) + reserved(procedure) ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewBigEndianMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewExpandStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewStrangeTypeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(NewDefaultValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ValueListChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(Change)operator(:) ident(TItemChange)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ValueListMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(EditBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(EditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ValueListCustomDrawSubItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) ident(SubItem)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ValueListCompare)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item1)operator(,) ident(Item2)operator(:) ident(TListItem)operator(;) ident(Data)operator(:) ident(Integer)operator(;) reserved(var) ident(Compare)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(ValueListColumnClick)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Column)operator(:) ident(TListColumn)operator(\);) + reserved(procedure) ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CopyDataPreviewMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CopyDataPreview)operator(;) + reserved(procedure) ident(ZeromizeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(function) ident(FindItemByRealName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) + + reserved(function) ident(FocusItem)operator(()ident(ARealValueName)operator(:) reserved(string)operator(;) + ident(FocusValueList)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(Boolean)operator(;) + reserved(procedure) ident(TakeAsMainValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) + reserved(procedure) ident(ValueListClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CheckValueListHotTrack)operator(;) + reserved(procedure) ident(SelectAllMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(InvertSelectionMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormDestroy)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + directive(private) + ident(ValueLabelClicked)operator(:) ident(Boolean)operator(;) + ident(SortBy)operator(:) ident(TValueListColumn)operator(;) + ident(SortByColumn)operator(:) ident(TListColumn)operator(;) + ident(SubItemIndex)operator(:) reserved(array)operator([)ident(TValueListColumn)operator(]) reserved(of) ident(Integer)operator(;) + directive(public) + ident(ValueNames)operator(:) ident(TStringList)operator(;) + ident(ValuesCommon)operator(:) ident(Boolean)operator(;) + ident(ValueCommonType)operator(:) ident(TRegDataType)operator(;) + reserved(end)operator(;) + +reserved(var) + ident(ValuesWin)operator(:) ident(TValuesWin)operator(;) + ident(ValueList)operator(:) ident(TListView)operator(;) + + ident(DefaultValueCaption)operator(:) reserved(string) operator(=) stringoperator(;) + +reserved(function) ident(ItemIsDefaultValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(RealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) reserved(string)operator(;) +reserved(procedure) ident(SetRealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Caption)operator(:) reserved(string)operator(\);) +reserved(function) ident(IconOfDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\):) ident(Integer)operator(;) +reserved(function) ident(IsMainValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) + +reserved(function) ident(ColorOfDataType)operator(()ident(DataType)operator(:) ident(TRegDataType)operator(;) + ident(DefaultColor)operator(:) ident(TColor) operator(=) ident(clWhite)operator(\):) ident(TColor)operator(;) +reserved(function) ident(DataPreviewOfContext)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + +reserved(function) ident(ValueDataSize)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(function) ident(ValueDataType)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(function) ident(ValueDataPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(function) ident(ValueTypeIcon)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) ident(Integer)operator(;) + +reserved(function) ident(StrOfRegDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\):) reserved(string)operator(;) + +reserved(implementation) + +reserved(uses) ident(PlutoMain)operator(,) ident(TreeU)operator(,) ident(WorkU)operator(,) ident(PrefU)operator(;) + +preprocessor({$R *.dfm}) + +reserved(function) ident(ItemIsDefaultValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Item)operator(.)ident(Data) operator(=) ident(Pointer)operator(()ident(DefaultValueFlag)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(RealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) + ident(Result) operator(:=) string + reserved(else) + ident(Result) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(SetRealValueName)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Caption)operator(:) reserved(string)operator(\);) +reserved(begin) + reserved(if) ident(Caption) operator(=) string reserved(then) reserved(begin) + ident(Item)operator(.)ident(Caption) operator(:=) ident(DefaultValueCaption)operator(;) + ident(Item)operator(.)ident(Data) operator(:=) ident(Pointer)operator(()ident(DefaultValueFlag)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Item)operator(.)ident(Caption) operator(:=) ident(Caption)operator(;) + ident(Item)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(IsMainValue)operator(()ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\)) operator(=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ColorOfDataType)operator(()ident(DataType)operator(:) ident(TRegDataType)operator(;) + ident(DefaultColor)operator(:) ident(TColor) operator(=) ident(clWhite)operator(\):) ident(TColor)operator(;) +reserved(begin) + reserved(if) ident(DataType) reserved(in) ident(rdStringTypes) reserved(then) ident(Result) operator(:=) ident(clBrightRed) + reserved(else) reserved(if) ident(DataType) operator(=) ident(rdMultiString) reserved(then) ident(Result) operator(:=) ident(clBrightPurple) + reserved(else) reserved(if) ident(DataType) reserved(in) ident(rdCardTypes) reserved(then) ident(Result) operator(:=) ident(clBrightBlue) + reserved(else) reserved(if) ident(DataType) operator(=) ident(rdBinary) reserved(then) ident(Result) operator(:=) ident(clBrightGreen) + reserved(else) ident(Result) operator(:=) ident(DefaultColor)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrOfRegDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\):) reserved(string)operator(;) +reserved(const) + ident(RegDataTypeStrings)operator(:) reserved(array)operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(of) reserved(string) operator(=) operator(() + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + string + operator(\);) +reserved(begin) + reserved(if) ident(Typ) reserved(in) operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(then) + ident(Result) operator(:=) ident(RegDataTypeStrings)operator([)ident(Typ)operator(]) + reserved(else) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(Typ)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdString)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewDWORDMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdCardinal)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdBinary)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CreateValue)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\);) +reserved(var) + ident(Item)operator(:) ident(TListItem)operator(;) + ident(ValueName)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(MainWin)operator(.)ident(ComponentState)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(MainReg) reserved(do) reserved(begin) + reserved(try) + ident(OpenCurKey)operator(;) + + ident(ValueName) operator(:=) stringoperator(;) comment(// find free name) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(do) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(ValueName) operator(:=) string operator(+) ident(IntToStr)operator(()ident(i)operator(\);) + reserved(end)operator(;) + + reserved(case) ident(Typ) reserved(of) + ident(rdString)operator(:) reserved(begin) + ident(WriteString)operator(()ident(ValueName)operator(,) stringoperator(\);) + reserved(end)operator(;) + ident(rdExpandString)operator(:) reserved(begin) + ident(WriteExpandString)operator(()ident(ValueName)operator(,) stringoperator(\);) + reserved(end)operator(;) + ident(rdCardinal)operator(:) reserved(begin) + ident(WriteCardinal)operator(()ident(ValueName)operator(,) integer(0)operator(\);) + reserved(end)operator(;) + ident(rdCardBigEndian)operator(:) reserved(begin) + ident(WriteCardinal)operator(()ident(ValueName)operator(,) integer(0)operator(,) ident(True)operator(\);) + reserved(end)operator(;) + ident(rdMultiString)operator(:) reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(WriteMultiString)operator(()ident(ValueName)operator(,) ident(SL)operator(\);) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + ident(rdBinary)operator(:) reserved(begin) + ident(WriteBin)operator(()ident(ValueName)operator(,) reserved(nil)operator(\);) + reserved(end)operator(;) + reserved(else) + ident(WriteBinType)operator(()ident(ValueName)operator(,) reserved(nil)operator(,) ident(Typ)operator(\);) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(ValueExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(CloseKey)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(MainReg)operator(,) ident(ValueName)operator(\);) + reserved(finally) + ident(CloseKey)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(Item) operator(:=) ident(FindItem)operator(()ident(ValueList)operator(,) ident(ValueName)operator(\);) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(ValueName)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(SelectItemOnly)operator(()ident(ValueList)operator(,) ident(Item)operator(\);) + ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) + ident(ValueLabelClicked) operator(:=) ident(True)operator(;) + ident(Item)operator(.)ident(EditCaption)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValuesU)operator(.)ident(ValueList) operator(:=) ident(ValueList)operator(;) + + ident(DefaultValueCaption) operator(:=) ident(PrefWin)operator(.)ident(DefaultValueNameE)operator(.)ident(Text)operator(;) + ident(ValueLabelClicked) operator(:=) ident(False)operator(;) + ident(SortBy) operator(:=) ident(vlcName)operator(;) + ident(SortByColumn) operator(:=) reserved(nil)operator(;) + + ident(ValueListResize)operator(()ident(Sender)operator(\);) + ident(ValueList)operator(.)ident(Items)operator(.)ident(Clear)operator(;) + ident(CheckValueListHotTrack)operator(;) + + ident(ValueNames) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(ValuesCommon) operator(:=) ident(False)operator(;) + ident(ValueCommonType) operator(:=) integer(0)operator(;) + + ident(NewDefaultValueMI)operator(.)ident(ImageIndex) operator(:=) ident(iconMainValue)operator(;) + ident(NewStringMI)operator(.)ident(ImageIndex) operator(:=) ident(iconString)operator(;) + ident(NewDWORDMI)operator(.)ident(ImageIndex) operator(:=) ident(iconCardinal)operator(;) + ident(NewBinaryMI)operator(.)ident(ImageIndex) operator(:=) ident(iconBinary)operator(;) + ident(NewMultiStringMI)operator(.)ident(ImageIndex) operator(:=) ident(iconMultiString)operator(;) + ident(NewElseMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueElse)operator(;) + + ident(DublicateMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueDublicate)operator(;) + ident(DeleteMI)operator(.)ident(ImageIndex) operator(:=) ident(iconDelete)operator(;) + ident(ZeromizeMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueZeromize)operator(;) + + ident(EditMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueEdit)operator(;) + ident(EditBinaryMI)operator(.)ident(ImageIndex) operator(:=) ident(iconValueEditBinary)operator(;) + ident(RenameMI)operator(.)ident(ImageIndex) operator(:=) ident(iconRename)operator(;) + + ident(TakeAsMainValueMI)operator(.)ident(ImageIndex) operator(:=) ident(iconTakeAsMainValue)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ConvertValue)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +comment({var + Allow: Boolean; + OldActive: Integer; }) +reserved(begin) +comment({ TargetPage := ShowPC.Pages[TMenuItem(Sender\).Tag]; + + OldActive := ShowPC.ActivePageIndex; + ShowPC.ActivePageIndex := TMenuItem(Sender\).Tag; + WorkWin.ShowPCChanging(Sender, Allow\); + if not Allow then + ShowPC.ActivePageIndex := OldActive; }) +reserved(end)operator(;) + +reserved(function) ident(ValueDataSize)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Typ)operator(:) ident(TRegDataType)operator(;) + ident(Size)operator(:) ident(Integer)operator(;) +comment(// ValueName: string;) +comment(// SL: TStringList;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + +comment(// ValueName := RealValueName(Item\);) + ident(Typ) operator(:=) ident(Context)operator(.)ident(Typ)operator(;) + ident(Size) operator(:=) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\);) + + reserved(if) ident(Typ) reserved(in) ident(rdStringTypes) reserved(then) + reserved(if) reserved(not) ident(PrefWin)operator(.)ident(CountZeroByteCB)operator(.)ident(Checked) reserved(then) + ident(Dec)operator(()ident(Size)operator(\);) + + reserved(if) ident(Typ) operator(=) ident(rdMultiString) reserved(then) + reserved(if) ident(PrefWin)operator(.)ident(ShowLineCountCB)operator(.)ident(Checked) reserved(then) reserved(begin) + ident(Size) operator(:=) ident(CharCount)operator(()ident(StrOfByteA)operator(()ident(Context)operator(.)ident(Data)operator(\),) char(#0)operator(\)) operator(-) integer(2)operator(;) +comment({ SL := TStringList.Create; + try + Reg.ReadMultiString(ValueName, SL, PrefWin.UseExtendedModelCB.Checked\); + Size := SL.Count; + finally + SL.Free; + end; }) + ident(Result) operator(:=) charoperator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(Result) operator(+) ident(IntToStr)operator(()ident(Size)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(ValueDataType)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(StrOfRegDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(DataPreviewOfContext)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + + reserved(function) ident(DWORDPreview)operator(()ident(Value)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) + reserved(begin) + reserved(if) ident(PrefWin)operator(.)ident(ShowDwordAsHex)operator(.)ident(Checked) reserved(then) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) string operator(+) ident(IntToHex)operator(()ident(Value)operator(,) integer(8)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) + reserved(end)operator(;) + + reserved(function) ident(BinaryPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + reserved(var) + ident(z)operator(:) reserved(string)operator(;) + + reserved(function) ident(DWORDStringOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(AddBinary)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) + reserved(var) + ident(piece)operator(:) ident(TByteA)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + ident(i) operator(:=) integer(0)operator(;) + reserved(while) operator(()ident(i) operator(<=) ident(High)operator(()ident(a)operator(\)\)) reserved(and) operator(()ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MaxPreviewLen)operator(\)) reserved(do) reserved(begin) + ident(piece) operator(:=) ident(Copy)operator(()ident(a)operator(,) ident(i)operator(,) integer(4)operator(\);) + reserved(if) ident(AddBinary) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(FriendlyStr)operator(()ident(piece)operator(\)) operator(+) charoperator(;) + ident(SetLength)operator(()ident(piece)operator(,) integer(4)operator(\);) + ident(Result) operator(:=) ident(Result) operator(+) ident(IntToStr)operator(()ident(PInteger)operator(()ident(piece)operator(\)^\)) operator(+) stringoperator(;) + ident(Inc)operator(()ident(i)operator(,) ident(SizeOf)operator(()ident(Integer)operator(\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(begin) + reserved(with) ident(Context) reserved(do) reserved(begin) + ident(Data) operator(:=) ident(Copy)operator(()ident(Data)operator(,) integer(0)operator(,) ident(MaxPreviewLen)operator(\);) + reserved(case) ident(PrefWin)operator(.)ident(ShowBinaryAsRG)operator(.)ident(ItemIndex) reserved(of) + integer(0)operator(:) ident(z) operator(:=) ident(FriendlyStr)operator(()ident(Data)operator(\);) + integer(1)operator(:) ident(z) operator(:=) ident(DWORDStringOfByteA)operator(()ident(Data)operator(\);) + integer(2)operator(:) ident(z) operator(:=) ident(DWORDStringOfByteA)operator(()ident(Data)operator(,) ident(True)operator(\);) + integer(3)operator(:) ident(z) operator(:=) ident(BinOfByteA)operator(()ident(Data)operator(,) integer(8)operator(,) stringoperator(\);) + integer(4)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(0)operator(\);) + integer(5)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(1)operator(\);) + integer(6)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(2)operator(\);) + integer(7)operator(:) ident(z) operator(:=) ident(HexOfByteA)operator(()ident(Data)operator(,) integer(4)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(Copy)operator(()ident(z)operator(,) integer(1)operator(,) ident(MaxPreviewLen)operator(\);) + reserved(end)operator(;) + + reserved(function) ident(StringPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + reserved(var) + ident(s)operator(:) reserved(string)operator(;) + ident(Expanded)operator(:) reserved(string)operator(;) + ident(DoExpand)operator(:) ident(Boolean)operator(;) + reserved(begin) + ident(s) operator(:=) ident(PChar)operator(()ident(Context)operator(.)ident(Data)operator(\);) + reserved(with) ident(PrefWin) reserved(do) + ident(Result) operator(:=) ident(StringQuoterBegin) operator(+) ident(FriendlyStr)operator(()ident(s)operator(\)) operator(+) ident(StringQuoterEnd)operator(;) + reserved(if) ident(s) operator(=) string reserved(then) + ident(Exit)operator(;) + + reserved(case) ident(PrefWin)operator(.)ident(ExpandStringsRG)operator(.)ident(ItemIndex) reserved(of) + integer(0)operator(:) ident(DoExpand) operator(:=) ident(False)operator(;) + integer(1)operator(:) ident(DoExpand) operator(:=) operator(()ident(Context)operator(.)ident(Typ) operator(=) ident(rdExpandString)operator(\)) reserved(and) operator(()ident(CharCount)operator(()ident(s)operator(,) charoperator(\)) operator(>=) integer(2)operator(\);) + integer(2)operator(:) ident(DoExpand) operator(:=) ident(True)operator(;) + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) + ident(PrefWin)operator(.)ident(ExpandStringsRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + ident(Exit)operator(;) + reserved(end)operator(;) + + reserved(if) ident(DoExpand) reserved(then) reserved(begin) + ident(Expanded) operator(:=) ident(ExpandString)operator(()ident(s)operator(\);) + reserved(if) ident(s) operator(<>) ident(Expanded) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) string operator(+) ident(Expanded) operator(+) char)delimiter(')>operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(function) ident(IntegerPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + reserved(begin) + reserved(if) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(Cardinal)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(DWORDPreview)operator(()ident(PInteger)operator(()ident(Context)operator(.)ident(Data)operator(\)^\);) + reserved(end) reserved(else) + ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\);) + reserved(end)operator(;) + + reserved(function) ident(MultiStringPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) + reserved(var) + ident(z)operator(:) reserved(string)operator(;) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(z) operator(:=) stringoperator(;) + + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(RegMultiStringOfByteA)operator(()ident(Context)operator(.)ident(Data)operator(,) ident(SL)operator(,) ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(z) operator(:=) ident(z) operator(+) ident(SL)operator([)ident(i)operator(]) operator(+) stringoperator(;) + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(Copy)operator(()ident(FriendlyStr)operator(()ident(z)operator(\),) integer(1)operator(,) ident(MaxPreviewLen)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(if) operator(()ident(Context)operator(.)ident(Data) operator(=) reserved(nil)operator(\)) reserved(or) operator(()ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>) ident(RegMaxDataSize)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(>) ident(MaxPreviewLen) reserved(then) + ident(SetLength)operator(()ident(Context)operator(.)ident(Data)operator(,) ident(MaxPreviewLen)operator(\);) + + reserved(if) ident(PrefWin)operator(.)ident(ShowAsBinaryCB)operator(.)ident(Checked) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(case) ident(Context)operator(.)ident(Typ) reserved(of) + ident(rdExpandString)operator(,) ident(rdString)operator(:) ident(Result) operator(:=) ident(StringPreview)operator(()ident(Context)operator(\);) + ident(rdCardinal)operator(,) ident(rdCardBigEndian)operator(:) ident(Result) operator(:=) ident(IntegerPreview)operator(()ident(Context)operator(\);) + ident(rdMultiString)operator(:) ident(Result) operator(:=) ident(MultiStringPreview)operator(()ident(Context)operator(\);) + reserved(else) + reserved(if) ident(PrefWin)operator(.)ident(Smart4BBCB)operator(.)ident(Checked) reserved(and) operator(()ident(Length)operator(()ident(Context)operator(.)ident(Data)operator(\)) operator(=) integer(4)operator(\)) reserved(then) + ident(Result) operator(:=) ident(IntegerPreview)operator(()ident(Context)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(BinaryPreview)operator(()ident(Context)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ValueDataPreview)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(DataPreviewOfContext)operator(()ident(Context)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(IconOfDataType)operator(()ident(Typ)operator(:) ident(TRegDataType)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Typ) reserved(in) operator([)ident(rdNone)operator(..)ident(rdLastType)operator(]) reserved(then) + ident(Result) operator(:=) ident(iconFirstType) operator(+) ident(Ord)operator(()ident(Typ)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(iconUnknownType)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ValueTypeIcon)operator(()ident(Context)operator(:) ident(TRegContext)operator(\):) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(IconOfDataType)operator(()ident(Context)operator(.)ident(Typ)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TValuesWin)operator(.)ident(UpdateValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) ident(Item)operator(:) ident(TListItem)operator(\):) ident(Boolean)operator(;) +comment(//Return Value: True if something has changed) +reserved(var) + ident(Size)operator(,) ident(Typ)operator(,) ident(Data)operator(:) reserved(string)operator(;) + ident(Icon)operator(:) ident(Integer)operator(;) + ident(Context)operator(:) ident(TRegContext)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Context) operator(:=) ident(Reg)operator(.)ident(ReadContext)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\);) + ident(Data) operator(:=) ident(ValueDataPreview)operator(()ident(Context)operator(\);) + ident(Size) operator(:=) ident(ValueDataSize)operator(()ident(Context)operator(\);) + ident(Typ) operator(:=) ident(ValueDataType)operator(()ident(Context)operator(\);) + ident(Icon) operator(:=) ident(ValueTypeIcon)operator(()ident(Context)operator(\);) + + reserved(if) ident(Icon) operator(<>) ident(Item)operator(.)ident(ImageIndex) reserved(then) reserved(begin) + ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(Icon)operator(;) + ident(Result) operator(:=) ident(True)operator(;) + reserved(end)operator(;) + + reserved(while) ident(Item)operator(.)ident(SubItems)operator(.)ident(Count) operator(<) ident(Integer)operator(()ident(High)operator(()ident(TValueListColumn)operator(\)\)) reserved(do) + ident(Item)operator(.)ident(SubItems)operator(.)ident(Add)operator(()stringoperator(\);) + + reserved(if) ident(Size) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(]]) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(]]) operator(:=) ident(Size)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Typ) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcType)operator(]]) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcType)operator(]]) operator(:=) ident(Typ)operator(;) + reserved(end)operator(;) + + reserved(if) operator(()ident(Data) operator(<>) ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(]]\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + ident(Item)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(]]) operator(:=) ident(Data)operator(;) + reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Repaint)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(AppendNewValueInfos)operator(()ident(Item)operator(:) ident(TListItem)operator(;) ident(Context)operator(:) ident(TRegContext)operator(\);) +reserved(begin) + ident(Item)operator(.)ident(ImageIndex) operator(:=) ident(ValueTypeIcon)operator(()ident(Context)operator(\);) + reserved(with) ident(Item)operator(.)ident(SubItems) reserved(do) reserved(begin) + ident(Append)operator(()ident(ValueDataSize)operator(()ident(Context)operator(\)\);) + ident(Append)operator(()ident(ValueDataType)operator(()ident(Context)operator(\)\);) + ident(Append)operator(()ident(ValueDataPreview)operator(()ident(Context)operator(\)\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) + ident(AppendInfos)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(TListItem)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(ValueList)operator(.)ident(Items)operator(.)ident(AddItem)operator(()reserved(nil)operator(,) operator(-)integer(1)operator(\);) + ident(Result)operator(.)ident(Indent) operator(:=) operator(-)integer(1)operator(;) + ident(SetRealValueName)operator(()ident(Result)operator(,) ident(ValueName)operator(\);) + reserved(if) ident(AppendInfos) reserved(then) + ident(AppendNewValueInfos)operator(()ident(Result)operator(,) ident(Reg)operator(.)ident(ReadContext)operator(()ident(ValueName)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListChange)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) + ident(Change)operator(:) ident(TItemChange)operator(\);) +reserved(var) + ident(ValueName)operator(:) reserved(string)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) + + reserved(function) ident(ComputeValuesCommon)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(var) ident(DataType)operator(:) ident(TRegDataType)operator(\):) ident(Boolean)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(ItemType)operator(:) ident(TRegDataType)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + + ident(i) operator(:=) integer(0)operator(;) + ident(DataType) operator(:=) integer(0)operator(;) + reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) + ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(];) + reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(Continue)operator(;) reserved(end)operator(;) + + ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\);) + reserved(if) ident(Reg)operator(.)ident(ValueReallyExists)operator(()ident(ValueName)operator(\)) reserved(then) reserved(begin) + + ident(ItemType) operator(:=) ident(Reg)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\);) + reserved(if) reserved(not) ident(Result) reserved(then) reserved(begin) + ident(DataType) operator(:=) ident(ItemType)operator(;) + ident(Result) operator(:=) ident(True)operator(;) + reserved(end) reserved(else) reserved(if) ident(ItemType) operator(<>) ident(DataType) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + ident(DataType) operator(:=) integer(0)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + + reserved(with) ident(ValueNames) reserved(do) + reserved(if) ident(Item)operator(.)ident(Focused) reserved(then) + ident(Insert)operator(()integer(0)operator(,) ident(ValueName)operator(\)) + reserved(else) + ident(Add)operator(()ident(ValueName)operator(\);) + + reserved(end) reserved(else) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(DataType) operator(:=) integer(0)operator(;) + ident(Result) operator(:=) ident(False)operator(;) + ident(Reload)operator(;) + ident(Break)operator(;) reserved(end)operator(;) + + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(or) ident(ValueList)operator(.)ident(IsEditing) reserved(or) reserved(not) ident(ValueList)operator(.)ident(Enabled) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Change) operator(<>) ident(ctState) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(if) operator(()ident(ValueList)operator(.)ident(SelCount) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) + ident(ValueNames)operator(.)ident(Clear)operator(;) + ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) reserved(not) ident(Item)operator(.)ident(Focused) reserved(then) + ident(Exit)operator(;) + + ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) + + ident(ValueNames)operator(.)ident(Clear)operator(;) + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) reserved(begin) + ident(ValuesCommon) operator(:=) ident(ComputeValuesCommon)operator(()ident(Reg)operator(,) ident(ValueCommonType)operator(\);) + reserved(if) ident(ValuesCommon) reserved(then) + ident(WorkWin)operator(.)ident(ShowValues)operator(()ident(Reg)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(ActiveControl) operator(=) ident(ValueList) reserved(then) + ident(MainWin)operator(.)ident(SetStatus)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) +reserved(begin) + reserved(with) ident(ValueList)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Item)operator(.)ident(Focused) reserved(then) + ident(Style) operator(:=) ident(Style) operator(+) operator([)ident(fsBold)operator(];) + reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) + ident(Color) operator(:=) ident(clBrightYellow) + reserved(else) + ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(TRegDataType)operator(()ident(Item)operator(.)ident(ImageIndex) operator(-) ident(iconFirstType)operator(\)\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(ItemFocused)operator(,) ident(ctState)operator(\);) + ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkWin)operator(.)ident(WorkPage)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(WorkWin)operator(.)ident(EditData)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListEditing)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) + reserved(var) ident(AllowEdit)operator(:) ident(Boolean)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(ValueLabelClicked) reserved(then) reserved(begin) + ident(AllowEdit) operator(:=) ident(False)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) comment(//unschön, aber beste Lösung bisher) + ident(Keyboard)operator(.)ident(SimKey)operator(()ident(VK_DELETE)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListEdited)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) + reserved(var) ident(S)operator(:) reserved(string)operator(\);) +reserved(var) + ident(Old)operator(:) reserved(string)operator(;) + ident(OldCaption)operator(:) reserved(string)operator(;) +reserved(begin) + ident(OldCaption) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) + ident(Old) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\);) + + reserved(if) ident(s) operator(=) ident(Old) reserved(then) reserved(begin) + reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator(\)) reserved(then) + ident(s) operator(:=) ident(DefaultValueCaption)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + reserved(try) + ident(Item)operator(.)ident(Caption) operator(:=) ident(s)operator(;) + + reserved(if) ident(TryRenameValue)operator(()ident(Old)operator(,) ident(s)operator(\)) reserved(then) reserved(begin) + ident(SetRealValueName)operator(()ident(Item)operator(,) ident(s)operator(\);) comment(//Sichere Zuweisung des Standard-Flags) + ident(s) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) comment(//Anschließend externer Aufruf "Item.Caption := s"!) + reserved(end) reserved(else) reserved(begin) + ident(s) operator(:=) ident(OldCaption)operator(;) + reserved(end)operator(;) + + reserved(finally) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(var) + ident(T)operator(:) reserved(string)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) +reserved(begin) + reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + + reserved(case) ident(Key) reserved(of) + ident(VK_SPACE)operator(:) ident(JumpToSel)operator(()ident(ValueList)operator(\);) + + ident(VK_F9)operator(:) ident(SwapFonts)operator(()ident(ValueList)operator(\);) + + ident(VK_F5)operator(:) ident(Reload)operator(;) + + ident(VK_F12)operator(:) reserved(begin) comment(//Sort) + reserved(if) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) + ident(T) operator(:=) ident(Item)operator(.)ident(Caption)operator(;) + ident(ValueList)operator(.)ident(SortType) operator(:=) ident(TSortType)operator(()integer(2) operator(-) operator(()ident(Integer)operator(()ident(ValueList)operator(.)ident(SortType)operator(\)\)\);) + reserved(if) ident(ValueList)operator(.)ident(SortType) operator(=) ident(stNone) reserved(then) + ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Sender)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) + ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(FindItem)operator(()ident(ValueList)operator(,) ident(T)operator(\);) + reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) + ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(MakeVisible)operator(()ident(True)operator(\);) + reserved(end)operator(;) + + ident(VK_DELETE)operator(:) ident(DeleteMIClick)operator(()ident(Sender)operator(\);) + + ident(VK_RETURN)operator(:) ident(ValueListDblCLick)operator(()ident(Sender)operator(\);) + + ident(Ord)operator(()charoperator(\):) + reserved(if) reserved(not) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(CopyPathMIClick)operator(()ident(Sender)operator(\);) + + ident(VK_SCROLL)operator(:) ident(CheckValueListHotTrack)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(ValueList) reserved(do) + ident(Columns)operator([)integer(3)operator(].)ident(Width) operator(:=) ident(ClientWidth) operator(-) operator(()integer(0) operator(+) + ident(Columns)operator([)integer(0)operator(].)ident(Width) operator(+) ident(Columns)operator([)integer(1)operator(].)ident(Width) operator(+) ident(Columns)operator([)integer(2)operator(].)ident(Width)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(DeleteValue)operator(;) +reserved(var) + ident(Item)operator(,) ident(NewSel)operator(:) ident(TListItem)operator(;) + ident(YesToAll)operator(:) ident(Boolean)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(DeleteIt)operator(()ident(Item)operator(:) ident(TListItem)operator(\);) + reserved(begin) + ident(OpenCurKey)operator(;) + reserved(if) ident(MainReg)operator(.)ident(DeleteValue)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)) + reserved(and) reserved(not) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)) reserved(then) reserved(begin) + ident(Item)operator(.)ident(Delete)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(ShowMessage)operator(()string operator(+) ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)\);) + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + + reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Repaint)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + + ident(NewSel) operator(:=) ident(GetNextBestNotSelected)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\);) + + ident(YesToAll) operator(:=) ident(False)operator(;) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) + ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(];) + reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(Continue)operator(;) reserved(end)operator(;) + + reserved(if) ident(YesToAll) reserved(then) + ident(DeleteIt)operator(()ident(Item)operator(\)) + reserved(else) reserved(begin) + reserved(case) ident(MessageDlg)operator(()string operator(+) + ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)) operator(+) charoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbYesToAll)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(of) + ident(mrYes)operator(:) ident(DeleteIt)operator(()ident(Item)operator(\);) + ident(mrYesToAll)operator(:) ident(YesToAll) operator(:=) ident(True)operator(;) + ident(mrCancel)operator(:) ident(Exit)operator(;) + ident(mrNo)operator(:) reserved(begin) + ident(Item)operator(.)ident(Selected) operator(:=) ident(False)operator(;) + ident(NewSel) operator(:=) ident(Item)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Assigned)operator(()ident(NewSel)operator(\)) reserved(then) reserved(begin) + ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(NewSel)operator(;) + ident(NewSel)operator(.)ident(Selected) operator(:=) ident(True)operator(;) + reserved(end) reserved(else) + ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) + + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ZeromizeValue)operator(;) +reserved(var) + ident(Item)operator(:) ident(TListItem)operator(;) + ident(YesToAll)operator(:) ident(Boolean)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(ZeromizeIt)operator(()ident(Item)operator(:) ident(TListItem)operator(\);) + reserved(begin) + reserved(with) ident(MainReg) reserved(do) reserved(begin) + ident(OpenCurKey)operator(;) + ident(ZeromizeValue)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\);) + ident(UpdateValue)operator(()ident(MainReg)operator(,) ident(Item)operator(\);) + ident(CloseKey)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + + ident(YesToAll) operator(:=) ident(False)operator(;) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(i) operator(<) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count) reserved(do) reserved(begin) + ident(Item) operator(:=) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(];) + reserved(if) reserved(not) ident(Item)operator(.)ident(Selected) reserved(then) reserved(begin) + ident(Inc)operator(()ident(i)operator(\);) + ident(Continue)operator(;) reserved(end)operator(;) + + reserved(if) ident(YesToAll) reserved(then) + ident(ZeromizeIt)operator(()ident(Item)operator(\)) + reserved(else) + reserved(case) ident(MessageDlg)operator(()string operator(+) + ident(Quote)operator(()ident(RealValueName)operator(()ident(Item)operator(\)\)) operator(+) stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbYesToAll)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(of) + + ident(mrYes)operator(:) reserved(begin) + ident(ZeromizeIt)operator(()ident(Item)operator(\);) + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) + + ident(mrYesToAll)operator(:) reserved(begin) + ident(YesToAll) operator(:=) ident(True)operator(;) + ident(ZeromizeIt)operator(()ident(Item)operator(\);) + reserved(end)operator(;) + ident(mrCancel)operator(:) ident(Exit)operator(;) + reserved(end)operator(;) + + reserved(if) ident(IsMainValue)operator(()ident(Item)operator(\)) reserved(then) + ident(RegTV)operator(.)ident(Repaint)operator(;) + reserved(end)operator(;) + + + ident(SpyThread)operator(.)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Writable)operator(,) ident(ValueOK)operator(,) ident(OnlyOneValue)operator(,) ident(OneValueOK)operator(:) ident(Boolean)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) + ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(Selected) operator(:=) ident(True)operator(;) + + reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(PrefWin)operator(.)ident(ComponentState)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Writable) operator(:=) reserved(not) ident(TreeWin)operator(.)ident(CantWrite)operator(;) + ident(NewDefaultValueMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + ident(NewStringMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + ident(NewDWORDMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + ident(NewBinaryMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + ident(NewMultiStringMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + ident(NewElseMI)operator(.)ident(Visible) operator(:=) ident(Writable)operator(;) + + ident(ValueOK) operator(:=) ident(Writable) reserved(and) operator(()ident(ValueList)operator(.)ident(ItemFocused) operator(<>) reserved(nil)operator(\);) + ident(OnlyOneValue) operator(:=) ident(ValueList)operator(.)ident(SelCount) operator(=) integer(1)operator(;) + ident(OneValueOK) operator(:=) ident(OnlyOneValue) reserved(and) ident(ValueOK)operator(;) + + ident(EditMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) + ident(EditBinaryMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) + ident(DublicateMI)operator(.)ident(Visible) operator(:=) ident(OneValueOK)operator(;) + ident(CopyPathMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) + ident(CopyDataPreviewMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) + ident(TakeAsMainValueMI)operator(.)ident(Visible) operator(:=) ident(OnlyOneValue)operator(;) + ident(RenameMI)operator(.)ident(Visible) operator(:=) ident(OneValueOK)operator(;) + ident(DeleteMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) + ident(ZeromizeMI)operator(.)ident(Visible) operator(:=) ident(ValueOK)operator(;) + + ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(TakeAsMainValueMI)operator(.)ident(Checked) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\)) operator(=) ident(PrefWin)operator(.)ident(MainPreviewE)operator(.)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListDeletion)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Assigned)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(\)) + reserved(and) ident(Item)operator(.)ident(Selected) reserved(and) ident(Item)operator(.)ident(Focused) reserved(then) reserved(begin) + ident(ValueList)operator(.)ident(ItemFocused) operator(:=) ident(GetNextBest)operator(()ident(Item)operator(\);) + ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(DeleteMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + ident(DeleteValue)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(RenameMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)) reserved(then) reserved(begin) + ident(ValueLabelClicked) operator(:=) ident(True)operator(;) + ident(ValueList)operator(.)ident(ItemFocused)operator(.)ident(EditCaption)operator(;) + ident(ValueLabelClicked) operator(:=) ident(False)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewBigEndianMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdCardBigEndian)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewExpandStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdExpandString)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(rdMultiString)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewStrangeTypeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CreateValue)operator(()ident(TRegDataType)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(Tag)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(NewDefaultValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(DefaultItem)operator(:) ident(TListItem)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) operator(()ident(TreeWin)operator(.)ident(ComponentState) operator(+) ident(MainWin)operator(.)ident(ComponentState)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(MainReg) reserved(do) reserved(begin) + reserved(try) + ident(OpenCurKey)operator(;) + + reserved(if) ident(StandardValueExists) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(CloseKey)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(WriteString)operator(()stringoperator(,) stringoperator(\);) + + reserved(if) reserved(not) ident(StandardValueExists) reserved(then) reserved(begin) + ident(ShowMessage)operator(()stringoperator(\);) + ident(CloseKey)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(MainReg)operator(,) stringoperator(\);) + reserved(finally) + ident(CloseKey)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) + ident(DefaultItem) operator(:=) reserved(nil)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(ItemIsDefaultValue)operator(()ident(Item)operator([)ident(i)operator(]\)) reserved(then) + ident(Break)operator(;) + + reserved(if) ident(i) operator(<) ident(Count) reserved(then) + ident(DefaultItem) operator(:=) ident(Item)operator([)ident(i)operator(];) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(DefaultItem)operator(\)) reserved(then) + ident(ShowMessage)operator(()stringoperator(\)) + reserved(else) reserved(begin) + ident(SelectItemOnly)operator(()ident(ValueList)operator(,) ident(DefaultItem)operator(\);) + ident(MainWin)operator(.)ident(StatusBarUpdate)operator(;) + ident(ValueListDblClick)operator(()ident(Sender)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item)operator(:) ident(TListItem)operator(;) + ident(Change)operator(:) ident(TItemChange)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) +reserved(begin) + reserved(if) ident(Item) operator(=) reserved(nil) reserved(then) + ident(AllowChange) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) +reserved(begin) + ident(ValueLabelClicked) operator(:=) ident(False)operator(;) + reserved(with) ident(ValueList) reserved(do) + reserved(if) operator(([)ident(htOnIcon)operator(,) ident(htOnLabel)operator(]) operator(*) ident(GetHitTestInfoAt)operator(()ident(X)operator(,) ident(Y)operator(\)\)) operator(<>) operator([]) reserved(then) + ident(ValueLabelClicked) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(EditBinaryMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(WorkWin)operator(.)ident(ShowAsBinary) operator(:=) ident(True)operator(;) + ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(ItemFocused)operator(,) ident(ctState)operator(\);) + ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(EditMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCustomDrawSubItem)operator(()ident(Sender)operator(:) ident(TCustomListView)operator(;) + ident(Item)operator(:) ident(TListItem)operator(;) ident(SubItem)operator(:) ident(Integer)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) + reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) +reserved(begin) + reserved(with) ident(ValueList)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + ident(Style) operator(:=) operator([];) + reserved(if) ident(SubItem) operator(=) integer(1) reserved(then) + ident(Color) operator(:=) ident(clSilver) + reserved(else) + ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(TRegDataType)operator(()ident(Item)operator(.)ident(ImageIndex) operator(-) ident(iconFirstType)operator(\)\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListCompare)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Item1)operator(,) ident(Item2)operator(:) ident(TListItem)operator(;) + ident(Data)operator(:) ident(Integer)operator(;) reserved(var) ident(Compare)operator(:) ident(Integer)operator(\);) +reserved(begin) + reserved(case) ident(SortBy) reserved(of) + ident(vlcName)operator(:) ident(Compare) operator(:=) ident(AnsiCompareText)operator(()ident(RealValueName)operator(()ident(Item1)operator(\),) ident(RealValueName)operator(()ident(Item2)operator(\)\);) + ident(vlcSize)operator(:) ident(Compare) operator(:=) ident(Integer)operator(() + ident(StrToIntDef)operator(()ident(Item1)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(]],) operator(-)integer(1)operator(\)) operator(>) + ident(StrToIntDef)operator(()ident(Item2)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcSize)operator(]],) operator(-)integer(1)operator(\)\);) + ident(vlcData)operator(:) ident(Compare) operator(:=) ident(Integer)operator(()ident(Item1)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(]]) operator(>) + ident(Item2)operator(.)ident(SubItems)operator([)ident(SubItemIndex)operator([)ident(vlcData)operator(]]\);) + ident(vlcType)operator(:) ident(Compare) operator(:=) ident(Integer)operator(()ident(Item1)operator(.)ident(ImageIndex) operator(>) ident(Item2)operator(.)ident(ImageIndex)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(Assigned)operator(()ident(SortByColumn)operator(\)) + reserved(and) operator(()ident(SortByColumn)operator(.)ident(ImageIndex) operator(=) ident(iconSortArrowDesc)operator(\)) reserved(then) + ident(Compare) operator(:=) integer(1) operator(-) ident(Compare)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListColumnClick)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Column)operator(:) ident(TListColumn)operator(\);) +reserved(begin) + reserved(case) ident(Column)operator(.)ident(ImageIndex) reserved(of) + ident(iconSortArrowAsc)operator(:) ident(Column)operator(.)ident(ImageIndex) operator(:=) ident(iconSortArrowDesc)operator(;) + ident(iconSortArrowDesc)operator(:) ident(Column)operator(.)ident(ImageIndex) operator(:=) operator(-)integer(1)operator(;) + reserved(else) + reserved(if) ident(Assigned)operator(()ident(SortByColumn)operator(\)) reserved(then) + ident(SortByColumn)operator(.)ident(ImageIndex) operator(:=) operator(-)integer(1)operator(;) + reserved(if) ident(TValueListColumn)operator(()ident(Column)operator(.)ident(Tag)operator(\)) reserved(in) ident(ValueListColumnRange) reserved(then) + ident(SortBy) operator(:=) ident(TValueListColumn)operator(()ident(Column)operator(.)ident(Tag)operator(\)) + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) + ident(Column)operator(.)ident(ImageIndex) operator(:=) ident(iconSortArrowAsc)operator(;) + reserved(end)operator(;) + + reserved(if) ident(Column)operator(.)ident(ImageIndex) operator(=) operator(-)integer(1) reserved(then) + ident(ValueList)operator(.)ident(SortType) operator(:=) ident(stNone) + reserved(else) reserved(begin) + ident(ValueList)operator(.)ident(SortType) operator(:=) ident(stData)operator(;) + ident(SortByColumn) operator(:=) ident(Column)operator(;) + reserved(end)operator(;) + + ident(Update)operator(;) + ident(ValueList)operator(.)ident(AlphaSort)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CloneValue)operator(;) +reserved(var) + ident(OldName)operator(,) ident(NewName)operator(:) reserved(string)operator(;) + + reserved(function) ident(GetNewName)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(;) reserved(const) ident(OldName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Prefix)operator(:) reserved(string)operator(;) + reserved(begin) + reserved(if) ident(OldName) operator(=) string reserved(then) + ident(Result) operator(:=) string + reserved(else) reserved(if) ident(Copy)operator(()ident(OldName)operator(,) integer(1)operator(,) integer(4)operator(\)) operator(<>) string reserved(then) + ident(Result) operator(:=) string operator(+) ident(OldName) + reserved(else) + ident(Result) operator(:=) ident(OldName)operator(;) + + ident(Prefix) operator(:=) ident(Result)operator(;) + ident(i) operator(:=) integer(1)operator(;) + reserved(while) ident(Reg)operator(.)ident(ValueExists)operator(()ident(Result)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(Prefix) operator(+) char operator(+) ident(IntToStr)operator(()ident(i)operator(\);) + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(TreeWin)operator(.)ident(CantWrite) reserved(then) + ident(Exit)operator(;) + + ident(OldName) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\);) + + reserved(try) + ident(OpenCurKey)operator(;) + + ident(NewName) operator(:=) ident(GetNewName)operator(()ident(MainReg)operator(,) ident(OldName)operator(\);) + ident(MainReg)operator(.)ident(CopyValue)operator(()ident(OldName)operator(,) ident(NewName)operator(\);) + ident(AddValue)operator(()ident(MainReg)operator(,) ident(NewName)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(DublicateMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CloneValue)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CopyDataPreviewMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + ident(CopyDataPreview)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CopyDataPreview)operator(;) +reserved(begin) + ident(OpenCurKey)operator(;) + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(DataPreviewOfContext)operator(()ident(MainReg)operator(.)ident(ReadContext)operator(() + ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\)\)\);) + ident(MainReg)operator(.)ident(CloseKey)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(UpdateValues)operator(()ident(SelectedOnly)operator(:) ident(Boolean) operator(=) ident(False)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(Reg)operator(:) ident(TXRegistry)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + + ident(Reg) operator(:=) ident(TXRegistry)operator(.)ident(Create)operator(;) + reserved(try) + reserved(if) ident(OpenNodeOK)operator(()ident(Reg)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\)) reserved(then) + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(SelectedOnly) reserved(and) reserved(not) ident(Item)operator([)ident(i)operator(].)ident(Selected) reserved(then) + ident(Continue)operator(;) + ident(UpdateValue)operator(()ident(Reg)operator(,) ident(Item)operator([)ident(i)operator(]\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(finally) + ident(Reg)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + ident(SpyThread)operator(.)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TValuesWin)operator(.)ident(TryRenameValue)operator(()ident(OldName)operator(:) reserved(string)operator(;) + reserved(var) ident(NewName)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(x)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(if) ident(OldName) operator(=) ident(NewName) reserved(then) + ident(Exit)operator(;) + + reserved(if) operator(()ident(Length)operator(()ident(NewName)operator(\)) operator(>) ident(RegMaxValueNameLen)operator(\)) reserved(then) reserved(begin) + ident(NewName) operator(:=) ident(Copy)operator(()ident(NewName)operator(,) integer(1)operator(,) ident(RegMaxValueNameLen)operator(\);) + reserved(if) ident(MessageDlg)operator(() + string operator(+) ident(IntToStr)operator(()ident(RegMaxValueNameLen)operator(\)) operator(+) string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(Quote)operator(()ident(StringWrap)operator(()ident(NewName)operator(,) integer(80)operator(\)\),) + ident(mtConfirmation)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) operator(<>) ident(mrOK) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + + reserved(if) ident(CharIn)operator(()ident(NewName)operator(,) operator([)char(#0)operator(..)char(#31)operator(]\)) reserved(then) reserved(begin) + ident(NewName) operator(:=) ident(ReplaceChars)operator(()ident(NewName)operator(,) operator([)char(#0)operator(..)char(#31)operator(],) charoperator(\);) + reserved(if) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(NewName) operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtConfirmation)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(],) integer(0)operator(\)) operator(<>) ident(mrYes) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + + reserved(if) reserved(not) ident(OpenCurKey) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(SameText)operator(()ident(OldName)operator(,) ident(NewName)operator(\)) reserved(then) reserved(begin) comment(//CharCase ändern) + ident(x) operator(:=) ident(MainReg)operator(.)ident(GetFreeValueName)operator(;) + ident(MainReg)operator(.)ident(RenameValue)operator(()ident(OldName)operator(,) ident(x)operator(\);) + ident(MainReg)operator(.)ident(RenameValue)operator(()ident(x)operator(,) ident(NewName)operator(\);) + reserved(end) reserved(else) reserved(begin) + reserved(if) reserved(not) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(NewName)operator(\)) reserved(then) reserved(begin) + ident(MainReg)operator(.)ident(RenameValue)operator(()ident(OldName)operator(,) ident(NewName)operator(\);) + reserved(end) reserved(else) reserved(begin) + reserved(if) ident(NewName) operator(=) string reserved(then) + ident(ShowMessage)operator(()stringoperator(\)) + reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(Quote)operator(()ident(NewName)operator(\)) operator(+) stringoperator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(end)operator(;) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + + reserved(if) ident(TextIn)operator(()ident(NewName)operator(,) stringoperator(\)) reserved(then) + ident(AddHint)operator(()stringoperator(\);) + + ident(Result) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ZeromizeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ZeromizeValue)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(ValueList)operator(.)ident(IsEditing) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(csDestroying) reserved(in) ident(MainWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(MainWin)operator(.)ident(CopyPathClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TValuesWin)operator(.)ident(FindItemByRealName)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(SameText)operator(()ident(RealValueName)operator(()ident(Item)operator([)ident(Result)operator(]\),) ident(ValueName)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TValuesWin)operator(.)ident(FocusItem)operator(()ident(ARealValueName)operator(:) reserved(string)operator(;) + ident(FocusValueList)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(with) ident(ValueList) reserved(do) reserved(begin) + ident(i) operator(:=) ident(FindItemByRealName)operator(()ident(ARealValueName)operator(\);) + + reserved(if) operator(()ident(i) operator(>) operator(-)integer(1)operator(\)) reserved(and) operator(()ident(i) operator(<) ident(Items)operator(.)ident(Count)operator(\)) reserved(then) + ident(Selected) operator(:=) ident(Items)operator([)ident(i)operator(]) + reserved(else) + ident(Selected) operator(:=) reserved(nil)operator(;) + + ident(ItemFocused) operator(:=) ident(Selected)operator(;) + + ident(Result) operator(:=) ident(Assigned)operator(()ident(Selected)operator(\);) + reserved(if) ident(Result) reserved(then) + ident(JumpToSel)operator(()ident(ValueList)operator(\);) + + reserved(if) ident(FocusValueList) reserved(then) + ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(TakeAsMainValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Item)operator(:) ident(TListItem)operator(;) + ident(ValueName)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Item)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(ValueName) operator(:=) ident(RealValueName)operator(()ident(Item)operator(\);) + reserved(with) ident(PrefWin)operator(.)ident(MainPreviewE) reserved(do) + reserved(if) ident(ValueName) operator(=) ident(Text) reserved(then) + ident(Text) operator(:=) string + reserved(else) + ident(Text) operator(:=) ident(ValueName)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(InitListColumnTags)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Columns)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(with) ident(ValueList)operator(.)ident(Columns)operator(.)ident(Items)operator([)ident(i)operator(]) reserved(do) reserved(begin) + ident(Tag) operator(:=) operator(-)integer(1)operator(;) + reserved(if) ident(Caption) operator(=) string reserved(then) + ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcName)operator(\)) + reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) + ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcSize)operator(\)) + reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) + ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcType)operator(\)) + reserved(else) reserved(if) ident(Caption) operator(=) string reserved(then) + ident(Tag) operator(:=) ident(Integer)operator(()ident(vlcData)operator(\)) + reserved(else) + ident(ShowMessage)operator(()ident(Format)operator(()stringoperator(,) + operator([)ident(Index)operator(,) ident(Caption)operator(]\)\);) + reserved(if) ident(Tag) operator(>) operator(-)integer(1) reserved(then) + ident(SubItemIndex)operator([)ident(TValueListColumn)operator(()ident(Tag)operator(\)]) operator(:=) ident(Index) operator(-) integer(1)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(FormShow)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(InitListColumnTags)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(Reload)operator(()ident(JumpToNewValue)operator(:) ident(Boolean) operator(=) ident(False)operator(;) + ident(ValueName)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(var) + ident(Sel)operator(:) ident(TListItem)operator(;) + ident(SelIndex)operator(:) ident(Integer)operator(;) + ident(SelRealValueName)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(TreeWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(SelIndex) operator(:=) operator(-)integer(1)operator(;) + reserved(if) ident(JumpToNewValue) reserved(then) + ident(SelRealValueName) operator(:=) ident(ValueName) + reserved(else) reserved(begin) + ident(Sel) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + reserved(if) ident(Assigned)operator(()ident(Sel)operator(\)) reserved(then) + ident(SelIndex) operator(:=) ident(Sel)operator(.)ident(Index)operator(;) + + reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) + ident(SelRealValueName) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(Items)operator([)ident(SelIndex)operator(]\);) + reserved(end)operator(;) + + ident(TreeWin)operator(.)ident(RegTVChange)operator(()ident(Self)operator(,) ident(RegTV)operator(.)ident(Selected)operator(\);) + + reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) + reserved(if) reserved(not) ident(FocusItem)operator(()ident(SelRealValueName)operator(,) ident(True)operator(\)) reserved(then) reserved(begin) + ident(SelIndex) operator(:=) ident(GetBestIndex)operator(()ident(ValueList)operator(,) ident(SelIndex)operator(\);) + reserved(if) ident(SelIndex) operator(>) operator(-)integer(1) reserved(then) + reserved(with) ident(ValueList) reserved(do) reserved(begin) + ident(Selected) operator(:=) ident(Items)operator([)ident(SelIndex)operator(];) + ident(ItemFocused) operator(:=) ident(Selected)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(LoadValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(Clock)operator(:) ident(TClock)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(WorkWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) reserved(begin) + ident(Clock) operator(:=) ident(TClock)operator(.)ident(Create)operator(()integer(1)operator(,) ident(tfSecs)operator(\);) + ident(ValueList)operator(.)ident(Enabled) operator(:=) ident(False)operator(;) + ident(BeginUpdate)operator(;) + reserved(try) + ident(Clear)operator(;) + ident(WorkWin)operator(.)ident(ReInitShowPC)operator(;) + + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(Reg)operator(.)ident(GetValueNames)operator(()ident(SL)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(ValuesWin)operator(.)ident(AddValue)operator(()ident(Reg)operator(,) ident(SL)operator([)ident(i)operator(]\);) + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + + reserved(finally) + ident(EndUpdate)operator(;) + ident(ValueList)operator(.)ident(Enabled) operator(:=) ident(True)operator(;) + ident(Clock)operator(.)ident(Stop)operator(;) + reserved(if) ident(MurphyMode) reserved(then) + ident(AddHint)operator(()ident(Format)operator(()stringoperator(,) operator([)ident(Clock)operator(.)ident(SecsPassed)operator(]\)\);) + ident(Clock)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) +reserved(begin) +comment(// Action := caNone;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(ValueListClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CheckValueListHotTrack)operator(;) + reserved(if) ident(ValueList)operator(.)ident(HotTrack) reserved(then) + ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(CheckValueListHotTrack)operator(;) +reserved(const) + ident(StyleOfSwitch)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) ident(TListHotTrackStyles) operator(=) operator(() + operator([],) operator([)ident(htHandPoint)operator(,) ident(htUnderlineHot)operator(]) operator(\);) +reserved(var) + ident(NewHotTrack)operator(:) ident(Boolean)operator(;) +reserved(begin) + reserved(if) ident(csDestroying) reserved(in) ident(PrefWin)operator(.)ident(ComponentState) reserved(then) + ident(Exit)operator(;) + + ident(NewHotTrack) operator(:=) ident(ScrollON) reserved(xor) ident(PrefWin)operator(.)ident(ValuesSingleClickCB)operator(.)ident(Checked)operator(;) + reserved(if) ident(NewHotTrack) operator(=) ident(ValueList)operator(.)ident(HotTrack) reserved(then) ident(Exit)operator(;) + + reserved(with) ident(ValueList) reserved(do) reserved(begin) + ident(HotTrack) operator(:=) ident(NewHotTrack)operator(;) + ident(HotTrackStyles) operator(:=) ident(StyleOfSwitch)operator([)ident(HotTrack)operator(];) + ident(Mouse)operator(.)ident(CursorPos) operator(:=) ident(Mouse)operator(.)ident(CursorPos)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(SelectAllMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(Item)operator([)ident(i)operator(].)ident(Selected) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(InvertSelectionMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(with) ident(ValueList)operator(.)ident(Items) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(Item)operator([)ident(i)operator(].)ident(Selected) operator(:=) reserved(not) ident(Item)operator([)ident(i)operator(].)ident(Selected)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TValuesWin)operator(.)ident(FormDestroy)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValueNames)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) +reserved(unit) ident(WorkU)operator(;) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(Messages)operator(,) ident(SysUtils)operator(,) ident(Variants)operator(,) ident(Classes)operator(,) ident(Graphics)operator(,) ident(Controls)operator(,) ident(Forms)operator(,) + ident(Dialogs)operator(,) ident(StdCtrls)operator(,) ident(ComCtrls)operator(,) ident(NewPanels)operator(,) ident(Grids)operator(,) ident(Clipbrd)operator(,) + ident(IntEdit)operator(,) ident(ExtCtrls)operator(,) ident(Menus)operator(,) ident(YTools)operator(,) ident(CompEx)operator(,) ident(PlutoConst)operator(,) + ident(XReg)operator(,) ident(Clock)operator(,) ident(Colors)operator(,) ident(ShellAPI)operator(,) ident(IniFiles)operator(,) ident(Math)operator(,) + ident(keybrd)operator(,) ident(Buttons)operator(,) ident(YTypes)operator(,) ident(LinkLabel)operator(,) ident(start)operator(,) + ident(PrefTools)operator(,) ident(ImgList)operator(,) ident(PHexMemo)operator(,) ident(PipelineTh)operator(,) ident(DropSource)operator(,) ident(DropTarget)operator(,) + ident(CrackTools)operator(;) + +reserved(type) + ident(TColorStringFmt) operator(=) operator(()ident(csfThreeSpacedDecimals)operator(\);) + + ident(TWorkWin) operator(=) reserved(class)operator(()ident(TForm)operator(\)) + ident(StringPU)operator(:) ident(TPopupMenu)operator(;) + ident(SpaceMI)operator(:) ident(TMenuItem)operator(;) + ident(FileMI)operator(:) ident(TMenuItem)operator(;) + ident(FileOpenD)operator(:) ident(TOpenDialog)operator(;) + ident(MainPC)operator(:) ident(TPageControl)operator(;) + ident(HintPage)operator(:) ident(TTabSheet)operator(;) + ident(Splitter1)operator(:) ident(TSplitter)operator(;) + ident(HintLB)operator(:) ident(TListBox)operator(;) + ident(InfoMemo)operator(:) ident(TMemo)operator(;) + ident(WorkPage)operator(:) ident(TTabSheet)operator(;) + ident(WorkP)operator(:) ident(TPanel)operator(;) + ident(ShowPC)operator(:) ident(TPageControl)operator(;) + ident(StringPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel1)operator(:) ident(TBorderPanel)operator(;) + ident(StringE)operator(:) ident(TEdit)operator(;) + ident(OKStringB)operator(:) ident(TButton)operator(;) + ident(BoolStrCB)operator(:) ident(TCheckBox)operator(;) + ident(CancelStringB)operator(:) ident(TButton)operator(;) + ident(StringAsColorP)operator(:) ident(TPanel)operator(;) + ident(StringAsFileP)operator(:) ident(TBorderPanel)operator(;) + ident(IconImage)operator(:) ident(TImage)operator(;) + ident(IntPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel5)operator(:) ident(TBorderPanel)operator(;) + ident(OKIntB)operator(:) ident(TButton)operator(;) + ident(CardBoolCB)operator(:) ident(TCheckBox)operator(;) + ident(CancelIntB)operator(:) ident(TButton)operator(;) + ident(BinaryPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel6)operator(:) ident(TBorderPanel)operator(;) + ident(Panel2)operator(:) ident(TPanel)operator(;) + ident(Label5)operator(:) ident(TLabel)operator(;) + ident(OffsetHE)operator(:) ident(THexEdit)operator(;) + ident(OKBinaryB)operator(:) ident(TButton)operator(;) + ident(CancelBinaryB)operator(:) ident(TButton)operator(;) + ident(StringTypeRG)operator(:) ident(TRadioGroup)operator(;) + ident(SpyPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel2)operator(:) ident(TBorderPanel)operator(;) + ident(SpyResumeB)operator(:) ident(TButton)operator(;) + ident(SpySuspendB)operator(:) ident(TButton)operator(;) + ident(SpyLB)operator(:) ident(TListBox)operator(;) + ident(Label4)operator(:) ident(TLabel)operator(;) + ident(Label7)operator(:) ident(TLabel)operator(;) + ident(CardTypeRG)operator(:) ident(TRadioGroup)operator(;) + ident(MultiStringPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel7)operator(:) ident(TBorderPanel)operator(;) + ident(OKMultiStringB)operator(:) ident(TButton)operator(;) + ident(CancelMultiStringB)operator(:) ident(TButton)operator(;) + ident(MultiStringM)operator(:) ident(TMemo)operator(;) + ident(DataTypeComB)operator(:) ident(TComboBox)operator(;) + ident(CardinalE)operator(:) ident(TCardEdit)operator(;) + ident(ColorDlg)operator(:) ident(TColorDialog)operator(;) + ident(MultiStringOpenD)operator(:) ident(TOpenDialog)operator(;) + ident(MultiStringSaveD)operator(:) ident(TSaveDialog)operator(;) + ident(MultiStringPU)operator(:) ident(TPopupMenu)operator(;) + ident(LadenMI)operator(:) ident(TMenuItem)operator(;) + ident(SpeichernMI)operator(:) ident(TMenuItem)operator(;) + ident(Hinzufgen1)operator(:) ident(TMenuItem)operator(;) + ident(N1)operator(:) ident(TMenuItem)operator(;) + ident(SisyPage)operator(:) ident(TTabSheet)operator(;) + ident(SpyClearTracesB)operator(:) ident(TButton)operator(;) + ident(Label11)operator(:) ident(TLabel)operator(;) + ident(HexEdit1)operator(:) ident(THexEdit)operator(;) + ident(Label12)operator(:) ident(TLabel)operator(;) + ident(Label13)operator(:) ident(TLabel)operator(;) + ident(SortMultiStringMI)operator(:) ident(TMenuItem)operator(;) + ident(SpyTestL)operator(:) ident(TLabel)operator(;) + ident(Panel3)operator(:) ident(TPanel)operator(;) + ident(CurValueE)operator(:) ident(TEdit)operator(;) + ident(BorderPanel8)operator(:) ident(TBorderPanel)operator(;) + ident(BorderPanel9)operator(:) ident(TBorderPanel)operator(;) + ident(SisyTV)operator(:) ident(TTreeView)operator(;) + ident(TabImages)operator(:) ident(TImageList)operator(;) + ident(ChangeImages)operator(:) ident(TImageList)operator(;) + ident(Panel7)operator(:) ident(TPanel)operator(;) + ident(ColorPanel1)operator(:) ident(TColorPanel)operator(;) + ident(Splitter2)operator(:) ident(TSplitter)operator(;) + ident(SpyDelayIE)operator(:) ident(TPrefIntEdit)operator(;) + ident(ListTracesCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(Panel5)operator(:) ident(TPanel)operator(;) + ident(Panel8)operator(:) ident(TPanel)operator(;) + ident(SisyExpandGroupsCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(ClearChangesB)operator(:) ident(TButton)operator(;) + ident(FilterChangesB)operator(:) ident(TButton)operator(;) + ident(SisyTVPU)operator(:) ident(TPopupMenu)operator(;) + ident(SisyGotoKeyMI)operator(:) ident(TMenuItem)operator(;) + ident(SisyDeleteChangeMI)operator(:) ident(TMenuItem)operator(;) + ident(SisyActivateChangeMI)operator(:) ident(TMenuItem)operator(;) + ident(N3)operator(:) ident(TMenuItem)operator(;) + ident(SisyCopyPathMI)operator(:) ident(TMenuItem)operator(;) + ident(N4)operator(:) ident(TMenuItem)operator(;) + ident(Panel9)operator(:) ident(TPanel)operator(;) + ident(ExternalEditB)operator(:) ident(TButton)operator(;) + ident(LoadExternalB)operator(:) ident(TButton)operator(;) + ident(ReloadStringB)operator(:) ident(TButton)operator(;) + ident(BinaryHM)operator(:) ident(TPHexMemo)operator(;) + ident(PipelineCB)operator(:) ident(TCheckBox)operator(;) + ident(ReloadDWordB)operator(:) ident(TButton)operator(;) + ident(ReloadBinaryB)operator(:) ident(TButton)operator(;) + ident(ReloadMultiStringB)operator(:) ident(TButton)operator(;) + ident(DescL)operator(:) ident(TLabel)operator(;) + ident(SisyHKUCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(SisyHKLMCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(SisyHKUL)operator(:) ident(TLabel)operator(;) + ident(SisyHKLML)operator(:) ident(TLabel)operator(;) + ident(SisyListCB)operator(:) ident(TPrefCheckBox)operator(;) + ident(CardSpecial0B)operator(:) ident(TButton)operator(;) + ident(CardSpecial1B)operator(:) ident(TButton)operator(;) + ident(CardSpecial_1B)operator(:) ident(TButton)operator(;) + ident(CardSpecial7FB)operator(:) ident(TButton)operator(;) + ident(SisyPU)operator(:) ident(TPopupMenu)operator(;) + ident(Idle1)operator(:) ident(TMenuItem)operator(;) + ident(Lowest1)operator(:) ident(TMenuItem)operator(;) + ident(Lower1)operator(:) ident(TMenuItem)operator(;) + ident(Normal1)operator(:) ident(TMenuItem)operator(;) + ident(Higher1)operator(:) ident(TMenuItem)operator(;) + ident(Highes1)operator(:) ident(TMenuItem)operator(;) + ident(SisyShowCurrentPathMI)operator(:) ident(TMenuItem)operator(;) + ident(N5)operator(:) ident(TMenuItem)operator(;) + ident(MultiStringTypeRG)operator(:) ident(TRadioGroup)operator(;) + ident(SeparatorE)operator(:) ident(TEdit)operator(;) + ident(Label1)operator(:) ident(TLabel)operator(;) + ident(MultiStringCountL)operator(:) ident(TLabel)operator(;) + ident(DropFileTarget)operator(:) ident(TDropFileTarget)operator(;) + ident(CryptoPage)operator(:) ident(TTabSheet)operator(;) + ident(BorderPanel3)operator(:) ident(TBorderPanel)operator(;) + ident(CryptoE)operator(:) ident(TEdit)operator(;) + ident(OKCryptoB)operator(:) ident(TButton)operator(;) + ident(CancelCryptoB)operator(:) ident(TButton)operator(;) + ident(ReloadCryptoB)operator(:) ident(TButton)operator(;) + ident(CryptoTypeRG)operator(:) ident(TRadioGroup)operator(;) + ident(Label2)operator(:) ident(TLabel)operator(;) + ident(LinkLabel2)operator(:) ident(TLinkLabel)operator(;) + reserved(procedure) ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(SpyResumeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpySuspendBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ArrPlutoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ArrRegEdBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ArrFreeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ArrBigValBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(SpaceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FileMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HintLBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MainPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StringEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(StringEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OKStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BoolStrCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CardinalEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CardBoolCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CardinalEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(OKIntBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowPCChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ShowPCChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ShowPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(ShowPCMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OKBinaryBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HexGrid1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HexGrid1KeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(BoolStrPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StringPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(IntPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BinaryPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ReInitShowPC)operator(;) + reserved(procedure) ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MultiStringMChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(OKMultiStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(StringAsColorPDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(MultiStringMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(LadenMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpeichernMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Hinzufgen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CancelBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HexGrid1Enter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpyClearTracesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpyLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + comment(//procedure BinLMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer\);) + reserved(procedure) ident(BinLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HexGrid1KeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(ValueViewChanged)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HexEdit1Change)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SortMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpyTestLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FocusForEditing)operator(;) + reserved(procedure) ident(CurValueEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(CurValueEEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + + reserved(procedure) ident(AddAHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(\);) + reserved(procedure) ident(SisyTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(SisyTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(SisyCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BinaryHMLineChange)operator(()ident(NewLine)operator(:) ident(Cardinal)operator(\);) + reserved(procedure) ident(OffsetHEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SpyDelayIEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(ClearChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(FilterChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyActivateChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyDeleteChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyCopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ExternalEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(LoadExternalBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(PipelineCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(BinaryHMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(xUseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SeparatorEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(HintLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) ident(Shift)operator(:) ident(TShiftState)operator(\);) + reserved(procedure) ident(DWORDSpecialBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(Button1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyPriorityMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyShowCurrentPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(DropFileTargetDrop)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(ShiftState)operator(:) ident(TShiftState)operator(;) + ident(Point)operator(:) ident(TPoint)operator(;) reserved(var) ident(Effect)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) + reserved(procedure) ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(IconImageDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(SisyTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) + reserved(procedure) ident(SisyTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) + reserved(procedure) ident(OKCryptoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) + reserved(procedure) ident(CryptoEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) + directive(private) + ident(PipelineThread)operator(:) ident(TPipelineThread)operator(;) + ident(BoolStr)operator(:) reserved(array) reserved(of) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string)operator(;) + ident(HexEditAutoChange)operator(:) ident(Boolean)operator(;) + ident(TargetPage)operator(:) ident(TTabSheet)operator(;) + reserved(procedure) ident(DeleteChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(DeactivateChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(procedure) ident(CopySelectedChangeName)operator(;) + reserved(procedure) ident(ClearChanges)operator(;) + directive(public) + ident(ShowAsBinary)operator(:) ident(Boolean)operator(;) + reserved(function) ident(LastHint)operator(:) reserved(string)operator(;) + reserved(function) ident(LoadBoolStr)operator(:) ident(Boolean)operator(;) + reserved(function) ident(LoadSisyFilter)operator(:) ident(Boolean)operator(;) + reserved(procedure) ident(ShowValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\);) + reserved(procedure) ident(UpdateWriteButtons)operator(;) + reserved(procedure) ident(EditData)operator(;) + reserved(end)operator(;) + +reserved(var) + ident(WorkWin)operator(:) ident(TWorkWin)operator(;) + ident(ShowPC)operator(:) ident(TPageControl)operator(;) + ident(MainPC)operator(:) ident(TPageControl)operator(;) + +reserved(implementation) + +reserved(uses) ident(TreeU)operator(,) ident(ValuesU)operator(,) ident(plutomain)operator(,) ident(splash)operator(,) ident(SisyphusTH)operator(,) ident(PrefU)operator(,) ident(ShellEx)operator(;) + +preprocessor({$R *.dfm}) + +reserved(function) ident(ColorOfString)operator(()ident(s)operator(:) reserved(string)operator(;) ident(Format)operator(:) ident(TColorStringFmt)operator(;) + ident(Default)operator(:) ident(TColor) operator(=) ident(clBlack)operator(\):) ident(TColor)operator(;) +reserved(var) + ident(SA)operator(:) ident(TStrA)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Default)operator(;) + ident(SA) operator(:=) reserved(nil)operator(;) + + reserved(case) ident(Format) reserved(of) + ident(csfThreeSpacedDecimals)operator(:) reserved(begin) + ident(SA) operator(:=) ident(Split)operator(()ident(s)operator(,) charoperator(\);) + reserved(if) ident(Length)operator(()ident(SA)operator(\)) operator(<>) integer(3) reserved(then) + ident(Exit)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) integer(2) reserved(do) + reserved(if) reserved(not) operator(()ident(IsValidInteger)operator(()ident(SA)operator([)ident(i)operator(]\)) reserved(and) operator(()ident(StrToIntDef)operator(()ident(SA)operator([)ident(i)operator(],) operator(-)integer(1)operator(\)) reserved(in) operator([)integer(0)operator(..)integer(255)operator(]\)\)) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) ident(ColorOfRGB)operator(()ident(StrToIntDef)operator(()ident(SA)operator([)integer(0)operator(],) integer(0)operator(\),) + ident(StrToIntDef)operator(()ident(SA)operator([)integer(1)operator(],) integer(0)operator(\),) + ident(StrToIntDef)operator(()ident(SA)operator([)integer(2)operator(],) integer(0)operator(\)\);) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StringOfColor)operator(()ident(Color)operator(:) ident(TColor)operator(;) ident(Format)operator(:) ident(TColorStringFmt)operator(\):) reserved(string)operator(;) +reserved(var) + ident(RGB)operator(:) ident(TRGB)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + ident(RGB) operator(:=) ident(RGBOfColor)operator(()ident(Color)operator(\);) + reserved(case) ident(Format) reserved(of) + ident(csfThreeSpacedDecimals)operator(:) reserved(begin) + reserved(with) ident(RGB) reserved(do) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(R)operator(\)) operator(+) char operator(+) ident(IntToStr)operator(()ident(G)operator(\)) operator(+) char operator(+) ident(IntToStr)operator(()ident(B)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TWorkWin)operator(.)ident(LastHint)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(with) ident(HintLB)operator(.)ident(Items) reserved(do) + reserved(if) ident(Count) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) + reserved(else) + ident(Result) operator(:=) stringoperator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(AddAHint)operator(()reserved(const) ident(Hint)operator(:) reserved(string)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(HintLB)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(HintLB)operator(.)ident(Items) reserved(do) reserved(begin) + reserved(if) ident(Count) operator(>) integer(0) reserved(then) reserved(begin) + reserved(if) ident(StrAtBegin)operator(()ident(LastHint)operator(,) ident(Hint)operator(\)) reserved(then) reserved(begin) comment(//same hint again) + reserved(with) ident(HintLB) reserved(do) + ident(Tag) operator(:=) ident(Tag) operator(+) integer(1)operator(;) + ident(Strings)operator([)ident(Count)operator(-)integer(1)operator(]) operator(:=) ident(Format)operator(()stringoperator(,) operator([)ident(Hint)operator(,) ident(HintLB)operator(.)ident(Tag)operator(]\);) + ident(Exit) reserved(end) reserved(else) + ident(HintLB)operator(.)ident(Tag) operator(:=) integer(1)operator(;) + reserved(end)operator(;) + ident(Add)operator(()ident(Hint)operator(\);) + reserved(end)operator(;) + ident(Application)operator(.)ident(ProcessMessages)operator(;) comment(//draw) +comment(// Sleep(1000\); //wait to read hints) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ReInitShowPC)operator(;) +reserved(begin) + reserved(with) ident(CurValueE) reserved(do) reserved(begin) + ident(Text) operator(:=) ident(NoValueCaption)operator(;) + ident(Font)operator(.)ident(Color) operator(:=) ident(clSilver)operator(;) + ident(Enabled) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) + + ident(StringE)operator(.)ident(Text) operator(:=) stringoperator(;) + ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + + ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(].)ident(Enabled) operator(:=) ident(False)operator(;) + + ident(CardinalE)operator(.)ident(Value) operator(:=) integer(0)operator(;) + ident(CardTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + + ident(BinaryHM)operator(.)ident(Data) operator(:=) reserved(nil)operator(;) + ident(PipelineCB)operator(.)ident(Checked) operator(:=) ident(False)operator(;) + + ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(Integer)operator(()ident(rdBinary)operator(\);) + + ident(MultiStringM)operator(.)ident(Clear)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + ident(MainWin)operator(.)ident(FormKeyDown)operator(()ident(Sender)operator(,) ident(Key)operator(,) ident(Shift)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpyResumeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SpyThread)operator(.)ident(Resume)operator(;) + ident(SpyTestLClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpySuspendBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(SpyTestLClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ArrPlutoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangePlutoStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ArrRegEdBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeRegEdStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ArrFreeBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeFreeStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ArrBigValBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ArrangeBigValStyle)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpaceMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StringE)operator(.)ident(Text) operator(:=) stringoperator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HintLBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text) operator(:=) ident(GetSel)operator(()ident(HintLB)operator(\);) + ident(WorkWin)operator(.)ident(InfoMemo)operator(.)ident(Text) operator(:=) ident(StatusBar)operator(.)ident(Panels)operator([)integer(0)operator(].)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(MainPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) + reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(PC)operator(:) ident(TPageControl)operator(;) + ident(Page)operator(:) ident(TTabSheet)operator(;) +reserved(begin) + ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\);) + ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(];) + reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightRed) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightGreen) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightBlue) + reserved(else) reserved(if) ident(Page)operator(.)ident(Caption) operator(=) string reserved(then) + ident(Color) operator(:=) ident(clBrightCyan) + reserved(else) + ident(Color) operator(:=) ident(clWhite)operator(;) + reserved(end)operator(;) + + reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) + reserved(if) ident(Active) reserved(then) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([)ident(fsBold)operator(];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(5)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(3)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(4)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\);) + reserved(end) reserved(else) reserved(begin) + ident(Font)operator(.)ident(Style) operator(:=) operator([];) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(2)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + ident(PC)operator(.)ident(Images)operator(.)ident(Draw)operator(()ident(PC)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(+) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(+) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ValueMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StringE)operator(.)ident(Text) operator(:=) ident(UntilStr)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(Caption)operator(,)stringoperator(\);) + ident(OKStringBClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(StringEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) + ident(OKStringBClick)operator(()ident(Sender)operator(\);) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(end)operator(;) + reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(CancelBClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(StringEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(State)operator(:) ident(TCheckBoxState)operator(;) + ident(Desc)operator(:) reserved(string)operator(;) +reserved(begin) + ident(IconImage)operator(.)ident(Picture) operator(:=) reserved(nil)operator(;) + + reserved(with) ident(StringAsColorP) reserved(do) reserved(begin) + ident(Color) operator(:=) ident(ColorOfString)operator(()ident(StringE)operator(.)ident(Text)operator(,) ident(csfThreeSpacedDecimals)operator(,) operator(-)integer(1)operator(\);) + ident(Visible) operator(:=) ident(Color) operator(<>) operator(-)integer(1)operator(;) + reserved(end)operator(;) + + reserved(try) + reserved(with) ident(IconImage)operator(.)ident(Picture)operator(.)ident(Icon) reserved(do) reserved(begin) + ident(ReleaseHandle)operator(;) + ident(Handle) operator(:=) ident(GetIconFromFile)operator(()ident(StringE)operator(.)ident(Text)operator(\);) + ident(StringAsFileP)operator(.)ident(Visible) operator(:=) ident(Handle) operator(<>) integer(0)operator(;) + reserved(end)operator(;) + reserved(except) + reserved(end)operator(;) + + ident(State) operator(:=) ident(cbGrayed)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(BoolStr)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(StringE)operator(.)ident(Text) operator(=) ident(BoolStr)operator([)ident(i)operator(][)ident(False)operator(]) reserved(then) + ident(State) operator(:=) ident(cbUnchecked) + reserved(else) reserved(if) ident(StringE)operator(.)ident(Text) operator(=) ident(BoolStr)operator([)ident(i)operator(][)ident(True)operator(]) reserved(then) + ident(State) operator(:=) ident(cbChecked) + reserved(else) + ident(Continue)operator(;) + ident(Break)operator(;) + reserved(end)operator(;) + + ident(BoolStrCB)operator(.)ident(Visible) operator(:=) ident(State) reserved(in) operator([)ident(cbChecked)operator(,) ident(cbUnchecked)operator(];) + ident(BoolStrCB)operator(.)ident(State) operator(:=) ident(State)operator(;) + + ident(Desc) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) + ident(Desc) operator(:=) ident(RegNameOfCLSID)operator(()ident(Desc)operator(\);) + reserved(with) ident(DescL) reserved(do) reserved(begin) + ident(Visible) operator(:=) operator(()ident(Desc) operator(<>) stringoperator(\);) + reserved(if) ident(Visible) reserved(then) + ident(Caption) operator(:=) string operator(+) ident(Desc)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OKStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(try) + ident(OpenCurKey)operator(;) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(case) ident(StringTypeRG)operator(.)ident(ItemIndex) reserved(of) + integer(0)operator(:) ident(MainReg)operator(.)ident(WriteString)operator(()ident(Strings)operator([)ident(i)operator(],) ident(StringE)operator(.)ident(Text)operator(\);) + integer(1)operator(:) ident(MainReg)operator(.)ident(WriteExpandString)operator(()ident(Strings)operator([)ident(i)operator(],) ident(StringE)operator(.)ident(Text)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BoolStrCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(BoolStr)operator(\)) reserved(do) reserved(begin) + reserved(if) operator(()ident(BoolStr)operator([)ident(i)operator(,) ident(False)operator(]) operator(=) ident(StringE)operator(.)ident(Text)operator(\)) + reserved(or) operator(()ident(BoolStr)operator([)ident(i)operator(,) ident(True)operator(]) operator(=) ident(StringE)operator(.)ident(Text)operator(\)) reserved(then) + ident(Break)operator(;) + reserved(end)operator(;) + + reserved(if) ident(i) operator(>) ident(High)operator(()ident(BoolStr)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(StringE)operator(.)ident(Text) operator(:=) ident(BoolStr)operator([)ident(i)operator(][)ident(BoolStrCB)operator(.)ident(Checked)operator(];) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CardinalEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(HexEditAutoChange) operator(:=) ident(True)operator(;) + reserved(with) ident(CardBoolCB) reserved(do) reserved(begin) + ident(Enabled) operator(:=) ident(True)operator(;) + reserved(case) ident(CardinalE)operator(.)ident(Value) reserved(of) + integer(1)operator(:) ident(Checked) operator(:=) ident(True)operator(;) + integer(0)operator(:) ident(Checked) operator(:=) ident(False)operator(;) + reserved(else) + ident(Enabled) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + ident(HexEdit1)operator(.)ident(Value) operator(:=) ident(CardinalE)operator(.)ident(Value)operator(;) + ident(HexEditAutoChange) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CardBoolCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(HexEditAutoChange) reserved(then) + ident(Exit)operator(;) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Ord)operator(()ident(CardBoolCB)operator(.)ident(Checked)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CardinalEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) + ident(OKIntBClick)operator(()ident(Sender)operator(\);) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(CancelBClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OKIntBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(Write4BB)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) ident(Value)operator(:) ident(Cardinal)operator(\);) + reserved(var) + ident(Typ)operator(:) ident(TRegDataType)operator(;) + reserved(begin) + reserved(if) ident(MainReg)operator(.)ident(ValueReallyExists)operator(()ident(ValueName)operator(\)) reserved(then) + ident(Typ) operator(:=) ident(MainReg)operator(.)ident(GetDataType)operator(()ident(ValueName)operator(\)) + reserved(else) + ident(Typ) operator(:=) ident(rdBinary)operator(;) + + reserved(if) ident(Typ) reserved(in) ident(rdCardTypes) reserved(then) + ident(Typ) operator(:=) ident(rdBinary)operator(;) + + ident(MainReg)operator(.)ident(WriteBinType)operator(()ident(ValueName)operator(,) ident(ByteAOfInt)operator(()ident(CardinalE)operator(.)ident(Value)operator(\),) ident(Typ)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(try) + ident(OpenCurKey)operator(;) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(case) ident(CardTypeRG)operator(.)ident(ItemIndex) reserved(of) + integer(0)operator(:) ident(MainReg)operator(.)ident(WriteCardinal)operator(()ident(Strings)operator([)ident(i)operator(],) ident(CardinalE)operator(.)ident(Value)operator(\);) + integer(1)operator(:) ident(MainReg)operator(.)ident(WriteCardinal)operator(()ident(Strings)operator([)ident(i)operator(],) ident(CardinalE)operator(.)ident(Value)operator(,) ident(True)operator(\);) + integer(2)operator(:) ident(Write4BB)operator(()ident(Strings)operator([)ident(i)operator(],) ident(CardinalE)operator(.)ident(Value)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FocusControl)operator(()ident(TObject)operator(()ident(ShowPC)operator(.)ident(ActivePage)operator(.)ident(Tag)operator(\)) reserved(as) ident(TWinControl)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCChanging)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(AllowChange)operator(:) ident(Boolean)operator(\);) + + reserved(function) ident(ByteAOfDWORD)operator(()ident(a)operator(:) ident(DWORD)operator(\):) ident(TByteA)operator(;) + reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(SizeOf)operator(()ident(DWORD)operator(\)\);) + ident(Move)operator(()ident(a)operator(,) ident(Pointer)operator(()ident(Result)operator(\)^,) ident(SizeOf)operator(()ident(DWORD)operator(\)\);) + reserved(end)operator(;) + +reserved(var) + ident(SourcePage)operator(:) ident(TTabSheet)operator(;) + ident(ValueName)operator(:) reserved(string)operator(;) +reserved(begin) + ident(SourcePage) operator(:=) ident(ShowPC)operator(.)ident(ActivePage)operator(;) + reserved(if) ident(SourcePage) operator(=) ident(IntPage) reserved(then) reserved(begin) + + reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string String)delimiter(')>operator(\);) + ident(StringE)operator(.)ident(Text) operator(:=) ident(CardinalE)operator(.)ident(Text)operator(;) + reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string Binary)delimiter(')>operator(\);) + ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(ByteAOfDWORD)operator(()ident(CardinalE)operator(.)ident(Value)operator(\);) + reserved(end) reserved(else) + ident(AllowChange) operator(:=) ident(False)operator(;) + + reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(StringPage) reserved(then) reserved(begin) + reserved(if) ident(TargetPage) operator(=) ident(IntPage) reserved(then) reserved(begin) + reserved(if) ident(IsValidCardinal)operator(()ident(StringE)operator(.)ident(Text)operator(\)) reserved(then) reserved(begin) + ident(AddHint)operator(()string DWORD)delimiter(')>operator(\);) + ident(CardinalE)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(AddHint)operator(()stringoperator(,) ident(True)operator(\);) + ident(AllowChange) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string Binary)delimiter(')>operator(\);) + ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(TByteA)operator(()ident(StringE)operator(.)ident(Text)operator(\);) + reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(MultiStringPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string MultiString)delimiter(')>operator(\);) + reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) + ident(MultiStringM)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) + ident(SeparatorEChange)operator(()ident(Sender)operator(\);) + reserved(end) reserved(else) + ident(AllowChange) operator(:=) ident(False)operator(;) + + reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(BinaryPage) reserved(then) reserved(begin) + reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string String)delimiter(')>operator(\);) + ident(StringE)operator(.)ident(Text) operator(:=) ident(FriendlyStr)operator(()reserved(string)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)\);) + reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(IntPage) reserved(then) reserved(begin) + reserved(if) ident(Length)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)) operator(>=) ident(SizeOf)operator(()ident(DWORD)operator(\)) reserved(then) reserved(begin) + ident(AddHint)operator(()string DWORD)delimiter(')>operator(\);) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(PDWORD)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)^;) + reserved(end) reserved(else) reserved(begin) + ident(AddHint)operator(()stringoperator(,) ident(True)operator(\);) + ident(AllowChange) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) reserved(if) ident(TargetPage) operator(=) ident(CryptoPage) reserved(then) reserved(begin) + reserved(if) ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(=) integer(1) reserved(then) reserved(begin) + ident(ValueName) operator(:=) ident(ValuesWin)operator(.)ident(ValueNames)operator([)integer(0)operator(];) + reserved(with) ident(CryptoTypeRG) reserved(do) reserved(begin) + ident(ItemIndex) operator(:=) operator(-)integer(1)operator(;) + reserved(if) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) reserved(then) reserved(begin) + ident(ItemIndex) operator(:=) integer(0)operator(;) + ident(CryptoE)operator(.)ident(Text) operator(:=) ident(DecodeScreenSaver)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\);) + reserved(end) reserved(else) reserved(if) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) + reserved(or) ident(SameText)operator(()ident(ValueName)operator(,) stringoperator(\)) reserved(then) reserved(begin) + ident(ItemIndex) operator(:=) integer(1)operator(;) + ident(CryptoE)operator(.)ident(Text) operator(:=) ident(DecodeSharedFolder)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(if) ident(CryptoTypeRG)operator(.)ident(ItemIndex) operator(=) operator(-)integer(1) reserved(then) + ident(AllowChange) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) + ident(AllowChange) operator(:=) ident(False)operator(;) + + reserved(end) reserved(else) reserved(if) ident(SourcePage) operator(=) ident(MultiStringPage) reserved(then) reserved(begin) + reserved(if) ident(TargetPage) operator(=) ident(StringPage) reserved(then) reserved(begin) + ident(AddHint)operator(()string String )delimiter(')>operator(\);) + reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) + ident(StringE)operator(.)ident(Text) operator(:=) ident(MultiStringM)operator(.)ident(Text) + reserved(else) + ident(StringE)operator(.)ident(Text) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\);) + comment(//end else if TargetPage = BinaryPage then begin) + reserved(end) reserved(else) + ident(AllowChange) operator(:=) ident(False)operator(;) + + reserved(end) reserved(else) + ident(AllowChange) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCDrawTab)operator(()ident(Control)operator(:) ident(TCustomTabControl)operator(;) ident(TabIndex)operator(:) ident(Integer)operator(;) + reserved(const) ident(Rect)operator(:) ident(TRect)operator(;) ident(Active)operator(:) ident(Boolean)operator(\);) +reserved(var) + ident(PC)operator(:) ident(TPageControl)operator(;) + ident(Page)operator(:) ident(TTabSheet)operator(;) +reserved(begin) + ident(PC) operator(:=) ident(TPageControl)operator(()ident(Control)operator(\);) + ident(Page) operator(:=) ident(PC)operator(.)ident(Pages)operator([)ident(TabIndex)operator(];) + reserved(with) ident(PC)operator(.)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Page) operator(=) ident(StringPage) reserved(then) + ident(Color) operator(:=) ident(clBrightRed) + reserved(else) reserved(if) ident(Page) operator(=) ident(MultiStringPage) reserved(then) + ident(Color) operator(:=) ident(clBrightPurple) + reserved(else) reserved(if) ident(Page) operator(=) ident(IntPage) reserved(then) + ident(Color) operator(:=) ident(clBrightBlue) + reserved(else) reserved(if) ident(Page) operator(=) ident(BinaryPage) reserved(then) + ident(Color) operator(:=) ident(clBrightGreen) + reserved(else) reserved(if) ident(Page) operator(=) ident(CryptoPage) reserved(then) + ident(Color) operator(:=) ident(clBrightCyan)operator(;) + reserved(end)operator(;) + + reserved(with) ident(PC)operator(.)ident(Canvas) reserved(do) reserved(begin) + reserved(if) ident(Active) reserved(then) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clGray) + reserved(else) + ident(Brush)operator(.)ident(Color) operator(:=) ident(clDarkGray)operator(;) + ident(FillRect)operator(()ident(Rect)operator(\);) + ident(TextOut)operator(()ident(Rect)operator(.)ident(Left) operator(+) integer(18) operator(+) integer(3)operator(,) ident(Rect)operator(.)ident(Top)operator(,) ident(Page)operator(.)ident(Caption)operator(\);) + ident(MainWin)operator(.)ident(ImageList1)operator(.)ident(Draw)operator(()ident(Control)operator(.)ident(Canvas)operator(,) ident(Rect)operator(.)ident(Left) operator(-) integer(1)operator(,) ident(Rect)operator(.)ident(Top) operator(-) integer(1)operator(,) ident(Page)operator(.)ident(ImageIndex)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ShowPCMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) +reserved(begin) + reserved(with) ident(ShowPC) reserved(do) + reserved(if) ident(htOnItem) reserved(in) ident(GetHitTestInfoAt)operator(()ident(X)operator(,) ident(Y)operator(\)) reserved(then) + ident(TargetPage) operator(:=) ident(Pages)operator([)ident(IndexOfTabAt)operator(()ident(X)operator(,) ident(Y)operator(\)];) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormCreate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(WorkU)operator(.)ident(ShowPC) operator(:=) ident(ShowPC)operator(;) + ident(WorkU)operator(.)ident(MainPC) operator(:=) ident(MainPC)operator(;) + + comment(//Zeromize) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) + ident(InfoMemo)operator(.)ident(Text) operator(:=) stringoperator(;) + ident(MultiStringM)operator(.)ident(Clear)operator(;) + ident(SisyTV)operator(.)ident(Items)operator(.)ident(Clear)operator(;) + ident(CurValueE)operator(.)ident(Text) operator(:=) ident(NoValueCaption)operator(;) + ident(HexEditAutoChange) operator(:=) ident(False)operator(;) + ident(TargetPage) operator(:=) reserved(nil)operator(;) + + comment(//Tagging) + ident(StringPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(StringE)operator(\);) + ident(IntPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(CardinalE)operator(\);) + ident(BinaryPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(BinaryHM)operator(\);) + ident(MultiStringPage)operator(.)ident(Tag) operator(:=) ident(Integer)operator(()ident(MultiStringM)operator(\);) + ident(ShowAsBinary) operator(:=) ident(False)operator(;) + + reserved(if) reserved(not) ident(Win9x) reserved(then) + ident(CryptoPage)operator(.)ident(TabVisible) operator(:=) ident(False)operator(;) + + ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(HintPage)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) reserved(nil)operator(;) + + ident(DropFileTarget)operator(.)directive(register)operator(()ident(StringE)operator(\);) + + reserved(with) ident(StringTypeRG) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ControlCount)operator(-)integer(1) reserved(do) + operator(()ident(Controls)operator([)ident(i)operator(]) reserved(as) ident(TRadioButton)operator(\).)ident(OnKeyDown) operator(:=) ident(StringEKeyDown)operator(;) + + ident(ExternalEditB)operator(.)ident(Enabled) operator(:=) ident(FileEx)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(\);) + + ident(PipelineThread) operator(:=) ident(TPipelineThread)operator(.)ident(CreateIt)operator(()ident(tpIdle)operator(,) stringoperator(,) ident(BinaryHM)operator(\);) + ident(PipelineThread)operator(.)ident(OnChange) operator(:=) ident(LoadExternalBClick)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OKBinaryBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Typ)operator(:) ident(Cardinal)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(try) + ident(Typ) operator(:=) ident(StrToIntDef)operator(()ident(UntilChar)operator(()ident(DataTypeComB)operator(.)ident(Text)operator(,) charoperator(\),) ident(Integer)operator(()ident(rdBinary)operator(\)\);) + ident(OpenCurKey)operator(;) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(MainReg)operator(.)ident(WriteBinType)operator(()ident(Strings)operator([)ident(i)operator(],) ident(BinaryHM)operator(.)ident(Data)operator(,) ident(Typ)operator(\);) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + comment({with BinaryHM do begin + with BinL, Font do + if ActiveByte < ByteCount then + Color := clBrightGreen + else begin + Color := clSilver; + Caption := '00000000'; + end; + BinL.Caption := IntToBinFill(CurrentByte, 8\); + end; }) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1KeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) + ident(OKBinaryBClick)operator(()ident(Sender)operator(\);) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(end)operator(;) + reserved(if) ident(key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(CancelBClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BoolStrPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(StringE)operator(.)ident(Text) operator(:=) ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(Caption)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(StringPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FocusControl)operator(()ident(StringE)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(IntPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FocusControl)operator(()ident(CardinalE)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryPageEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(FocusControl)operator(()ident(BinaryHM)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(DeActivateIt)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeActivateThis)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormDeactivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(TEdit)operator(()ident(ActiveControl)operator(\).)ident(OnExit)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormActivate)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(ActiveControl)operator(\)) reserved(and) operator(()ident(ActiveControl)operator(.)ident(Tag) operator(=) ident(EditControlFlag)operator(\)) reserved(then) + ident(TEdit)operator(()ident(ActiveControl)operator(\).)ident(OnEnter)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(MultiStringMChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MultiStringCountL)operator(.)ident(Caption) operator(:=) ident(StrNumerus)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(Count)operator(,) + stringoperator(,) stringoperator(,) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OKMultiStringBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(UseExtendedModel)operator(:) ident(Boolean)operator(;) + ident(i)operator(:) ident(Integer)operator(;) + ident(JoinedText)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(if) operator(()ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(=) integer(1)operator(\)) reserved(then) reserved(begin) + reserved(if) ident(ValuesWin)operator(.)ident(ValueCommonType) operator(=) ident(rdMultiString) reserved(then) + reserved(if) ident(mrYes)operator(<>)ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string String)delimiter(')>operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(try) + ident(OpenCurKey)operator(;) + ident(JoinedText) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\);) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) + ident(MainReg)operator(.)ident(WriteString)operator(()ident(Strings)operator([)ident(i)operator(],) ident(JoinedText)operator(\);) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(UseExtendedModel) operator(:=) ident(True)operator(;) + reserved(if) ident(ContainsEmptyLines)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(\)) reserved(then) + reserved(case) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbNo)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(of) + + ident(mrNo)operator(:) ident(UseExtendedModel) operator(:=) ident(True)operator(;) + + ident(mrYes)operator(:) reserved(begin) + reserved(with) ident(MultiStringM) reserved(do) reserved(begin) + ident(Lines)operator(.)ident(BeginUpdate)operator(;) + ident(DeleteEmptyLines)operator(()ident(Lines)operator(\);) + ident(Lines)operator(.)ident(EndUpdate)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(else) ident(Exit)operator(;) + + reserved(end)operator(;) + + reserved(try) + ident(OpenCurKey)operator(;) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) ident(MainReg)operator(.)ident(GetDataType)operator(()ident(Strings)operator([)ident(i)operator(]\)) operator(<>) ident(rdMultiString) reserved(then) + reserved(if) ident(mrYes) operator(<>) ident(MessageDlg)operator(()string operator(+) ident(EOL) operator(+) + string MultiString)delimiter(')>operator(,) ident(mtWarning)operator(,) operator([)ident(mbYes)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(if) ident(UseExtendedModel) reserved(then) + ident(MainReg)operator(.)ident(WriteStringList)operator(()ident(Strings)operator([)ident(i)operator(],) ident(MultiStringM)operator(.)ident(Lines)operator(\)) + reserved(else) + ident(MainReg)operator(.)ident(WriteMultiString)operator(()ident(Strings)operator([)ident(i)operator(],) ident(MultiStringM)operator(.)ident(Lines)operator(\);) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(StringAsColorPDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(ColorDlg)operator(.)ident(Execute) reserved(then) + ident(StringE)operator(.)ident(Text) operator(:=) ident(StringOfColor)operator(()ident(ColorDlg)operator(.)ident(Color)operator(,) ident(csfThreeSpacedDecimals)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(MultiStringMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(MultiStringM)operator(.)ident(SelectAll)operator(;) + ident(ActivateIt)operator(()ident(MultiStringM)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(LadenMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(MultiStringOpenD) reserved(do) reserved(begin) + ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\);) + reserved(if) ident(Execute) reserved(then) + ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpeichernMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(MultiStringSaveD) reserved(do) reserved(begin) + ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\);) + reserved(if) ident(Execute) reserved(then) + ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(SaveToFile)operator(()ident(FileName)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(Hinzufgen1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + reserved(with) ident(MultiStringOpenD) reserved(do) reserved(begin) + ident(InitialDir) operator(:=) ident(ExtractFileDrive)operator(()ident(MyDir)operator(\);) + reserved(if) ident(Execute) reserved(then) reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\);) + ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(AddStrings)operator(()ident(SL)operator(\);) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CancelBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + ident(ValuesWin)operator(.)ident(ValueListChange)operator(()ident(Sender)operator(,) ident(ValueList)operator(.)ident(Selected)operator(,) ident(ctState)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1Enter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(HexGrid1Click)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpyClearTracesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SpyLB)operator(.)ident(Clear)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpyLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) operator(()ident(ssShift) reserved(in) ident(Shift)operator(\)) reserved(and) operator(()ident(key) operator(=) ident(VK_DELETE)operator(\)) reserved(then) reserved(begin) + ident(key) operator(:=) integer(0)operator(;) + ident(SpyLB)operator(.)ident(Clear)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(key) operator(=) ident(VK_F9) reserved(then) reserved(begin) + ident(key) operator(:=) integer(0)operator(;) + ident(SwapFonts)operator(()ident(SpyLB)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BinLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + comment(// with HexGrid1 do) + comment(// Byt[ActiveByte] := IntOfBin(BinL.Caption\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HexGrid1KeyUp)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + comment(//HexGrid1Click(Sender\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ValueViewChanged)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + + ident(SpyThread)operator(.)ident(Suspend)operator(;) + ident(OpenCurKey)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(ValueList)operator(.)ident(Items)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(ValuesWin)operator(.)ident(UpdateValue)operator(()ident(MainReg)operator(,) ident(ValueList)operator(.)ident(Items)operator([)ident(i)operator(]\);) + + ident(MainReg)operator(.)ident(CloseKey)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HexEdit1Change)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(HexEditAutoChange) reserved(then) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(HexEdit1)operator(.)ident(Value)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SortMultiStringMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(with) ident(SL) reserved(do) reserved(begin) + ident(Assign)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(\);) + ident(Sort)operator(;) + reserved(end)operator(;) + ident(MultiStringM)operator(.)ident(Lines)operator(.)ident(Assign)operator(()ident(SL)operator(\);) + ident(SL)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpyTestLClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(SpyTestL)operator(.)ident(Caption) operator(:=) ident(StrOfBool)operator(()ident(SpyThread)operator(.)ident(Suspended)operator(,) stringoperator(,) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FocusForEditing)operator(;) +reserved(begin) + ident(FocusControl)operator(()ident(MainPC)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TWorkWin)operator(.)ident(LoadBoolStr)operator(:) ident(Boolean)operator(;) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(FileName)operator(:) reserved(string)operator(;) + ident(i)operator(,) ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + + ident(AddHint)operator(()stringoperator(\);) + + ident(FileName) operator(:=) ident(PlutoDir) operator(+) ident(BoolStrFileName)operator(;) + reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) + ident(AddToLastHint)operator(()stringoperator(\);) + ident(AddHint)operator(()ident(FileName)operator(\);) + ident(Result) operator(:=) ident(False)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\);) + ident(DeleteCommentLines)operator(()ident(SL)operator(\);) + ident(BoolStr) operator(:=) reserved(nil)operator(;) + ident(SetLength)operator(()ident(BoolStr)operator(,) ident(SL)operator(.)ident(Count)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + comment(//Split the string by the '|'-sign) + ident(p) operator(:=) ident(Pos)operator(()charoperator(,) ident(SL)operator([)ident(i)operator(]\);) + ident(BoolStr)operator([)ident(i)operator(][)ident(False)operator(]) operator(:=) ident(Copy)operator(()ident(SL)operator([)ident(i)operator(],) integer(1)operator(,) ident(p)operator(-)integer(1)operator(\);) + ident(BoolStr)operator([)ident(i)operator(][)ident(True)operator(]) operator(:=) ident(Copy)operator(()ident(SL)operator([)ident(i)operator(],) ident(p)operator(+)integer(1)operator(,) ident(Length)operator(()ident(SL)operator([)ident(i)operator(]\)) operator(-) ident(p)operator(\);) + reserved(end)operator(;) + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + ident(AddToLastHint)operator(()stringoperator(\);) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TWorkWin)operator(.)ident(LoadSisyFilter)operator(:) ident(Boolean)operator(;) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(FileName)operator(:) reserved(string)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + + ident(FileName) operator(:=) ident(PlutoDir) operator(+) ident(SisyFilterFileName)operator(;) + reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) + ident(Result) operator(:=) ident(False) + reserved(else) reserved(begin) + ident(AddHint)operator(()stringoperator(\);) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(SL)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\);) + ident(DeleteCommentLines)operator(()ident(SL)operator(,) charoperator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(SL)operator([)ident(i)operator(]) operator(:=) ident(TrimLeft)operator(()ident(SL)operator([)ident(i)operator(]\);) + + ident(SisyFilter)operator(.)ident(Clear)operator(;) + ident(SisyFilter)operator(.)ident(AddStrings)operator(()ident(SL)operator(\);) + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + ident(AddToLastHint)operator(()stringoperator(\);) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVGetSelectedIndex)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + ident(Node)operator(.)ident(SelectedIndex) operator(:=) ident(Node)operator(.)ident(ImageIndex)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(Path)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Path) operator(:=) ident(RootOfNode)operator(()ident(Node)operator(\).)ident(Text)operator(;) + + reserved(if) ident(Node)operator(.)ident(Level) operator(>) integer(0) reserved(then) reserved(begin) + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(2) reserved(then) + ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) + reserved(if) ident(Node)operator(.)ident(HasChildren) reserved(then) + ident(Path) operator(:=) ident(Path) operator(+) string operator(+) ident(Node)operator(.)ident(Text) comment(//Value) + reserved(else) + ident(Path) operator(:=) ident(Path) operator(+) char operator(+) ident(Node)operator(.)ident(Text) comment(//SubKey) + reserved(end)operator(;) + + ident(MainWin)operator(.)ident(GotoKey)operator(()ident(Path)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(DeleteChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(var) + ident(SubNode)operator(:) ident(TTreeNode)operator(;) + + reserved(procedure) ident(FreeSisyChangeNode)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) + reserved(begin) + reserved(try) + reserved(with) operator(()ident(TObject)operator(()ident(Node)operator(.)ident(Data)operator(\)) reserved(as) ident(TSisyChange)operator(\)) reserved(do) + ident(Free)operator(;) + reserved(except) + ident(ReportFmt)operator(()stringoperator(,) stringoperator(,) operator([)ident(Node)operator(.)ident(Text)operator(]\);) + reserved(end)operator(;) + + ident(Node)operator(.)ident(Delete)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(2) reserved(then) + ident(Node) operator(:=) ident(Node)operator(.)ident(Parent)operator(;) + + reserved(if) ident(Node)operator(.)ident(Level) operator(=) integer(0) reserved(then) reserved(begin) + ident(SisyTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(RootOfNode)operator(()ident(Node)operator(\)\);) + ident(SubNode) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) + reserved(while) ident(Assigned)operator(()ident(SubNode)operator(\)) reserved(do) reserved(begin) + ident(FreeSisyChangeNode)operator(()ident(SubNode)operator(\);) + ident(SubNode) operator(:=) ident(Node)operator(.)ident(GetFirstChild)operator(;) reserved(end)operator(;) + ident(Node)operator(.)ident(Delete)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(SisyTV)operator(.)ident(Selected) operator(:=) ident(GetNextBest)operator(()ident(Node)operator(\);) + ident(FreeSisyChangeNode)operator(()ident(Node)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(DeactivateChange)operator(()ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + ident(Node) operator(:=) ident(RootOfNode)operator(()ident(Node)operator(\);) + + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(SisyChangeActivated)operator(()ident(Node)operator(\)) reserved(then) reserved(begin) + ident(SetSisyChangeState)operator(()ident(Node)operator(,) ident(False)operator(\);) + ident(Node)operator(.)ident(Cut) operator(:=) ident(True)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(SetSisyChangeState)operator(()ident(Node)operator(,) ident(True)operator(\);) + ident(Node)operator(.)ident(Cut) operator(:=) ident(False)operator(;) + reserved(end)operator(;) + ident(SisyTV)operator(.)ident(Repaint)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CopySelectedChangeName)operator(;) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Node)operator(.)ident(Text)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(RootOfNode)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\);) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + comment({if Key = VK_RETURN then + SisyTVDblCLick(Sender\); + + if Key = VK_DELETE then + if (ssCtrl in Shift\) and (Key = VK_DELETE\) then + DeactivateChange(Node\) + else + DeleteChange(Node\); + + if (ssCtrl in Shift\) and (Char(Key\) = 'C'\) then + CopySelectedChangeName;}) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(Started) reserved(then) + ident(Exit)operator(;) + + reserved(with) ident(TCheckBox)operator(()ident(Sender)operator(\),) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(Tag)operator(]\)) reserved(do) reserved(begin) + reserved(if) ident(Checked) reserved(then) + ident(Resume) + reserved(else) + ident(Suspend)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CurValueEEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CurValueE)operator(.)ident(Text) operator(:=) ident(RealValueName)operator(()ident(ValueList)operator(.)ident(ItemFocused)operator(\);) + ident(CurValueE)operator(.)ident(SelectAll)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CurValueEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) + + reserved(procedure) ident(RenameValue)operator(()ident(NewName)operator(:) reserved(string)operator(\);) + reserved(var) + ident(Item)operator(:) ident(TListItem)operator(;) + reserved(begin) + ident(Item) operator(:=) ident(ValueList)operator(.)ident(ItemFocused)operator(;) + reserved(if) ident(ValuesWin)operator(.)ident(TryRenameValue)operator(()ident(CurKey)operator(.)ident(Value)operator(,) ident(NewName)operator(\)) reserved(then) + ident(SetRealValueName)operator(()ident(Item)operator(,) ident(NewName)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) + ident(SpyThread)operator(.)ident(Suspend)operator(;) + reserved(try) + ident(RenameValue)operator(()ident(CurValueE)operator(.)ident(Text)operator(\);) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\);) + ident(FocusControl)operator(()ident(CurValueE)operator(\);) + reserved(finally) + ident(SpyThread)operator(.)ident(Restart) operator(:=) ident(True)operator(;) + ident(SpyThread)operator(.)ident(Resume)operator(;) + reserved(end)operator(;) + ident(Key) operator(:=) integer(0)operator(;) + comment(//CurValueE.SelectAll;) + reserved(end) reserved(else) reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) reserved(begin) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryHMLineChange)operator(()ident(NewLine)operator(:) ident(Cardinal)operator(\);) +reserved(begin) + ident(OffsetHE)operator(.)ident(Value) operator(:=) ident(BinaryHM)operator(.)ident(Pos)operator(;) + comment(// BinaryAsIntL.Value := Integer(BinaryHM.CurentCard\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OffsetHEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(BinaryHM)operator(.)ident(Pos) operator(:=) ident(OffsetHE)operator(.)ident(Value)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SpyDelayIEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(Assigned)operator(()ident(SpyThread)operator(\)) reserved(then) + ident(SpyThread)operator(.)ident(Delay) operator(:=) ident(SpyDelayIE)operator(.)ident(Value)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVExpanded)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Node)operator(:) ident(TTreeNode)operator(\);) +reserved(begin) + reserved(if) ident(Node)operator(.)ident(ImageIndex) operator(=) integer(8) reserved(then) + ident(Node)operator(.)ident(ImageIndex) operator(:=) integer(7)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ClearChanges)operator(;) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + reserved(with) ident(SisyTV)operator(.)ident(Items) reserved(do) reserved(begin) + ident(Node) operator(:=) ident(GetFirstNode)operator(;) + reserved(while) ident(Assigned)operator(()ident(Node)operator(\)) reserved(do) reserved(begin) + ident(DeleteChange)operator(()ident(Node)operator(\);) + ident(Node) operator(:=) ident(GetFirstNode)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ClearChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) ident(mrOK) operator(<>) ident(MessageDlg)operator(()stringoperator(,) + ident(mtWarning)operator(,) operator([)ident(mbOK)operator(,) ident(mbCancel)operator(],) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(ClearChanges)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FilterChangesBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(NotePad)operator(()ident(PlutoDir) operator(+) ident(SisyFilterFileName)operator(\);) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) + stringoperator(\);) + ident(LoadSisyFilter)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(KeySelected)operator(:) ident(Boolean)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) +reserved(begin) + ident(Node) operator(:=) ident(SisyTV)operator(.)ident(Selected)operator(;) + ident(KeySelected) operator(:=) ident(Assigned)operator(()ident(Node)operator(\);) + + ident(SisyGoToKeyMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) + ident(SisyDeleteChangeMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) + ident(SisyActivateChangeMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) + ident(SisyCopyPathMI)operator(.)ident(Enabled) operator(:=) ident(KeySelected)operator(;) + reserved(if) reserved(not) ident(KeySelected) reserved(then) + ident(Exit)operator(;) + + ident(SisyActivateChangeMI)operator(.)ident(Checked) operator(:=) ident(SisyChangeActivated)operator(()ident(RootOfNode)operator(()ident(Node)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyActivateChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeactivateChange)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\)) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyDeleteChangeMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(DeleteChange)operator(()ident(SisyTV)operator(.)ident(Selected)operator(\)) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyCopyPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CopySelectedChangeName)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FileMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(s)operator(:) reserved(string)operator(;) +reserved(begin) + reserved(with) ident(FileOpenD) reserved(do) reserved(begin) + ident(s) operator(:=) ident(ExtractPath)operator(()ident(StringE)operator(.)ident(Text)operator(\);) + reserved(if) ident(s) operator(<>) string reserved(then) + ident(InitialDir) operator(:=) ident(s) + reserved(else) + ident(InitialDir) operator(:=) ident(MyDir)operator(;) + + ident(s) operator(:=) ident(ExtractFileName)operator(()ident(StringE)operator(.)ident(Text)operator(\);) + ident(s) operator(:=) ident(DeleteChars)operator(()ident(s)operator(,) charoperator(\);) + reserved(if) ident(s) operator(<>) string reserved(then) + ident(FileName) operator(:=) ident(s)operator(;) + + reserved(if) ident(Execute) reserved(then) + ident(StringE)operator(.)ident(Text) operator(:=) ident(FileName)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ExternalEditBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(FileName)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(TempDir) operator(+) char operator(+) ident(DeleteChars)operator(()ident(CurValueE)operator(.)ident(Text)operator(,) ident(FileNameEnemies)operator(\)) operator(+) + stringoperator(;) + reserved(if) ident(SaveByteA)operator(()ident(BinaryHM)operator(.)ident(Data)operator(,) ident(FileName)operator(\)) reserved(then) + ident(ExecFileWith)operator(()ident(PrefWin)operator(.)ident(ExternalHexEditE)operator(.)ident(Text)operator(,) ident(FileName)operator(\)) + reserved(else) + ident(ShowMessage)operator(()string operator(+) ident(EOL) operator(+) ident(FileName)operator(\);) + + ident(PipelineThread)operator(.)ident(FileName) operator(:=) ident(FileName)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(LoadExternalBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(FileName)operator(:) reserved(string)operator(;) + ident(Data)operator(:) ident(TByteA)operator(;) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Data) operator(:=) reserved(nil)operator(;) + + ident(FileName) operator(:=) ident(TempDir) operator(+) char operator(+) ident(CurValueE)operator(.)ident(Text) operator(+) stringoperator(;) + reserved(if) reserved(not) ident(FileEx)operator(()ident(FileName)operator(\)) reserved(then) reserved(begin) + comment({ShowMessage('File not found:' + EOL + + FileName\);}) + ident(Exit)operator(;) + reserved(end)operator(;) + + ident(Data) operator(:=) ident(LoadByteA)operator(()ident(FileName)operator(\);) + reserved(if) ident(Length)operator(()ident(Data)operator(\)) operator(=) ident(Length)operator(()ident(BinaryHM)operator(.)ident(Data)operator(\)) reserved(then) reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Data)operator(\)) reserved(do) + reserved(if) ident(Data)operator([)ident(i)operator(]) operator(<>) ident(BinaryHM)operator(.)ident(Data)operator([)ident(i)operator(]) reserved(then) reserved(begin) + ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Data)operator(;) + ident(Exit)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) + ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Data)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(PipelineCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(PipelineThread)operator(,) ident(PipelineCB) reserved(do) + reserved(if) ident(Checked) reserved(then) reserved(begin) + reserved(if) ident(Suspended) reserved(then) + ident(Resume)operator(;) + reserved(end) reserved(else) + reserved(if) reserved(not) ident(Suspended) reserved(then) + ident(Suspend)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ReloadBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Self)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(BinaryHMEnter)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PipelineCB)operator(.)ident(Checked) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(xUseExtendedModelCBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Load)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SeparatorEChange)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(if) reserved(not) ident(SeparatorE)operator(.)ident(Enabled) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(SeparatorE)operator(.)ident(Text) operator(=) string reserved(then) reserved(begin) + reserved(if) ident(StringE)operator(.)ident(Text) operator(=) string reserved(then) + ident(Exit) + reserved(else) + ident(MultiStringM)operator(.)ident(Text) operator(:=) ident(StringE)operator(.)ident(Text)operator(;) + ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(].)ident(Enabled) operator(:=) ident(False)operator(;) + ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + reserved(end) reserved(else) reserved(begin) + reserved(if) ident(StringE)operator(.)ident(Text) operator(=) string reserved(then) + ident(StringE)operator(.)ident(Text) operator(:=) ident(Join)operator(()ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(\);) + ident(MultiStringTypeRG)operator(.)ident(Buttons)operator([)integer(1)operator(].)ident(Enabled) operator(:=) ident(True)operator(;) + ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) + ident(Split)operator(()ident(StringE)operator(.)ident(Text)operator(,) ident(SeparatorE)operator(.)ident(Text)operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(False)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(HintLBKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) operator(()ident(Key) operator(=) ident(Byte)operator(()charoperator(\)\)) reserved(and) operator(()ident(ssCtrl) reserved(in) ident(Shift)operator(\)) reserved(then) + reserved(with) ident(HintLb) reserved(do) + reserved(if) ident(ItemIndex) operator(>=) integer(0) reserved(then) + ident(Clipboard)operator(.)ident(AsText) operator(:=) ident(Items)operator([)ident(ItemIndex)operator(];) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(DWORDSpecialBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(StrToIntDef)operator((()ident(Sender) reserved(as) ident(TButton)operator(\).)ident(Caption)operator(,) integer(0)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(Button1Click)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(ShowPC)operator(.)ident(SelectNextPage)operator(()ident(True)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyPUPopup)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SisyPU)operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(PopupComponent)operator(.)ident(Tag)operator(]\)) reserved(do) + ident(Items)operator([)ident(Integer)operator(()ident(Priority)operator(\)].)ident(Checked) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyPriorityMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(SisyPU)operator(.)ident(PopupComponent)operator(.)ident(Tag)operator(]\)) reserved(do) reserved(begin) + ident(Priority) operator(:=) ident(TThreadPriority)operator(()ident(TMenuItem)operator(()ident(Sender)operator(\).)ident(MenuIndex)operator(\);) + reserved(if) ident(Priority) operator(<=) ident(tpNormal) reserved(then) + ident(Uni)operator(.)ident(WriteInteger)operator(()stringoperator(,) ident(Integer)operator(()ident(Priority)operator(\)\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyShowCurrentPathMIClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + reserved(with) ident(SisyPU)operator(,) ident(TSisyThread)operator(()ident(Sisys)operator([)ident(PopupComponent)operator(.)ident(Tag)operator(]\)) reserved(do) reserved(begin) + ident(Suspend)operator(;) + ident(ShowMessage)operator(()ident(CurrentSpyKey)operator(.)ident(Path)operator(\);) + ident(Resume)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(DropFileTargetDrop)operator(()ident(Sender)operator(:) ident(TObject)operator(;) + ident(ShiftState)operator(:) ident(TShiftState)operator(;) ident(Point)operator(:) ident(TPoint)operator(;) reserved(var) ident(Effect)operator(:) ident(Integer)operator(\);) +reserved(begin) + ident(StringE)operator(.)ident(Text) operator(:=) ident(DropFileTarget)operator(.)ident(Files)operator([)integer(0)operator(];) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormClose)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Action)operator(:) ident(TCloseAction)operator(\);) +reserved(begin) +comment(// Action := caNone;) + ident(DropFileTarget)operator(.)ident(Unregister)operator(;) + ident(ClearChanges)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(FormResize)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(begin) + ident(Realign)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(IconImageDblClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(Filename)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(GetFileNew)operator(()ident(StringE)operator(.)ident(Text)operator(\);) + reserved(if) ident(FileName) operator(<>) string reserved(then) + ident(ExecFile)operator(()ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(ShowValues)operator(()ident(Reg)operator(:) ident(TXRegistry)operator(\);) +reserved(var) + ident(MainValueName)operator(:) reserved(string)operator(;) + ident(ValueCommonType)operator(:) ident(TRegDataType)operator(;) + + reserved(procedure) ident(ShowValueAsBinary)operator(()reserved(const) ident(ValueName)operator(:) reserved(string)operator(;) + ident(Smart4BB)operator(:) ident(Boolean) operator(=) ident(True)operator(\);) + reserved(begin) + reserved(if) ident(Smart4BB) + reserved(and) ident(PrefWin)operator(.)ident(Smart4BBCB)operator(.)ident(Checked) + reserved(and) operator(()ident(Reg)operator(.)ident(GetDataSize)operator(()ident(ValueName)operator(\)) operator(=) integer(4)operator(\)) reserved(then) reserved(begin) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Reg)operator(.)ident(ReadCardinal)operator(()ident(ValueName)operator(\);) + ident(CardTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(2)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(IntPage)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + ident(BinaryHM)operator(.)ident(Data) operator(:=) ident(Reg)operator(.)ident(ReadBin)operator(()ident(ValueName)operator(\);) + ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(ValueCommonType)operator(;) + reserved(if) ident(IsValidDataType)operator(()ident(ValueCommonType)operator(\)) reserved(then) + ident(DataTypeComB)operator(.)ident(ItemIndex) operator(:=) ident(ValueCommonType) + reserved(else) reserved(begin) + ident(DataTypeComB)operator(.)ident(Text) operator(:=) ident(IntToStr)operator(()ident(ValueCommonType)operator(\);) + ident(AddHint)operator(()string operator(+) ident(DataTypeComB)operator(.)ident(Text) operator(+) string operator(+) + ident(Quote)operator(()ident(ValueName)operator(\)\);) + reserved(end)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(BinaryPage)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(with) ident(ValuesWin) reserved(do) reserved(begin) + reserved(if) reserved(not) ident(Assigned)operator(()ident(ValueNames)operator(\)) reserved(or) operator(()ident(ValueNames)operator(.)ident(Count) operator(=) integer(0)operator(\)) reserved(then) + reserved(raise) ident(EReadError)operator(.)ident(Create)operator(()stringoperator(\);) + ident(MainValueName) operator(:=) ident(ValueNames)operator([)integer(0)operator(];) + reserved(end)operator(;) + ident(ValueCommonType) operator(:=) ident(ValuesWin)operator(.)ident(ValueCommonType)operator(;) + + reserved(with) ident(CurValueE) reserved(do) reserved(begin) + ident(Enabled) operator(:=) ident(True)operator(;) + reserved(if) ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(=) integer(1) reserved(then) + ident(Text) operator(:=) ident(MainValueName) + reserved(else) + ident(Text) operator(:=) ident(Copy)operator(()ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(CommaText)operator(,) integer(1)operator(,) integer(255)operator(\);) + + ident(Font)operator(.)ident(Color) operator(:=) ident(ColorOfDataType)operator(()ident(ValueCommonType)operator(\);) + reserved(end)operator(;) + + reserved(if) ident(KeyIsDown)operator(()ident(VK_MENU)operator(\)) reserved(or) ident(ShowAsBinary) reserved(then) reserved(begin) + ident(ShowValueAsBinary)operator(()ident(MainValueName)operator(,) ident(False)operator(\);) + reserved(end) reserved(else) reserved(if) ident(ValueCommonType) reserved(in) ident(rdStringTypes) reserved(then) reserved(begin) + ident(StringE)operator(.)ident(Text) operator(:=) ident(Reg)operator(.)ident(ReadString)operator(()ident(MainValueName)operator(\);) + reserved(case) ident(ValueCommonType) reserved(of) + ident(rdString)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + ident(rdExpandString)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) + reserved(end)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(StringPage)operator(;) + reserved(end) reserved(else) reserved(if) ident(ValueCommonType) reserved(in) ident(rdCardTypes) reserved(then) reserved(begin) + ident(CardinalE)operator(.)ident(Value) operator(:=) ident(Reg)operator(.)ident(ReadCardinal)operator(()ident(MainValueName)operator(\);) + reserved(case) ident(ValueCommonType) reserved(of) + ident(rdCardinal)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + ident(rdCardBigEndian)operator(:) ident(StringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(1)operator(;) + reserved(end)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(IntPage)operator(;) + reserved(end) reserved(else) reserved(if) ident(ValueCommonType) operator(=) ident(rdMultiString) reserved(then) reserved(begin) + ident(MultiStringM)operator(.)ident(Clear)operator(;) + ident(Reg)operator(.)ident(ReadMultiString)operator(()ident(MainValueName)operator(,) ident(MultiStringM)operator(.)ident(Lines)operator(,) ident(PrefWin)operator(.)ident(UseExtendedModelCB)operator(.)ident(Checked)operator(\);) + ident(SeparatorEChange)operator(()ident(Self)operator(\);) + ident(MultiStringTypeRG)operator(.)ident(ItemIndex) operator(:=) integer(0)operator(;) + ident(ShowPC)operator(.)ident(ActivePage) operator(:=) ident(MultiStringPage)operator(;) + reserved(end) reserved(else) reserved(begin) + ident(ShowValueAsBinary)operator(()ident(MainValueName)operator(\);) + reserved(end)operator(;) + + ident(ShowAsBinary) operator(:=) ident(False)operator(;) + + ident(UpdateWriteButtons)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(UpdateWriteButtons)operator(;) +reserved(const) + ident(BtnTextOfMultiEdit)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) stringoperator(\);) +reserved(var) + ident(BtnText)operator(:) reserved(string)operator(;) +reserved(begin) + ident(BtnText) operator(:=) ident(BtnTextOfMultiEdit)operator([)ident(ValuesWin)operator(.)ident(ValueNames)operator(.)ident(Count) operator(>) integer(1)operator(];) + ident(OKStringB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) + ident(OKIntB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) + ident(OKMultiStringB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) + ident(OKBinaryB)operator(.)ident(Caption) operator(:=) ident(BtnText)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(EditData)operator(;) +reserved(begin) + ident(AddHint)operator(()stringoperator(\);) + ident(MainPC)operator(.)ident(ActivePage) operator(:=) ident(WorkPage)operator(;) + + reserved(with) ident(ShowPC) reserved(do) + reserved(if) ident(ActivePage) operator(=) reserved(nil) reserved(then) + ident(Exit) + reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(StringPage) reserved(then) reserved(begin) + ident(FocusControl)operator(()ident(StringE)operator(\);) + ident(StringE)operator(.)ident(SelectAll)operator(;) + reserved(end) + reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(IntPage) reserved(then) + ident(FocusControl)operator(()ident(CardinalE)operator(\)) + reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(MultiStringPage) reserved(then) + ident(FocusControl)operator(()ident(MultiStringM)operator(\)) + reserved(else) reserved(if) ident(ActivePage) operator(=) ident(WorkWin)operator(.)ident(BinaryPage) reserved(then) + ident(FocusControl)operator(()ident(BinaryHM)operator(\)) + reserved(else) + ident(ShowMessage)operator(()stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVCustomDrawItem)operator(()ident(Sender)operator(:) ident(TCustomTreeView)operator(;) + ident(Node)operator(:) ident(TTreeNode)operator(;) ident(State)operator(:) ident(TCustomDrawState)operator(;) reserved(var) ident(DefaultDraw)operator(:) ident(Boolean)operator(\);) +reserved(begin) + reserved(with) ident(TTreeView)operator(()ident(Sender)operator(\).)ident(Canvas)operator(.)ident(Font) reserved(do) reserved(begin) + reserved(if) ident(Node)operator(.)ident(Cut) reserved(then) + ident(Color) operator(:=) hex($AAAAAA) + reserved(else) + ident(Color) operator(:=) ident(clWhite)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(SisyTVMouseDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) ident(Button)operator(:) ident(TMouseButton)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(;) ident(X)operator(,) ident(Y)operator(:) ident(Integer)operator(\);) +reserved(var) + ident(Node)operator(:) ident(TTreeNode)operator(;) + ident(RelX)operator(,) ident(RelY)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(with) ident(SisyTV) reserved(do) reserved(begin) + ident(RelX) operator(:=) ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\).)ident(X)operator(;) + ident(RelY) operator(:=) ident(ScreenToClient)operator(()ident(Mouse)operator(.)ident(CursorPos)operator(\).)ident(Y)operator(;) + ident(Node) operator(:=) ident(GetNodeAt)operator(()ident(RelX)operator(,) ident(RelY)operator(\);) + reserved(end)operator(;) + reserved(if) reserved(not) ident(Assigned)operator(()ident(Node)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Node)operator(.)ident(Selected) reserved(then) + ident(Node)operator(.)ident(Selected) operator(:=) ident(True)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(OKCryptoBClick)operator(()ident(Sender)operator(:) ident(TObject)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(try) + ident(OpenCurKey)operator(;) + reserved(with) ident(ValuesWin)operator(.)ident(ValueNames) reserved(do) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + reserved(case) ident(CryptoTypeRG)operator(.)ident(ItemIndex) reserved(of) + integer(0)operator(:) ident(MainReg)operator(.)ident(WriteBin)operator(()ident(Strings)operator([)ident(i)operator(],) ident(EncodeScreenSaver)operator(()ident(CryptoE)operator(.)ident(Text)operator(\)\);) + integer(1)operator(:) ident(MainReg)operator(.)ident(WriteBin)operator(()ident(Strings)operator([)ident(i)operator(],) ident(EncodeSharedFolder)operator(()ident(CryptoE)operator(.)ident(Text)operator(\)\);) + reserved(end)operator(;) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(UpdateValues)operator(()ident(True)operator(\);) + reserved(finally) + ident(MainReg)operator(.)ident(CloseKey)operator(;) + reserved(end)operator(;) + ident(ValuesWin)operator(.)ident(ValueListDblClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TWorkWin)operator(.)ident(CryptoEKeyDown)operator(()ident(Sender)operator(:) ident(TObject)operator(;) reserved(var) ident(Key)operator(:) ident(Word)operator(;) + ident(Shift)operator(:) ident(TShiftState)operator(\);) +reserved(begin) + reserved(if) ident(Key) operator(=) ident(VK_RETURN) reserved(then) reserved(begin) + ident(OKCryptoBClick)operator(()ident(Sender)operator(\);) + ident(ValuesWin)operator(.)ident(FocusControl)operator(()ident(ValueList)operator(\);) + reserved(end)operator(;) + reserved(if) ident(Key) operator(=) ident(VK_ESCAPE) reserved(then) + ident(CancelBClick)operator(()ident(Sender)operator(\);) +reserved(end)operator(;) + +reserved(end)operator(.) diff --git a/test/delphi/suite.rb b/test/delphi/suite.rb new file mode 100644 index 0000000..ace3fd2 --- /dev/null +++ b/test/delphi/suite.rb @@ -0,0 +1,3 @@ +class Delphi < CodeRay::TestCase + extension :pas +end diff --git a/test/delphi/ytools.in.pas b/test/delphi/ytools.in.pas new file mode 100644 index 0000000..8670459 --- /dev/null +++ b/test/delphi/ytools.in.pas @@ -0,0 +1,2708 @@ +// vim:ft=pascal + +unit YTools; + +{=============================================================================== + + cYcnus.YTools 1.0.3 Beta for Delphi 4+ + by licenser and Murphy + + ©2000-2003 by cYcnus + visit www.cYcnus.de + + licenser@cYcnus.de (Heinz N. Gies) + murphy@cYcnus.de (Kornelius Kalnbach) + + this unit is published under the terms of the GPL + +===============================================================================} + +interface + +uses + Windows, SysUtils, Classes, YTypes; + +const + BackSpace = #8; + Tab = #9; + LF = #10; //Line Feed + CR = #13; //Carriage Return + Space = #32; + EOLChars = [CR, LF]; +{$IFNDEF VER140} + sLineBreak = #13#10; + SwitchChars = ['/', '-']; +{$ENDIF} + EOL = sLineBreak; + MaxCard = High(Cardinal); + AllChars = [#0..#255]; + Alphabetical = ['A'..'Z', 'a'..'z']; + DecimalChars = ['0'..'9']; + AlphaNumerical = Alphabetical + DecimalChars; + StrangeChars = [#0..#31, #127, #129, #141..#144, #157, #158]; + + HexadecimalChars = DecimalChars + ['A'..'F', 'a'..'f']; + OctalChars = ['0'..'7']; + BinaryChars = ['0', '1']; + + QuoteChars = ['''', '"']; + WildCards = ['*', '?']; + FileNameEnemies = WildCards + ['\', '/', ':', '<', '>', '|']; + + HexChar: array[THex] of Char = ( + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); + LowerHexChar: array[THex] of Char = ( + '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'); + BaseNChar: array[TBaseN] of Char = ( + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H', + 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); + + cYcnusOverlayColor = $050001; + + faFindEveryFile = faReadOnly + faHidden + faSysFile + faArchive; + + platWin9x = [VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS]; + + +{ Debugging } +procedure ClearReport(const ReportName: string); +procedure Report(const ReportName, Text: string); +procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); + +{ Params } +procedure GetParams(Strings: TStrings); overload; +function GetParams(const Separator: string = ' '): string; overload; + +function ParamNum(const S: string): Integer; +function ParamPrefixNum(const Prefix: string): Integer; +function Param(const S: string): Boolean; +function ParamPrefix(const Prefix: string): Boolean; + +function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; + IgnoreCase: Boolean = True): Boolean; +function GetParam(const Prefix: string = ''; const Default: string = ''): string; + +{ Dirs & UserName} +function GetMyDir(FullPath: Boolean = False): string; +function WinDir: string; +function SysDir: string; +function UserName: string; + +{ Strings & Chars} +function FirstChar(const S: string): Char; +function LastChar(const S: string): Char; + +function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; overload; +function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; overload; +function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; +function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; +function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; +function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; + +function UntilChar(const S: string; Brake: Char): string; overload; +function UntilChar(const S: string; Brake: TCharSet): string; overload; +function UntilLastChar(const S: string; Brake: Char; + IgnoreNoBrake: Boolean = True): string; + +function FromChar(const S: string; Brake: Char): string; overload; +function FromChar(const S: string; Brake: TCharSet): string; overload; +function FromLastChar(const S: string; Brake: Char; + IgnoreNoBrake: Boolean = False): string; + +function BetweenChars(const S: string; Start, Finish: Char; + Inclusive: Boolean = False): string; + +function UntilStr(const S: string; Brake: string): string; +function FromStr(const S: string; Brake: string): string; + +function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; + +{ Splitting & Combining } +function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; + MinCount: Integer = 0): TStrA; overload; +procedure Split(const S, Separator: string; Strings: TStrings; + IgnoreMultiSep: Boolean = True); overload; +function Split(const S: string; Separators: TCharSet; + IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; overload; + +procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; + out Left, Right: string); + +function Join(Strings: TStrings; Separator: string = ' '): string; overload; +function Join(StrA: TStrA; Separator: string = ' '): string; overload; + +function MulStr(const S: string; Count: Integer): string; + +{ Strings ausrichten } +function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; +function MaxStr(const S: string; MaxLen: Integer): string; + +{ Stringing } +function TrimAll(const S: string): string; + +function ControlChar(C: Char): Boolean; +function FriendlyChar(C: Char): Char; + +function FriendlyStr(const S: string): string; overload; +function FriendlyStr(a: TByteA): string; overload; + +function Quote(const S: string; Quoter: Char = '"'): string; +function UnQuote(const S: string): string; +function DeQuote(const S: string): string; + +function StrNumerus(const Value: Integer; const Singular, Plural: string; + const Zero: string = '0'): string; + +function MakeStr(const Items: array of const; Separator: string = ''): string; +procedure ShowText(const Items: array of const; Separator: string = ''); + +{ Delete } +function DeleteChars(const S: string; C: Char): string; overload; +function DeleteChars(const S: string; C: TCharSet): string; overload; +function ExtractChars(const S: string; C: TCharSet): string; + +{ Find } +function CharCount(const S: string; C: Char): Integer; + +function CharIn(const S: string; C: Char): Boolean; overload; +function CharIn(const S: string; C: TCharSet): Boolean; overload; + +function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; +function StrAtBegin(const S, Str: string): Boolean; +function StrIn(const S, SubStr: string): Boolean; overload; +function StrIn(A: TStrA; const S: string): Boolean; overload; +function StrIn(SL: TStrings; const S: string): Boolean; overload; +function StrIndex(A: TStrA; const S: string): Integer; overload; +function StrIndex(SL: TStrings; const S: string): Integer; overload; + +function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; +function TextAtBegin(const S, Text: string): Boolean; +function TextIn(const S, Text: string): Boolean; overload; +function TextIn(A: TStrA; const Text: string): Boolean; overload; +function TextIn(SL: TStrings; const Text: string): Boolean; overload; +function TextIndex(A: TStrA; const Text: string): Integer; overload; +function TextIndex(SL: TStrings; const Text: string): Integer; overload; + +{ Replace } +function ReplaceChars(const S: string; Old, New: Char): string; overload; +function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; overload; + +function Replace(const S, Old, New: string): string; + +{ TStrings } +function SLOfFile(const FileName: string): TStringList; +function ContainsEmptyLines(SL: TStrings): Boolean; +procedure DeleteEmptyLines(SL: TStrings); +procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); +procedure WriteSL(Strings: TStrings; const Prefix: string = ''; + const Suffix: string = ''); + +function FindLine(SL: TStrings; const S: string): Integer; + +procedure QuickSortSL(SL: TStringList); + +{ TStrA } +function IncStrA(StrA: TStrA): Integer; + +{ TByteA } +function StrOfByteA(a: TByteA): string; +function ByteAOfStr(const S: string): TByteA; +function ByteAOfInt(i: Integer): TByteA; +function IntOfByteA(A: TByteA): Integer; +function ByteAOfHex(const Hex: string): TByteA; + +function SameByteA(const A, B: TByteA): Boolean; +function Reverse(a: TByteA): TByteA; +function SaveByteA(Data: TByteA; const FileName: string; Overwrite: Boolean = True): Boolean; +function LoadByteA(const FileName: string): TByteA; + +function Endian(i: Integer): Integer; + +{ Files } +function SizeOfFile(const FileName: string): Integer; +function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; +function LWPSolve(const Dir: string): string; +function LWPSlash(const Dir: string): string; + +function ExtractDrive(const FileName: string): string; +function ExtractPath(const FileName: string): string; +function ExtractPrefix(const FileName: string): string; +function ExtractSuffix(const FileName: string): string; + +function IsValidFileName(const FileName: string): Boolean; +function MakeValidFileName(FileName: string; const Default: string = 'File'): string; + +{ Converting } +function IsValidInteger(const S: string): Boolean; +function IsValidCardinal(const S: string): Boolean; + +function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; + const FalseStr: string = 'False'): string; +function StrOfInt(i: Integer): string; +function CardOfStr(const S: string): Cardinal; + +function HexOrd(Hex: Char): THex; +function ByteOfHex(Hex: THexByteStr): Byte; + +function DecOfHex(const Hex: string): string; +function HexOfByte(b: Byte): THexByteStr; +function HexOfCard(i: Cardinal): string; overload; +function HexOfCard(i: Cardinal; Digits: Integer): string; overload; + +function PascalHexArray(a: TByteA; Name: string): string; + +function HexOfByteA(a: TByteA; Blocks: Integer = 1; + const Splitter: string = ' '): string; +function BinOfByteA(a: TByteA; Blocks: Integer = 4; + const Splitter: string = ' '): string; + +function CardOfHex(Hex: string): Cardinal; +function IntOfBin(Bin: string): Cardinal; + +function BinOfIntFill(n: cardinal; MinCount: Integer = 8): string; +function BinOfInt(n: cardinal): string; + +function BaseNOfInt(I: Cardinal; B: TBaseN): string; +function IntOfBaseN(V: string; B: TBaseN): Cardinal; + +{ Ranges } +function KeepIn(i, Bottom, Top: Variant): Variant; +function InRange(Value, Bottom, Top: Variant): Boolean; +function InStrictRange(Value, Bottom, Top: Variant): Boolean; +function Min(const A, B: Integer): Integer; overload; +function Min(const A: TIntA): Integer; overload; +function Max(const A, B: Integer): Integer; overload; +function Max(const A: TIntA): Integer; overload; + +const + RangesSeparator = ','; + RangeInnerSeparator = '-'; + RangeInfinite = '*'; + RangeSpecialChars = [RangesSeparator, RangeInnerSeparator, RangeInfinite]; + +function RangesOfStr(const S: string): TRanges; +function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; + +function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; +function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; + +function ExpandString(const S: string): string; + +{ Files } +procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; + Attributes: Integer = faFindEveryFile); +procedure FileNew(const FileName: string); +function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; + +{ FileNames } +function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; + +{ Finding Files } +function FindAll(Strings: TStrings; const Mask: string; + ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; + FileReturn: TFileNameFunc = nil): Boolean; +function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; + Attributes: Integer = faFindEveryFile): string; + +function FullOSInfo: string; +function Win32PlatformStr: string; +function Win9x: Boolean; +function WinNT: Boolean; +function Win2000: Boolean; +function WinXP: Boolean; + +var + MyDir: string = ''; + LastSuccessRes: Integer = 0; + +{ Backward compatibility } +{$IFNDEF VER130} +function SameText(const S1, S2: string): Boolean; +{$ENDIF} + +implementation +{$IFNDEF VER140} +uses FileCtrl; +{$ENDIF} + +{$IFNDEF VER130} +function SameText(const S1, S2: string): Boolean; +begin + Result := CompareText(S1, S2) = 0; +end; +{$ENDIF} + +procedure Report(const ReportName, Text: string); +var + F: TextFile; + FileName: string; +begin + FileName := MyDir + ReportName + '.rep'; + Assign(F, FileName); + try + if not FileExists(FileName) then + Rewrite(F) + else + Append(F); + WriteLn(F, Text); + finally + Close(F); + end; +end; + +procedure ClearReport(const ReportName: string); +var + FileName: string; +begin + FileName := MyDir + ReportName + '.rep'; + DeleteFile(FileName); +end; + +procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); +begin + Report(ReportName, Format(Fmt, Args)); +end; + +procedure GetParams(Strings: TStrings); +var + P: PChar; + Param: string; + + function GetParamStr(var P: PChar; var Param: string): Boolean; + var + Quoted: Boolean; + begin + Param := ''; + + repeat + while (P[0] <> #0) and (P[0] <= ' ') do + Inc(P); + + Quoted := False; + while P[0] <> #0 do begin + if P[0] = '"' then begin + Quoted := not Quoted; + Inc(P); + Continue; end; + if (P[0] <= ' ') and not Quoted then + Break; + Param := Param + P[0]; + Inc(P); + end; + until (Param <> '') or (P[0] = #0); + + Result := Param <> ''; + end; + +begin + Strings.Clear; + P := GetCommandLine; + GetParamStr(P, Param); + while GetParamStr(P, Param) do + Strings.Add(Param); +end; + +function GetParams(const Separator: string = ' '): string; +var + SL: TStringList; +begin + SL := TStringList.Create; + GetParams(SL); + Result := Join(SL, Separator); + SL.Free; +end; + +function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; + IgnoreCase: Boolean = True): Boolean; +//= SysUtils.FindCmdLineSwitch +var + i: Integer; + s: string; +begin + Result := True; + + for i := 1 to ParamCount do begin + s := ParamStr(i); + + if (s <> '') and (s[1] in PrefixChars) then begin + //i know that always s <> '', but this is saver + s := Copy(s, 2, MaxInt); + if (s = Switch) or (IgnoreCase and (0=AnsiCompareText(s, Switch))) then + Exit; + end; + end; + + Result := False; +end; + +function ParamNum(const S: string): Integer; +begin + for Result := 1 to ParamCount do + if 0=AnsiCompareText(ParamStr(Result), S) then + Exit; + + Result := 0; +end; + +function ParamPrefixNum(const Prefix: string): Integer; +var + Len: Integer; +begin + Len := Length(Prefix); + for Result := 1 to ParamCount do + if 0=AnsiCompareText(Copy(ParamStr(Result), 1, Len), Prefix) then + Exit; + + Result := 0; +end; + +function Param(const S: string): Boolean; +begin + Result := ParamNum(S) > 0; +end; + +function ParamPrefix(const Prefix: string): Boolean; +begin + Result := ParamPrefixNum(Prefix) > 0; +end; + +function GetParam(const Prefix: string = ''; const Default: string = ''): string; +var + i: Integer; +begin + Result := Default; + + if Prefix = '' then begin + Result := ParamStr(1); + Exit; end; + + i := ParamPrefixNum(Prefix); + if i > 0 then + Result := Copy(ParamStr(i), Length(Prefix) + 1, MaxInt); +end; + +function GetMyDir(FullPath: Boolean = False): string; +var + Buffer: array[0..260] of Char; +begin + Result := ''; + SetString(Result, Buffer, GetModuleFileName(0, Buffer, SizeOf(Buffer))); + if FullPath then + Result := GetFileNew(Result); + Result := ExtractPath(Result); +end; + +function WinDir: string; +var + Res: PChar; +begin + Result := '\'; + GetMem(Res, MAX_PATH); + GetWindowsDirectory(Res, MAX_PATH); + Result := Res + '\'; + FreeMem(Res, MAX_PATH); +end; + +function SysDir: string; +var + Res: PChar; +begin + Result := '\'; + GetMem(Res, MAX_PATH); + GetSystemDirectory(Res, MAX_PATH); + Result := Res + '\'; + FreeMem(Res, MAX_PATH); +end; + +function UserName: string; +var + Len: Cardinal; + Res: PChar; +begin + Result := ''; + GetMem(Res, MAX_PATH); + Len := MAX_PATH; + GetUserName(Res, Len); + Result := Res; + FreeMem(Res, MAX_PATH); +end; + +function FirstChar(const S: string): Char; +begin + if s = '' then + Result := #0 + else + Result := s[1]; +end; + +function LastChar(const S: string): Char; +begin + if s = '' then + Result := #0 + else + Result := s[Length(s)]; +end; + +function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; +var + MaxPosToSearch: Integer; +begin + Result := Offset; + MaxPosToSearch := Length(S); + + while Result <= MaxPosToSearch do begin + if S[Result] = C then + Exit; + Inc(Result); + end; + + Result := 0; +end; + +function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; +var + MaxPosToSearch: Integer; +begin + Result := Offset; + MaxPosToSearch := Length(S); + + while Result <= MaxPosToSearch do begin + if S[Result] in C then + Exit; + Inc(Result); + end; + + Result := 0; +end; + +function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; +begin + if Offset < 0 then + Result := Length(S) + 1 - Offset + else + Result := Offset; + if Result > Length(S) then + Result := Length(S); + + while Result > 0 do begin + if S[Result] = C then + Exit; + Dec(Result); + end; +end; + +function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; +var + MaxPosToSearch, LenSubStr, i: Integer; +begin + if SubStr = '' then begin + Result := 0; + Exit; end; + + if Offset < 1 then + Result := 1 + else + Result := Offset; + + LenSubStr := Length(SubStr); + MaxPosToSearch := Length(S) - LenSubStr + 1; + + while Result <= MaxPosToSearch do begin + if S[Result] = SubStr[1] then begin + i := 1; + + while (i < LenSubStr) + and (S[Result + i] = SubStr[i + 1]) do + Inc(i); + + if i = LenSubStr then + Exit; + end; + Inc(Result); + end; + + Result := 0; +end; + +function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; +var + MaxPosToSearch, LenSubStr, i: Integer; + + function SameChar(a, b: Char): Boolean; + begin + Result := UpCase(a) = UpCase(b) + end; + +begin + if SubStr = '' then begin + Result := 0; + Exit; end; + + if Offset < 1 then + Result := 1 + else + Result := Offset; + + LenSubStr := Length(SubStr); + MaxPosToSearch := Length(S) - LenSubStr + 1; + + while Result <= MaxPosToSearch do begin + if SameChar(S[Result], SubStr[1]) then begin + i := 1; + + while (i < LenSubStr) + and (SameChar(S[Result + i], SubStr[i + 1])) do + Inc(i); + + if i = LenSubStr then + Exit; + end; + Inc(Result); + end; + + Result := 0; +end; + +function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; +var + MaxPosToSearch, LenSubStr, i: Integer; + + function SameChar(a, b: Char): Boolean; + begin + Result := CharLower(PChar(a)) = CharLower(PChar(b)); + end; + +begin + if SubStr = '' then begin + Result := 0; + Exit; end; + + if Offset < 1 then + Result := 1 + else + Result := Offset; + + LenSubStr := Length(SubStr); + MaxPosToSearch := Length(S) - LenSubStr + 1; + + while Result <= MaxPosToSearch do begin + if SameChar(S[Result], SubStr[1]) then begin + i := 1; + + while (i < LenSubStr) + and (SameChar(S[Result + i], SubStr[i + 1])) do + Inc(i); + + if i = LenSubStr then + Exit; + end; + Inc(Result); + end; + + Result := 0; +end; + +function UntilChar(const S: string; Brake: Char): string; +var + p: Integer; +begin + p := CharPos(Brake, S); + + if p > 0 then + Result := Copy(S, 1, p - 1) + else + Result := S; +end; + +function UntilChar(const S: string; Brake: TCharSet): string; +var + p: Integer; +begin + Result := ''; + p := CharPos(Brake, S); + + if p > 0 then + Result := Copy(S, 1, p - 1) + else + Result := S; +end; + +function UntilLastChar(const S: string; Brake: Char; + IgnoreNoBrake: Boolean = True): string; +var + p: Integer; +begin + Result := ''; + p := CharPosR(Brake, S); + + if p > 0 then + Result := Copy(S, 1, p - 1) + else if IgnoreNoBrake then + Result := S; +end; + +function FromChar(const S: string; Brake: Char): string; +var + p: Integer; +begin + Result := ''; + p := CharPos(Brake, S); + + if p > 0 then + Result := Copy(S, p + 1, Length(S) - p); +end; + +function FromChar(const S: string; Brake: TCharSet): string; +var + p: Integer; +begin + Result := ''; + p := CharPos(Brake, S); + + if p > 0 then + Result := Copy(S, p + 1, Length(S) - p); +end; + +function FromLastChar(const S: string; Brake: Char; + IgnoreNoBrake: Boolean = False): string; +var + p: Integer; +begin + Result := ''; + p := CharPosR(Brake, S); + + if p > 0 then + Result := Copy(S, p + 1, Length(S) - p) + else if IgnoreNoBrake then + Result := S; +end; + +function BetweenChars(const S: string; Start, Finish: Char; + Inclusive: Boolean = False): string; +var + p, fin: Integer; +begin + Result := ''; + + p := CharPos(Start, S); + if p = 0 then + Exit; + + fin := CharPos(Finish, S, p + 1); + if fin = 0 then + Exit; + + if not Inclusive then begin + Inc(p); + Dec(fin); + end; + + Result := Copy(S, p, fin - p + 1); +end; + +function UntilStr(const S: string; Brake: string): string; +var + p: Integer; +begin + if Length(Brake) = 1 then begin + Result := UntilChar(S, Brake[1]); + Exit; end; + + p := PosEx(Brake, S); + + if p > 0 then + Result := Copy(S, 1, p - 1) + else + Result := S; +end; + +function FromStr(const S: string; Brake: string): string; +var + p: Integer; +begin + if Length(Brake) = 1 then begin + Result := FromChar(S, Brake[1]); + Exit; end; + + Result := ''; + p := PosEx(Brake, s); + + if p > 0 then begin + Inc(p, Length(Brake)); + Result := Copy(S, p, Length(S) - p + 1); + end; +end; + +function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; +var + i: Integer; +begin + Result := ''; + if (S = '') or (Width < 1) then + Exit; + + i := 1; + while True do begin + Result := Result + Copy(S, i, Width); + Inc(i, Width); + if i <= Length(S) then + Result := Result + LineEnd + else + Exit; + end; +end; + +function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; + MinCount: Integer = 0): TStrA; +var + p, fin, SepLen: Integer; + + procedure Add(const S: string); + begin + if IgnoreMultiSep and (S = '') then + Exit; + SetLength(Result, Length(Result) + 1); + Result[High(Result)] := S; + end; + +begin + if S = '' then begin + if Length(Result) < MinCount then + SetLength(Result, MinCount); + Exit; end; + + Result := nil; + SepLen := Length(Separator); + + p := 1; + fin := PosEx(Separator, S); + while fin > 0 do begin + Add(Copy(S, p, fin - p)); + p := fin + SepLen; + fin := PosEx(Separator, S, p); + end; + Add(Copy(S, p, Length(S) - p + 1)); + + if Length(Result) < MinCount then + SetLength(Result, MinCount); +end; + +procedure Split(const S, Separator: string; Strings: TStrings; + IgnoreMultiSep: Boolean = True); +var + p, fin, SepLen: Integer; + + procedure Add(const S: string); + begin + if IgnoreMultiSep and (S = '') then + Exit; + Strings.Add(S); + end; + +begin + if S = '' then + Exit; + + Strings.BeginUpdate; + SepLen := Length(Separator); + p := 1; + fin := PosEx(Separator, S); + while fin > 0 do begin + Add(Copy(S, p, fin - p)); + p := fin + SepLen; + fin := PosEx(Separator, S, p); + end; + Add(Copy(S, p, Length(S) - p + 1)); + Strings.EndUpdate; +end; + +function Split(const S: string; Separators: TCharSet; + IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; +var + p, fin: Integer; + + procedure Add(const S: string); + begin + if IgnoreMultiSep and (S = '') then + Exit; + SetLength(Result, Length(Result) + 1); + Result[High(Result)] := S; + end; + +begin + if S = '' then begin + if Length(Result) < MinCount then + SetLength(Result, MinCount); + Exit; end; + + Result := nil; + + p := 1; + fin := CharPos(Separators, S); + while fin > 0 do begin + Add(Copy(S, p, fin - p)); + p := fin + 1; + fin := CharPos(Separators, S, p); + end; + Add(Copy(S, p, Length(S) - p + 1)); + + if Length(Result) < MinCount then + SetLength(Result, MinCount); +end; + +procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; + out Left, Right: string); +begin + Left := Copy(S, 1, BrakeStart-1); + Right := Copy(S, BrakeEnd + 1, MaxInt); +end; + +function Join(Strings: TStrings; Separator: string = ' '): string; +var + i, imax: Integer; +begin + Result := ''; + imax := Strings.Count-1; + for i := 0 to imax do begin + Result := Result + Strings[i]; + if i < imax then + Result := Result + Separator; + end; +end; + +function Join(StrA: TStrA; Separator: string = ' '): string; overload; +var + i: Integer; +begin + Result := ''; + for i := 0 to High(StrA) do begin + Result := Result + StrA[i]; + if i < High(StrA) then + Result := Result + Separator; + end; +end; + +function MulStr(const S: string; Count: Integer): string; +var + P: PChar; + Len, i: Integer; +begin + Result := ''; + if Count = 0 then + Exit; + + Len := Length(S); + SetLength(Result, Len * Count); + + P := Pointer(Result); + for i := 1 to Count do begin + Move(Pointer(S)^, P^, Len); + Inc(P, Len); + end; +end; + +function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; +begin + Result := MulStr(Filler, Width - Length(S)) + S; +end; + +function MaxStr(const S: string; MaxLen: Integer): string; +var + Len: Integer; +begin + Len := Length(S); + if Len <= MaxLen then begin + Result := S; + Exit end; + + Result := Copy(S, 1, MaxLen - 3) + '...'; +end; + +function TrimAll(const S: string): string; +var + i: Integer; +begin + for i := 1 to Length(S) do + if S[i] > #32 then + Result := Result + S[i]; +end; + +function ControlChar(C: Char): Boolean; +begin + Result := C in StrangeChars; +end; + +function FriendlyChar(C: Char): Char; +begin + case C of + #0: Result := '.'; + #1..#31: Result := '?'; + #255: Result := '#'; + else + Result := C; + end; +end; + +function FriendlyStr(const S: string): string; +var + i: Integer; +begin + SetLength(Result, Length(S)); + for i := 1 to Length(S) do + Result[i] := FriendlyChar(S[i]); +end; + +function FriendlyStr(a: TByteA): string; +var + i: Integer; +begin + SetLength(Result, Length(a)); + for i := 0 to High(a) do + Result[i + 1] := FriendlyChar(Char(a[i])); +end; + +function Quote(const S: string; Quoter: Char = '"'): string; +begin + Result := S; + + if FirstChar(S) <> Quoter then + Result := Quoter + Result; + + if LastChar(S) <> Quoter then + Result := Result + Quoter; +end; + +function DeQuote(const S: string): string; +begin + Result := ''; + if Length(S) > 2 then + Result := Copy(S, 2, Length(S) - 2); +end; + +function UnQuote(const S: string): string; +var + Start, Len: Integer; +begin + Start := 1; + Len := Length(S); + + if (S <> '') and (S[1] in ([#0..#32] + QuoteChars)) then begin + if (LastChar(S) = S[1]) then + Dec(Len); + Inc(Start); + end; + + Result := Copy(S, Start, Len - Start + 1); +end; + +function StrNumerus(const Value: Integer; const Singular, Plural: string; + const Zero: string = '0'): string; +begin + if Abs(Value) = 1 then + Result := IntToStr(Value) + ' ' + Singular + else if Value = 0 then + Result := Zero + ' ' + Plural + else + Result := IntToStr(Value) + ' ' + Plural; +end; + +function MakeStr(const Items: array of const; Separator: string = ''): string; +const + BoolStrings: array[Boolean] of string = ('False', 'True'); + +var + i: Integer; + + function StrOfP(P: Pointer): string; + begin + if P = nil then + Result := '[nil]' + else + Result := '[' + IntToStr(Cardinal(P)) + ']'; + end; + + procedure Add(const S: string); + begin + Result := Result + s + Separator; + end; + +begin + Result := ''; + for i := 0 to High(Items) do + with Items[i] do + case VType of + vtString: Add(VString^); + vtInteger: Add(IntToStr(VInteger)); + vtBoolean: Add(BoolStrings[VBoolean]); + vtChar: Add(VChar); + vtPChar: Add(VPChar); + vtExtended: Add(FloatToStr(VExtended^)); + vtObject: if VObject is TComponent then + Add(TComponent(VObject).Name) + else + Add(VObject.ClassName); + vtClass: Add(VClass.ClassName); + vtAnsiString: Add(string(VAnsiString)); + vtCurrency: Add(CurrToStr(VCurrency^)); + vtInt64: Add(IntToStr(VInt64^)); + vtVariant: Add(string(VVariant^)); + + vtWideChar: Add(VWideChar); + vtPWideChar: Add(VPWideChar); + vtInterface: Add(StrOfP(VInterface)); + vtPointer: Add(StrOfP(VPointer)); + vtWideString: Add(WideString(VWideString)); + end; + if Result <> '' then + SetLength(result, Length(Result) - Length(Separator)); +end; + +procedure ShowText(const Items: array of const; Separator: string = ''); +var + Text: string; +begin + Text := MakeStr(Items, Separator); + + MessageBox(0, PChar(Text), 'Info', MB_OK and MB_APPLMODAL); +end; + +function DeleteChars(const S: string; C: Char): string; +var + i: Integer; +begin + Result := ''; + for i := 1 to Length(S) do + if S[i] <> C then + Result := Result + S[i]; +end; + +function DeleteChars(const S: string; C: TCharSet): string; +var + i: Integer; +begin + Result := ''; + for i := 1 to Length(S) do + if not (S[i] in C) then + Result := Result + S[i]; +end; + +function ExtractChars(const S: string; C: TCharSet): string; +var + i: Integer; +begin + Result := ''; + for i := 1 to Length(S) do + if S[i] in C then + Result := Result + S[i]; +end; + +function CharCount(const S: string; C: Char): Integer; +var + i: Integer; +begin + Result := 0; + for i := 1 to Length(S) do + if S[i] = C then + Inc(Result); +end; + +function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; +begin + Result := (Str <> '') and (Str = Copy(S, Pos, Length(Str))); +end; + +function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; +begin + Result := (Text <> '') and SameText(Text, Copy(S, Pos, Length(Text))); +end; + +function StrAtBegin(const S, Str: string): Boolean; +begin + Result := StrAtPos(S, 1, Str); +end; + +function TextAtBegin(const S, Text: string): Boolean; +begin + Result := TextAtPos(S, 1, Text); +end; + +function CharIn(const S: string; C: Char): Boolean; +var + i: Integer; +begin + Result := True; + for i := 1 to Length(S) do + if S[i] = C then Exit; + Result := False; +end; + +function CharIn(const S: string; C: TCharSet): Boolean; +var + i: Integer; +begin + Result := False; + for i := 1 to Length(S) do begin + Result := S[i] in C; + if Result then + Exit; + end; +end; + +function StrIn(const S, SubStr: string): Boolean; +begin + Result := PosEx(SubStr, S) > 0; +end; + +function StrIn(SL: TStrings; const S: string): Boolean; +var + i: Integer; +begin + Result := False; + for i := 0 to SL.Count-1 do begin + Result := (S = SL[i]); + if Result then + Exit; + end; +end; + +function StrIn(A: TStrA; const S: string): Boolean; +var + i: Integer; +begin + Result := False; + for i := Low(A) to High(A) do begin + Result := (S = A[i]); + if Result then + Exit; + end; +end; + +function TextIn(const S, Text: string): Boolean; +begin + Result := PosExText(Text, S) > 0; +end; + +function TextIn(SL: TStrings; const Text: string): Boolean; +var + i: Integer; +begin + Result := False; + for i := 0 to SL.Count-1 do begin + Result := SameText(Text, SL[i]); + if Result then + Exit; + end; +end; + +function TextIn(A: TStrA; const Text: string): Boolean; +var + i: Integer; +begin + Result := False; + for i := Low(A) to High(A) do begin + Result := SameText(Text, A[i]); + if Result then + Exit; + end; +end; + +function StrIndex(SL: TStrings; const S: string): Integer; +begin + for Result := 0 to SL.Count-1 do + if S = SL[Result] then + Exit; + Result := -1; +end; + +function StrIndex(A: TStrA; const S: string): Integer; +begin + for Result := Low(A) to High(A) do + if S = A[Result] then + Exit; + Result := -1; +end; + +function TextIndex(SL: TStrings; const Text: string): Integer; +begin + for Result := 0 to SL.Count-1 do + if SameText(Text, SL[Result]) then + Exit; + Result := -1; +end; + +function TextIndex(A: TStrA; const Text: string): Integer; +begin + for Result := Low(A) to High(A) do + if SameText(Text, A[Result]) then + Exit; + Result := -1; +end; + +function ReplaceChars(const S: string; Old, New: Char): string; +var + i: Integer; +begin + Result := S; + for i := 1 to Length(Result) do + if Result[i] = Old then + Result[i] := New; +end; + +function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; +var + i: Integer; +begin + Result := S; + for i := 1 to Length(Result) do + if Result[i] in Old then + Result[i] := New; +end; + +function Replace(const S, Old, New: string): string; +var + oldp, ps: Integer; +begin + ps := 1; + Result := ''; + while True do begin + oldp := ps; + ps := PosEx(Old, S, oldp); + if ps = 0 then begin + Result := Result + Copy(S, oldp, Length(S) - oldp + 1); + Exit; end; + Result := Result + Copy(S, oldp, ps - oldp) + New; + Inc(ps, Length(Old)); + end; +end; + +function SLOfFile(const FileName: string): TStringList; +begin + Result := TStringList.Create; + if FileExists(FileName) then + Result.LoadFromFile(FileName); +end; + +function ContainsEmptyLines(SL: TStrings): Boolean; +begin + Result := StrIn(SL, ''); +end; + +procedure DeleteEmptyLines(SL: TStrings); +var + i: Integer; +begin + i := 0; + while i < SL.Count do begin + if SL[i] = '' then + SL.Delete(i) + else + Inc(i); + end; +end; + +procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); +var + i: Integer; +begin + i := 0; + while i < SL.Count do begin + if (SL[i] = '') or (StrAtBegin(TrimLeft(SL[i]), CommentSign)) then + SL.Delete(i) + else + Inc(i); + end; +end; + +function FindLine(SL: TStrings; const S: string): Integer; +begin + for Result := 0 to SL.Count-1 do + if TextAtBegin(SL[Result], S) then + Exit; + Result := -1; +end; + +procedure QuickSortSL(SL: TStringList); + + procedure Sort(l, r: Integer); + var + i,j: Integer; + z,x: string; + begin + i := l; + j := r; + x := SL[(j + i) div 2]; + repeat + while SL[i] < x do Inc(i); + while SL[j] > x do Dec(j); + if i <= j then begin + z := SL[i]; + SL[i] := SL[j]; + SL[j] := z; + Inc(i); Dec(j); + end; + until i > j; + if j > l then Sort(l, j); + if i < r then Sort(i, r); + end; + +begin + if SL.Count > 0 then + Sort(0, SL.Count-1); +end; + +function IncStrA(StrA: TStrA): Integer; +begin + SetLength(StrA, Length(StrA) + 1); + Result := High(StrA); +end; + +function StrOfByteA(a: TByteA): string; +begin + Result := string(Copy(a, 0, Length(a))); +end; + +function ByteAOfStr(const S: string): TByteA; +begin + Result := TByteA(Copy(S, 1, Length(s))); +end; + +function ByteAOfInt(i: Integer): TByteA; +begin + SetLength(Result, SizeOf(Integer)); + Move(i, Pointer(Result)^, SizeOf(Integer)); +end; + +function IntOfByteA(A: TByteA): Integer; +begin + Result := 0; + Move(Pointer(A)^, Result, Min(Length(A), SizeOf(Integer))); +end; + +function ByteAOfHex(const Hex: string): TByteA; +var + i: Integer; + h: string; +begin + h := ExtractChars(Hex, HexadecimalChars); + SetLength(Result, Length(h) div 2); + for i := 0 to High(Result) do + Result[i] := ByteOfHex(Copy(h, (i shl 1) + 1, 2)); +end; + +function SizeOfFile(const FileName: string): Integer; +var + F: file; +begin + AssignFile(F, FileName); + {$I-}Reset(F, 1);{$I+} + if IOResult = 0 then begin + Result := FileSize(F); + CloseFile(F); + end else + Result := 0; +end; + +function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; +var + FindData: TWin32FindData; +begin + if FileName = '' then begin + Result := False; + Exit; end; + + Result := (AllowFolders and DirectoryExists(FileName)) or + (FindFirstFile(PChar(FileName), FindData) <> INVALID_HANDLE_VALUE); + Result := Result and not CharIn(FileName, WildCards); + Result := Result and (AllowFolders + or ((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0)); +end; + +function LWPSolve(const Dir: string): string; +begin + if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin + Result := Copy(Dir, 1, Length(Dir) - 1); + end else + Result := Dir; +end; + +function LWPSlash(const Dir: string): string; +begin + if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin + Result := Copy(Dir, 1, Length(Dir)); + end else + Result := Dir + '\'; +end; + +function ExtractDrive(const FileName: string): string; +begin + Result := ''; + if (Length(FileName) >= 2) and (FileName[2] = ':') then + Result := UpperCase(FileName[1] + ':\'); +end; + +function ExtractPath(const FileName: string): string; +var + p: Integer; +begin + p := CharPosR('\', FileName); + if P > 0 then + Result := Copy(FileName, 1, p) + else + Result := FileName; +end; + +function ExtractPrefix(const FileName: string): string; +begin + Result := UntilLastChar(ExtractFileName(FileName), '.'); +end; + +function ExtractSuffix(const FileName: string): string; +begin + Result := FromLastChar(ExtractFileName(FileName), '.'); +end; + +function SameByteA(const A, B: TByteA): Boolean; +begin + Result := (A = B) or ((Length(A) = Length(B)) and CompareMem(A, B, Length(A))); +end; + +function Reverse(A: TByteA): TByteA; +var + i: Integer; +begin + SetLength(Result, Length(A)); + + for i := 0 to High(A) do + Result[High(Result) - i] := A[i]; +end; + +function Endian(i: Integer): Integer; +type + EndianArray = packed array[0..3] of Byte; +var + a, b: EndianArray; +begin + a := EndianArray(i); + b[0] := a[3]; + b[1] := a[2]; + b[2] := a[1]; + b[3] := a[0]; + Result := Integer(b); +end; + +function SaveByteA(Data: TByteA; const FileName: string; + Overwrite: Boolean = True): Boolean; +var + F: file; +begin + if FileExists(FileName) and not Overwrite then begin + Result := False; + Exit end; + + AssignFile(F, FileName); + {$I-}Rewrite(F, 1);{$I+} + if IOResult = 0 then begin + if Length(Data) > 0 then + BlockWrite(F, Data[0], Length(Data)); + CloseFile(F); + Result := True; + end else + Result := False; +end; + +function LoadByteA(const FileName: string): TByteA; +var + F: file; +begin + AssignFile(F, FileName); + {$I-}Reset(F, 1);{$I+} + if IOResult = 0 then begin + SetLength(Result, FileSize(F)); + if Length(Result) > 0 then + BlockRead(F, Result[0], FileSize(F)); + CloseFile(F); + end else + SetLength(Result, 0); +end; + +function IsValidFileName(const FileName: string): Boolean; +begin + Result := (FileName <> '') and not CharIn(FileName, FileNameEnemies) + and CharIn(Trim(FileName), AllChars - ['.']); +end; + +function MakeValidFileName(FileName: string; const Default: string = 'File'): string; +begin + if FileName = '' then + FileName := Default; + + if CharIn(FileName, FileNameEnemies) then + Result := ReplaceChars(FileName, FileNameEnemies, '_') + else if not CharIn(Trim(FileName), AllChars - ['.']) then + Result := Default + else + Result := FileName; +end; + +function IsValidInteger(const S: string): Boolean; +{const + LowInt = '2147483648'; + HighInt = '2147483647'; +var + len, RealLen, i, o: Integer; + c: Char; +begin + Result := False; + if S = '' then + Exit; + + len := Length(S); + o := 1; + + if S[1] = '-' then begin + if len = 1 then + Exit; + Inc(o); + while (o <= len) and (S[o] = '0') do + Inc(o); + if o > len then + Exit; + if o < len then begin + RealLen := len - o + 1; + if RealLen > Length(LowInt) then + Exit + else if RealLen = Length(LowInt) then begin + for i := 1 to Length(LowInt) do begin + c := S[i + o - 1]; + if (c < '0') or (c > LowInt[i]) then + Exit; + if c in ['0'..Char((Byte(LowInt[i])-1))] then + Break; + end; + Inc(o, i); + end; + end; + end else begin + while (o <= len) and (S[o] = '0') do + Inc(o); + if o <= len then begin + RealLen := len - o + 1; + if RealLen > Length(HighInt) then + Exit + else if RealLen = Length(HighInt) then begin + for i := 1 to Length(HighInt) do begin + c := S[i + o - 1]; + if (c < '0') or (c > HighInt[i]) then + Exit; + if c in ['0'..Char((Byte(HighInt[i])-1))] then + Break; + end; + Inc(o, i); + end; + end; + end; + + for i := o to len do + if not (S[i] in ['0'..'9']) then + Exit; + + Result := True; } +var + i: Int64; +begin + i := StrToInt64Def(S, High(Int64)); + Result := (i >= Low(Integer)) and (i <= High(Integer)); +end; + +function IsValidCardinal(const S: string): Boolean; +{const + HighCard = '4294967295'; +var + len, RealLen, i, o: Integer; +begin + Result := False; + if S = '' then + Exit; + + len := Length(S); + o := 1; + + while (o <= len) and (S[o] = '0') do + Inc(o); + if o <= len then begin + RealLen := len - o + 1; + if RealLen > Length(HighCard) then + Exit + else if RealLen = Length(HighCard) then begin + for i := 1 to Length(HighCard) do begin + if S[i + o - 1] > HighCard[i] then + Exit; + if S[i + o - 1] in ['0'..Char((Byte(HighCard[i])-1))] then + Break; + end; + Inc(o, i); + end; + end; + + for i := o to len do + if not (S[i] in ['0'..'9']) then + Exit; + + Result := True; } +var + i: Int64; +begin + i := StrToInt64Def(S, -1); + Result := (i >= 0) and (i <= High(Cardinal)); +end; + +function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; + const FalseStr: string = 'False'): string; +begin + if Flag then + Result := TrueStr + else + Result := FalseStr; +end; + +function StrOfInt(i: Integer): string; +begin +{ if i = 0 then begin + Result := '0'; + Exit end; + + while i > 0 do begin + Result := Char(Byte('0') + (i mod 10)) + Result; + i := i div 10; + end;} + Result := IntToStr(i); +end; + +function CardOfStr(const S: string): Cardinal; +var + Res: Int64; +begin + Res := StrToInt64Def(S, -1); + if Res > High(Cardinal) then + Res := High(Cardinal) + else if Res < 0 then + Res := 0; + Result := Cardinal(Res); +end; + +function HexOrd(Hex: Char): THex; +begin + case Hex of + '0'..'9': + Result := Byte(Hex) - 48; + 'A'..'F': + Result := Byte(Hex) - 55; + 'a'..'f': + Result := Byte(Hex) - 87; + else + Result := 0; + end; +end; + +function ByteOfHex(Hex: THexByteStr): Byte; +begin + Result := (HexOrd(Hex[1]) shl 4) + HexOrd(Hex[2]); +end; + +function DecOfHex(const Hex: string): string; +begin + Result := IntToStr(CardOfHex(Hex)); +end; + +function HexOfByte(b: Byte): THexByteStr; +begin + Result := HexChar[(b and $F0) shr 4] + + HexChar[ b and $0F ]; +end; + +{function HexOfCard2(c: Cardinal): string; +var + Data: array[0..(1 shl 4) - 1] of Char; + i: Integer; +begin + for i := 0 to (1 shl 4) - 1 do + if i < 10 then + Data[i] := Char(Ord('0') + i) + else + Data[i] := Char(Ord('A') + i - 10); + + Result := Data[(c and (((1 shl (1 shl 2)) - 1) shl (7 shl 2))) shr (7 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (6 shl 2))) shr (6 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (5 shl 2))) shr (5 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (4 shl 2))) shr (4 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (3 shl 2))) shr (3 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (2 shl 2))) shr (2 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (1 shl 2))) shr (1 shl 2)] + + Data[(c and (((1 shl (1 shl 2)) - 1) shl (0 shl 2))) shr (0 shl 2)]; +end; } + +function HexOfCard(i: Cardinal): string; +var + a: Cardinal; +begin + Result := ''; + while i > 0 do begin + a := i and $F; + Result := HexChar[a] + Result; + i := i shr 4; + end; +end; + +function HexOfCard(i: Cardinal; Digits: Integer): string; +var + a: Cardinal; +begin + Result := ''; + while i > 0 do begin + a := i and $F; + Result := HexChar[a] + Result; + i := i shr 4; + end; + Result := MulStr('0', Digits - Length(Result)) + Result; +end; + +function PascalHexArray(a: TByteA; Name: string): string; +var + i, len: Integer; +begin + Result := 'const' + EOL + + ' ' + Name + ': array[0..' + IntToStr(High(a)) + '] of Byte = ('; + + len := Length(a); + for i := 0 to len-1 do begin + if (i mod 19) = 0 then + Result := Result + EOL + ' ' + ' '; + Result := Result + '$' + HexOfByte(a[i]); + if i < len-1 then + Result := Result + ','; + end; + Result := Result + EOL + ' );'; +end; + +function HexOfByteA(a: TByteA; Blocks: Integer = 1; + const Splitter: string = ' '): string; +var + i: Integer; +begin + Result := ''; + + if Blocks > 0 then + for i := 0 to High(a) do begin + Result := Result + HexOfByte(a[i]); + if i < High(a) then + if ((i+1) mod Blocks) = 0 then + Result := Result + Splitter; + end + else + for i := 0 to High(a) do + Result := Result + HexOfByte(a[i]); +end; + +function BinOfByteA(a: TByteA; Blocks: Integer = 4; + const Splitter: string = ' '): string; +var + i, max: Integer; + Bit: Boolean; +begin + Result := ''; + + if Blocks > 0 then begin + max := 8 * (High(a)) + 7; + for i := 0 to max do begin + Bit := 7-(i mod 8) in TBitSet(a[i div 8]); + Result := Result + Char(Byte('0') + Byte(Bit)); + if i < max then + if ((i+1) mod Blocks) = 0 then + Result := Result + Splitter; + end; + end else + for i := 0 to High(a) do + Result := Result + Char(Byte('0') + a[i] shr (i and 8)); +end; + +function CardOfHex(Hex: string): Cardinal; +var + i: Integer; +begin + Result := 0; + Hex := Copy(ExtractChars(Hex, HexadecimalChars), 1, 8); + + for i := 1 to Length(Hex) do + if Hex[i] <> '0' then + Inc(Result, HexOrd(Hex[i]) shl ((Length(Hex) - i) shl 2)); +end; + +function IntOfBin(Bin: string): Cardinal; +var + i: Integer; +begin + Result := 0; + Bin := Copy(ExtractChars(Bin, BinaryChars), 1, 32); + + for i := Length(Bin) downto 1 do + if Bin[i] = '1' then + Inc(Result, 1 shl (Length(Bin) - i)); +end; + +function BinOfInt(n: Cardinal): string; +var + a: Integer; +begin + if n = 0 then begin + Result := '0'; + exit; end; + + Result := ''; + while n > 0 do begin + a := n and 1; + Result := Char(a + Byte('0')) + Result; + n := n shr 1; + end; +end; + +function BinOfIntFill(n: Cardinal; MinCount: Integer = 8): string; +var + a: Integer; +begin + if n = 0 then begin + Result := MulStr('0', MinCount); + Exit; end; + + Result := ''; + while n > 0 do begin + a := n and 1; + Result := Char(a + Byte('0')) + Result; + n := n shr 1; + end; + Result := MulStr('0', MinCount - Length(Result)) + Result; +end; + +function BaseNOfInt(I: Cardinal; B: TBaseN): string; +var + a: Integer; +begin + if (B < 2) or (i = 0) then begin + Result := '0'; + Exit; end; + + Result := ''; + while i > 0 do begin + a := i mod B; + Result := BaseNChar[a] + Result; + i := i div B; + end; +end; + +function IntOfBaseN(V: string; B: TBaseN): Cardinal; +var + i: Integer; + F: Cardinal; + c: Byte; +begin + Result := 0; + V := TrimAll(V); + F := 1; + for i := Length(V) downto 1 do begin + c := Byte(UpCase(V[i])); + case Char(c) of + '0'..'9': c := c - 48; + 'A'..'Z': c := c - 55; + end; + if c < B then + Result := Result + Byte(c) * F; + F := F * B; + end; +end; + +function KeepIn(i, Bottom, Top: Variant): Variant; +begin + Result := i; + if Result > Top then + Result := Top + else if Result < Bottom then + Result := Bottom; +end; + +function InRange(Value, Bottom, Top: Variant): Boolean; +begin + Result := (Value >= Bottom) and (Value <= Top); +end; + +function InStrictRange(Value, Bottom, Top: Variant): Boolean; +begin + Result := (Value > Bottom) and (Value < Top); +end; + +function Min(const A, B: Integer): Integer; +begin + if A < B then + Result := A + else + Result := B; +end; + +function Min(const A: TIntA): Integer; +var + i: Integer; +begin + Result := 0; + if Length(A) = 0 then + Exit; + + Result := A[0]; + for i := 1 to High(A) do + if A[i] < Result then + Result := A[i]; +end; + +function Max(const A, B: Integer): Integer; +begin + if A > B then + Result := A + else + Result := B; +end; + +function Max(const A: TIntA): Integer; +var + i: Integer; +begin + Result := 0; + if Length(A) = 0 then + Exit; + + Result := A[0]; + for i := 1 to High(A) do + if A[i] > Result then + Result := A[i]; +end; + +function RangesOfStr(const S: string): TRanges; +var + SL: TStringList; + r, b, t: string; + i, p: Integer; + + function TryStrToCard(const S: string; out Value: Cardinal): Boolean; + var + E: Integer; + begin + Val(S, Value, E); + Result := E = 0; + end; + +begin + Result := nil; + SL := TStringList.Create; + try + Split(S, RangesSeparator, SL); + SetLength(Result, SL.Count); + for i := 0 to SL.Count-1 do begin + r := SL[i]; + with Result[i] do begin + p := CharPos(RangeInnerSeparator, r); + Simple := p = 0; // no '-' found + if Simple then begin + if r = RangeInfinite then begin // * --> *-* + Simple := False; + Bottom := Low(Bottom); + Top := High(Top); + end else if not TryStrToCard(r, Value) then + Break; + + end else begin + TileStr(r, p, p, b, t); + + if b = RangeInfinite then + Bottom := Low(Bottom) + else if not TryStrToCard(b, Bottom) then + Break; + + if t = RangeInfinite then + Top := High(Top) + else if not TryStrToCard(t, Top) then + Break; + if Bottom > Top then begin + p := Bottom; Bottom := Top; Top := p; + end; + end; + end; + end; + + if i <> SL.Count then + Result := nil; + + finally + SL.Free; + end; +end; + +function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; +var + i: Integer; +begin + Result := True; + + for i := 0 to High(Ranges) do + with Ranges[i] do + if Simple then begin + if TestValue = Value then + Exit; + end else begin + if InRange(TestValue, Bottom, Top) then + Exit; + end; + + Result := False; +end; + +procedure WriteSL(Strings: TStrings; const Prefix: string = ''; + const Suffix: string = ''); +var + i: Integer; +begin + for i := 0 to Strings.Count-1 do + WriteLn(Prefix + Strings[i] + Suffix); +end; + +function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; +begin + Result := (Res = ResultOnSuccess); + LastSuccessRes := Res; +end; + +function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; +begin + Result := not Success(Res, ResultOnSuccess); +end; + +function ExpandString(const S: string): string; +var + Len: Integer; + P, Res: PChar; +begin + Result := ''; + P := PChar(S); + Len := ExpandEnvironmentStrings(P, nil, 0); + if Len = 0 then + Exit; + + GetMem(Res, Len); + ExpandEnvironmentStrings(P, Res, Len); + + Result := Res; + FreeMem(Res, Len); +end; + +function FindAll(Strings: TStrings; const Mask: string; + ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; + FileReturn: TFileNameFunc = nil): Boolean; +var + Path, FileName: string; + + procedure ScanDir(const Path, FileName: string); + var + PSR: TSearchRec; + Res: Integer; + + procedure Add(const S: string); + begin + if S <> '' then + Strings.Add(S); + end; + + begin + Res := FindFirst(Path + FileName, Attributes, PSR); + while Success(Res, 0) do begin + if Assigned(FileReturn) then + Add(FileReturn(Path + PSR.Name)) + else + Add(Path + PSR.Name); + Res := FindNext(PSR); + end; + FindClose(PSR); + if not ScanSubDirs then + Exit; + + Res := FindFirst(Path + '*', faDirectory, PSR); + while Success(Res, 0) do begin + if (PSR.Attr and faDirectory > 0) + and (PSR.Name <> '.') and (PSR.Name <> '..') then + ScanDir(Path + PSR.Name + '\', FileName); + Res := FindNext(PSR); + end; + FindClose(PSR); + end; + +begin + Strings.Clear; + Path := ExtractPath(Mask); + FileName := ExtractFileName(Mask); + ScanDir(Path, FileName); + Result := Strings.Count > 0; +end; + +function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; + Attributes: Integer = faFindEveryFile): string; +var + Path, FileName: string; + + function ScanDir(const Path, FileName: string): Boolean; + var + PSR: TSearchRec; + Res: Integer; + begin + Result := False; + if Success(FindFirst(Path + FileName, Attributes, PSR), 0) then begin + FindAllFirst := Path + PSR.Name; + Result := True; + FindClose(PSR); + Exit; end; + if not ScanSubDirs then + Exit; + + Res := FindFirst(Path + '*', faDirectory, PSR); + while not Result and Success(Res, 0) do begin + if (PSR.Attr and faDirectory > 0) + and (PSR.Name <> '.') and (PSR.Name <> '..') then + Result := ScanDir(Path + PSR.Name + '\', FileName); + Res := FindNext(PSR); + end; + FindClose(PSR); + end; +begin + Result := ''; + Path := ExtractPath(Mask); + FileName := ExtractFileName(Mask); + ScanDir(Path, FileName); +end; + +procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; + Attributes: Integer = faFindEveryFile); +var + Path, FileName: string; + + procedure ScanDir(const Path, FileName: string); + var + PSR: TSearchRec; + Res: Integer; + + procedure TryDeleteFile(const FileName: string); + begin + try + DeleteFile(Path + PSR.Name); + except + end; + end; + + begin + Res := FindFirst(Path + FileName, Attributes, PSR); + while Success(Res, 0) do begin + TryDeleteFile(Path + PSR.Name); + Res := FindNext(PSR); + end; + FindClose(PSR); + if not ScanSubDirs then + Exit; + + Res := FindFirst(Path + '*', faDirectory, PSR); + while Success(Res, 0) do begin + if (PSR.Attr and faDirectory > 0) + and (PSR.Name <> '.') and (PSR.Name <> '..') then begin + ScanDir(Path + PSR.Name + '\', FileName); + TryDeleteFile(Path + PSR.Name); + end; + Res := FindNext(PSR); + end; + FindClose(PSR); + end; +begin + Path := ExtractPath(Mask); + FileName := ExtractFileName(Mask); + ScanDir(Path, FileName); +end; + +function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; +var + Drive: string; + pf, pd, Len: Integer; + PSR: TSearchRec; +begin + Result := ''; + FileName := Trim(FileName); + if Length(FileName) < 2 then + Exit; + + Drive := ExtractDrive(FileName); + if not DirectoryExists(Drive) then + Exit; + + if NoFloppyDrives and (Drive[1] in ['A', 'B']) then + Exit; + + Len := Length(FileName); + Result := Drive; + pf := Length(Drive) + 1; + while pf <= Len do begin + if FileName[pf] = '\' then begin + Result := Result + '\'; + Inc(pf); + Continue; end; + + pd := CharPos('\', FileName, pf); + if pd = 0 then begin + if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faFindEveryFile, PSR) then begin + Result := Result + PSR.Name; + Break; end else begin + FindClose(PSR); + if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faDirectory, PSR) then + Result := Result + PSR.Name + '\' + else + Result := ''; + FindClose(PSR); + if Result = '' then + Break; + end; + end; + + if 0=FindFirst(Result + Copy(FileName, pf, pd - pf), faDirectory, PSR) then + Result := Result + PSR.Name + '\' + else + Result := ''; + FindClose(PSR); + if Result = '' then + Break; + + pf := pd + 1; + end; + + if (Result <> '') and not FileEx(Result, True) then + Result := ''; +end; + +function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; +var + LocalFileTime: TFileTime; + Res: Integer; +begin + Result := 0; + + FileTimeToLocalFileTime(FileTime, LocalFileTime); + if not FileTimeToDosDateTime(LocalFileTime, LongRec(Res).Hi, + LongRec(Res).Lo) then + Res := -1; + + if (Res = -1) or (Res = 0) then + Exit; + try + Result := FileDateToDateTime(Res); + except + end; +end; + +procedure FileNew(const FileName: string); +var + Handle: Integer; +begin + Handle := FileCreate(FileName); + FileClose(Handle); +end; + +function Win32PlatformStr: string; +const + PlatformStrings: array[VER_PLATFORM_WIN32s..VER_PLATFORM_WIN32_NT] of string = + ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT'); +begin + Result := PlatformStrings[Win32Platform]; +end; + +function FullOSInfo: string; +begin + Result := Format( + 'Platform: %s' + EOL + + 'Version: %d.%d Build %d' + EOL + + 'CSD: %s', + [ + Win32PlatformStr, + Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, + Win32CSDVersion + ] + ); +end; + +function Win9x: Boolean; +begin + Result := Win32Platform = VER_PLATFORM_WIN32_WINDOWS; +end; + +function WinNT: Boolean; +begin + Result := Win32Platform = VER_PLATFORM_WIN32_NT; +end; + +function Win2000: Boolean; +begin + Result := (Win32Platform = VER_PLATFORM_WIN32_NT) + and (Win32MajorVersion = 4); +end; + +function WinXP: Boolean; +begin + Result := Win32MajorVersion >= 5; +end; + +initialization + MyDir := GetMyDir; + +end. + +unit FifoStream; + +interface + +uses Classes, windows, Dialogs; + +const + DefaultChunksize = 32768; // 32kb per chunk as default. + +type + PMemChunk = ^TMemChunk; + TMemChunk = record + Filled: Longword; + Read: Longword; + Data: pointer; + end; + + TFifo = class + private + FBuffers: TList; + FChunksize: Longword; + FCritSect: TRTLCriticalSection; + FIsWinNT: boolean; + FBytesInFifo: LongWord; + protected + function GetBytesInFifo: LongWord; + public + constructor Create; + destructor Destroy; override; + procedure Write(Data: pointer; Size: LongWord); + procedure Read(Buff: pointer; var ReqSize: LongWord); + procedure PeekData(Buff: pointer; var ReqSize: LongWord); + published + property BytesInFifo: LongWord read FBytesInFifo; + end; + +implementation + +constructor TFifo.Create; +begin + inherited; + FBuffers := TList.Create; + // set default chunksize... + FChunksize := DefaultChunksize; + InitializeCriticalSection(FCritSect); +end; + +destructor TFifo.Destroy; +var + I: Integer; +begin + EnterCriticalSection(FCritSect); + for I := 0 to FBuffers.count - 1 do + begin + FreeMem(PMemChunk(Fbuffers[I]).Data); + Dispose(PMemChunk(Fbuffers[I])); + end; + FBuffers.Clear; + FBuffers.Free; + LeaveCriticalSection(FCritSect); + + DeleteCriticalSection(FCritSect); + inherited; +end; + +function TFifo.GetBytesInFifo: LongWord; +begin + Result := 0; + if FBuffers.Count = 0 then + begin + exit; + end + else + begin + if FBuffers.Count > 1 then + Inc(Result, (FBuffers.Count - 1) * FChunkSize); + Inc(Result, PMemChunk(FBuffers[Fbuffers.Count - 1]).Filled); + Dec(Result, PMemChunk(FBuffers[0]).Read); + end; +end; + +procedure TFifo.Write(Data: pointer; Size: LongWord); +var + Privpointer: pointer; + PrivSize: LongWord; + Chunk: PMemChunk; + PosInChunk: pointer; +begin + if LongWord(Data) = 0 then + begin + // null pointer? somebody is trying to fool us, get out... + Exit; + end; + EnterCriticalSection(FCritSect); + PrivPointer := Data; + PrivSize := 0; + // are already buffers there? + if FBuffers.count > 0 then + begin + // is the last one of them not completely filled? + if PMemChunk(FBuffers[FBuffers.count - 1]).filled < FChunksize then + // not completely filled, so fill up the buffer. + begin + Chunk := PMemChunk(FBuffers[FBuffers.count - 1]); + // fetch chunkdata. + PosInChunk := Chunk.Data; + // move to current fill pos... + Inc(LongWord(PosInChunk), Chunk.Filled); + // can we fill the chunk completely? + if Size > FChunksize - Chunk.Filled then + begin + // yes we can. + Move(PrivPointer^, PosInChunk^, FChunksize - Chunk.Filled); + Inc(PrivSize, FChunksize - Chunk.Filled); + Inc(LongWord(PrivPointer), FChunksize - Chunk.Filled); + Chunk.Filled := FChunkSize; + end + else + // we have to less data for filling the chunk completely, + // just put everything in. + begin + Move(PrivPointer^, PosInChunk^, Size); + Inc(PrivSize, Size); + Inc(Chunk.Filled, Size); + end; + end; + end; + // as long as we have remaining stuff put it into new chunks. + while (PrivSize < Size) do + begin + new(Chunk); + GetMem(Chunk.Data, FChunksize); + Chunk.Read := 0; + // can we fill an entire chunk with the remaining data? + if Privsize + FChunksize < Size then + begin + // yes we can, so put the stuff in. + Move(Privpointer^, Chunk.Data^, FChunksize); + Inc(LongWord(PrivPointer), FChunksize); + Inc(PrivSize, FChunksize); + Chunk.Filled := FChunksize; + end + else // we have to less data to fill the entire chunk, just put the remaining stuff in. + begin + Move(Privpointer^, Chunk.Data^, Size - Privsize); + Chunk.Filled := Size - Privsize; + Inc(PrivSize, Size - Privsize); + end; + Fbuffers.Add(Chunk); + end; + if Size <> Privsize then + Showmessage('miscalculation in TFifo.write'); + FBytesInFifo := GetBytesInFifo; + LeaveCriticalSection(FCritSect); +end; + +procedure TFifo.Read(Buff: pointer; var ReqSize: LongWord); +var + PrivSize: Integer; + Privpos: pointer; + Chunk: PMemChunk; + ChunkPos: pointer; +begin + if LongWord(Buff) = 0 then + begin + // null pointer? somebody is trying to fool us, get out... + Exit; + end; + EnterCriticalSection(FCritSect); + PrivSize := 0; + Privpos := Buff; + while FBuffers.Count > 0 do + begin + Chunk := PMemChunk(FBuffers[0]); + ChunkPos := Chunk.data; + Inc(LongWord(ChunkPos), Chunk.Read); + // does the remaining part of the chunk fit into the buffer? + if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then + begin // yep, it fits + Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); + Inc(PrivSize, Chunk.Filled - Chunk.read); + FreeMem(Chunk.Data); + Dispose(Chunk); + FBuffers.Delete(0); + end + else // remaining part didn't fit, get as much as we can and increment the + // read attribute. + begin + Move(ChunkPos^, Privpos^, ReqSize - PrivSize); + Inc(Chunk.read, ReqSize - PrivSize); + Inc(PrivSize, ReqSize - PrivSize); + // as we filled the buffer, we'll have to break here. + break; + end; + end; + FBytesInFifo := GetBytesInFifo; + LeaveCriticalSection(FCritSect); + ReqSize := PrivSize; +end; + +// read Data from Stream without removing it from the Stream... + +procedure TFifo.PeekData(Buff: pointer; var ReqSize: LongWord); +var + PrivSize: Integer; + Privpos: pointer; + Chunk: PMemChunk; + ChunkPos: pointer; + ChunkNr: Integer; +begin + if LongWord(Buff) = 0 then + begin + // null pointer? somebody is trying to fool us, get out... + Exit; + end; + EnterCriticalSection(FCritSect); + PrivSize := 0; + Privpos := Buff; + ChunkNr := 0; + while FBuffers.Count > ChunkNr do + begin + Chunk := PMemChunk(FBuffers[ChunkNr]); + ChunkPos := Chunk.data; + Inc(LongWord(ChunkPos), Chunk.Read); + // does the remaining part of the chunk fit into the buffer? + if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then + begin // yep, it fits + Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); + Inc(PrivSize, Chunk.Filled - Chunk.read); + Inc(ChunkNr); + end + else // remaining part didn't fit, get as much as we can and increment the + // read attribute. + begin + Move(ChunkPos^, Privpos^, ReqSize - PrivSize); + Inc(PrivSize, ReqSize - PrivSize); + // as we filled the buffer, we'll have to break here. + break; + end; + end; + LeaveCriticalSection(FCritSect); + ReqSize := PrivSize; +end; + +end. diff --git a/test/delphi/ytools.out.raydebug b/test/delphi/ytools.out.raydebug new file mode 100644 index 0000000..f1621fd --- /dev/null +++ b/test/delphi/ytools.out.raydebug @@ -0,0 +1,2708 @@ +comment(// vim:ft=pascal) + +reserved(unit) ident(YTools)operator(;) + +comment({=============================================================================== + + cYcnus.YTools 1.0.3 Beta for Delphi 4+ + by licenser and Murphy + + ©2000-2003 by cYcnus + visit www.cYcnus.de + + licenser@cYcnus.de (Heinz N. Gies\) + murphy@cYcnus.de (Kornelius Kalnbach\) + + this unit is published under the terms of the GPL + +===============================================================================}) + +reserved(interface) + +reserved(uses) + ident(Windows)operator(,) ident(SysUtils)operator(,) ident(Classes)operator(,) ident(YTypes)operator(;) + +reserved(const) + ident(BackSpace) operator(=) char(#8)operator(;) + ident(Tab) operator(=) char(#9)operator(;) + ident(LF) operator(=) char(#10)operator(;) comment(//Line Feed) + ident(CR) operator(=) char(#13)operator(;) comment(//Carriage Return) + ident(Space) operator(=) char(#32)operator(;) + ident(EOLChars) operator(=) operator([)ident(CR)operator(,) ident(LF)operator(];) +preprocessor({$IFNDEF VER140}) + ident(sLineBreak) operator(=) char(#13)char(#10)operator(;) + ident(SwitchChars) operator(=) operator([)charoperator(,) charoperator(];) +preprocessor({$ENDIF}) + ident(EOL) operator(=) ident(sLineBreak)operator(;) + ident(MaxCard) operator(=) ident(High)operator(()ident(Cardinal)operator(\);) + ident(AllChars) operator(=) operator([)char(#0)operator(..)char(#255)operator(];) + ident(Alphabetical) operator(=) operator([)charoperator(..)charoperator(,) charoperator(..)charoperator(];) + ident(DecimalChars) operator(=) operator([)charoperator(..)charoperator(];) + ident(AlphaNumerical) operator(=) ident(Alphabetical) operator(+) ident(DecimalChars)operator(;) + ident(StrangeChars) operator(=) operator([)char(#0)operator(..)char(#31)operator(,) char(#127)operator(,) char(#129)operator(,) char(#141)operator(..)char(#144)operator(,) char(#157)operator(,) char(#158)operator(];) + + ident(HexadecimalChars) operator(=) ident(DecimalChars) operator(+) operator([)charoperator(..)charoperator(,) charoperator(..)charoperator(];) + ident(OctalChars) operator(=) operator([)charoperator(..)charoperator(];) + ident(BinaryChars) operator(=) operator([)charoperator(,) charoperator(];) + + ident(QuoteChars) operator(=) operator([)charoperator(,) charoperator(];) + ident(WildCards) operator(=) operator([)charoperator(,) charoperator(];) + ident(FileNameEnemies) operator(=) ident(WildCards) operator(+) operator([)charoperator(,) charoperator(,) charoperator(,) charoperator(,) char)delimiter(')>operator(,) charoperator(];) + + ident(HexChar)operator(:) reserved(array)operator([)ident(THex)operator(]) reserved(of) ident(Char) operator(=) operator(() + charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\);) + ident(LowerHexChar)operator(:) reserved(array)operator([)ident(THex)operator(]) reserved(of) ident(Char) operator(=) operator(() + charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\);) + ident(BaseNChar)operator(:) reserved(array)operator([)ident(TBaseN)operator(]) reserved(of) ident(Char) operator(=) operator(() + charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,) + charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(,)charoperator(\);) + + ident(cYcnusOverlayColor) operator(=) hex($050001)operator(;) + + ident(faFindEveryFile) operator(=) ident(faReadOnly) operator(+) ident(faHidden) operator(+) ident(faSysFile) operator(+) ident(faArchive)operator(;) + + ident(platWin9x) operator(=) operator([)ident(VER_PLATFORM_WIN32s)operator(,) ident(VER_PLATFORM_WIN32_WINDOWS)operator(];) + + +comment({ Debugging }) +reserved(procedure) ident(ClearReport)operator(()reserved(const) ident(ReportName)operator(:) reserved(string)operator(\);) +reserved(procedure) ident(Report)operator(()reserved(const) ident(ReportName)operator(,) ident(Text)operator(:) reserved(string)operator(\);) +reserved(procedure) ident(ReportFmt)operator(()reserved(const) ident(ReportName)operator(,) ident(Fmt)operator(:) reserved(string)operator(;) reserved(const) ident(Args)operator(:) reserved(array) reserved(of) reserved(const)operator(\);) + +comment({ Params }) +reserved(procedure) ident(GetParams)operator(()ident(Strings)operator(:) ident(TStrings)operator(\);) directive(overload)operator(;) +reserved(function) ident(GetParams)operator(()reserved(const) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) directive(overload)operator(;) + +reserved(function) ident(ParamNum)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(function) ident(ParamPrefixNum)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(function) ident(Param)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(ParamPrefix)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + +reserved(function) ident(Switch)operator(()reserved(const) ident(Switch)operator(:) reserved(string)operator(;) reserved(const) ident(PrefixChars)operator(:) ident(TCharSet) operator(=) ident(SwitchChars)operator(;) + ident(IgnoreCase)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(GetParam)operator(()reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) + +comment({ Dirs & UserName}) +reserved(function) ident(GetMyDir)operator(()ident(FullPath)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) +reserved(function) ident(WinDir)operator(:) reserved(string)operator(;) +reserved(function) ident(SysDir)operator(:) reserved(string)operator(;) +reserved(function) ident(UserName)operator(:) reserved(string)operator(;) + +comment({ Strings & Chars}) +reserved(function) ident(FirstChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Char)operator(;) +reserved(function) ident(LastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Char)operator(;) + +reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(TCharSet)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(CharPosR)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) operator(-)integer(1)operator(\):) ident(Integer)operator(;) +reserved(function) ident(PosEx)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(function) ident(PosExText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(function) ident(PosExAnsiText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) + +reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(UntilLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) + ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) reserved(string)operator(;) + +reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(FromLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) + ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) + +reserved(function) ident(BetweenChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Start)operator(,) ident(Finish)operator(:) ident(Char)operator(;) + ident(Inclusive)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) + +reserved(function) ident(UntilStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(FromStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(StringWrap)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) reserved(const) ident(LineEnd)operator(:) reserved(string) operator(=) ident(EOL)operator(\):) reserved(string)operator(;) + +comment({ Splitting & Combining }) +reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\):) ident(TStrA)operator(;) directive(overload)operator(;) +reserved(procedure) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(Strings)operator(:) ident(TStrings)operator(;) + ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(\);) directive(overload)operator(;) +reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Separators)operator(:) ident(TCharSet)operator(;) + ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\):) ident(TStrA)operator(;) directive(overload)operator(;) + +reserved(procedure) ident(TileStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(BrakeStart)operator(:) ident(Integer)operator(;) ident(BrakeEnd)operator(:) ident(Integer)operator(;) + reserved(out) ident(Left)operator(,) ident(Right)operator(:) reserved(string)operator(\);) + +reserved(function) ident(Join)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(Join)operator(()ident(StrA)operator(:) ident(TStrA)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) directive(overload)operator(;) + +reserved(function) ident(MulStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Count)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) + +comment({ Strings ausrichten }) +reserved(function) ident(AlignR)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) ident(Filler)operator(:) ident(Char) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(function) ident(MaxStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(MaxLen)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) + +comment({ Stringing }) +reserved(function) ident(TrimAll)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(ControlChar)operator(()ident(C)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(FriendlyChar)operator(()ident(C)operator(:) ident(Char)operator(\):) ident(Char)operator(;) + +reserved(function) ident(FriendlyStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(FriendlyStr)operator(()ident(a)operator(:) ident(TByteA)operator(\):) reserved(string)operator(;) directive(overload)operator(;) + +reserved(function) ident(Quote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Quoter)operator(:) ident(Char) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(function) ident(UnQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(DeQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(StrNumerus)operator(()reserved(const) ident(Value)operator(:) ident(Integer)operator(;) reserved(const) ident(Singular)operator(,) ident(Plural)operator(:) reserved(string)operator(;) + reserved(const) ident(Zero)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) + +reserved(function) ident(MakeStr)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(procedure) ident(ShowText)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\);) + +comment({ Delete }) +reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(ExtractChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) + +comment({ Find }) +reserved(function) ident(CharCount)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) ident(Integer)operator(;) + +reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) + +reserved(function) ident(StrAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Str)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(StrAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Str)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(StrIn)operator(()reserved(const) ident(S)operator(,) ident(SubStr)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(StrIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(StrIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(StrIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(StrIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) + +reserved(function) ident(TextAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(TextAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(TextIn)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(TextIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(TextIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) directive(overload)operator(;) +reserved(function) ident(TextIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(TextIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) + +comment({ Replace }) +reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(,) ident(New)operator(:) ident(Char)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(:) ident(TCharSet)operator(;) ident(New)operator(:) ident(Char)operator(\):) reserved(string)operator(;) directive(overload)operator(;) + +reserved(function) ident(Replace)operator(()reserved(const) ident(S)operator(,) ident(Old)operator(,) ident(New)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +comment({ TStrings }) +reserved(function) ident(SLOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(TStringList)operator(;) +reserved(function) ident(ContainsEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\):) ident(Boolean)operator(;) +reserved(procedure) ident(DeleteEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\);) +reserved(procedure) ident(DeleteCommentLines)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(CommentSign)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(procedure) ident(WriteSL)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) + reserved(const) ident(Suffix)operator(:) reserved(string) operator(=) stringoperator(\);) + +reserved(function) ident(FindLine)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) + +reserved(procedure) ident(QuickSortSL)operator(()ident(SL)operator(:) ident(TStringList)operator(\);) + +comment({ TStrA }) +reserved(function) ident(IncStrA)operator(()ident(StrA)operator(:) ident(TStrA)operator(\):) ident(Integer)operator(;) + +comment({ TByteA }) +reserved(function) ident(StrOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(\):) reserved(string)operator(;) +reserved(function) ident(ByteAOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) +reserved(function) ident(ByteAOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\):) ident(TByteA)operator(;) +reserved(function) ident(IntOfByteA)operator(()ident(A)operator(:) ident(TByteA)operator(\):) ident(Integer)operator(;) +reserved(function) ident(ByteAOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) + +reserved(function) ident(SameByteA)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(TByteA)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(Reverse)operator(()ident(a)operator(:) ident(TByteA)operator(\):) ident(TByteA)operator(;) +reserved(function) ident(SaveByteA)operator(()ident(Data)operator(:) ident(TByteA)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(Overwrite)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(LoadByteA)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) + +reserved(function) ident(Endian)operator(()ident(i)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) + +comment({ Files }) +reserved(function) ident(SizeOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(function) ident(FileEx)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(AllowFolders)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(LWPSolve)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(LWPSlash)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(ExtractDrive)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(ExtractPath)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(ExtractPrefix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(ExtractSuffix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(IsValidFileName)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(MakeValidFileName)operator(()ident(FileName)operator(:) reserved(string)operator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) + +comment({ Converting }) +reserved(function) ident(IsValidInteger)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(IsValidCardinal)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + +reserved(function) ident(StrOfBool)operator(()ident(flag)operator(:) ident(Boolean)operator(;) reserved(const) ident(TrueStr)operator(:) reserved(string) operator(=) stringoperator(;) + reserved(const) ident(FalseStr)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(function) ident(StrOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) +reserved(function) ident(CardOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) + +reserved(function) ident(HexOrd)operator(()ident(Hex)operator(:) ident(Char)operator(\):) ident(THex)operator(;) +reserved(function) ident(ByteOfHex)operator(()ident(Hex)operator(:) ident(THexByteStr)operator(\):) ident(Byte)operator(;) + +reserved(function) ident(DecOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(function) ident(HexOfByte)operator(()ident(b)operator(:) ident(Byte)operator(\):) ident(THexByteStr)operator(;) +reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(;) ident(Digits)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) directive(overload)operator(;) + +reserved(function) ident(PascalHexArray)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Name)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +reserved(function) ident(HexOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(1)operator(;) + reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(function) ident(BinOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(4)operator(;) + reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) + +reserved(function) ident(CardOfHex)operator(()ident(Hex)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) +reserved(function) ident(IntOfBin)operator(()ident(Bin)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) + +reserved(function) ident(BinOfIntFill)operator(()ident(n)operator(:) ident(cardinal)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(8)operator(\):) reserved(string)operator(;) +reserved(function) ident(BinOfInt)operator(()ident(n)operator(:) ident(cardinal)operator(\):) reserved(string)operator(;) + +reserved(function) ident(BaseNOfInt)operator(()ident(I)operator(:) ident(Cardinal)operator(;) ident(B)operator(:) ident(TBaseN)operator(\):) reserved(string)operator(;) +reserved(function) ident(IntOfBaseN)operator(()ident(V)operator(:) reserved(string)operator(;) ident(B)operator(:) ident(TBaseN)operator(\):) ident(Cardinal)operator(;) + +comment({ Ranges }) +reserved(function) ident(KeepIn)operator(()ident(i)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Variant)operator(;) +reserved(function) ident(InRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(InStrictRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) +reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\):) ident(Integer)operator(;) directive(overload)operator(;) + +reserved(const) + ident(RangesSeparator) operator(=) charoperator(;) + ident(RangeInnerSeparator) operator(=) charoperator(;) + ident(RangeInfinite) operator(=) charoperator(;) + ident(RangeSpecialChars) operator(=) operator([)ident(RangesSeparator)operator(,) ident(RangeInnerSeparator)operator(,) ident(RangeInfinite)operator(];) + +reserved(function) ident(RangesOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(TRanges)operator(;) +reserved(function) ident(InRanges)operator(()ident(Ranges)operator(:) ident(TRanges)operator(;) ident(TestValue)operator(:) ident(Cardinal)operator(\):) ident(Boolean)operator(;) + +reserved(function) ident(Success)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(Failure)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\):) ident(Boolean)operator(;) + +reserved(function) ident(ExpandString)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) + +comment({ Files }) +reserved(procedure) ident(DeleteFiles)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\);) +reserved(procedure) ident(FileNew)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\);) +reserved(function) ident(DateTimeOfFileTime)operator(()reserved(const) ident(FileTime)operator(:) ident(TFileTime)operator(\):) ident(TDateTime)operator(;) + +comment({ FileNames }) +reserved(function) ident(GetFileNew)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(NoFloppyDrives)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) reserved(string)operator(;) + +comment({ Finding Files }) +reserved(function) ident(FindAll)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Mask)operator(:) reserved(string)operator(;) + ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(;) + ident(FileReturn)operator(:) ident(TFileNameFunc) operator(=) reserved(nil)operator(\):) ident(Boolean)operator(;) +reserved(function) ident(FindAllFirst)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\):) reserved(string)operator(;) + +reserved(function) ident(FullOSInfo)operator(:) reserved(string)operator(;) +reserved(function) ident(Win32PlatformStr)operator(:) reserved(string)operator(;) +reserved(function) ident(Win9x)operator(:) ident(Boolean)operator(;) +reserved(function) ident(WinNT)operator(:) ident(Boolean)operator(;) +reserved(function) ident(Win2000)operator(:) ident(Boolean)operator(;) +reserved(function) ident(WinXP)operator(:) ident(Boolean)operator(;) + +reserved(var) + ident(MyDir)operator(:) reserved(string) operator(=) stringoperator(;) + ident(LastSuccessRes)operator(:) ident(Integer) operator(=) integer(0)operator(;) + +comment({ Backward compatibility }) +preprocessor({$IFNDEF VER130}) +reserved(function) ident(SameText)operator(()reserved(const) ident(S1)operator(,) ident(S2)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +preprocessor({$ENDIF}) + +reserved(implementation) +preprocessor({$IFNDEF VER140}) +reserved(uses) ident(FileCtrl)operator(;) +preprocessor({$ENDIF}) + +preprocessor({$IFNDEF VER130}) +reserved(function) ident(SameText)operator(()reserved(const) ident(S1)operator(,) ident(S2)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(CompareText)operator(()ident(S1)operator(,) ident(S2)operator(\)) operator(=) integer(0)operator(;) +reserved(end)operator(;) +preprocessor({$ENDIF}) + +reserved(procedure) ident(Report)operator(()reserved(const) ident(ReportName)operator(,) ident(Text)operator(:) reserved(string)operator(\);) +reserved(var) + ident(F)operator(:) ident(TextFile)operator(;) + ident(FileName)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(MyDir) operator(+) ident(ReportName) operator(+) stringoperator(;) + ident(Assign)operator(()ident(F)operator(,) ident(FileName)operator(\);) + reserved(try) + reserved(if) reserved(not) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) + ident(Rewrite)operator(()ident(F)operator(\)) + reserved(else) + ident(Append)operator(()ident(F)operator(\);) + ident(WriteLn)operator(()ident(F)operator(,) ident(Text)operator(\);) + reserved(finally) + ident(Close)operator(()ident(F)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(ClearReport)operator(()reserved(const) ident(ReportName)operator(:) reserved(string)operator(\);) +reserved(var) + ident(FileName)operator(:) reserved(string)operator(;) +reserved(begin) + ident(FileName) operator(:=) ident(MyDir) operator(+) ident(ReportName) operator(+) stringoperator(;) + ident(DeleteFile)operator(()ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(ReportFmt)operator(()reserved(const) ident(ReportName)operator(,) ident(Fmt)operator(:) reserved(string)operator(;) reserved(const) ident(Args)operator(:) reserved(array) reserved(of) reserved(const)operator(\);) +reserved(begin) + ident(Report)operator(()ident(ReportName)operator(,) ident(Format)operator(()ident(Fmt)operator(,) ident(Args)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(GetParams)operator(()ident(Strings)operator(:) ident(TStrings)operator(\);) +reserved(var) + ident(P)operator(:) ident(PChar)operator(;) + ident(Param)operator(:) reserved(string)operator(;) + + reserved(function) ident(GetParamStr)operator(()reserved(var) ident(P)operator(:) ident(PChar)operator(;) reserved(var) ident(Param)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + reserved(var) + ident(Quoted)operator(:) ident(Boolean)operator(;) + reserved(begin) + ident(Param) operator(:=) stringoperator(;) + + reserved(repeat) + reserved(while) operator(()ident(P)operator([)integer(0)operator(]) operator(<>) char(#0)operator(\)) reserved(and) operator(()ident(P)operator([)integer(0)operator(]) operator(<=) charoperator(\)) reserved(do) + ident(Inc)operator(()ident(P)operator(\);) + + ident(Quoted) operator(:=) ident(False)operator(;) + reserved(while) ident(P)operator([)integer(0)operator(]) operator(<>) char(#0) reserved(do) reserved(begin) + reserved(if) ident(P)operator([)integer(0)operator(]) operator(=) char reserved(then) reserved(begin) + ident(Quoted) operator(:=) reserved(not) ident(Quoted)operator(;) + ident(Inc)operator(()ident(P)operator(\);) + ident(Continue)operator(;) reserved(end)operator(;) + reserved(if) operator(()ident(P)operator([)integer(0)operator(]) operator(<=) charoperator(\)) reserved(and) reserved(not) ident(Quoted) reserved(then) + ident(Break)operator(;) + ident(Param) operator(:=) ident(Param) operator(+) ident(P)operator([)integer(0)operator(];) + ident(Inc)operator(()ident(P)operator(\);) + reserved(end)operator(;) + reserved(until) operator(()ident(Param) operator(<>) stringoperator(\)) reserved(or) operator(()ident(P)operator([)integer(0)operator(]) operator(=) char(#0)operator(\);) + + ident(Result) operator(:=) ident(Param) operator(<>) stringoperator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Strings)operator(.)ident(Clear)operator(;) + ident(P) operator(:=) ident(GetCommandLine)operator(;) + ident(GetParamStr)operator(()ident(P)operator(,) ident(Param)operator(\);) + reserved(while) ident(GetParamStr)operator(()ident(P)operator(,) ident(Param)operator(\)) reserved(do) + ident(Strings)operator(.)ident(Add)operator(()ident(Param)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(GetParams)operator(()reserved(const) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) +reserved(begin) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + ident(GetParams)operator(()ident(SL)operator(\);) + ident(Result) operator(:=) ident(Join)operator(()ident(SL)operator(,) ident(Separator)operator(\);) + ident(SL)operator(.)ident(Free)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Switch)operator(()reserved(const) ident(Switch)operator(:) reserved(string)operator(;) reserved(const) ident(PrefixChars)operator(:) ident(TCharSet) operator(=) ident(SwitchChars)operator(;) + ident(IgnoreCase)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(Boolean)operator(;) +comment(//= SysUtils.FindCmdLineSwitch) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(s)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) reserved(begin) + ident(s) operator(:=) ident(ParamStr)operator(()ident(i)operator(\);) + + reserved(if) operator(()ident(s) operator(<>) stringoperator(\)) reserved(and) operator(()ident(s)operator([)integer(1)operator(]) reserved(in) ident(PrefixChars)operator(\)) reserved(then) reserved(begin) + comment(//i know that always s <> '', but this is saver) + ident(s) operator(:=) ident(Copy)operator(()ident(s)operator(,) integer(2)operator(,) ident(MaxInt)operator(\);) + reserved(if) operator(()ident(s) operator(=) ident(Switch)operator(\)) reserved(or) operator(()ident(IgnoreCase) reserved(and) operator(()integer(0)operator(=)ident(AnsiCompareText)operator(()ident(s)operator(,) ident(Switch)operator(\)\)\)) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ParamNum)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) + reserved(if) integer(0)operator(=)ident(AnsiCompareText)operator(()ident(ParamStr)operator(()ident(Result)operator(\),) ident(S)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ParamPrefixNum)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(Len)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Len) operator(:=) ident(Length)operator(()ident(Prefix)operator(\);) + reserved(for) ident(Result) operator(:=) integer(1) reserved(to) ident(ParamCount) reserved(do) + reserved(if) integer(0)operator(=)ident(AnsiCompareText)operator(()ident(Copy)operator(()ident(ParamStr)operator(()ident(Result)operator(\),) integer(1)operator(,) ident(Len)operator(\),) ident(Prefix)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Param)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(ParamNum)operator(()ident(S)operator(\)) operator(>) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ParamPrefix)operator(()reserved(const) ident(Prefix)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(ParamPrefixNum)operator(()ident(Prefix)operator(\)) operator(>) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(GetParam)operator(()reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Default)operator(;) + + reserved(if) ident(Prefix) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) ident(ParamStr)operator(()integer(1)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(i) operator(:=) ident(ParamPrefixNum)operator(()ident(Prefix)operator(\);) + reserved(if) ident(i) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(ParamStr)operator(()ident(i)operator(\),) ident(Length)operator(()ident(Prefix)operator(\)) operator(+) integer(1)operator(,) ident(MaxInt)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(GetMyDir)operator(()ident(FullPath)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Buffer)operator(:) reserved(array)operator([)integer(0)operator(..)integer(260)operator(]) reserved(of) ident(Char)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(SetString)operator(()ident(Result)operator(,) ident(Buffer)operator(,) ident(GetModuleFileName)operator(()integer(0)operator(,) ident(Buffer)operator(,) ident(SizeOf)operator(()ident(Buffer)operator(\)\)\);) + reserved(if) ident(FullPath) reserved(then) + ident(Result) operator(:=) ident(GetFileNew)operator(()ident(Result)operator(\);) + ident(Result) operator(:=) ident(ExtractPath)operator(()ident(Result)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(WinDir)operator(:) reserved(string)operator(;) +reserved(var) + ident(Res)operator(:) ident(PChar)operator(;) +reserved(begin) + ident(Result) operator(:=) charoperator(;) + ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) + ident(GetWindowsDirectory)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) + ident(Result) operator(:=) ident(Res) operator(+) charoperator(;) + ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(SysDir)operator(:) reserved(string)operator(;) +reserved(var) + ident(Res)operator(:) ident(PChar)operator(;) +reserved(begin) + ident(Result) operator(:=) charoperator(;) + ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) + ident(GetSystemDirectory)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) + ident(Result) operator(:=) ident(Res) operator(+) charoperator(;) + ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(UserName)operator(:) reserved(string)operator(;) +reserved(var) + ident(Len)operator(:) ident(Cardinal)operator(;) + ident(Res)operator(:) ident(PChar)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(GetMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) + ident(Len) operator(:=) ident(MAX_PATH)operator(;) + ident(GetUserName)operator(()ident(Res)operator(,) ident(Len)operator(\);) + ident(Result) operator(:=) ident(Res)operator(;) + ident(FreeMem)operator(()ident(Res)operator(,) ident(MAX_PATH)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(FirstChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Char)operator(;) +reserved(begin) + reserved(if) ident(s) operator(=) string reserved(then) + ident(Result) operator(:=) char(#0) + reserved(else) + ident(Result) operator(:=) ident(s)operator([)integer(1)operator(];) +reserved(end)operator(;) + +reserved(function) ident(LastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Char)operator(;) +reserved(begin) + reserved(if) ident(s) operator(=) string reserved(then) + ident(Result) operator(:=) char(#0) + reserved(else) + ident(Result) operator(:=) ident(s)operator([)ident(Length)operator(()ident(s)operator(\)];) +reserved(end)operator(;) + +reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(MaxPosToSearch)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Offset)operator(;) + ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\);) + + reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) + reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(C) reserved(then) + ident(Exit)operator(;) + ident(Inc)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(CharPos)operator(()ident(C)operator(:) ident(TCharSet)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(MaxPosToSearch)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Offset)operator(;) + ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\);) + + reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) + reserved(if) ident(S)operator([)ident(Result)operator(]) reserved(in) ident(C) reserved(then) + ident(Exit)operator(;) + ident(Inc)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(CharPosR)operator(()ident(C)operator(:) ident(Char)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) operator(-)integer(1)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Offset) operator(<) integer(0) reserved(then) + ident(Result) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(+) integer(1) operator(-) ident(Offset) + reserved(else) + ident(Result) operator(:=) ident(Offset)operator(;) + reserved(if) ident(Result) operator(>) ident(Length)operator(()ident(S)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Length)operator(()ident(S)operator(\);) + + reserved(while) ident(Result) operator(>) integer(0) reserved(do) reserved(begin) + reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(C) reserved(then) + ident(Exit)operator(;) + ident(Dec)operator(()ident(Result)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PosEx)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(Offset) operator(<) integer(1) reserved(then) + ident(Result) operator(:=) integer(1) + reserved(else) + ident(Result) operator(:=) ident(Offset)operator(;) + + ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\);) + ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) + + reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) + reserved(if) ident(S)operator([)ident(Result)operator(]) operator(=) ident(SubStr)operator([)integer(1)operator(]) reserved(then) reserved(begin) + ident(i) operator(:=) integer(1)operator(;) + + reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) + reserved(and) operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(]) operator(=) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(]\)) reserved(do) + ident(Inc)operator(()ident(i)operator(\);) + + reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(Inc)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PosExText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) + + reserved(function) ident(SameChar)operator(()ident(a)operator(,) ident(b)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(UpCase)operator(()ident(a)operator(\)) operator(=) ident(UpCase)operator(()ident(b)operator(\)) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(Offset) operator(<) integer(1) reserved(then) + ident(Result) operator(:=) integer(1) + reserved(else) + ident(Result) operator(:=) ident(Offset)operator(;) + + ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\);) + ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) + + reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) + reserved(if) ident(SameChar)operator(()ident(S)operator([)ident(Result)operator(],) ident(SubStr)operator([)integer(1)operator(]\)) reserved(then) reserved(begin) + ident(i) operator(:=) integer(1)operator(;) + + reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) + reserved(and) operator(()ident(SameChar)operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(],) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(]\)\)) reserved(do) + ident(Inc)operator(()ident(i)operator(\);) + + reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(Inc)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PosExAnsiText)operator(()reserved(const) ident(SubStr)operator(,) ident(S)operator(:) reserved(string)operator(;) ident(Offset)operator(:) ident(Integer) operator(=) integer(1)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(MaxPosToSearch)operator(,) ident(LenSubStr)operator(,) ident(i)operator(:) ident(Integer)operator(;) + + reserved(function) ident(SameChar)operator(()ident(a)operator(,) ident(b)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(CharLower)operator(()ident(PChar)operator(()ident(a)operator(\)\)) operator(=) ident(CharLower)operator(()ident(PChar)operator(()ident(b)operator(\)\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(SubStr) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + reserved(if) ident(Offset) operator(<) integer(1) reserved(then) + ident(Result) operator(:=) integer(1) + reserved(else) + ident(Result) operator(:=) ident(Offset)operator(;) + + ident(LenSubStr) operator(:=) ident(Length)operator(()ident(SubStr)operator(\);) + ident(MaxPosToSearch) operator(:=) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(LenSubStr) operator(+) integer(1)operator(;) + + reserved(while) ident(Result) operator(<=) ident(MaxPosToSearch) reserved(do) reserved(begin) + reserved(if) ident(SameChar)operator(()ident(S)operator([)ident(Result)operator(],) ident(SubStr)operator([)integer(1)operator(]\)) reserved(then) reserved(begin) + ident(i) operator(:=) integer(1)operator(;) + + reserved(while) operator(()ident(i) operator(<) ident(LenSubStr)operator(\)) + reserved(and) operator(()ident(SameChar)operator(()ident(S)operator([)ident(Result) operator(+) ident(i)operator(],) ident(SubStr)operator([)ident(i) operator(+) integer(1)operator(]\)\)) reserved(do) + ident(Inc)operator(()ident(i)operator(\);) + + reserved(if) ident(i) operator(=) ident(LenSubStr) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(Inc)operator(()ident(Result)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(UntilChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(UntilLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) + ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(CharPosR)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) + reserved(else) reserved(if) ident(IgnoreNoBrake) reserved(then) + ident(Result) operator(:=) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(FromChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(CharPos)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(FromLastChar)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) ident(Char)operator(;) + ident(IgnoreNoBrake)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(CharPosR)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p) operator(+) integer(1)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p)operator(\)) + reserved(else) reserved(if) ident(IgnoreNoBrake) reserved(then) + ident(Result) operator(:=) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(BetweenChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Start)operator(,) ident(Finish)operator(:) ident(Char)operator(;) + ident(Inclusive)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(,) ident(fin)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + ident(p) operator(:=) ident(CharPos)operator(()ident(Start)operator(,) ident(S)operator(\);) + reserved(if) ident(p) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(fin) operator(:=) ident(CharPos)operator(()ident(Finish)operator(,) ident(S)operator(,) ident(p) operator(+) integer(1)operator(\);) + reserved(if) ident(fin) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + reserved(if) reserved(not) ident(Inclusive) reserved(then) reserved(begin) + ident(Inc)operator(()ident(p)operator(\);) + ident(Dec)operator(()ident(fin)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p) operator(+) integer(1)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(UntilStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Length)operator(()ident(Brake)operator(\)) operator(=) integer(1) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(UntilChar)operator(()ident(S)operator(,) ident(Brake)operator([)integer(1)operator(]\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(p) operator(:=) ident(PosEx)operator(()ident(Brake)operator(,) ident(S)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(p) operator(-) integer(1)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FromStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Brake)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(Length)operator(()ident(Brake)operator(\)) operator(=) integer(1) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(FromChar)operator(()ident(S)operator(,) ident(Brake)operator([)integer(1)operator(]\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) stringoperator(;) + ident(p) operator(:=) ident(PosEx)operator(()ident(Brake)operator(,) ident(s)operator(\);) + + reserved(if) ident(p) operator(>) integer(0) reserved(then) reserved(begin) + ident(Inc)operator(()ident(p)operator(,) ident(Length)operator(()ident(Brake)operator(\)\);) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StringWrap)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) reserved(const) ident(LineEnd)operator(:) reserved(string) operator(=) ident(EOL)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(if) operator(()ident(S) operator(=) stringoperator(\)) reserved(or) operator(()ident(Width) operator(<) integer(1)operator(\)) reserved(then) + ident(Exit)operator(;) + + ident(i) operator(:=) integer(1)operator(;) + reserved(while) ident(True) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(i)operator(,) ident(Width)operator(\);) + ident(Inc)operator(()ident(i)operator(,) ident(Width)operator(\);) + reserved(if) ident(i) operator(<=) ident(Length)operator(()ident(S)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(LineEnd) + reserved(else) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\):) ident(TStrA)operator(;) +reserved(var) + ident(p)operator(,) ident(fin)operator(,) ident(SepLen)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) + ident(Exit)operator(;) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(+) integer(1)operator(\);) + ident(Result)operator([)ident(High)operator(()ident(Result)operator(\)]) operator(:=) ident(S)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(S) operator(=) string reserved(then) reserved(begin) + reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) + ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) reserved(nil)operator(;) + ident(SepLen) operator(:=) ident(Length)operator(()ident(Separator)operator(\);) + + ident(p) operator(:=) integer(1)operator(;) + ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(\);) + reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\)\);) + ident(p) operator(:=) ident(fin) operator(+) ident(SepLen)operator(;) + ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(,) ident(p)operator(\);) + reserved(end)operator(;) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\)\);) + + reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) + ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(Split)operator(()reserved(const) ident(S)operator(,) ident(Separator)operator(:) reserved(string)operator(;) ident(Strings)operator(:) ident(TStrings)operator(;) + ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(\);) +reserved(var) + ident(p)operator(,) ident(fin)operator(,) ident(SepLen)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) + ident(Exit)operator(;) + ident(Strings)operator(.)ident(Add)operator(()ident(S)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(S) operator(=) string reserved(then) + ident(Exit)operator(;) + + ident(Strings)operator(.)ident(BeginUpdate)operator(;) + ident(SepLen) operator(:=) ident(Length)operator(()ident(Separator)operator(\);) + ident(p) operator(:=) integer(1)operator(;) + ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(\);) + reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\)\);) + ident(p) operator(:=) ident(fin) operator(+) ident(SepLen)operator(;) + ident(fin) operator(:=) ident(PosEx)operator(()ident(Separator)operator(,) ident(S)operator(,) ident(p)operator(\);) + reserved(end)operator(;) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\)\);) + ident(Strings)operator(.)ident(EndUpdate)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Split)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Separators)operator(:) ident(TCharSet)operator(;) + ident(IgnoreMultiSep)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(0)operator(\):) ident(TStrA)operator(;) +reserved(var) + ident(p)operator(,) ident(fin)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) ident(IgnoreMultiSep) reserved(and) operator(()ident(S) operator(=) stringoperator(\)) reserved(then) + ident(Exit)operator(;) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(+) integer(1)operator(\);) + ident(Result)operator([)ident(High)operator(()ident(Result)operator(\)]) operator(:=) ident(S)operator(;) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(S) operator(=) string reserved(then) reserved(begin) + reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) + ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) reserved(nil)operator(;) + + ident(p) operator(:=) integer(1)operator(;) + ident(fin) operator(:=) ident(CharPos)operator(()ident(Separators)operator(,) ident(S)operator(\);) + reserved(while) ident(fin) operator(>) integer(0) reserved(do) reserved(begin) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(fin) operator(-) ident(p)operator(\)\);) + ident(p) operator(:=) ident(fin) operator(+) integer(1)operator(;) + ident(fin) operator(:=) ident(CharPos)operator(()ident(Separators)operator(,) ident(S)operator(,) ident(p)operator(\);) + reserved(end)operator(;) + ident(Add)operator(()ident(Copy)operator(()ident(S)operator(,) ident(p)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(p) operator(+) integer(1)operator(\)\);) + + reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(<) ident(MinCount) reserved(then) + ident(SetLength)operator(()ident(Result)operator(,) ident(MinCount)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TileStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(BrakeStart)operator(:) ident(Integer)operator(;) ident(BrakeEnd)operator(:) ident(Integer)operator(;) + reserved(out) ident(Left)operator(,) ident(Right)operator(:) reserved(string)operator(\);) +reserved(begin) + ident(Left) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(BrakeStart)operator(-)integer(1)operator(\);) + ident(Right) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(BrakeEnd) operator(+) integer(1)operator(,) ident(MaxInt)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(Join)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(,) ident(imax)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(imax) operator(:=) ident(Strings)operator(.)ident(Count)operator(-)integer(1)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(imax) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(Strings)operator([)ident(i)operator(];) + reserved(if) ident(i) operator(<) ident(imax) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Separator)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Join)operator(()ident(StrA)operator(:) ident(TStrA)operator(;) ident(Separator)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) directive(overload)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(StrA)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(StrA)operator([)ident(i)operator(];) + reserved(if) ident(i) operator(<) ident(High)operator(()ident(StrA)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Separator)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(MulStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Count)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) +reserved(var) + ident(P)operator(:) ident(PChar)operator(;) + ident(Len)operator(,) ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(if) ident(Count) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\);) + ident(SetLength)operator(()ident(Result)operator(,) ident(Len) operator(*) ident(Count)operator(\);) + + ident(P) operator(:=) ident(Pointer)operator(()ident(Result)operator(\);) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Count) reserved(do) reserved(begin) + ident(Move)operator(()ident(Pointer)operator(()ident(S)operator(\)^,) ident(P)operator(^,) ident(Len)operator(\);) + ident(Inc)operator(()ident(P)operator(,) ident(Len)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(AlignR)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Width)operator(:) ident(Integer)operator(;) ident(Filler)operator(:) ident(Char) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(MulStr)operator(()ident(Filler)operator(,) ident(Width) operator(-) ident(Length)operator(()ident(S)operator(\)\)) operator(+) ident(S)operator(;) +reserved(end)operator(;) + +reserved(function) ident(MaxStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(MaxLen)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Len)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\);) + reserved(if) ident(Len) operator(<=) ident(MaxLen) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(S)operator(;) + ident(Exit) reserved(end)operator(;) + + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(MaxLen) operator(-) integer(3)operator(\)) operator(+) stringoperator(;) +reserved(end)operator(;) + +reserved(function) ident(TrimAll)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) ident(S)operator([)ident(i)operator(]) operator(>) char(#32) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(ControlChar)operator(()ident(C)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(C) reserved(in) ident(StrangeChars)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FriendlyChar)operator(()ident(C)operator(:) ident(Char)operator(\):) ident(Char)operator(;) +reserved(begin) + reserved(case) ident(C) reserved(of) + char(#0)operator(:) ident(Result) operator(:=) charoperator(;) + char(#1)operator(..)char(#31)operator(:) ident(Result) operator(:=) charoperator(;) + char(#255)operator(:) ident(Result) operator(:=) charoperator(;) + reserved(else) + ident(Result) operator(:=) ident(C)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FriendlyStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(S)operator(\)\);) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + ident(Result)operator([)ident(i)operator(]) operator(:=) ident(FriendlyChar)operator(()ident(S)operator([)ident(i)operator(]\);) +reserved(end)operator(;) + +reserved(function) ident(FriendlyStr)operator(()ident(a)operator(:) ident(TByteA)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(a)operator(\)\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) + ident(Result)operator([)ident(i) operator(+) integer(1)operator(]) operator(:=) ident(FriendlyChar)operator(()ident(Char)operator(()ident(a)operator([)ident(i)operator(]\)\);) +reserved(end)operator(;) + +reserved(function) ident(Quote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Quoter)operator(:) ident(Char) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(S)operator(;) + + reserved(if) ident(FirstChar)operator(()ident(S)operator(\)) operator(<>) ident(Quoter) reserved(then) + ident(Result) operator(:=) ident(Quoter) operator(+) ident(Result)operator(;) + + reserved(if) ident(LastChar)operator(()ident(S)operator(\)) operator(<>) ident(Quoter) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Quoter)operator(;) +reserved(end)operator(;) + +reserved(function) ident(DeQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(if) ident(Length)operator(()ident(S)operator(\)) operator(>) integer(2) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) integer(2)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) integer(2)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(UnQuote)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Start)operator(,) ident(Len)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Start) operator(:=) integer(1)operator(;) + ident(Len) operator(:=) ident(Length)operator(()ident(S)operator(\);) + + reserved(if) operator(()ident(S) operator(<>) stringoperator(\)) reserved(and) operator(()ident(S)operator([)integer(1)operator(]) reserved(in) operator(([)char(#0)operator(..)char(#32)operator(]) operator(+) ident(QuoteChars)operator(\)\)) reserved(then) reserved(begin) + reserved(if) operator(()ident(LastChar)operator(()ident(S)operator(\)) operator(=) ident(S)operator([)integer(1)operator(]\)) reserved(then) + ident(Dec)operator(()ident(Len)operator(\);) + ident(Inc)operator(()ident(Start)operator(\);) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(Copy)operator(()ident(S)operator(,) ident(Start)operator(,) ident(Len) operator(-) ident(Start) operator(+) integer(1)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(StrNumerus)operator(()reserved(const) ident(Value)operator(:) ident(Integer)operator(;) reserved(const) ident(Singular)operator(,) ident(Plural)operator(:) reserved(string)operator(;) + reserved(const) ident(Zero)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(Abs)operator(()ident(Value)operator(\)) operator(=) integer(1) reserved(then) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) char operator(+) ident(Singular) + reserved(else) reserved(if) ident(Value) operator(=) integer(0) reserved(then) + ident(Result) operator(:=) ident(Zero) operator(+) char operator(+) ident(Plural) + reserved(else) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(Value)operator(\)) operator(+) char operator(+) ident(Plural)operator(;) +reserved(end)operator(;) + +reserved(function) ident(MakeStr)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(const) + ident(BoolStrings)operator(:) reserved(array)operator([)ident(Boolean)operator(]) reserved(of) reserved(string) operator(=) operator(()stringoperator(,) stringoperator(\);) + +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + + reserved(function) ident(StrOfP)operator(()ident(P)operator(:) ident(Pointer)operator(\):) reserved(string)operator(;) + reserved(begin) + reserved(if) ident(P) operator(=) reserved(nil) reserved(then) + ident(Result) operator(:=) string + reserved(else) + ident(Result) operator(:=) char operator(+) ident(IntToStr)operator(()ident(Cardinal)operator(()ident(P)operator(\)\)) operator(+) charoperator(;) + reserved(end)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(s) operator(+) ident(Separator)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Items)operator(\)) reserved(do) + reserved(with) ident(Items)operator([)ident(i)operator(]) reserved(do) + reserved(case) ident(VType) reserved(of) + ident(vtString)operator(:) ident(Add)operator(()ident(VString)operator(^\);) + ident(vtInteger)operator(:) ident(Add)operator(()ident(IntToStr)operator(()ident(VInteger)operator(\)\);) + ident(vtBoolean)operator(:) ident(Add)operator(()ident(BoolStrings)operator([)ident(VBoolean)operator(]\);) + ident(vtChar)operator(:) ident(Add)operator(()ident(VChar)operator(\);) + ident(vtPChar)operator(:) ident(Add)operator(()ident(VPChar)operator(\);) + ident(vtExtended)operator(:) ident(Add)operator(()ident(FloatToStr)operator(()ident(VExtended)operator(^\)\);) + ident(vtObject)operator(:) reserved(if) ident(VObject) reserved(is) ident(TComponent) reserved(then) + ident(Add)operator(()ident(TComponent)operator(()ident(VObject)operator(\).)ident(Name)operator(\)) + reserved(else) + ident(Add)operator(()ident(VObject)operator(.)ident(ClassName)operator(\);) + ident(vtClass)operator(:) ident(Add)operator(()ident(VClass)operator(.)ident(ClassName)operator(\);) + ident(vtAnsiString)operator(:) ident(Add)operator(()reserved(string)operator(()ident(VAnsiString)operator(\)\);) + ident(vtCurrency)operator(:) ident(Add)operator(()ident(CurrToStr)operator(()ident(VCurrency)operator(^\)\);) + ident(vtInt64)operator(:) ident(Add)operator(()ident(IntToStr)operator(()ident(VInt64)operator(^\)\);) + ident(vtVariant)operator(:) ident(Add)operator(()reserved(string)operator(()ident(VVariant)operator(^\)\);) + + ident(vtWideChar)operator(:) ident(Add)operator(()ident(VWideChar)operator(\);) + ident(vtPWideChar)operator(:) ident(Add)operator(()ident(VPWideChar)operator(\);) + ident(vtInterface)operator(:) ident(Add)operator(()ident(StrOfP)operator(()ident(VInterface)operator(\)\);) + ident(vtPointer)operator(:) ident(Add)operator(()ident(StrOfP)operator(()ident(VPointer)operator(\)\);) + ident(vtWideString)operator(:) ident(Add)operator(()ident(WideString)operator(()ident(VWideString)operator(\)\);) + reserved(end)operator(;) + reserved(if) ident(Result) operator(<>) string reserved(then) + ident(SetLength)operator(()ident(result)operator(,) ident(Length)operator(()ident(Result)operator(\)) operator(-) ident(Length)operator(()ident(Separator)operator(\)\);) +reserved(end)operator(;) + +reserved(procedure) ident(ShowText)operator(()reserved(const) ident(Items)operator(:) reserved(array) reserved(of) reserved(const)operator(;) ident(Separator)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(var) + ident(Text)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Text) operator(:=) ident(MakeStr)operator(()ident(Items)operator(,) ident(Separator)operator(\);) + + ident(MessageBox)operator(()integer(0)operator(,) ident(PChar)operator(()ident(Text)operator(\),) stringoperator(,) ident(MB_OK) reserved(and) ident(MB_APPLMODAL)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) ident(S)operator([)ident(i)operator(]) operator(<>) ident(C) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(DeleteChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) reserved(not) operator(()ident(S)operator([)ident(i)operator(]) reserved(in) ident(C)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(ExtractChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) ident(S)operator([)ident(i)operator(]) reserved(in) ident(C) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(S)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(CharCount)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) ident(S)operator([)ident(i)operator(]) operator(=) ident(C) reserved(then) + ident(Inc)operator(()ident(Result)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(StrAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Str)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Str) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Str) operator(=) ident(Copy)operator(()ident(S)operator(,) ident(Pos)operator(,) ident(Length)operator(()ident(Str)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(TextAtPos)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Pos)operator(:) ident(Integer)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Text) operator(<>) stringoperator(\)) reserved(and) ident(SameText)operator(()ident(Text)operator(,) ident(Copy)operator(()ident(S)operator(,) ident(Pos)operator(,) ident(Length)operator(()ident(Text)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(StrAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Str)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(StrAtPos)operator(()ident(S)operator(,) integer(1)operator(,) ident(Str)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(TextAtBegin)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(TextAtPos)operator(()ident(S)operator(,) integer(1)operator(,) ident(Text)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(Char)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) + reserved(if) ident(S)operator([)ident(i)operator(]) operator(=) ident(C) reserved(then) ident(Exit)operator(;) + ident(Result) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(function) ident(CharIn)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(C)operator(:) ident(TCharSet)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(S)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(S)operator([)ident(i)operator(]) reserved(in) ident(C)operator(;) + reserved(if) ident(Result) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrIn)operator(()reserved(const) ident(S)operator(,) ident(SubStr)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(PosEx)operator(()ident(SubStr)operator(,) ident(S)operator(\)) operator(>) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(Result) operator(:=) operator(()ident(S) operator(=) ident(SL)operator([)ident(i)operator(]\);) + reserved(if) ident(Result) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) operator(()ident(S) operator(=) ident(A)operator([)ident(i)operator(]\);) + reserved(if) ident(Result) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TextIn)operator(()reserved(const) ident(S)operator(,) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(PosExText)operator(()ident(Text)operator(,) ident(S)operator(\)) operator(>) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TextIn)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(SameText)operator(()ident(Text)operator(,) ident(SL)operator([)ident(i)operator(]\);) + reserved(if) ident(Result) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TextIn)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(for) ident(i) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(SameText)operator(()ident(Text)operator(,) ident(A)operator([)ident(i)operator(]\);) + reserved(if) ident(Result) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(S) operator(=) ident(SL)operator([)ident(Result)operator(]) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) + reserved(if) ident(S) operator(=) ident(A)operator([)ident(Result)operator(]) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TextIndex)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(SameText)operator(()ident(Text)operator(,) ident(SL)operator([)ident(Result)operator(]\)) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TextIndex)operator(()ident(A)operator(:) ident(TStrA)operator(;) reserved(const) ident(Text)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) ident(Low)operator(()ident(A)operator(\)) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) + reserved(if) ident(SameText)operator(()ident(Text)operator(,) ident(A)operator([)ident(Result)operator(]\)) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(,) ident(New)operator(:) ident(Char)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(S)operator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Result)operator(\)) reserved(do) + reserved(if) ident(Result)operator([)ident(i)operator(]) operator(=) ident(Old) reserved(then) + ident(Result)operator([)ident(i)operator(]) operator(:=) ident(New)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ReplaceChars)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) ident(Old)operator(:) ident(TCharSet)operator(;) ident(New)operator(:) ident(Char)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(S)operator(;) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Result)operator(\)) reserved(do) + reserved(if) ident(Result)operator([)ident(i)operator(]) reserved(in) ident(Old) reserved(then) + ident(Result)operator([)ident(i)operator(]) operator(:=) ident(New)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Replace)operator(()reserved(const) ident(S)operator(,) ident(Old)operator(,) ident(New)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(oldp)operator(,) ident(ps)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(ps) operator(:=) integer(1)operator(;) + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(True) reserved(do) reserved(begin) + ident(oldp) operator(:=) ident(ps)operator(;) + ident(ps) operator(:=) ident(PosEx)operator(()ident(Old)operator(,) ident(S)operator(,) ident(oldp)operator(\);) + reserved(if) ident(ps) operator(=) integer(0) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(oldp)operator(,) ident(Length)operator(()ident(S)operator(\)) operator(-) ident(oldp) operator(+) integer(1)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + ident(Result) operator(:=) ident(Result) operator(+) ident(Copy)operator(()ident(S)operator(,) ident(oldp)operator(,) ident(ps) operator(-) ident(oldp)operator(\)) operator(+) ident(New)operator(;) + ident(Inc)operator(()ident(ps)operator(,) ident(Length)operator(()ident(Old)operator(\)\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(SLOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(TStringList)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(then) + ident(Result)operator(.)ident(LoadFromFile)operator(()ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(ContainsEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(StrIn)operator(()ident(SL)operator(,) stringoperator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(DeleteEmptyLines)operator(()ident(SL)operator(:) ident(TStrings)operator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(i) operator(<) ident(SL)operator(.)ident(Count) reserved(do) reserved(begin) + reserved(if) ident(SL)operator([)ident(i)operator(]) operator(=) string reserved(then) + ident(SL)operator(.)ident(Delete)operator(()ident(i)operator(\)) + reserved(else) + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(DeleteCommentLines)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(CommentSign)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(i) operator(:=) integer(0)operator(;) + reserved(while) ident(i) operator(<) ident(SL)operator(.)ident(Count) reserved(do) reserved(begin) + reserved(if) operator(()ident(SL)operator([)ident(i)operator(]) operator(=) stringoperator(\)) reserved(or) operator(()ident(StrAtBegin)operator(()ident(TrimLeft)operator(()ident(SL)operator([)ident(i)operator(]\),) ident(CommentSign)operator(\)\)) reserved(then) + ident(SL)operator(.)ident(Delete)operator(()ident(i)operator(\)) + reserved(else) + ident(Inc)operator(()ident(i)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FindLine)operator(()ident(SL)operator(:) ident(TStrings)operator(;) reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(Result) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) + reserved(if) ident(TextAtBegin)operator(()ident(SL)operator([)ident(Result)operator(],) ident(S)operator(\)) reserved(then) + ident(Exit)operator(;) + ident(Result) operator(:=) operator(-)integer(1)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(QuickSortSL)operator(()ident(SL)operator(:) ident(TStringList)operator(\);) + + reserved(procedure) ident(Sort)operator(()ident(l)operator(,) ident(r)operator(:) ident(Integer)operator(\);) + reserved(var) + ident(i)operator(,)ident(j)operator(:) ident(Integer)operator(;) + ident(z)operator(,)ident(x)operator(:) reserved(string)operator(;) + reserved(begin) + ident(i) operator(:=) ident(l)operator(;) + ident(j) operator(:=) ident(r)operator(;) + ident(x) operator(:=) ident(SL)operator([()ident(j) operator(+) ident(i)operator(\)) reserved(div) integer(2)operator(];) + reserved(repeat) + reserved(while) ident(SL)operator([)ident(i)operator(]) operator(<) ident(x) reserved(do) ident(Inc)operator(()ident(i)operator(\);) + reserved(while) ident(SL)operator([)ident(j)operator(]) operator(>) ident(x) reserved(do) ident(Dec)operator(()ident(j)operator(\);) + reserved(if) ident(i) operator(<=) ident(j) reserved(then) reserved(begin) + ident(z) operator(:=) ident(SL)operator([)ident(i)operator(];) + ident(SL)operator([)ident(i)operator(]) operator(:=) ident(SL)operator([)ident(j)operator(];) + ident(SL)operator([)ident(j)operator(]) operator(:=) ident(z)operator(;) + ident(Inc)operator(()ident(i)operator(\);) ident(Dec)operator(()ident(j)operator(\);) + reserved(end)operator(;) + reserved(until) ident(i) operator(>) ident(j)operator(;) + reserved(if) ident(j) operator(>) ident(l) reserved(then) ident(Sort)operator(()ident(l)operator(,) ident(j)operator(\);) + reserved(if) ident(i) operator(<) ident(r) reserved(then) ident(Sort)operator(()ident(i)operator(,) ident(r)operator(\);) + reserved(end)operator(;) + +reserved(begin) + reserved(if) ident(SL)operator(.)ident(Count) operator(>) integer(0) reserved(then) + ident(Sort)operator(()integer(0)operator(,) ident(SL)operator(.)ident(Count)operator(-)integer(1)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(IncStrA)operator(()ident(StrA)operator(:) ident(TStrA)operator(\):) ident(Integer)operator(;) +reserved(begin) + ident(SetLength)operator(()ident(StrA)operator(,) ident(Length)operator(()ident(StrA)operator(\)) operator(+) integer(1)operator(\);) + ident(Result) operator(:=) ident(High)operator(()ident(StrA)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(StrOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) reserved(string)operator(()ident(Copy)operator(()ident(a)operator(,) integer(0)operator(,) ident(Length)operator(()ident(a)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(ByteAOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(TByteA)operator(()ident(Copy)operator(()ident(S)operator(,) integer(1)operator(,) ident(Length)operator(()ident(s)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(ByteAOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\):) ident(TByteA)operator(;) +reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(SizeOf)operator(()ident(Integer)operator(\)\);) + ident(Move)operator(()ident(i)operator(,) ident(Pointer)operator(()ident(Result)operator(\)^,) ident(SizeOf)operator(()ident(Integer)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(IntOfByteA)operator(()ident(A)operator(:) ident(TByteA)operator(\):) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Move)operator(()ident(Pointer)operator(()ident(A)operator(\)^,) ident(Result)operator(,) ident(Min)operator(()ident(Length)operator(()ident(A)operator(\),) ident(SizeOf)operator(()ident(Integer)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(ByteAOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(h)operator(:) reserved(string)operator(;) +reserved(begin) + ident(h) operator(:=) ident(ExtractChars)operator(()ident(Hex)operator(,) ident(HexadecimalChars)operator(\);) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(h)operator(\)) reserved(div) integer(2)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Result)operator(\)) reserved(do) + ident(Result)operator([)ident(i)operator(]) operator(:=) ident(ByteOfHex)operator(()ident(Copy)operator(()ident(h)operator(,) operator(()ident(i) reserved(shl) integer(1)operator(\)) operator(+) integer(1)operator(,) integer(2)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(SizeOfFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(F)operator(:) reserved(file)operator(;) +reserved(begin) + ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\);) + preprocessor({$I-})ident(Reset)operator(()ident(F)operator(,) integer(1)operator(\);)preprocessor({$I+}) + reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(FileSize)operator(()ident(F)operator(\);) + ident(CloseFile)operator(()ident(F)operator(\);) + reserved(end) reserved(else) + ident(Result) operator(:=) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FileEx)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(;) ident(AllowFolders)operator(:) ident(Boolean) operator(=) ident(False)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(FindData)operator(:) ident(TWin32FindData)operator(;) +reserved(begin) + reserved(if) ident(FileName) operator(=) string reserved(then) reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) operator(()ident(AllowFolders) reserved(and) ident(DirectoryExists)operator(()ident(FileName)operator(\)\)) reserved(or) + operator(()ident(FindFirstFile)operator(()ident(PChar)operator(()ident(FileName)operator(\),) ident(FindData)operator(\)) operator(<>) ident(INVALID_HANDLE_VALUE)operator(\);) + ident(Result) operator(:=) ident(Result) reserved(and) reserved(not) ident(CharIn)operator(()ident(FileName)operator(,) ident(WildCards)operator(\);) + ident(Result) operator(:=) ident(Result) reserved(and) operator(()ident(AllowFolders) + reserved(or) operator((()ident(FindData)operator(.)ident(dwFileAttributes) reserved(and) ident(FILE_ATTRIBUTE_DIRECTORY)operator(\)) operator(=) integer(0)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(LWPSolve)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) operator(()ident(Dir) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Dir)operator([)ident(Length)operator(()ident(Dir)operator(\)]) operator(=) charoperator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Copy)operator(()ident(Dir)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Dir)operator(\)) operator(-) integer(1)operator(\);) + reserved(end) reserved(else) + ident(Result) operator(:=) ident(Dir)operator(;) +reserved(end)operator(;) + +reserved(function) ident(LWPSlash)operator(()reserved(const) ident(Dir)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) operator(()ident(Dir) operator(<>) stringoperator(\)) reserved(and) operator(()ident(Dir)operator([)ident(Length)operator(()ident(Dir)operator(\)]) operator(=) charoperator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Copy)operator(()ident(Dir)operator(,) integer(1)operator(,) ident(Length)operator(()ident(Dir)operator(\)\);) + reserved(end) reserved(else) + ident(Result) operator(:=) ident(Dir) operator(+) charoperator(;) +reserved(end)operator(;) + +reserved(function) ident(ExtractDrive)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(if) operator(()ident(Length)operator(()ident(FileName)operator(\)) operator(>=) integer(2)operator(\)) reserved(and) operator(()ident(FileName)operator([)integer(2)operator(]) operator(=) charoperator(\)) reserved(then) + ident(Result) operator(:=) ident(UpperCase)operator(()ident(FileName)operator([)integer(1)operator(]) operator(+) stringoperator(\);) +reserved(end)operator(;) + +reserved(function) ident(ExtractPath)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(p)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(p) operator(:=) ident(CharPosR)operator(()charoperator(,) ident(FileName)operator(\);) + reserved(if) ident(P) operator(>) integer(0) reserved(then) + ident(Result) operator(:=) ident(Copy)operator(()ident(FileName)operator(,) integer(1)operator(,) ident(p)operator(\)) + reserved(else) + ident(Result) operator(:=) ident(FileName)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ExtractPrefix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(UntilLastChar)operator(()ident(ExtractFileName)operator(()ident(FileName)operator(\),) charoperator(\);) +reserved(end)operator(;) + +reserved(function) ident(ExtractSuffix)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(FromLastChar)operator(()ident(ExtractFileName)operator(()ident(FileName)operator(\),) charoperator(\);) +reserved(end)operator(;) + +reserved(function) ident(SameByteA)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(TByteA)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(A) operator(=) ident(B)operator(\)) reserved(or) operator((()ident(Length)operator(()ident(A)operator(\)) operator(=) ident(Length)operator(()ident(B)operator(\)\)) reserved(and) ident(CompareMem)operator(()ident(A)operator(,) ident(B)operator(,) ident(Length)operator(()ident(A)operator(\)\)\);) +reserved(end)operator(;) + +reserved(function) ident(Reverse)operator(()ident(A)operator(:) ident(TByteA)operator(\):) ident(TByteA)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(Length)operator(()ident(A)operator(\)\);) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) + ident(Result)operator([)ident(High)operator(()ident(Result)operator(\)) operator(-) ident(i)operator(]) operator(:=) ident(A)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(Endian)operator(()ident(i)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) +reserved(type) + ident(EndianArray) operator(=) reserved(packed) reserved(array)operator([)integer(0)operator(..)integer(3)operator(]) reserved(of) ident(Byte)operator(;) +reserved(var) + ident(a)operator(,) ident(b)operator(:) ident(EndianArray)operator(;) +reserved(begin) + ident(a) operator(:=) ident(EndianArray)operator(()ident(i)operator(\);) + ident(b)operator([)integer(0)operator(]) operator(:=) ident(a)operator([)integer(3)operator(];) + ident(b)operator([)integer(1)operator(]) operator(:=) ident(a)operator([)integer(2)operator(];) + ident(b)operator([)integer(2)operator(]) operator(:=) ident(a)operator([)integer(1)operator(];) + ident(b)operator([)integer(3)operator(]) operator(:=) ident(a)operator([)integer(0)operator(];) + ident(Result) operator(:=) ident(Integer)operator(()ident(b)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(SaveByteA)operator(()ident(Data)operator(:) ident(TByteA)operator(;) reserved(const) ident(FileName)operator(:) reserved(string)operator(;) + ident(Overwrite)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(F)operator(:) reserved(file)operator(;) +reserved(begin) + reserved(if) ident(FileExists)operator(()ident(FileName)operator(\)) reserved(and) reserved(not) ident(Overwrite) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + ident(Exit) reserved(end)operator(;) + + ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\);) + preprocessor({$I-})ident(Rewrite)operator(()ident(F)operator(,) integer(1)operator(\);)preprocessor({$I+}) + reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) + reserved(if) ident(Length)operator(()ident(Data)operator(\)) operator(>) integer(0) reserved(then) + ident(BlockWrite)operator(()ident(F)operator(,) ident(Data)operator([)integer(0)operator(],) ident(Length)operator(()ident(Data)operator(\)\);) + ident(CloseFile)operator(()ident(F)operator(\);) + ident(Result) operator(:=) ident(True)operator(;) + reserved(end) reserved(else) + ident(Result) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(function) ident(LoadByteA)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(TByteA)operator(;) +reserved(var) + ident(F)operator(:) reserved(file)operator(;) +reserved(begin) + ident(AssignFile)operator(()ident(F)operator(,) ident(FileName)operator(\);) + preprocessor({$I-})ident(Reset)operator(()ident(F)operator(,) integer(1)operator(\);)preprocessor({$I+}) + reserved(if) ident(IOResult) operator(=) integer(0) reserved(then) reserved(begin) + ident(SetLength)operator(()ident(Result)operator(,) ident(FileSize)operator(()ident(F)operator(\)\);) + reserved(if) ident(Length)operator(()ident(Result)operator(\)) operator(>) integer(0) reserved(then) + ident(BlockRead)operator(()ident(F)operator(,) ident(Result)operator([)integer(0)operator(],) ident(FileSize)operator(()ident(F)operator(\)\);) + ident(CloseFile)operator(()ident(F)operator(\);) + reserved(end) reserved(else) + ident(SetLength)operator(()ident(Result)operator(,) integer(0)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(IsValidFileName)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(FileName) operator(<>) stringoperator(\)) reserved(and) reserved(not) ident(CharIn)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(\)) + reserved(and) ident(CharIn)operator(()ident(Trim)operator(()ident(FileName)operator(\),) ident(AllChars) operator(-) operator([)charoperator(]\);) +reserved(end)operator(;) + +reserved(function) ident(MakeValidFileName)operator(()ident(FileName)operator(:) reserved(string)operator(;) reserved(const) ident(Default)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(FileName) operator(=) string reserved(then) + ident(FileName) operator(:=) ident(Default)operator(;) + + reserved(if) ident(CharIn)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(\)) reserved(then) + ident(Result) operator(:=) ident(ReplaceChars)operator(()ident(FileName)operator(,) ident(FileNameEnemies)operator(,) charoperator(\)) + reserved(else) reserved(if) reserved(not) ident(CharIn)operator(()ident(Trim)operator(()ident(FileName)operator(\),) ident(AllChars) operator(-) operator([)charoperator(]\)) reserved(then) + ident(Result) operator(:=) ident(Default) + reserved(else) + ident(Result) operator(:=) ident(FileName)operator(;) +reserved(end)operator(;) + +reserved(function) ident(IsValidInteger)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +comment({const + LowInt = '2147483648'; + HighInt = '2147483647'; +var + len, RealLen, i, o: Integer; + c: Char; +begin + Result := False; + if S = '' then + Exit; + + len := Length(S\); + o := 1; + + if S[1] = '-' then begin + if len = 1 then + Exit; + Inc(o\); + while (o <= len\) and (S[o] = '0'\) do + Inc(o\); + if o > len then + Exit; + if o < len then begin + RealLen := len - o + 1; + if RealLen > Length(LowInt\) then + Exit + else if RealLen = Length(LowInt\) then begin + for i := 1 to Length(LowInt\) do begin + c := S[i + o - 1]; + if (c < '0'\) or (c > LowInt[i]\) then + Exit; + if c in ['0'..Char((Byte(LowInt[i]\)-1\)\)] then + Break; + end; + Inc(o, i\); + end; + end; + end else begin + while (o <= len\) and (S[o] = '0'\) do + Inc(o\); + if o <= len then begin + RealLen := len - o + 1; + if RealLen > Length(HighInt\) then + Exit + else if RealLen = Length(HighInt\) then begin + for i := 1 to Length(HighInt\) do begin + c := S[i + o - 1]; + if (c < '0'\) or (c > HighInt[i]\) then + Exit; + if c in ['0'..Char((Byte(HighInt[i]\)-1\)\)] then + Break; + end; + Inc(o, i\); + end; + end; + end; + + for i := o to len do + if not (S[i] in ['0'..'9']\) then + Exit; + + Result := True; }) +reserved(var) + ident(i)operator(:) ident(Int64)operator(;) +reserved(begin) + ident(i) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) ident(High)operator(()ident(Int64)operator(\)\);) + ident(Result) operator(:=) operator(()ident(i) operator(>=) ident(Low)operator(()ident(Integer)operator(\)\)) reserved(and) operator(()ident(i) operator(<=) ident(High)operator(()ident(Integer)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(IsValidCardinal)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) +comment({const + HighCard = '4294967295'; +var + len, RealLen, i, o: Integer; +begin + Result := False; + if S = '' then + Exit; + + len := Length(S\); + o := 1; + + while (o <= len\) and (S[o] = '0'\) do + Inc(o\); + if o <= len then begin + RealLen := len - o + 1; + if RealLen > Length(HighCard\) then + Exit + else if RealLen = Length(HighCard\) then begin + for i := 1 to Length(HighCard\) do begin + if S[i + o - 1] > HighCard[i] then + Exit; + if S[i + o - 1] in ['0'..Char((Byte(HighCard[i]\)-1\)\)] then + Break; + end; + Inc(o, i\); + end; + end; + + for i := o to len do + if not (S[i] in ['0'..'9']\) then + Exit; + + Result := True; }) +reserved(var) + ident(i)operator(:) ident(Int64)operator(;) +reserved(begin) + ident(i) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) operator(-)integer(1)operator(\);) + ident(Result) operator(:=) operator(()ident(i) operator(>=) integer(0)operator(\)) reserved(and) operator(()ident(i) operator(<=) ident(High)operator(()ident(Cardinal)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(StrOfBool)operator(()ident(flag)operator(:) ident(Boolean)operator(;) reserved(const) ident(TrueStr)operator(:) reserved(string) operator(=) stringoperator(;) + reserved(const) ident(FalseStr)operator(:) reserved(string) operator(=) stringoperator(\):) reserved(string)operator(;) +reserved(begin) + reserved(if) ident(Flag) reserved(then) + ident(Result) operator(:=) ident(TrueStr) + reserved(else) + ident(Result) operator(:=) ident(FalseStr)operator(;) +reserved(end)operator(;) + +reserved(function) ident(StrOfInt)operator(()ident(i)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) +reserved(begin) +comment({ if i = 0 then begin + Result := '0'; + Exit end; + + while i > 0 do begin + Result := Char(Byte('0'\) + (i mod 10\)\) + Result; + i := i div 10; + end;}) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(i)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(CardOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) +reserved(var) + ident(Res)operator(:) ident(Int64)operator(;) +reserved(begin) + ident(Res) operator(:=) ident(StrToInt64Def)operator(()ident(S)operator(,) operator(-)integer(1)operator(\);) + reserved(if) ident(Res) operator(>) ident(High)operator(()ident(Cardinal)operator(\)) reserved(then) + ident(Res) operator(:=) ident(High)operator(()ident(Cardinal)operator(\)) + reserved(else) reserved(if) ident(Res) operator(<) integer(0) reserved(then) + ident(Res) operator(:=) integer(0)operator(;) + ident(Result) operator(:=) ident(Cardinal)operator(()ident(Res)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(HexOrd)operator(()ident(Hex)operator(:) ident(Char)operator(\):) ident(THex)operator(;) +reserved(begin) + reserved(case) ident(Hex) reserved(of) + charoperator(..)charoperator(:) + ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(48)operator(;) + charoperator(..)charoperator(:) + ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(55)operator(;) + charoperator(..)charoperator(:) + ident(Result) operator(:=) ident(Byte)operator(()ident(Hex)operator(\)) operator(-) integer(87)operator(;) + reserved(else) + ident(Result) operator(:=) integer(0)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(ByteOfHex)operator(()ident(Hex)operator(:) ident(THexByteStr)operator(\):) ident(Byte)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(HexOrd)operator(()ident(Hex)operator([)integer(1)operator(]\)) reserved(shl) integer(4)operator(\)) operator(+) ident(HexOrd)operator(()ident(Hex)operator([)integer(2)operator(]\);) +reserved(end)operator(;) + +reserved(function) ident(DecOfHex)operator(()reserved(const) ident(Hex)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(IntToStr)operator(()ident(CardOfHex)operator(()ident(Hex)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(HexOfByte)operator(()ident(b)operator(:) ident(Byte)operator(\):) ident(THexByteStr)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(HexChar)operator([()ident(b) reserved(and) hex($F0)operator(\)) reserved(shr) integer(4)operator(]) + operator(+) ident(HexChar)operator([) ident(b) reserved(and) hex($0F) operator(];) +reserved(end)operator(;) + +comment({function HexOfCard2(c: Cardinal\): string; +var + Data: array[0..(1 shl 4\) - 1] of Char; + i: Integer; +begin + for i := 0 to (1 shl 4\) - 1 do + if i < 10 then + Data[i] := Char(Ord('0'\) + i\) + else + Data[i] := Char(Ord('A'\) + i - 10\); + + Result := Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (7 shl 2\)\)\) shr (7 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (6 shl 2\)\)\) shr (6 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (5 shl 2\)\)\) shr (5 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (4 shl 2\)\)\) shr (4 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (3 shl 2\)\)\) shr (3 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (2 shl 2\)\)\) shr (2 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (1 shl 2\)\)\) shr (1 shl 2\)] + + Data[(c and (((1 shl (1 shl 2\)\) - 1\) shl (0 shl 2\)\)\) shr (0 shl 2\)]; +end; }) + +reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(\):) reserved(string)operator(;) +reserved(var) + ident(a)operator(:) ident(Cardinal)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) + ident(a) operator(:=) ident(i) reserved(and) hex($F)operator(;) + ident(Result) operator(:=) ident(HexChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) + ident(i) operator(:=) ident(i) reserved(shr) integer(4)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(HexOfCard)operator(()ident(i)operator(:) ident(Cardinal)operator(;) ident(Digits)operator(:) ident(Integer)operator(\):) reserved(string)operator(;) +reserved(var) + ident(a)operator(:) ident(Cardinal)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) + ident(a) operator(:=) ident(i) reserved(and) hex($F)operator(;) + ident(Result) operator(:=) ident(HexChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) + ident(i) operator(:=) ident(i) reserved(shr) integer(4)operator(;) + reserved(end)operator(;) + ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(Digits) operator(-) ident(Length)operator(()ident(Result)operator(\)\)) operator(+) ident(Result)operator(;) +reserved(end)operator(;) + +reserved(function) ident(PascalHexArray)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Name)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(,) ident(len)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) string operator(+) ident(EOL) operator(+) + string operator(+) ident(Name) operator(+) string operator(+) ident(IntToStr)operator(()ident(High)operator(()ident(a)operator(\)\)) operator(+) stringoperator(;) + + ident(len) operator(:=) ident(Length)operator(()ident(a)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(len)operator(-)integer(1) reserved(do) reserved(begin) + reserved(if) operator(()ident(i) reserved(mod) integer(19)operator(\)) operator(=) integer(0) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(EOL) operator(+) string operator(+) stringoperator(;) + ident(Result) operator(:=) ident(Result) operator(+) char operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(]\);) + reserved(if) ident(i) operator(<) ident(len)operator(-)integer(1) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) charoperator(;) + reserved(end)operator(;) + ident(Result) operator(:=) ident(Result) operator(+) ident(EOL) operator(+) stringoperator(;) +reserved(end)operator(;) + +reserved(function) ident(HexOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(1)operator(;) + reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + reserved(if) ident(Blocks) operator(>) integer(0) reserved(then) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(]\);) + reserved(if) ident(i) operator(<) ident(High)operator(()ident(a)operator(\)) reserved(then) + reserved(if) operator((()ident(i)operator(+)integer(1)operator(\)) reserved(mod) ident(Blocks)operator(\)) operator(=) integer(0) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Splitter)operator(;) + reserved(end) + reserved(else) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) + ident(Result) operator(:=) ident(Result) operator(+) ident(HexOfByte)operator(()ident(a)operator([)ident(i)operator(]\);) +reserved(end)operator(;) + +reserved(function) ident(BinOfByteA)operator(()ident(a)operator(:) ident(TByteA)operator(;) ident(Blocks)operator(:) ident(Integer) operator(=) integer(4)operator(;) + reserved(const) ident(Splitter)operator(:) reserved(string) operator(=) charoperator(\):) reserved(string)operator(;) +reserved(var) + ident(i)operator(,) ident(max)operator(:) ident(Integer)operator(;) + ident(Bit)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + + reserved(if) ident(Blocks) operator(>) integer(0) reserved(then) reserved(begin) + ident(max) operator(:=) integer(8) operator(*) operator(()ident(High)operator(()ident(a)operator(\)\)) operator(+) integer(7)operator(;) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(max) reserved(do) reserved(begin) + ident(Bit) operator(:=) integer(7)operator(-()ident(i) reserved(mod) integer(8)operator(\)) reserved(in) ident(TBitSet)operator(()ident(a)operator([)ident(i) reserved(div) integer(8)operator(]\);) + ident(Result) operator(:=) ident(Result) operator(+) ident(Char)operator(()ident(Byte)operator(()charoperator(\)) operator(+) ident(Byte)operator(()ident(Bit)operator(\)\);) + reserved(if) ident(i) operator(<) ident(max) reserved(then) + reserved(if) operator((()ident(i)operator(+)integer(1)operator(\)) reserved(mod) ident(Blocks)operator(\)) operator(=) integer(0) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Splitter)operator(;) + reserved(end)operator(;) + reserved(end) reserved(else) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(a)operator(\)) reserved(do) + ident(Result) operator(:=) ident(Result) operator(+) ident(Char)operator(()ident(Byte)operator(()charoperator(\)) operator(+) ident(a)operator([)ident(i)operator(]) reserved(shr) operator(()ident(i) reserved(and) integer(8)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(CardOfHex)operator(()ident(Hex)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Hex) operator(:=) ident(Copy)operator(()ident(ExtractChars)operator(()ident(Hex)operator(,) ident(HexadecimalChars)operator(\),) integer(1)operator(,) integer(8)operator(\);) + + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(Length)operator(()ident(Hex)operator(\)) reserved(do) + reserved(if) ident(Hex)operator([)ident(i)operator(]) operator(<>) char reserved(then) + ident(Inc)operator(()ident(Result)operator(,) ident(HexOrd)operator(()ident(Hex)operator([)ident(i)operator(]\)) reserved(shl) operator((()ident(Length)operator(()ident(Hex)operator(\)) operator(-) ident(i)operator(\)) reserved(shl) integer(2)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(IntOfBin)operator(()ident(Bin)operator(:) reserved(string)operator(\):) ident(Cardinal)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(Bin) operator(:=) ident(Copy)operator(()ident(ExtractChars)operator(()ident(Bin)operator(,) ident(BinaryChars)operator(\),) integer(1)operator(,) integer(32)operator(\);) + + reserved(for) ident(i) operator(:=) ident(Length)operator(()ident(Bin)operator(\)) reserved(downto) integer(1) reserved(do) + reserved(if) ident(Bin)operator([)ident(i)operator(]) operator(=) char reserved(then) + ident(Inc)operator(()ident(Result)operator(,) integer(1) reserved(shl) operator(()ident(Length)operator(()ident(Bin)operator(\)) operator(-) ident(i)operator(\)\);) +reserved(end)operator(;) + +reserved(function) ident(BinOfInt)operator(()ident(n)operator(:) ident(Cardinal)operator(\):) reserved(string)operator(;) +reserved(var) + ident(a)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(n) operator(=) integer(0) reserved(then) reserved(begin) + ident(Result) operator(:=) charoperator(;) + ident(exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(n) operator(>) integer(0) reserved(do) reserved(begin) + ident(a) operator(:=) ident(n) reserved(and) integer(1)operator(;) + ident(Result) operator(:=) ident(Char)operator(()ident(a) operator(+) ident(Byte)operator(()charoperator(\)\)) operator(+) ident(Result)operator(;) + ident(n) operator(:=) ident(n) reserved(shr) integer(1)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(BinOfIntFill)operator(()ident(n)operator(:) ident(Cardinal)operator(;) ident(MinCount)operator(:) ident(Integer) operator(=) integer(8)operator(\):) reserved(string)operator(;) +reserved(var) + ident(a)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(n) operator(=) integer(0) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(MinCount)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(n) operator(>) integer(0) reserved(do) reserved(begin) + ident(a) operator(:=) ident(n) reserved(and) integer(1)operator(;) + ident(Result) operator(:=) ident(Char)operator(()ident(a) operator(+) ident(Byte)operator(()charoperator(\)\)) operator(+) ident(Result)operator(;) + ident(n) operator(:=) ident(n) reserved(shr) integer(1)operator(;) + reserved(end)operator(;) + ident(Result) operator(:=) ident(MulStr)operator(()charoperator(,) ident(MinCount) operator(-) ident(Length)operator(()ident(Result)operator(\)\)) operator(+) ident(Result)operator(;) +reserved(end)operator(;) + +reserved(function) ident(BaseNOfInt)operator(()ident(I)operator(:) ident(Cardinal)operator(;) ident(B)operator(:) ident(TBaseN)operator(\):) reserved(string)operator(;) +reserved(var) + ident(a)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) operator(()ident(B) operator(<) integer(2)operator(\)) reserved(or) operator(()ident(i) operator(=) integer(0)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) charoperator(;) + ident(Exit)operator(;) reserved(end)operator(;) + + ident(Result) operator(:=) stringoperator(;) + reserved(while) ident(i) operator(>) integer(0) reserved(do) reserved(begin) + ident(a) operator(:=) ident(i) reserved(mod) ident(B)operator(;) + ident(Result) operator(:=) ident(BaseNChar)operator([)ident(a)operator(]) operator(+) ident(Result)operator(;) + ident(i) operator(:=) ident(i) reserved(div) ident(B)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(IntOfBaseN)operator(()ident(V)operator(:) reserved(string)operator(;) ident(B)operator(:) ident(TBaseN)operator(\):) ident(Cardinal)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) + ident(F)operator(:) ident(Cardinal)operator(;) + ident(c)operator(:) ident(Byte)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + ident(V) operator(:=) ident(TrimAll)operator(()ident(V)operator(\);) + ident(F) operator(:=) integer(1)operator(;) + reserved(for) ident(i) operator(:=) ident(Length)operator(()ident(V)operator(\)) reserved(downto) integer(1) reserved(do) reserved(begin) + ident(c) operator(:=) ident(Byte)operator(()ident(UpCase)operator(()ident(V)operator([)ident(i)operator(]\)\);) + reserved(case) ident(Char)operator(()ident(c)operator(\)) reserved(of) + charoperator(..)charoperator(:) ident(c) operator(:=) ident(c) operator(-) integer(48)operator(;) + charoperator(..)charoperator(:) ident(c) operator(:=) ident(c) operator(-) integer(55)operator(;) + reserved(end)operator(;) + reserved(if) ident(c) operator(<) ident(B) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(Byte)operator(()ident(c)operator(\)) operator(*) ident(F)operator(;) + ident(F) operator(:=) ident(F) operator(*) ident(B)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(KeepIn)operator(()ident(i)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Variant)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(i)operator(;) + reserved(if) ident(Result) operator(>) ident(Top) reserved(then) + ident(Result) operator(:=) ident(Top) + reserved(else) reserved(if) ident(Result) operator(<) ident(Bottom) reserved(then) + ident(Result) operator(:=) ident(Bottom)operator(;) +reserved(end)operator(;) + +reserved(function) ident(InRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Value) operator(>=) ident(Bottom)operator(\)) reserved(and) operator(()ident(Value) operator(<=) ident(Top)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(InStrictRange)operator(()ident(Value)operator(,) ident(Bottom)operator(,) ident(Top)operator(:) ident(Variant)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Value) operator(>) ident(Bottom)operator(\)) reserved(and) operator(()ident(Value) operator(<) ident(Top)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(A) operator(<) ident(B) reserved(then) + ident(Result) operator(:=) ident(A) + reserved(else) + ident(Result) operator(:=) ident(B)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Min)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + reserved(if) ident(Length)operator(()ident(A)operator(\)) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) ident(A)operator([)integer(0)operator(];) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) + reserved(if) ident(A)operator([)ident(i)operator(]) operator(<) ident(Result) reserved(then) + ident(Result) operator(:=) ident(A)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(,) ident(B)operator(:) ident(Integer)operator(\):) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(A) operator(>) ident(B) reserved(then) + ident(Result) operator(:=) ident(A) + reserved(else) + ident(Result) operator(:=) ident(B)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Max)operator(()reserved(const) ident(A)operator(:) ident(TIntA)operator(\):) ident(Integer)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + reserved(if) ident(Length)operator(()ident(A)operator(\)) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(Result) operator(:=) ident(A)operator([)integer(0)operator(];) + reserved(for) ident(i) operator(:=) integer(1) reserved(to) ident(High)operator(()ident(A)operator(\)) reserved(do) + reserved(if) ident(A)operator([)ident(i)operator(]) operator(>) ident(Result) reserved(then) + ident(Result) operator(:=) ident(A)operator([)ident(i)operator(];) +reserved(end)operator(;) + +reserved(function) ident(RangesOfStr)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) ident(TRanges)operator(;) +reserved(var) + ident(SL)operator(:) ident(TStringList)operator(;) + ident(r)operator(,) ident(b)operator(,) ident(t)operator(:) reserved(string)operator(;) + ident(i)operator(,) ident(p)operator(:) ident(Integer)operator(;) + + reserved(function) ident(TryStrToCard)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(;) reserved(out) ident(Value)operator(:) ident(Cardinal)operator(\):) ident(Boolean)operator(;) + reserved(var) + ident(E)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(Val)operator(()ident(S)operator(,) ident(Value)operator(,) ident(E)operator(\);) + ident(Result) operator(:=) ident(E) operator(=) integer(0)operator(;) + reserved(end)operator(;) + +reserved(begin) + ident(Result) operator(:=) reserved(nil)operator(;) + ident(SL) operator(:=) ident(TStringList)operator(.)ident(Create)operator(;) + reserved(try) + ident(Split)operator(()ident(S)operator(,) ident(RangesSeparator)operator(,) ident(SL)operator(\);) + ident(SetLength)operator(()ident(Result)operator(,) ident(SL)operator(.)ident(Count)operator(\);) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(SL)operator(.)ident(Count)operator(-)integer(1) reserved(do) reserved(begin) + ident(r) operator(:=) ident(SL)operator([)ident(i)operator(];) + reserved(with) ident(Result)operator([)ident(i)operator(]) reserved(do) reserved(begin) + ident(p) operator(:=) ident(CharPos)operator(()ident(RangeInnerSeparator)operator(,) ident(r)operator(\);) + ident(Simple) operator(:=) ident(p) operator(=) integer(0)operator(;) comment(// no '-' found) + reserved(if) ident(Simple) reserved(then) reserved(begin) + reserved(if) ident(r) operator(=) ident(RangeInfinite) reserved(then) reserved(begin) comment(// * --> *-*) + ident(Simple) operator(:=) ident(False)operator(;) + ident(Bottom) operator(:=) ident(Low)operator(()ident(Bottom)operator(\);) + ident(Top) operator(:=) ident(High)operator(()ident(Top)operator(\);) + reserved(end) reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(r)operator(,) ident(Value)operator(\)) reserved(then) + ident(Break)operator(;) + + reserved(end) reserved(else) reserved(begin) + ident(TileStr)operator(()ident(r)operator(,) ident(p)operator(,) ident(p)operator(,) ident(b)operator(,) ident(t)operator(\);) + + reserved(if) ident(b) operator(=) ident(RangeInfinite) reserved(then) + ident(Bottom) operator(:=) ident(Low)operator(()ident(Bottom)operator(\)) + reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(b)operator(,) ident(Bottom)operator(\)) reserved(then) + ident(Break)operator(;) + + reserved(if) ident(t) operator(=) ident(RangeInfinite) reserved(then) + ident(Top) operator(:=) ident(High)operator(()ident(Top)operator(\)) + reserved(else) reserved(if) reserved(not) ident(TryStrToCard)operator(()ident(t)operator(,) ident(Top)operator(\)) reserved(then) + ident(Break)operator(;) + reserved(if) ident(Bottom) operator(>) ident(Top) reserved(then) reserved(begin) + ident(p) operator(:=) ident(Bottom)operator(;) ident(Bottom) operator(:=) ident(Top)operator(;) ident(Top) operator(:=) ident(p)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) ident(i) operator(<>) ident(SL)operator(.)ident(Count) reserved(then) + ident(Result) operator(:=) reserved(nil)operator(;) + + reserved(finally) + ident(SL)operator(.)ident(Free)operator(;) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(function) ident(InRanges)operator(()ident(Ranges)operator(:) ident(TRanges)operator(;) ident(TestValue)operator(:) ident(Cardinal)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(True)operator(;) + + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(High)operator(()ident(Ranges)operator(\)) reserved(do) + reserved(with) ident(Ranges)operator([)ident(i)operator(]) reserved(do) + reserved(if) ident(Simple) reserved(then) reserved(begin) + reserved(if) ident(TestValue) operator(=) ident(Value) reserved(then) + ident(Exit)operator(;) + reserved(end) reserved(else) reserved(begin) + reserved(if) ident(InRange)operator(()ident(TestValue)operator(,) ident(Bottom)operator(,) ident(Top)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(end)operator(;) + + ident(Result) operator(:=) ident(False)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(WriteSL)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Prefix)operator(:) reserved(string) operator(=) stringoperator(;) + reserved(const) ident(Suffix)operator(:) reserved(string) operator(=) stringoperator(\);) +reserved(var) + ident(i)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(for) ident(i) operator(:=) integer(0) reserved(to) ident(Strings)operator(.)ident(Count)operator(-)integer(1) reserved(do) + ident(WriteLn)operator(()ident(Prefix) operator(+) ident(Strings)operator([)ident(i)operator(]) operator(+) ident(Suffix)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(Success)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Res) operator(=) ident(ResultOnSuccess)operator(\);) + ident(LastSuccessRes) operator(:=) ident(Res)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Failure)operator(()ident(Res)operator(:) ident(Integer)operator(;) ident(ResultOnSuccess)operator(:) ident(Integer) operator(=) ident(ERROR_SUCCESS)operator(\):) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) reserved(not) ident(Success)operator(()ident(Res)operator(,) ident(ResultOnSuccess)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(ExpandString)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Len)operator(:) ident(Integer)operator(;) + ident(P)operator(,) ident(Res)operator(:) ident(PChar)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(P) operator(:=) ident(PChar)operator(()ident(S)operator(\);) + ident(Len) operator(:=) ident(ExpandEnvironmentStrings)operator(()ident(P)operator(,) reserved(nil)operator(,) integer(0)operator(\);) + reserved(if) ident(Len) operator(=) integer(0) reserved(then) + ident(Exit)operator(;) + + ident(GetMem)operator(()ident(Res)operator(,) ident(Len)operator(\);) + ident(ExpandEnvironmentStrings)operator(()ident(P)operator(,) ident(Res)operator(,) ident(Len)operator(\);) + + ident(Result) operator(:=) ident(Res)operator(;) + ident(FreeMem)operator(()ident(Res)operator(,) ident(Len)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(FindAll)operator(()ident(Strings)operator(:) ident(TStrings)operator(;) reserved(const) ident(Mask)operator(:) reserved(string)operator(;) + ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(;) + ident(FileReturn)operator(:) ident(TFileNameFunc) operator(=) reserved(nil)operator(\):) ident(Boolean)operator(;) +reserved(var) + ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) + + reserved(procedure) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\);) + reserved(var) + ident(PSR)operator(:) ident(TSearchRec)operator(;) + ident(Res)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(Add)operator(()reserved(const) ident(S)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(if) ident(S) operator(<>) string reserved(then) + ident(Strings)operator(.)ident(Add)operator(()ident(S)operator(\);) + reserved(end)operator(;) + + reserved(begin) + ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\);) + reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) + reserved(if) ident(Assigned)operator(()ident(FileReturn)operator(\)) reserved(then) + ident(Add)operator(()ident(FileReturn)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\)\)) + reserved(else) + ident(Add)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\);) + ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) + ident(Exit)operator(;) + + ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\);) + reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) + reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) + reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) + ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\);) + ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + +reserved(begin) + ident(Strings)operator(.)ident(Clear)operator(;) + ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\);) + ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\);) + ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\);) + ident(Result) operator(:=) ident(Strings)operator(.)ident(Count) operator(>) integer(0)operator(;) +reserved(end)operator(;) + +reserved(function) ident(FindAllFirst)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) + + reserved(function) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\):) ident(Boolean)operator(;) + reserved(var) + ident(PSR)operator(:) ident(TSearchRec)operator(;) + ident(Res)operator(:) ident(Integer)operator(;) + reserved(begin) + ident(Result) operator(:=) ident(False)operator(;) + reserved(if) ident(Success)operator(()ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\),) integer(0)operator(\)) reserved(then) reserved(begin) + ident(FindAllFirst) operator(:=) ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(;) + ident(Result) operator(:=) ident(True)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + ident(Exit)operator(;) reserved(end)operator(;) + reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) + ident(Exit)operator(;) + + ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\);) + reserved(while) reserved(not) ident(Result) reserved(and) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) + reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) + reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) + ident(Result) operator(:=) ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\);) + ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\);) + ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\);) + ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(DeleteFiles)operator(()reserved(const) ident(Mask)operator(:) reserved(string)operator(;) ident(ScanSubDirs)operator(:) ident(Boolean) operator(=) ident(True)operator(;) + ident(Attributes)operator(:) ident(Integer) operator(=) ident(faFindEveryFile)operator(\);) +reserved(var) + ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(;) + + reserved(procedure) ident(ScanDir)operator(()reserved(const) ident(Path)operator(,) ident(FileName)operator(:) reserved(string)operator(\);) + reserved(var) + ident(PSR)operator(:) ident(TSearchRec)operator(;) + ident(Res)operator(:) ident(Integer)operator(;) + + reserved(procedure) ident(TryDeleteFile)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\);) + reserved(begin) + reserved(try) + ident(DeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\);) + reserved(except) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(begin) + ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) ident(FileName)operator(,) ident(Attributes)operator(,) ident(PSR)operator(\);) + reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) + ident(TryDeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\);) + ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(if) reserved(not) ident(ScanSubDirs) reserved(then) + ident(Exit)operator(;) + + ident(Res) operator(:=) ident(FindFirst)operator(()ident(Path) operator(+) charoperator(,) ident(faDirectory)operator(,) ident(PSR)operator(\);) + reserved(while) ident(Success)operator(()ident(Res)operator(,) integer(0)operator(\)) reserved(do) reserved(begin) + reserved(if) operator(()ident(PSR)operator(.)ident(Attr) reserved(and) ident(faDirectory) operator(>) integer(0)operator(\)) + reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) charoperator(\)) reserved(and) operator(()ident(PSR)operator(.)ident(Name) operator(<>) stringoperator(\)) reserved(then) reserved(begin) + ident(ScanDir)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name) operator(+) charoperator(,) ident(FileName)operator(\);) + ident(TryDeleteFile)operator(()ident(Path) operator(+) ident(PSR)operator(.)ident(Name)operator(\);) + reserved(end)operator(;) + ident(Res) operator(:=) ident(FindNext)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(end)operator(;) +reserved(begin) + ident(Path) operator(:=) ident(ExtractPath)operator(()ident(Mask)operator(\);) + ident(FileName) operator(:=) ident(ExtractFileName)operator(()ident(Mask)operator(\);) + ident(ScanDir)operator(()ident(Path)operator(,) ident(FileName)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(GetFileNew)operator(()ident(FileName)operator(:) reserved(string)operator(;) ident(NoFloppyDrives)operator(:) ident(Boolean) operator(=) ident(True)operator(\):) reserved(string)operator(;) +reserved(var) + ident(Drive)operator(:) reserved(string)operator(;) + ident(pf)operator(,) ident(pd)operator(,) ident(Len)operator(:) ident(Integer)operator(;) + ident(PSR)operator(:) ident(TSearchRec)operator(;) +reserved(begin) + ident(Result) operator(:=) stringoperator(;) + ident(FileName) operator(:=) ident(Trim)operator(()ident(FileName)operator(\);) + reserved(if) ident(Length)operator(()ident(FileName)operator(\)) operator(<) integer(2) reserved(then) + ident(Exit)operator(;) + + ident(Drive) operator(:=) ident(ExtractDrive)operator(()ident(FileName)operator(\);) + reserved(if) reserved(not) ident(DirectoryExists)operator(()ident(Drive)operator(\)) reserved(then) + ident(Exit)operator(;) + + reserved(if) ident(NoFloppyDrives) reserved(and) operator(()ident(Drive)operator([)integer(1)operator(]) reserved(in) operator([)charoperator(,) charoperator(]\)) reserved(then) + ident(Exit)operator(;) + + ident(Len) operator(:=) ident(Length)operator(()ident(FileName)operator(\);) + ident(Result) operator(:=) ident(Drive)operator(;) + ident(pf) operator(:=) ident(Length)operator(()ident(Drive)operator(\)) operator(+) integer(1)operator(;) + reserved(while) ident(pf) operator(<=) ident(Len) reserved(do) reserved(begin) + reserved(if) ident(FileName)operator([)ident(pf)operator(]) operator(=) char reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) charoperator(;) + ident(Inc)operator(()ident(pf)operator(\);) + ident(Continue)operator(;) reserved(end)operator(;) + + ident(pd) operator(:=) ident(CharPos)operator(()charoperator(,) ident(FileName)operator(,) ident(pf)operator(\);) + reserved(if) ident(pd) operator(=) integer(0) reserved(then) reserved(begin) + reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(MaxInt)operator(\),) ident(faFindEveryFile)operator(,) ident(PSR)operator(\)) reserved(then) reserved(begin) + ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name)operator(;) + ident(Break)operator(;) reserved(end) reserved(else) reserved(begin) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(MaxInt)operator(\),) ident(faDirectory)operator(,) ident(PSR)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name) operator(+) char + reserved(else) + ident(Result) operator(:=) stringoperator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(if) ident(Result) operator(=) string reserved(then) + ident(Break)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + + reserved(if) integer(0)operator(=)ident(FindFirst)operator(()ident(Result) operator(+) ident(Copy)operator(()ident(FileName)operator(,) ident(pf)operator(,) ident(pd) operator(-) ident(pf)operator(\),) ident(faDirectory)operator(,) ident(PSR)operator(\)) reserved(then) + ident(Result) operator(:=) ident(Result) operator(+) ident(PSR)operator(.)ident(Name) operator(+) char + reserved(else) + ident(Result) operator(:=) stringoperator(;) + ident(FindClose)operator(()ident(PSR)operator(\);) + reserved(if) ident(Result) operator(=) string reserved(then) + ident(Break)operator(;) + + ident(pf) operator(:=) ident(pd) operator(+) integer(1)operator(;) + reserved(end)operator(;) + + reserved(if) operator(()ident(Result) operator(<>) stringoperator(\)) reserved(and) reserved(not) ident(FileEx)operator(()ident(Result)operator(,) ident(True)operator(\)) reserved(then) + ident(Result) operator(:=) stringoperator(;) +reserved(end)operator(;) + +reserved(function) ident(DateTimeOfFileTime)operator(()reserved(const) ident(FileTime)operator(:) ident(TFileTime)operator(\):) ident(TDateTime)operator(;) +reserved(var) + ident(LocalFileTime)operator(:) ident(TFileTime)operator(;) + ident(Res)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + + ident(FileTimeToLocalFileTime)operator(()ident(FileTime)operator(,) ident(LocalFileTime)operator(\);) + reserved(if) reserved(not) ident(FileTimeToDosDateTime)operator(()ident(LocalFileTime)operator(,) ident(LongRec)operator(()ident(Res)operator(\).)ident(Hi)operator(,) + ident(LongRec)operator(()ident(Res)operator(\).)ident(Lo)operator(\)) reserved(then) + ident(Res) operator(:=) operator(-)integer(1)operator(;) + + reserved(if) operator(()ident(Res) operator(=) operator(-)integer(1)operator(\)) reserved(or) operator(()ident(Res) operator(=) integer(0)operator(\)) reserved(then) + ident(Exit)operator(;) + reserved(try) + ident(Result) operator(:=) ident(FileDateToDateTime)operator(()ident(Res)operator(\);) + reserved(except) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(FileNew)operator(()reserved(const) ident(FileName)operator(:) reserved(string)operator(\);) +reserved(var) + ident(Handle)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(Handle) operator(:=) ident(FileCreate)operator(()ident(FileName)operator(\);) + ident(FileClose)operator(()ident(Handle)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(Win32PlatformStr)operator(:) reserved(string)operator(;) +reserved(const) + ident(PlatformStrings)operator(:) reserved(array)operator([)ident(VER_PLATFORM_WIN32s)operator(..)ident(VER_PLATFORM_WIN32_NT)operator(]) reserved(of) reserved(string) operator(=) + operator(()stringoperator(,) stringoperator(,) stringoperator(\);) +reserved(begin) + ident(Result) operator(:=) ident(PlatformStrings)operator([)ident(Win32Platform)operator(];) +reserved(end)operator(;) + +reserved(function) ident(FullOSInfo)operator(:) reserved(string)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Format)operator(() + string operator(+) ident(EOL) operator(+) + string operator(+) ident(EOL) operator(+) + stringoperator(,) + operator([) + ident(Win32PlatformStr)operator(,) + ident(Win32MajorVersion)operator(,) ident(Win32MinorVersion)operator(,) ident(Win32BuildNumber)operator(,) + ident(Win32CSDVersion) + operator(]) + operator(\);) +reserved(end)operator(;) + +reserved(function) ident(Win9x)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_WINDOWS)operator(;) +reserved(end)operator(;) + +reserved(function) ident(WinNT)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_NT)operator(;) +reserved(end)operator(;) + +reserved(function) ident(Win2000)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) operator(()ident(Win32Platform) operator(=) ident(VER_PLATFORM_WIN32_NT)operator(\)) + reserved(and) operator(()ident(Win32MajorVersion) operator(=) integer(4)operator(\);) +reserved(end)operator(;) + +reserved(function) ident(WinXP)operator(:) ident(Boolean)operator(;) +reserved(begin) + ident(Result) operator(:=) ident(Win32MajorVersion) operator(>=) integer(5)operator(;) +reserved(end)operator(;) + +reserved(initialization) + ident(MyDir) operator(:=) ident(GetMyDir)operator(;) + +reserved(end)operator(.) + +reserved(unit) ident(FifoStream)operator(;) + +reserved(interface) + +reserved(uses) ident(Classes)operator(,) ident(windows)operator(,) ident(Dialogs)operator(;) + +reserved(const) + ident(DefaultChunksize) operator(=) integer(32768)operator(;) comment(// 32kb per chunk as default.) + +reserved(type) + ident(PMemChunk) operator(=) operator(^)ident(TMemChunk)operator(;) + ident(TMemChunk) operator(=) reserved(record) + ident(Filled)operator(:) ident(Longword)operator(;) + ident(Read)operator(:) ident(Longword)operator(;) + ident(Data)operator(:) ident(pointer)operator(;) + reserved(end)operator(;) + + ident(TFifo) operator(=) reserved(class) + directive(private) + ident(FBuffers)operator(:) ident(TList)operator(;) + ident(FChunksize)operator(:) ident(Longword)operator(;) + ident(FCritSect)operator(:) ident(TRTLCriticalSection)operator(;) + ident(FIsWinNT)operator(:) ident(boolean)operator(;) + ident(FBytesInFifo)operator(:) ident(LongWord)operator(;) + directive(protected) + reserved(function) ident(GetBytesInFifo)operator(:) ident(LongWord)operator(;) + directive(public) + reserved(constructor) ident(Create)operator(;) + reserved(destructor) ident(Destroy)operator(;) directive(override)operator(;) + reserved(procedure) ident(Write)operator(()ident(Data)operator(:) ident(pointer)operator(;) ident(Size)operator(:) ident(LongWord)operator(\);) + reserved(procedure) ident(Read)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\);) + reserved(procedure) ident(PeekData)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\);) + directive(published) + reserved(property) ident(BytesInFifo)operator(:) ident(LongWord) directive(read) ident(FBytesInFifo)operator(;) + reserved(end)operator(;) + +reserved(implementation) + +reserved(constructor) ident(TFifo)operator(.)ident(Create)operator(;) +reserved(begin) + reserved(inherited)operator(;) + ident(FBuffers) operator(:=) ident(TList)operator(.)ident(Create)operator(;) + comment(// set default chunksize...) + ident(FChunksize) operator(:=) ident(DefaultChunksize)operator(;) + ident(InitializeCriticalSection)operator(()ident(FCritSect)operator(\);) +reserved(end)operator(;) + +reserved(destructor) ident(TFifo)operator(.)ident(Destroy)operator(;) +reserved(var) + ident(I)operator(:) ident(Integer)operator(;) +reserved(begin) + ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\);) + reserved(for) ident(I) operator(:=) integer(0) reserved(to) ident(FBuffers)operator(.)ident(count) operator(-) integer(1) reserved(do) + reserved(begin) + ident(FreeMem)operator(()ident(PMemChunk)operator(()ident(Fbuffers)operator([)ident(I)operator(]\).)ident(Data)operator(\);) + ident(Dispose)operator(()ident(PMemChunk)operator(()ident(Fbuffers)operator([)ident(I)operator(]\)\);) + reserved(end)operator(;) + ident(FBuffers)operator(.)ident(Clear)operator(;) + ident(FBuffers)operator(.)ident(Free)operator(;) + ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\);) + + ident(DeleteCriticalSection)operator(()ident(FCritSect)operator(\);) + reserved(inherited)operator(;) +reserved(end)operator(;) + +reserved(function) ident(TFifo)operator(.)ident(GetBytesInFifo)operator(:) ident(LongWord)operator(;) +reserved(begin) + ident(Result) operator(:=) integer(0)operator(;) + reserved(if) ident(FBuffers)operator(.)ident(Count) operator(=) integer(0) reserved(then) + reserved(begin) + ident(exit)operator(;) + reserved(end) + reserved(else) + reserved(begin) + reserved(if) ident(FBuffers)operator(.)ident(Count) operator(>) integer(1) reserved(then) + ident(Inc)operator(()ident(Result)operator(,) operator(()ident(FBuffers)operator(.)ident(Count) operator(-) integer(1)operator(\)) operator(*) ident(FChunkSize)operator(\);) + ident(Inc)operator(()ident(Result)operator(,) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(Fbuffers)operator(.)ident(Count) operator(-) integer(1)operator(]\).)ident(Filled)operator(\);) + ident(Dec)operator(()ident(Result)operator(,) ident(PMemChunk)operator(()ident(FBuffers)operator([)integer(0)operator(]\).)ident(Read)operator(\);) + reserved(end)operator(;) +reserved(end)operator(;) + +reserved(procedure) ident(TFifo)operator(.)ident(Write)operator(()ident(Data)operator(:) ident(pointer)operator(;) ident(Size)operator(:) ident(LongWord)operator(\);) +reserved(var) + ident(Privpointer)operator(:) ident(pointer)operator(;) + ident(PrivSize)operator(:) ident(LongWord)operator(;) + ident(Chunk)operator(:) ident(PMemChunk)operator(;) + ident(PosInChunk)operator(:) ident(pointer)operator(;) +reserved(begin) + reserved(if) ident(LongWord)operator(()ident(Data)operator(\)) operator(=) integer(0) reserved(then) + reserved(begin) + comment(// null pointer? somebody is trying to fool us, get out...) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\);) + ident(PrivPointer) operator(:=) ident(Data)operator(;) + ident(PrivSize) operator(:=) integer(0)operator(;) + comment(// are already buffers there?) + reserved(if) ident(FBuffers)operator(.)ident(count) operator(>) integer(0) reserved(then) + reserved(begin) + comment(// is the last one of them not completely filled?) + reserved(if) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(FBuffers)operator(.)ident(count) operator(-) integer(1)operator(]\).)ident(filled) operator(<) ident(FChunksize) reserved(then) + comment(// not completely filled, so fill up the buffer.) + reserved(begin) + ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(FBuffers)operator(.)ident(count) operator(-) integer(1)operator(]\);) + comment(// fetch chunkdata.) + ident(PosInChunk) operator(:=) ident(Chunk)operator(.)ident(Data)operator(;) + comment(// move to current fill pos...) + ident(Inc)operator(()ident(LongWord)operator(()ident(PosInChunk)operator(\),) ident(Chunk)operator(.)ident(Filled)operator(\);) + comment(// can we fill the chunk completely?) + reserved(if) ident(Size) operator(>) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled) reserved(then) + reserved(begin) + comment(// yes we can.) + ident(Move)operator(()ident(PrivPointer)operator(^,) ident(PosInChunk)operator(^,) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\);) + ident(Inc)operator(()ident(LongWord)operator(()ident(PrivPointer)operator(\),) ident(FChunksize) operator(-) ident(Chunk)operator(.)ident(Filled)operator(\);) + ident(Chunk)operator(.)ident(Filled) operator(:=) ident(FChunkSize)operator(;) + reserved(end) + reserved(else) + comment(// we have to less data for filling the chunk completely,) + comment(// just put everything in.) + reserved(begin) + ident(Move)operator(()ident(PrivPointer)operator(^,) ident(PosInChunk)operator(^,) ident(Size)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(Size)operator(\);) + ident(Inc)operator(()ident(Chunk)operator(.)ident(Filled)operator(,) ident(Size)operator(\);) + reserved(end)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + comment(// as long as we have remaining stuff put it into new chunks.) + reserved(while) operator(()ident(PrivSize) operator(<) ident(Size)operator(\)) reserved(do) + reserved(begin) + ident(new)operator(()ident(Chunk)operator(\);) + ident(GetMem)operator(()ident(Chunk)operator(.)ident(Data)operator(,) ident(FChunksize)operator(\);) + ident(Chunk)operator(.)ident(Read) operator(:=) integer(0)operator(;) + comment(// can we fill an entire chunk with the remaining data?) + reserved(if) ident(Privsize) operator(+) ident(FChunksize) operator(<) ident(Size) reserved(then) + reserved(begin) + comment(// yes we can, so put the stuff in.) + ident(Move)operator(()ident(Privpointer)operator(^,) ident(Chunk)operator(.)ident(Data)operator(^,) ident(FChunksize)operator(\);) + ident(Inc)operator(()ident(LongWord)operator(()ident(PrivPointer)operator(\),) ident(FChunksize)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(FChunksize)operator(\);) + ident(Chunk)operator(.)ident(Filled) operator(:=) ident(FChunksize)operator(;) + reserved(end) + reserved(else) comment(// we have to less data to fill the entire chunk, just put the remaining stuff in.) + reserved(begin) + ident(Move)operator(()ident(Privpointer)operator(^,) ident(Chunk)operator(.)ident(Data)operator(^,) ident(Size) operator(-) ident(Privsize)operator(\);) + ident(Chunk)operator(.)ident(Filled) operator(:=) ident(Size) operator(-) ident(Privsize)operator(;) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(Size) operator(-) ident(Privsize)operator(\);) + reserved(end)operator(;) + ident(Fbuffers)operator(.)ident(Add)operator(()ident(Chunk)operator(\);) + reserved(end)operator(;) + reserved(if) ident(Size) operator(<>) ident(Privsize) reserved(then) + ident(Showmessage)operator(()stringoperator(\);) + ident(FBytesInFifo) operator(:=) ident(GetBytesInFifo)operator(;) + ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\);) +reserved(end)operator(;) + +reserved(procedure) ident(TFifo)operator(.)ident(Read)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\);) +reserved(var) + ident(PrivSize)operator(:) ident(Integer)operator(;) + ident(Privpos)operator(:) ident(pointer)operator(;) + ident(Chunk)operator(:) ident(PMemChunk)operator(;) + ident(ChunkPos)operator(:) ident(pointer)operator(;) +reserved(begin) + reserved(if) ident(LongWord)operator(()ident(Buff)operator(\)) operator(=) integer(0) reserved(then) + reserved(begin) + comment(// null pointer? somebody is trying to fool us, get out...) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\);) + ident(PrivSize) operator(:=) integer(0)operator(;) + ident(Privpos) operator(:=) ident(Buff)operator(;) + reserved(while) ident(FBuffers)operator(.)ident(Count) operator(>) integer(0) reserved(do) + reserved(begin) + ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)integer(0)operator(]\);) + ident(ChunkPos) operator(:=) ident(Chunk)operator(.)ident(data)operator(;) + ident(Inc)operator(()ident(LongWord)operator(()ident(ChunkPos)operator(\),) ident(Chunk)operator(.)ident(Read)operator(\);) + comment(// does the remaining part of the chunk fit into the buffer?) + reserved(if) ident(PrivSize) operator(+) operator(()ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\)) operator(<) ident(ReqSize) reserved(then) + reserved(begin) comment(// yep, it fits) + ident(Move)operator(()ident(ChunkPos)operator(^,) ident(Privpos)operator(^,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\);) + ident(FreeMem)operator(()ident(Chunk)operator(.)ident(Data)operator(\);) + ident(Dispose)operator(()ident(Chunk)operator(\);) + ident(FBuffers)operator(.)ident(Delete)operator(()integer(0)operator(\);) + reserved(end) + reserved(else) comment(// remaining part didn't fit, get as much as we can and increment the) + comment(// read attribute.) + reserved(begin) + ident(Move)operator(()ident(ChunkPos)operator(^,) ident(Privpos)operator(^,) ident(ReqSize) operator(-) ident(PrivSize)operator(\);) + ident(Inc)operator(()ident(Chunk)operator(.)directive(read)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\);) + comment(// as we filled the buffer, we'll have to break here.) + ident(break)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + ident(FBytesInFifo) operator(:=) ident(GetBytesInFifo)operator(;) + ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\);) + ident(ReqSize) operator(:=) ident(PrivSize)operator(;) +reserved(end)operator(;) + +comment(// read Data from Stream without removing it from the Stream...) + +reserved(procedure) ident(TFifo)operator(.)ident(PeekData)operator(()ident(Buff)operator(:) ident(pointer)operator(;) reserved(var) ident(ReqSize)operator(:) ident(LongWord)operator(\);) +reserved(var) + ident(PrivSize)operator(:) ident(Integer)operator(;) + ident(Privpos)operator(:) ident(pointer)operator(;) + ident(Chunk)operator(:) ident(PMemChunk)operator(;) + ident(ChunkPos)operator(:) ident(pointer)operator(;) + ident(ChunkNr)operator(:) ident(Integer)operator(;) +reserved(begin) + reserved(if) ident(LongWord)operator(()ident(Buff)operator(\)) operator(=) integer(0) reserved(then) + reserved(begin) + comment(// null pointer? somebody is trying to fool us, get out...) + ident(Exit)operator(;) + reserved(end)operator(;) + ident(EnterCriticalSection)operator(()ident(FCritSect)operator(\);) + ident(PrivSize) operator(:=) integer(0)operator(;) + ident(Privpos) operator(:=) ident(Buff)operator(;) + ident(ChunkNr) operator(:=) integer(0)operator(;) + reserved(while) ident(FBuffers)operator(.)ident(Count) operator(>) ident(ChunkNr) reserved(do) + reserved(begin) + ident(Chunk) operator(:=) ident(PMemChunk)operator(()ident(FBuffers)operator([)ident(ChunkNr)operator(]\);) + ident(ChunkPos) operator(:=) ident(Chunk)operator(.)ident(data)operator(;) + ident(Inc)operator(()ident(LongWord)operator(()ident(ChunkPos)operator(\),) ident(Chunk)operator(.)ident(Read)operator(\);) + comment(// does the remaining part of the chunk fit into the buffer?) + reserved(if) ident(PrivSize) operator(+) operator(()ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\)) operator(<) ident(ReqSize) reserved(then) + reserved(begin) comment(// yep, it fits) + ident(Move)operator(()ident(ChunkPos)operator(^,) ident(Privpos)operator(^,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(Chunk)operator(.)ident(Filled) operator(-) ident(Chunk)operator(.)directive(read)operator(\);) + ident(Inc)operator(()ident(ChunkNr)operator(\);) + reserved(end) + reserved(else) comment(// remaining part didn't fit, get as much as we can and increment the) + comment(// read attribute.) + reserved(begin) + ident(Move)operator(()ident(ChunkPos)operator(^,) ident(Privpos)operator(^,) ident(ReqSize) operator(-) ident(PrivSize)operator(\);) + ident(Inc)operator(()ident(PrivSize)operator(,) ident(ReqSize) operator(-) ident(PrivSize)operator(\);) + comment(// as we filled the buffer, we'll have to break here.) + ident(break)operator(;) + reserved(end)operator(;) + reserved(end)operator(;) + ident(LeaveCriticalSection)operator(()ident(FCritSect)operator(\);) + ident(ReqSize) operator(:=) ident(PrivSize)operator(;) +reserved(end)operator(;) + +reserved(end)operator(.) diff --git a/test/html/ampersand.out.raydebug b/test/html/ampersand.out.raydebug index fced304..0e0b464 100644 --- a/test/html/ampersand.out.raydebug +++ b/test/html/ampersand.out.raydebug @@ -1 +1 @@ -error(&) +error(&) diff --git a/test/html/suite.rb b/test/html/suite.rb index f4cd6f4..29c45f8 100644 --- a/test/html/suite.rb +++ b/test/html/suite.rb @@ -1,9 +1,2 @@ -class HTMLTest < CodeRaySuite - - @file = __FILE__ - LANG = :html - EXTENSION = 'html' - -end - -$suite << HTMLTest.suite if $suite +class HTML < CodeRay::TestCase +end diff --git a/test/html/tolkien.html b/test/html/tolkien.html index f4dd841..c5e15c7 100644 --- a/test/html/tolkien.html +++ b/test/html/tolkien.html @@ -1,15 +1,15 @@ + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - - CodeRay HTML Encoder Example - + - - - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
-<head><title>Faszination Tolkien - Herr der Ringe &amp; Co.</title>
-<meta name="description" content="J.R.R. Tolkien und seine Werke (Schwerpunkt: Der Herr der Ringe). Anf&auml;ngerfreundlich gestaltet. Gro&szlig;e kommentierte Galerie, Downloads, Forum, Postkarten, etc." />
-<meta name="Author" content="Vladimir Simovic aka Perun" />
-<meta name="Keywords" content="J.R.R. Tolkien, Tolkien, Herr der Ringe, Der Herr der Ringe, HdR, hdr, herr ringe, Perun, Vladimir Simovic, Herr der Ringe Motive, Herr der Ringe Postkarten, kleiner hobbit, ringcon, ring*con" />
-<meta name="page-topic" content="J.R.R. Tolkien und seine Werke. Speziell Der Herr der Ringe" />
-<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
-<meta name="language" content="de" />
-<meta name="robots" content="index,follow" />
-<meta name="revisit-after" content="7 days" />
-<meta http-equiv="imagetoolbar" content="no" />
-<style type="text/css">
-<!--
-@import url("/css/perun.css");
--->
-</style>
-<link rel="shortcut icon" href="http://www.faszination-tolkien.de/favicon.ico" />
-<link rel="home" href="/" title="Startseite" />
-<link rel="author" href="mailto:perun@faszination-tolkien.de,faszination-tolkien@web.de" title="Mail" />
-<link rel="copyright" href="/kontakte/impressum" title="Impressum" />
-<link rel="index" href="/hilfe/sitemap" title="Inhaltsverzeichnis" />
-<link rel="help" href="/hilfe/faq" title="FAQ" />
-<link rel="search" href="/hilfe/suchen" />
-<link rel="download" href="/goodies/downloads" />
-<link rel="bookmark" href="http://www.faszination-tolkien.de" title="Faszination Tolkien" />
-<script type="text/javascript">
-<!--
-if(top.frames.length > 0)
-top.location.href=self.location;
-//-->
-</script>
-</head>
-<body>
-<div id="kopf" title="Anmerkungen zu den Bildern und &copy; in dem Styleswitch-Bereich">
-</div>
-<div id="inhalt">
-<div style="font:11px verdana, sans-serif; margin:3px 0 0 0;">
-<script type="text/javascript">
-<!-- start js_paths.js???
-var path = "";
-var href = document.location.href;
-var s = href.split("/");
-for (var i=2;i<(s.length-1);i++) {
-path+="<a href=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"/\">"+s[i]+"</a> / ";
-}
-i=s.length-1;
-path+="<a href=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\">"+s[i]+"</a>";
-var url = /* window.location.protocol + "//" + */ path;
-document.writeln(url);
-// ende -->
-</script>
-
-</div>
-<h1>Faszination Tolkien - Herr der Ringe &amp; Co.</h1>
-
-<p>Diese Seite besch&auml;ftigt sich mit den &quot;Hauptwerken&quot; von J. R. R. Tolkien. Im Mittelpunkt steht <strong>Der Herr der Ringe</strong>, aber nach und nach werden immer mehr Details aus <strong>Der kleine Hobbit</strong> bzw. <strong>Der Hobbit</strong> und <strong>Silmarillion</strong> einflie&szlig;en.</p>
-<p>Auf der Seite gibt es, neben vielen selbstverfassten Infos, eine gro&szlig;e <a href="/galerie">Galerie</a> mit 'Herr der Ringe' Bildern (273 Bilder), eine <a href="goodies/downloads">Download</a> Sektion mit 13 <a href="goodies/downloads/winamp-skins">Winampskins</a> und einen <a href="http://www.guweb.com/cgi-bin/postcard?id=PERUN">eCard Versand</a> (digitale Postkarten) mit 'Herr der Ringe' Motiven.</p>
-<p><b>Anmerkung:</b> die Unterpunkte in der Navigation, einige Links im Text und viele Bilder haben Informationen (Titel), daher lohnt es sich den Cursor, &uuml;ber den Link ruhen zu lassen. Einige h&auml;ufige Fragen wurden schon in dem Bereich <a href="/hilfe/faq">FAQ</a> beantwortet.</p>
-
-<p>Immer auf dem laufenden bleiben? Mit <a href="goodies/newsletter">Newsletter</a>, <a href="javascript:sidebar.addPanel('Faszination-Tolkien','http://www.faszination-tolkien.de/goodies/sidebar/index.php','')">Sidebar</a> (Mozilla und Netscape ab 6.x) oder mit <a href="goodies/rss/index.xml">RSS</a>.</p>
-
-<p><strong><a href="goodies/styleswitcher">Styleswitcher</a></strong> - &auml;ndere das Aussehen dieser Seite.</p>
-
-<p><strong>Diese Website wird aus Zeitgründen nicht mehr aktualisiert.</strong></p>
-
-
-<div style="text-align:center; padding:5px;">
-<!-- Anfang Banner -->
-
-<img src="http://www.die-gefaehrten.net/banner.php?banner=minitolkien&amp;id=68" width="100" height="50" alt="Webring Banner (minitolkien)" border="0" usemap="#gef_banner_minitolkien" />
-<map name="gef_banner_minitolkien" id="gef_banner_minitolkien" style="display:inline;">
-    <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=next&amp;id=68" alt="N&auml;chste Seite" title="N&auml;chste Seite" coords="70,30,100,50" />
-    <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=prev&amp;id=68" alt="Vorherige Seite" title="Vorherige Seite" coords="0,30,30,50" />
-    <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=home&amp;id=68" alt="Die Gef&auml;hrten Homepage" title="Die Gef&auml;hrten Homepage" coords="0,0,100,25" />
-</map>
-
-<!--<img src="links/fremde-banner/minitolkien.jpg" width="100" height="50" alt="Webring &quot;Die Gef&auml;hrten&quot;" ismap="ismap" usemap="#minitolkien" />
-<map name="minitolkien" id="minitolkien" style="display:inline;"><area shape="rect" alt="N&auml;chste Seite" href="http://www.die-gefaehrten.net/jump.php?action=next&amp;id=Vladimir" coords="73,29,96,46" /><area shape="rect" alt="Vorherige Seite" href="http://www.die-gefaehrten.net/jump.php?action=prev&amp;id=Vladimir" coords="4,30,26,46" /><area shape="rect" alt="Die Gef&auml;hrten" href="http://www.die-gefaehrten.net/jump.php?action=home&amp;id=Vladimir" coords="5,5,95,23" /></map>-->
-<!-- Ende Banner -->
-
-<a href="http://pl15994.macbay.de/mozilla/bestviewedwithmozilla.htm" title="Best viewed with Mozilla or any other Browser"><img src="links/fremde-banner/bestviewedwithmozill.gif" width="169" height="29" alt="Best viewed with Mozilla or any other Browser" /></a>
-
-<!-- Anfang des Topsites Codes der Listinus-Toppages -->
-<a href="http://click.listinus.de/topsite.php?id=34908" title="Top 50 Herr der Ringe - stimme f&uuml;r diese Seite ab."><img src="http://icon.listinus.de/topicon.php?id=34908" alt="Top 50 Herr der Ringe - stimme f&uuml;r diese Seite ab." /></a>
-<!-- Ende des Topsites Codes der Listinus-Toppages -->
-</div>
-
-<div style="text-align:center; padding:5px;">
-<form method="post" action="http://www.drachenritter.de/webring.php3" style="display:inline;">
-<input type="hidden" name="id" value="585" />
-<input type="hidden" name="mini" value="on" />
-<input type="image" src="/links/fremde-banner/minidrachenritter.jpg" name="click" title="Webring der Drachenritter" />
-</form>
-
-<a href="http://www.schatzwaechter.de"><img src="links/fremde-banner/faszinationtolkien.gif" width="128" height="56" alt="Schatzw&auml;chter" /></a>
-</div>
-
-<p>
-Faszination Tolkien ist zudem noch bei folgenden gro&szlig;en <a href="/die-seite/awards#wichtige-linklisten">Linklisten</a> aufgenommen.
-</p>
-
-<p class="fussanker"><a href="#">nach oben</a></p>
-</div>
-
-<div id="linkenavi"><!--linke seite-->
-<a href="/kurzfassungen/" class="navilinks">Kurzfassungen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Zusammenfassung von Herr der Ringe und Der Hobbit. &laquo;</span><br /></a>
-
-<a href="/ringe/" class="navilinks">Die Ringe <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Ringe der Macht. &laquo;</span><br /></a>
-
-<a href="/geschichte/" class="navilinks">Die Geschichte <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Geschichte von Arda bzw. Mittelerde. &laquo;</span><br /></a>
-
-<a href="/landeskunde/" class="navilinks">Landeskunde <span class="hide">&raquo; <b>Tolkiens Welt:</b> Geopolitische Informationen &uuml;ber Mittelerde. &laquo;</span><br /></a>
-
-<a href="/personen/" class="navilinks">Personen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Wichtige Personen. &laquo;</span><br /></a>
-
-<a href="/volk/" class="navilinks" style="margin-bottom:10px;">V&ouml;lker/Wesen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Verschiedene V&ouml;lker und Wesen von Arda bzw. Mittelerde. &laquo;</span><br /></a>
-<!---->
-<a href="/jrr-tolkien/" class="navilinks">J. R. R. Tolkien <span class="hide">&raquo; <b>Person Tolkien:</b> Eine kurze Biographie &uuml;ber Tolkien; B&uuml;cherliste mit Werken von Tolkien und Sekund&auml;rliteratur. &laquo;</span><br /></a>
-
-<a href="/galerie/" class="navilinks">Galerie <span class="hide">&raquo; <b>Bilder</b>  von K&uuml;nstlern, die von Tolkiens Werken Inspiriert wurden. &laquo;</span><br /></a>
-<!---->
-<a href="/ueberlegungen/" class="navilinks" style="margin-bottom:10px;">&Uuml;berlegungen <span class="hide">&raquo; <b>Spekulation</b>, Gedanken zu diversen Ereignissen in Mittelerde. &laquo;</span><br /></a>
-<a href="/filme/" class="navilinks"> Film/e <span class="hide">&raquo; <b>Tolkien und Medien:</b> Infos zu den beiden Verfilmungen von Herr der Ringe. &laquo;</span>
-<br /></a>
-<a href="/spiele/" class="navilinks">Spiele <span class="hide">&raquo; <b>Tolkien und Medien:</b> Versch. Spiele rund um Tolkiens Werke: Brett- und Kartenspiele, PC Spiele, Online Spiele etc. &laquo;</span><br /></a>
-<a href="/fans/" class="navilinks">Fans <span class="hide">&raquo; <b>Fans und Ihre Aktivit&auml;ten:</b> Interviews, &quot;Dein erstes Mal&quot; etc. &laquo;</span><br /></a>
-</div><!--ende linker seite-->
-
-<div id="rechtenavi"><!--rechte seite-->
-<a href="/news/" class="navilinks">News <span class="hide2">&raquo; <b>Neuigkeiten:</b> &uuml;ber Tolkiens Werke, den Film, &uuml;ber die Seite etc. &laquo;</span><br /></a>
-
-<a href="/termine/" class="navilinks" style="margin-bottom:10px;">Termine <span class="hide2">&raquo; <b>Anstehende Veranstaltungen</b> zum Thema J. R. R. Tolkien und seine Werke. &laquo;</span><br /></a>
-<!---->
-<a href="/kontakte" class="navilinks">Kontakte <span class="hide2">&raquo; Impressum, Kontaktformular, Presseinfos &laquo;</span><br /></a>
-<a href="/interaktiv" class="navilinks">Interaktiv <span class="hide2">&raquo; <b>Forum, G&auml;stebuch,</b> Umfragen, Chat. &laquo;</span><br /></a>
-<a href="/hilfe" class="navilinks">Hilfe <span class="hide2">&raquo; Suche, FAQ, Sitemap. &laquo;</span><br /></a>
-<a href="/goodies" class="navilinks">Goodies <span class="hide2">&raquo; Newsletter, Sidebar, Styleswitcher, eCards, Winampskins, Downloads, Weiterempfehlen. &laquo;</span><br /></a>
-<a href="/die-seite" class="navilinks" style="margin-bottom:10px;">Die Seite <span class="hide2">&raquo; Ruhmeshalle bzw. Awards, Warum? etc. &laquo;</span><br /></a>
-
-<!---->
-<a href="/links/" class="navilinks">Links <span class="hide2">&raquo; Links zu anderen Tolkien Seiten und zu Webringen. Banner zum Bannertausch. &laquo;</span><br /></a>
-
-<a href="/empfehlungen/" class="navilinks">Empfehlungen <span class="hide2">&raquo; <b>Meine Empfehlungen:</b> B&uuml;cher, Spiele etc. &laquo;</span><br /></a>
-
-<a href="/wettbewerbe" class="navilinks">Wettbewerbe <span class="hide2">&raquo; Wettbewerbe und Gewinnspiele. &laquo;</span><br /></a>
-</div><!--ende rechter seite-->
-
-<div id="fuss">
-<div class="center">
-G&uuml;ltiges <a href="http://validator.w3.org/check/referer"
-
- title="Diese Seite h&auml;lt sich an die Webstandards">XHTML 1.0</a> und g&uuml;ltiges <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.faszination-tolkien.de/css/perun.css"
-
- title="Diese Seite h&auml;lt sich an die Webstandards">CSS</a>
-<br />
-2002-2006 by <a href="/kontakte/impressum/" title="Kontakt mit dem Webmaster">Perun</a> - Letzte &Auml;nderung: 04.03.2006 01:56:23<br />
-<a href="http://www.faszination-tolkien.de">www.faszination-tolkien.de</a> || <a href="http://www.herr-der-ringe.ws">www.herr-der-ringe.ws</a> || <a href="http://www.perun.net">www.perun.net</a>
-<br />
-<span class="sehrklein">Webdesign by: <a href="http://www.vlad-design.de" title="Vlad-Design: Webdesign von Vladimir Simovic">Vlad-Design</a> || hosted by: <a href="http://www.all-inkl.com/index.php?partner=14435" title="Sehr gute und g&uuml;nstige Webhosting-Angebote">www.all-inkl.com</a></span>
-</div>
-<p class="unsichtbar">&rarr;Hinweis: Schon mal dar&uuml;ber nachgedacht deinen Browser upzudaten?<br />Auf z. B. Mozilla, oder Netscape 7.x, oder Opera 7.x oder zumindest auf Internet Explorer 6.</p>
-</div>
-<!-- PowerPhlogger Code START -->
-<script language="JavaScript" type="text/javascript" src="/pphlogger.js"></script>
-<noscript><img alt="" src="http://www.faszination-tolkien.de/statistik/pphlogger.php?id=Perun&amp;st=img" /></noscript>
-<!-- PowerPhlogger Code END -->
-</body>
-</html>
-
+
+
  1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+  3 <head><title>Faszination Tolkien - Herr der Ringe &amp; Co.</title>
+  4 <meta name="description" content="J.R.R. Tolkien und seine Werke (Schwerpunkt: Der Herr der Ringe). Anf&auml;ngerfreundlich gestaltet. Gro&szlig;e kommentierte Galerie, Downloads, Forum, Postkarten, etc." />
+  5 <meta name="Author" content="Vladimir Simovic aka Perun" />
+  6 <meta name="Keywords" content="J.R.R. Tolkien, Tolkien, Herr der Ringe, Der Herr der Ringe, HdR, hdr, herr ringe, Perun, Vladimir Simovic, Herr der Ringe Motive, Herr der Ringe Postkarten, kleiner hobbit, ringcon, ring*con" />
+  7 <meta name="page-topic" content="J.R.R. Tolkien und seine Werke. Speziell Der Herr der Ringe" />
+  8 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+  9 <meta name="language" content="de" />
+ 10 <meta name="robots" content="index,follow" />
+ 11 <meta name="revisit-after" content="7 days" />
+ 12 <meta http-equiv="imagetoolbar" content="no" />
+ 13 <style type="text/css">
+ 14 <!--
+ 15 @import url("/css/perun.css");
+ 16 -->
+ 17 </style>
+ 18 <link rel="shortcut icon" href="http://www.faszination-tolkien.de/favicon.ico" />
+ 19 <link rel="home" href="/" title="Startseite" />
+ 20 <link rel="author" href="mailto:perun@faszination-tolkien.de,faszination-tolkien@web.de" title="Mail" />
+ 21 <link rel="copyright" href="/kontakte/impressum" title="Impressum" />
+ 22 <link rel="index" href="/hilfe/sitemap" title="Inhaltsverzeichnis" />
+ 23 <link rel="help" href="/hilfe/faq" title="FAQ" />
+ 24 <link rel="search" href="/hilfe/suchen" />
+ 25 <link rel="download" href="/goodies/downloads" />
+ 26 <link rel="bookmark" href="http://www.faszination-tolkien.de" title="Faszination Tolkien" />
+ 27 <script type="text/javascript">
+ 28 <!--
+ 29 if(top.frames.length > 0)
+ 30 top.location.href=self.location;
+ 31 //-->
+ 32 </script>
+ 33 </head>
+ 34 <body>
+ 35 <div id="kopf" title="Anmerkungen zu den Bildern und &copy; in dem Styleswitch-Bereich">
+ 36 </div>
+ 37 <div id="inhalt">
+ 38 <div style="font:11px verdana, sans-serif; margin:3px 0 0 0;">
+ 39 <script type="text/javascript">
+ 40 <!-- start js_paths.js???
+ 41 var path = "";
+ 42 var href = document.location.href;
+ 43 var s = href.split("/");
+ 44 for (var i=2;i<(s.length-1);i++) {
+ 45 path+="<a href=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"/\">"+s[i]+"</a> / ";
+ 46 }
+ 47 i=s.length-1;
+ 48 path+="<a href=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\">"+s[i]+"</a>";
+ 49 var url = /* window.location.protocol + "//" + */ path;
+ 50 document.writeln(url);
+ 51 // ende -->
+ 52 </script>
+ 53 
+ 54 </div>
+ 55 <h1>Faszination Tolkien - Herr der Ringe &amp; Co.</h1>
+ 56 
+ 57 <p>Diese Seite besch&auml;ftigt sich mit den &quot;Hauptwerken&quot; von J. R. R. Tolkien. Im Mittelpunkt steht <strong>Der Herr der Ringe</strong>, aber nach und nach werden immer mehr Details aus <strong>Der kleine Hobbit</strong> bzw. <strong>Der Hobbit</strong> und <strong>Silmarillion</strong> einflie&szlig;en.</p>
+ 58 <p>Auf der Seite gibt es, neben vielen selbstverfassten Infos, eine gro&szlig;e <a href="/galerie">Galerie</a> mit 'Herr der Ringe' Bildern (273 Bilder), eine <a href="goodies/downloads">Download</a> Sektion mit 13 <a href="goodies/downloads/winamp-skins">Winampskins</a> und einen <a href="http://www.guweb.com/cgi-bin/postcard?id=PERUN">eCard Versand</a> (digitale Postkarten) mit 'Herr der Ringe' Motiven.</p>
+ 59 <p><b>Anmerkung:</b> die Unterpunkte in der Navigation, einige Links im Text und viele Bilder haben Informationen (Titel), daher lohnt es sich den Cursor, &uuml;ber den Link ruhen zu lassen. Einige h&auml;ufige Fragen wurden schon in dem Bereich <a href="/hilfe/faq">FAQ</a> beantwortet.</p>
+ 60 
+ 61 <p>Immer auf dem laufenden bleiben? Mit <a href="goodies/newsletter">Newsletter</a>, <a href="javascript:sidebar.addPanel('Faszination-Tolkien','http://www.faszination-tolkien.de/goodies/sidebar/index.php','')">Sidebar</a> (Mozilla und Netscape ab 6.x) oder mit <a href="goodies/rss/index.xml">RSS</a>.</p>
+ 62 
+ 63 <p><strong><a href="goodies/styleswitcher">Styleswitcher</a></strong> - &auml;ndere das Aussehen dieser Seite.</p>
+ 64 
+ 65 <p><strong>Diese Website wird aus Zeitgründen nicht mehr aktualisiert.</strong></p>
+ 66 
+ 67 
+ 68 <div style="text-align:center; padding:5px;">
+ 69 <!-- Anfang Banner -->
+ 70 
+ 71 <img src="http://www.die-gefaehrten.net/banner.php?banner=minitolkien&amp;id=68" width="100" height="50" alt="Webring Banner (minitolkien)" border="0" usemap="#gef_banner_minitolkien" />
+ 72 <map name="gef_banner_minitolkien" id="gef_banner_minitolkien" style="display:inline;">
+ 73     <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=next&amp;id=68" alt="N&auml;chste Seite" title="N&auml;chste Seite" coords="70,30,100,50" />
+ 74     <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=prev&amp;id=68" alt="Vorherige Seite" title="Vorherige Seite" coords="0,30,30,50" />
+ 75     <area shape="rect" href="http://www.die-gefaehrten.net/jump.php?action=home&amp;id=68" alt="Die Gef&auml;hrten Homepage" title="Die Gef&auml;hrten Homepage" coords="0,0,100,25" />
+ 76 </map>
+ 77 
+ 78 <!--<img src="links/fremde-banner/minitolkien.jpg" width="100" height="50" alt="Webring &quot;Die Gef&auml;hrten&quot;" ismap="ismap" usemap="#minitolkien" />
+ 79 <map name="minitolkien" id="minitolkien" style="display:inline;"><area shape="rect" alt="N&auml;chste Seite" href="http://www.die-gefaehrten.net/jump.php?action=next&amp;id=Vladimir" coords="73,29,96,46" /><area shape="rect" alt="Vorherige Seite" href="http://www.die-gefaehrten.net/jump.php?action=prev&amp;id=Vladimir" coords="4,30,26,46" /><area shape="rect" alt="Die Gef&auml;hrten" href="http://www.die-gefaehrten.net/jump.php?action=home&amp;id=Vladimir" coords="5,5,95,23" /></map>-->
+ 80 <!-- Ende Banner -->
+ 81 
+ 82 <a href="http://pl15994.macbay.de/mozilla/bestviewedwithmozilla.htm" title="Best viewed with Mozilla or any other Browser"><img src="links/fremde-banner/bestviewedwithmozill.gif" width="169" height="29" alt="Best viewed with Mozilla or any other Browser" /></a>
+ 83 
+ 84 <!-- Anfang des Topsites Codes der Listinus-Toppages -->
+ 85 <a href="http://click.listinus.de/topsite.php?id=34908" title="Top 50 Herr der Ringe - stimme f&uuml;r diese Seite ab."><img src="http://icon.listinus.de/topicon.php?id=34908" alt="Top 50 Herr der Ringe - stimme f&uuml;r diese Seite ab." /></a>
+ 86 <!-- Ende des Topsites Codes der Listinus-Toppages -->
+ 87 </div>
+ 88 
+ 89 <div style="text-align:center; padding:5px;">
+ 90 <form method="post" action="http://www.drachenritter.de/webring.php3" style="display:inline;">
+ 91 <input type="hidden" name="id" value="585" />
+ 92 <input type="hidden" name="mini" value="on" />
+ 93 <input type="image" src="/links/fremde-banner/minidrachenritter.jpg" name="click" title="Webring der Drachenritter" />
+ 94 </form>
+ 95 
+ 96 <a href="http://www.schatzwaechter.de"><img src="links/fremde-banner/faszinationtolkien.gif" width="128" height="56" alt="Schatzw&auml;chter" /></a>
+ 97 </div>
+ 98 
+ 99 <p>
+100 Faszination Tolkien ist zudem noch bei folgenden gro&szlig;en <a href="/die-seite/awards#wichtige-linklisten">Linklisten</a> aufgenommen.
+101 </p>
+102 
+103 <p class="fussanker"><a href="#">nach oben</a></p>
+104 </div>
+105 
+106 <div id="linkenavi"><!--linke seite-->
+107 <a href="/kurzfassungen/" class="navilinks">Kurzfassungen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Zusammenfassung von Herr der Ringe und Der Hobbit. &laquo;</span><br /></a>
+108 
+109 <a href="/ringe/" class="navilinks">Die Ringe <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Ringe der Macht. &laquo;</span><br /></a>
+110 
+111 <a href="/geschichte/" class="navilinks">Die Geschichte <span class="hide">&raquo; <b>Tolkiens Welt:</b> Die Geschichte von Arda bzw. Mittelerde. &laquo;</span><br /></a>
+112 
+113 <a href="/landeskunde/" class="navilinks">Landeskunde <span class="hide">&raquo; <b>Tolkiens Welt:</b> Geopolitische Informationen &uuml;ber Mittelerde. &laquo;</span><br /></a>
+114 
+115 <a href="/personen/" class="navilinks">Personen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Wichtige Personen. &laquo;</span><br /></a>
+116 
+117 <a href="/volk/" class="navilinks" style="margin-bottom:10px;">V&ouml;lker/Wesen <span class="hide">&raquo; <b>Tolkiens Welt:</b> Verschiedene V&ouml;lker und Wesen von Arda bzw. Mittelerde. &laquo;</span><br /></a>
+118 <!---->
+119 <a href="/jrr-tolkien/" class="navilinks">J. R. R. Tolkien <span class="hide">&raquo; <b>Person Tolkien:</b> Eine kurze Biographie &uuml;ber Tolkien; B&uuml;cherliste mit Werken von Tolkien und Sekund&auml;rliteratur. &laquo;</span><br /></a>
+120 
+121 <a href="/galerie/" class="navilinks">Galerie <span class="hide">&raquo; <b>Bilder</b>  von K&uuml;nstlern, die von Tolkiens Werken Inspiriert wurden. &laquo;</span><br /></a>
+122 <!---->
+123 <a href="/ueberlegungen/" class="navilinks" style="margin-bottom:10px;">&Uuml;berlegungen <span class="hide">&raquo; <b>Spekulation</b>, Gedanken zu diversen Ereignissen in Mittelerde. &laquo;</span><br /></a>
+124 <a href="/filme/" class="navilinks"> Film/e <span class="hide">&raquo; <b>Tolkien und Medien:</b> Infos zu den beiden Verfilmungen von Herr der Ringe. &laquo;</span>
+125 <br /></a>
+126 <a href="/spiele/" class="navilinks">Spiele <span class="hide">&raquo; <b>Tolkien und Medien:</b> Versch. Spiele rund um Tolkiens Werke: Brett- und Kartenspiele, PC Spiele, Online Spiele etc. &laquo;</span><br /></a>
+127 <a href="/fans/" class="navilinks">Fans <span class="hide">&raquo; <b>Fans und Ihre Aktivit&auml;ten:</b> Interviews, &quot;Dein erstes Mal&quot; etc. &laquo;</span><br /></a>
+128 </div><!--ende linker seite-->
+129 
+130 <div id="rechtenavi"><!--rechte seite-->
+131 <a href="/news/" class="navilinks">News <span class="hide2">&raquo; <b>Neuigkeiten:</b> &uuml;ber Tolkiens Werke, den Film, &uuml;ber die Seite etc. &laquo;</span><br /></a>
+132 
+133 <a href="/termine/" class="navilinks" style="margin-bottom:10px;">Termine <span class="hide2">&raquo; <b>Anstehende Veranstaltungen</b> zum Thema J. R. R. Tolkien und seine Werke. &laquo;</span><br /></a>
+134 <!---->
+135 <a href="/kontakte" class="navilinks">Kontakte <span class="hide2">&raquo; Impressum, Kontaktformular, Presseinfos &laquo;</span><br /></a>
+136 <a href="/interaktiv" class="navilinks">Interaktiv <span class="hide2">&raquo; <b>Forum, G&auml;stebuch,</b> Umfragen, Chat. &laquo;</span><br /></a>
+137 <a href="/hilfe" class="navilinks">Hilfe <span class="hide2">&raquo; Suche, FAQ, Sitemap. &laquo;</span><br /></a>
+138 <a href="/goodies" class="navilinks">Goodies <span class="hide2">&raquo; Newsletter, Sidebar, Styleswitcher, eCards, Winampskins, Downloads, Weiterempfehlen. &laquo;</span><br /></a>
+139 <a href="/die-seite" class="navilinks" style="margin-bottom:10px;">Die Seite <span class="hide2">&raquo; Ruhmeshalle bzw. Awards, Warum? etc. &laquo;</span><br /></a>
+140 
+141 <!---->
+142 <a href="/links/" class="navilinks">Links <span class="hide2">&raquo; Links zu anderen Tolkien Seiten und zu Webringen. Banner zum Bannertausch. &laquo;</span><br /></a>
+143 
+144 <a href="/empfehlungen/" class="navilinks">Empfehlungen <span class="hide2">&raquo; <b>Meine Empfehlungen:</b> B&uuml;cher, Spiele etc. &laquo;</span><br /></a>
+145 
+146 <a href="/wettbewerbe" class="navilinks">Wettbewerbe <span class="hide2">&raquo; Wettbewerbe und Gewinnspiele. &laquo;</span><br /></a>
+147 </div><!--ende rechter seite-->
+148 
+149 <div id="fuss">
+150 <div class="center">
+151 G&uuml;ltiges <a href="http://validator.w3.org/check/referer"
+152 
+153  title="Diese Seite h&auml;lt sich an die Webstandards">XHTML 1.0</a> und g&uuml;ltiges <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.faszination-tolkien.de/css/perun.css"
+154 
+155  title="Diese Seite h&auml;lt sich an die Webstandards">CSS</a>
+156 <br />
+157 2002-2006 by <a href="/kontakte/impressum/" title="Kontakt mit dem Webmaster">Perun</a> - Letzte &Auml;nderung: 04.03.2006 01:56:23<br />
+158 <a href="http://www.faszination-tolkien.de">www.faszination-tolkien.de</a> || <a href="http://www.herr-der-ringe.ws">www.herr-der-ringe.ws</a> || <a href="http://www.perun.net">www.perun.net</a>
+159 <br />
+160 <span class="sehrklein">Webdesign by: <a href="http://www.vlad-design.de" title="Vlad-Design: Webdesign von Vladimir Simovic">Vlad-Design</a> || hosted by: <a href="http://www.all-inkl.com/index.php?partner=14435" title="Sehr gute und g&uuml;nstige Webhosting-Angebote">www.all-inkl.com</a></span>
+161 </div>
+162 <p class="unsichtbar">&rarr;Hinweis: Schon mal dar&uuml;ber nachgedacht deinen Browser upzudaten?<br />Auf z. B. Mozilla, oder Netscape 7.x, oder Opera 7.x oder zumindest auf Internet Explorer 6.</p>
+163 </div>
+164 <!-- PowerPhlogger Code START -->
+165 <script language="JavaScript" type="text/javascript" src="/pphlogger.js"></script>
+166 <noscript><img alt="" src="http://www.faszination-tolkien.de/statistik/pphlogger.php?id=Perun&amp;st=img" /></noscript>
+167 <!-- PowerPhlogger Code END -->
+168 </body>
+169 </html>
+170 
+
diff --git a/test/html/tolkien.out.raydebug b/test/html/tolkien.out.raydebug index 09147bc..653ddd0 100644 --- a/test/html/tolkien.out.raydebug +++ b/test/html/tolkien.out.raydebug @@ -1,169 +1,169 @@ -preprocessor() -tag( attribute_name(xml:lang)operator(=)string attribute_name(lang)operator(=)stringtag(>) -tag()tag()plain(Faszination Tolkien - Herr der Ringe )entity(&) plain(Co.)tag() -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag( attribute_name(content)operator(=)string tag(/>) -tag(tag(>) -comment() -tag() -tag( attribute_name(href)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string tag(/>) -tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag(tag(>) -comment() -tag() -tag() -tag() -tag( attribute_name(title)operator(=)stringtag(>) -tag() -tag(tag(>) -tag(tag(>) -tag(tag(>) -comment() -tag() - -tag() -tag(

)plain(Faszination Tolkien - Herr der Ringe )entity(&) plain(Co.)tag(

) - -tag(

)plain(Diese Seite besch)entity(ä)plain(ftigt sich mit den )entity(")plain(Hauptwerken)entity(") plain(von J. R. R. Tolkien. Im Mittelpunkt steht )tag()plain(Der Herr der Ringe)tag()plain(, aber nach und nach werden immer mehr Details aus )tag()plain(Der kleine Hobbit)tag() plain(bzw. )tag()plain(Der Hobbit)tag() plain(und )tag()plain(Silmarillion)tag() plain(einflie)entity(ß)plain(en.)tag(

) -tag(

)plain(Auf der Seite gibt es, neben vielen selbstverfassten Infos, eine gro)entity(ß)plain(e )tag(tag(>)plain(Galerie)tag() plain(mit 'Herr der Ringe' Bildern (273 Bilder\), eine )tag(tag(>)plain(Download)tag() plain(Sektion mit 13 )tag(tag(>)plain(Winampskins)tag() plain(und einen )tag(tag(>)plain(eCard Versand)tag() plain((digitale Postkarten\) mit 'Herr der Ringe' Motiven.)tag(

) -tag(

)tag()plain(Anmerkung:)tag() plain(die Unterpunkte in der Navigation, einige Links im Text und viele Bilder haben Informationen (Titel\), daher lohnt es sich den Cursor, )entity(ü)plain(ber den Link ruhen zu lassen. Einige h)entity(ä)plain(ufige Fragen wurden schon in dem Bereich )tag(tag(>)plain(FAQ)tag() plain(beantwortet.)tag(

) - -tag(

)plain(Immer auf dem laufenden bleiben? Mit )tag(tag(>)plain(Newsletter)tag()plain(, )tag(tag(>)plain(Sidebar)tag() plain((Mozilla und Netscape ab 6.x\) oder mit )tag(tag(>)plain(RSS)tag()plain(.)tag(

) - -tag(

)tag()tag(tag(>)plain(Styleswitcher)tag()tag() plain(- )entity(ä)plain(ndere das Aussehen dieser Seite.)tag(

) - -tag(

)tag()plain(Diese Website wird aus Zeitgründen nicht mehr aktualisiert.)tag()tag(

) - - -tag(tag(>) -comment() - -tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string attribute_name(border)operator(=)string attribute_name(usemap)operator(=)string tag(/>) -tag( attribute_name(id)operator(=)string attribute_name(style)operator(=)stringtag(>) - tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) - tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) - tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) -tag() - -comment() -comment() - -tag( attribute_name(title)operator(=)stringtag(>)tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string tag(/>)tag() - -comment() -tag( attribute_name(title)operator(=)stringtag(>)tag( attribute_name(alt)operator(=)string tag(/>)tag() -comment() -tag() - -tag(tag(>) -tag( attribute_name(action)operator(=)string attribute_name(style)operator(=)stringtag(>) -tag( attribute_name(name)operator(=)string attribute_name(value)operator(=)string tag(/>) -tag( attribute_name(name)operator(=)string attribute_name(value)operator(=)string tag(/>) -tag( attribute_name(src)operator(=)string attribute_name(name)operator(=)string attribute_name(title)operator(=)string tag(/>) -tag() - -tag(tag(>)tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string tag(/>)tag() -tag() - -tag(

) -plain(Faszination Tolkien ist zudem noch bei folgenden gro)entity(ß)plain(en )tag(tag(>)plain(Linklisten)tag() plain(aufgenommen. -)tag(

) - -tag(tag(>)tag(tag(>)plain(nach oben)tag()tag(

) -tag() - -tag(tag(>)comment() -tag( attribute_name(class)operator(=)stringtag(>)plain(Kurzfassungen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Zusammenfassung von Herr der Ringe und Der Hobbit. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Die Ringe )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Ringe der Macht. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Die Geschichte )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Geschichte von Arda bzw. Mittelerde. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Landeskunde )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Geopolitische Informationen )entity(ü)plain(ber Mittelerde. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Personen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Wichtige Personen. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(V)entity(ö)plain(lker/Wesen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Verschiedene V)entity(ö)plain(lker und Wesen von Arda bzw. Mittelerde. )entity(«)tag()tag()tag() -comment() -tag( attribute_name(class)operator(=)stringtag(>)plain(J. R. R. Tolkien )tag(tag(>)entity(») tag()plain(Person Tolkien:)tag() plain(Eine kurze Biographie )entity(ü)plain(ber Tolkien; B)entity(ü)plain(cherliste mit Werken von Tolkien und Sekund)entity(ä)plain(rliteratur. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Galerie )tag(tag(>)entity(») tag()plain(Bilder)tag() plain(von K)entity(ü)plain(nstlern, die von Tolkiens Werken Inspiriert wurden. )entity(«)tag()tag()tag() -comment() -tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)entity(Ü)plain(berlegungen )tag(tag(>)entity(») tag()plain(Spekulation)tag()plain(, Gedanken zu diversen Ereignissen in Mittelerde. )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)stringtag(>) plain(Film/e )tag(tag(>)entity(») tag()plain(Tolkien und Medien:)tag() plain(Infos zu den beiden Verfilmungen von Herr der Ringe. )entity(«)tag() -tag()tag() -tag( attribute_name(class)operator(=)stringtag(>)plain(Spiele )tag(tag(>)entity(») tag()plain(Tolkien und Medien:)tag() plain(Versch. Spiele rund um Tolkiens Werke: Brett- und Kartenspiele, PC Spiele, Online Spiele etc. )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)stringtag(>)plain(Fans )tag(tag(>)entity(») tag()plain(Fans und Ihre Aktivit)entity(ä)plain(ten:)tag() plain(Interviews, )entity(")plain(Dein erstes Mal)entity(") plain(etc. )entity(«)tag()tag()tag() -tag()comment() - -tag(tag(>)comment() -tag( attribute_name(class)operator(=)stringtag(>)plain(News )tag(tag(>)entity(») tag()plain(Neuigkeiten:)tag() entity(ü)plain(ber Tolkiens Werke, den Film, )entity(ü)plain(ber die Seite etc. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(Termine )tag(tag(>)entity(») tag()plain(Anstehende Veranstaltungen)tag() plain(zum Thema J. R. R. Tolkien und seine Werke. )entity(«)tag()tag()tag() -comment() -tag( attribute_name(class)operator(=)stringtag(>)plain(Kontakte )tag(tag(>)entity(») plain(Impressum, Kontaktformular, Presseinfos )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)stringtag(>)plain(Interaktiv )tag(tag(>)entity(») tag()plain(Forum, G)entity(ä)plain(stebuch,)tag() plain(Umfragen, Chat. )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)stringtag(>)plain(Hilfe )tag(tag(>)entity(») plain(Suche, FAQ, Sitemap. )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)stringtag(>)plain(Goodies )tag(tag(>)entity(») plain(Newsletter, Sidebar, Styleswitcher, eCards, Winampskins, Downloads, Weiterempfehlen. )entity(«)tag()tag()tag() -tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(Die Seite )tag(tag(>)entity(») plain(Ruhmeshalle bzw. Awards, Warum? etc. )entity(«)tag()tag()tag() - -comment() -tag( attribute_name(class)operator(=)stringtag(>)plain(Links )tag(tag(>)entity(») plain(Links zu anderen Tolkien Seiten und zu Webringen. Banner zum Bannertausch. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Empfehlungen )tag(tag(>)entity(») tag()plain(Meine Empfehlungen:)tag() plain(B)entity(ü)plain(cher, Spiele etc. )entity(«)tag()tag()tag() - -tag( attribute_name(class)operator(=)stringtag(>)plain(Wettbewerbe )tag(tag(>)entity(») plain(Wettbewerbe und Gewinnspiele. )entity(«)tag()tag()tag() -tag()comment() - -tag(tag(>) -tag(tag(>) -plain(G)entity(ü)plain(ltiges )tag( - - attribute_name(title)operator(=)stringtag(>)plain(XHTML 1.0)tag() plain(und g)entity(ü)plain(ltiges )tag( - - attribute_name(title)operator(=)stringtag(>)plain(CSS)tag() -tag() -plain(2002-2006 by )tag( attribute_name(title)operator(=)stringtag(>)plain(Perun)tag() plain(- Letzte )entity(Ä)plain(nderung: 04.03.2006 01:56:23)tag() -tag(tag(>)plain(www.faszination-tolkien.de)tag() plain(|| )tag(tag(>)plain(www.herr-der-ringe.ws)tag() plain(|| )tag(tag(>)plain(www.perun.net)tag() -tag() -tag(tag(>)plain(Webdesign by: )tag( attribute_name(title)operator(=)stringtag(>)plain(Vlad-Design)tag() plain(|| hosted by: )tag( attribute_name(title)operator(=)stringtag(>)plain(www.all-inkl.com)tag()tag() -tag() -tag(tag(>)entity(→)plain(Hinweis: Schon mal dar)entity(ü)plain(ber nachgedacht deinen Browser upzudaten?)tag()plain(Auf z. B. Mozilla, oder Netscape 7.x, oder Opera 7.x oder zumindest auf Internet Explorer 6.)tag(

) -tag() -comment() -tag( attribute_name(type)operator(=)string attribute_name(src)operator(=)stringtag(>)tag() -tag() -comment() -tag() -tag() +preprocessor() +tag( attribute_name(xml:lang)operator(=)string attribute_name(lang)operator(=)stringtag(>) +tag()tag()plain(Faszination Tolkien - Herr der Ringe )entity(&) plain(Co.)tag() +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag( attribute_name(content)operator(=)string tag(/>) +tag(tag(>) +comment() +tag() +tag( attribute_name(href)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string tag(/>) +tag( attribute_name(href)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag(tag(>) +comment() +tag() +tag() +tag() +tag( attribute_name(title)operator(=)stringtag(>) +tag() +tag(tag(>) +tag(tag(>) +tag(tag(>) +comment() +tag() + +tag() +tag(

)plain(Faszination Tolkien - Herr der Ringe )entity(&) plain(Co.)tag(

) + +tag(

)plain(Diese Seite besch)entity(ä)plain(ftigt sich mit den )entity(")plain(Hauptwerken)entity(") plain(von J. R. R. Tolkien. Im Mittelpunkt steht )tag()plain(Der Herr der Ringe)tag()plain(, aber nach und nach werden immer mehr Details aus )tag()plain(Der kleine Hobbit)tag() plain(bzw. )tag()plain(Der Hobbit)tag() plain(und )tag()plain(Silmarillion)tag() plain(einflie)entity(ß)plain(en.)tag(

) +tag(

)plain(Auf der Seite gibt es, neben vielen selbstverfassten Infos, eine gro)entity(ß)plain(e )tag(tag(>)plain(Galerie)tag() plain(mit 'Herr der Ringe' Bildern (273 Bilder\), eine )tag(tag(>)plain(Download)tag() plain(Sektion mit 13 )tag(tag(>)plain(Winampskins)tag() plain(und einen )tag(tag(>)plain(eCard Versand)tag() plain((digitale Postkarten\) mit 'Herr der Ringe' Motiven.)tag(

) +tag(

)tag()plain(Anmerkung:)tag() plain(die Unterpunkte in der Navigation, einige Links im Text und viele Bilder haben Informationen (Titel\), daher lohnt es sich den Cursor, )entity(ü)plain(ber den Link ruhen zu lassen. Einige h)entity(ä)plain(ufige Fragen wurden schon in dem Bereich )tag(tag(>)plain(FAQ)tag() plain(beantwortet.)tag(

) + +tag(

)plain(Immer auf dem laufenden bleiben? Mit )tag(tag(>)plain(Newsletter)tag()plain(, )tag(tag(>)plain(Sidebar)tag() plain((Mozilla und Netscape ab 6.x\) oder mit )tag(tag(>)plain(RSS)tag()plain(.)tag(

) + +tag(

)tag()tag(tag(>)plain(Styleswitcher)tag()tag() plain(- )entity(ä)plain(ndere das Aussehen dieser Seite.)tag(

) + +tag(

)tag()plain(Diese Website wird aus Zeitgründen nicht mehr aktualisiert.)tag()tag(

) + + +tag(tag(>) +comment() + +tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string attribute_name(border)operator(=)string attribute_name(usemap)operator(=)string tag(/>) +tag( attribute_name(id)operator(=)string attribute_name(style)operator(=)stringtag(>) + tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) + tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) + tag( attribute_name(href)operator(=)string attribute_name(alt)operator(=)string attribute_name(title)operator(=)string attribute_name(coords)operator(=)string tag(/>) +tag() + +comment() +comment() + +tag( attribute_name(title)operator(=)stringtag(>)tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string tag(/>)tag() + +comment() +tag( attribute_name(title)operator(=)stringtag(>)tag( attribute_name(alt)operator(=)string tag(/>)tag() +comment() +tag() + +tag(tag(>) +tag( attribute_name(action)operator(=)string attribute_name(style)operator(=)stringtag(>) +tag( attribute_name(name)operator(=)string attribute_name(value)operator(=)string tag(/>) +tag( attribute_name(name)operator(=)string attribute_name(value)operator(=)string tag(/>) +tag( attribute_name(src)operator(=)string attribute_name(name)operator(=)string attribute_name(title)operator(=)string tag(/>) +tag() + +tag(tag(>)tag( attribute_name(width)operator(=)string attribute_name(height)operator(=)string attribute_name(alt)operator(=)string tag(/>)tag() +tag() + +tag(

) +plain(Faszination Tolkien ist zudem noch bei folgenden gro)entity(ß)plain(en )tag(tag(>)plain(Linklisten)tag() plain(aufgenommen. +)tag(

) + +tag(tag(>)tag(tag(>)plain(nach oben)tag()tag(

) +tag() + +tag(tag(>)comment() +tag( attribute_name(class)operator(=)stringtag(>)plain(Kurzfassungen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Zusammenfassung von Herr der Ringe und Der Hobbit. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Die Ringe )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Ringe der Macht. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Die Geschichte )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Die Geschichte von Arda bzw. Mittelerde. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Landeskunde )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Geopolitische Informationen )entity(ü)plain(ber Mittelerde. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Personen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Wichtige Personen. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(V)entity(ö)plain(lker/Wesen )tag(tag(>)entity(») tag()plain(Tolkiens Welt:)tag() plain(Verschiedene V)entity(ö)plain(lker und Wesen von Arda bzw. Mittelerde. )entity(«)tag()tag()tag() +comment() +tag( attribute_name(class)operator(=)stringtag(>)plain(J. R. R. Tolkien )tag(tag(>)entity(») tag()plain(Person Tolkien:)tag() plain(Eine kurze Biographie )entity(ü)plain(ber Tolkien; B)entity(ü)plain(cherliste mit Werken von Tolkien und Sekund)entity(ä)plain(rliteratur. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Galerie )tag(tag(>)entity(») tag()plain(Bilder)tag() plain(von K)entity(ü)plain(nstlern, die von Tolkiens Werken Inspiriert wurden. )entity(«)tag()tag()tag() +comment() +tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)entity(Ü)plain(berlegungen )tag(tag(>)entity(») tag()plain(Spekulation)tag()plain(, Gedanken zu diversen Ereignissen in Mittelerde. )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)stringtag(>) plain(Film/e )tag(tag(>)entity(») tag()plain(Tolkien und Medien:)tag() plain(Infos zu den beiden Verfilmungen von Herr der Ringe. )entity(«)tag() +tag()tag() +tag( attribute_name(class)operator(=)stringtag(>)plain(Spiele )tag(tag(>)entity(») tag()plain(Tolkien und Medien:)tag() plain(Versch. Spiele rund um Tolkiens Werke: Brett- und Kartenspiele, PC Spiele, Online Spiele etc. )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)stringtag(>)plain(Fans )tag(tag(>)entity(») tag()plain(Fans und Ihre Aktivit)entity(ä)plain(ten:)tag() plain(Interviews, )entity(")plain(Dein erstes Mal)entity(") plain(etc. )entity(«)tag()tag()tag() +tag()comment() + +tag(tag(>)comment() +tag( attribute_name(class)operator(=)stringtag(>)plain(News )tag(tag(>)entity(») tag()plain(Neuigkeiten:)tag() entity(ü)plain(ber Tolkiens Werke, den Film, )entity(ü)plain(ber die Seite etc. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(Termine )tag(tag(>)entity(») tag()plain(Anstehende Veranstaltungen)tag() plain(zum Thema J. R. R. Tolkien und seine Werke. )entity(«)tag()tag()tag() +comment() +tag( attribute_name(class)operator(=)stringtag(>)plain(Kontakte )tag(tag(>)entity(») plain(Impressum, Kontaktformular, Presseinfos )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)stringtag(>)plain(Interaktiv )tag(tag(>)entity(») tag()plain(Forum, G)entity(ä)plain(stebuch,)tag() plain(Umfragen, Chat. )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)stringtag(>)plain(Hilfe )tag(tag(>)entity(») plain(Suche, FAQ, Sitemap. )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)stringtag(>)plain(Goodies )tag(tag(>)entity(») plain(Newsletter, Sidebar, Styleswitcher, eCards, Winampskins, Downloads, Weiterempfehlen. )entity(«)tag()tag()tag() +tag( attribute_name(class)operator(=)string attribute_name(style)operator(=)stringtag(>)plain(Die Seite )tag(tag(>)entity(») plain(Ruhmeshalle bzw. Awards, Warum? etc. )entity(«)tag()tag()tag() + +comment() +tag( attribute_name(class)operator(=)stringtag(>)plain(Links )tag(tag(>)entity(») plain(Links zu anderen Tolkien Seiten und zu Webringen. Banner zum Bannertausch. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Empfehlungen )tag(tag(>)entity(») tag()plain(Meine Empfehlungen:)tag() plain(B)entity(ü)plain(cher, Spiele etc. )entity(«)tag()tag()tag() + +tag( attribute_name(class)operator(=)stringtag(>)plain(Wettbewerbe )tag(tag(>)entity(») plain(Wettbewerbe und Gewinnspiele. )entity(«)tag()tag()tag() +tag()comment() + +tag(tag(>) +tag(tag(>) +plain(G)entity(ü)plain(ltiges )tag( + + attribute_name(title)operator(=)stringtag(>)plain(XHTML 1.0)tag() plain(und g)entity(ü)plain(ltiges )tag( + + attribute_name(title)operator(=)stringtag(>)plain(CSS)tag() +tag() +plain(2002-2006 by )tag( attribute_name(title)operator(=)stringtag(>)plain(Perun)tag() plain(- Letzte )entity(Ä)plain(nderung: 04.03.2006 01:56:23)tag() +tag(tag(>)plain(www.faszination-tolkien.de)tag() plain(|| )tag(tag(>)plain(www.herr-der-ringe.ws)tag() plain(|| )tag(tag(>)plain(www.perun.net)tag() +tag() +tag(tag(>)plain(Webdesign by: )tag( attribute_name(title)operator(=)stringtag(>)plain(Vlad-Design)tag() plain(|| hosted by: )tag( attribute_name(title)operator(=)stringtag(>)plain(www.all-inkl.com)tag()tag() +tag() +tag(tag(>)entity(→)plain(Hinweis: Schon mal dar)entity(ü)plain(ber nachgedacht deinen Browser upzudaten?)tag()plain(Auf z. B. Mozilla, oder Netscape 7.x, oder Opera 7.x oder zumindest auf Internet Explorer 6.)tag(

) +tag() +comment() +tag( attribute_name(type)operator(=)string attribute_name(src)operator(=)stringtag(>)tag() +tag() +comment() +tag() +tag() diff --git a/test/nitro-xhtml/suite.rb b/test/nitro-xhtml/suite.rb new file mode 100644 index 0000000..c2f0e33 --- /dev/null +++ b/test/nitro-xhtml/suite.rb @@ -0,0 +1,3 @@ +class Nitro < CodeRay::TestCase + extension :xhtml +end diff --git a/test/nitro-xhtml/tags.in.xhtml b/test/nitro-xhtml/tags.in.xhtml new file mode 100644 index 0000000..398031c --- /dev/null +++ b/test/nitro-xhtml/tags.in.xhtml @@ -0,0 +1,87 @@ + +
+ +

Questions with Tags: #{@tags.join(" ")}

+ + 0 ?> + + Too many results for that Tag, please reduce the number by using one of the following Tags: + #{cloud_of(@qtags)} + +
+ +

#{q.question}

+

+ + #{excerpt} +

+

#{q.answers.size.to_i} answers

+ +
+
+ #{@qpager.navigation} +
+ +
+

no question with this/these tag(s) found

+

Ask a question here.

+
+ + + 0 ?> +

Tips with Tags: #{@tags.join(" ")}

+ + Too many results for that Tag, please reduce the number by using one of the following Tags: + #{cloud_of(@ttags)} + +
+ +

#{t.title}

+

+ + #{excerpt} +

+ +
+
+ #{@tpager.navigation} +
+ + + 0 ?> +

Tutorials with Tags: #{@tags.join(" ")}

+ + Too many results for that Tag, please reduce the number by using one of the following Tags: + #{cloud_of(@tuttags)} + +
+ +

#{t.title}

+

+ + #{excerpt} +

+ +
+
+ #{@tpager.navigation} +
+ + + + +
+ + + #{t.name} + +
+ +
+ + +
+ + diff --git a/test/nitro-xhtml/tags.out.raydebug b/test/nitro-xhtml/tags.out.raydebug new file mode 100644 index 0000000..7ce6076 --- /dev/null +++ b/test/nitro-xhtml/tags.out.raydebug @@ -0,0 +1,87 @@ +tag(tag(>) + tag(tag(>) + inline)> + tag(

)plain(Questions with Tags: )inlineoperator(\))delimiter(})>tag(

) + + inline) integer(0) delimiter(?>)> + inline)> + plain(Too many results for that Tag, please reduce the number by using one of the following Tags: + )inline + inline)> + tag(tag(>) + inline)> + tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) + tag(

) + inline)> + inline + tag(

) + tag(tag(>)inline plain(answers)tag(

) + inline)> + tag() + tag(tag(>) + inline + tag() + inline)> + tag(tag(>) + tag(

)plain(no question with this/these tag(s\) found)tag(

) + tag(

)tag(tag(>)plain(Ask a question here.)tag()tag(

) + tag() + inline)> + + inline) integer(0) delimiter(?>)> + tag(

)plain(Tips with Tags: )inlineoperator(\))delimiter(})>tag(

) + inline)> + plain(Too many results for that Tag, please reduce the number by using one of the following Tags: + )inline + inline)> + tag(tag(>) + inline)> + tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) + tag(

) + inline)> + inline + tag(

) + inline)> + tag() + tag(tag(>) + inline + tag() + inline)> + + inline) integer(0) delimiter(?>)> + tag(

)plain(Tutorials with Tags: )inlineoperator(\))delimiter(})>tag(

) + inline)> + plain(Too many results for that Tag, please reduce the number by using one of the following Tags: + )inline + inline)> + tag(tag(>) + inline)> + tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) + tag(

) + inline)> + inline + tag(

) + inline)> + tag() + tag(tag(>) + inline + tag() + inline)> + + + inline)> + tag(tag(>) + inline)> + inline)> + tag(delimiter(")> attribute_name(style)operator(=)stringcontent(em;)delimiter(")>tag(>)inlinetag() + inline)> + tag() comment() + inline)> + tag() comment() + + tag( tag(/>) +tag() + +comment() diff --git a/test/rhtml/day.out.raydebug b/test/rhtml/day.out.raydebug index e4fe996..7440d64 100644 --- a/test/rhtml/day.out.raydebug +++ b/test/rhtml/day.out.raydebug @@ -1,26 +1,26 @@ -inline)> -inline)> - -tag() - tag(tag(>) - inline)> - inline)>tag()tag()plain(Samstag)tag()inline)> - tag() - tag(tag(>) - inline)> - tag() - tag(tag(>) - inline)> - inlineoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:edit)operator(,) symbol(:id) operator(=)operator(>) ident(auftritt) delimiter(%>)> - tag() - tag(tag(>) - inlineoperator(\)) operator(+) string)delimiter(')> reserved(unless) ident(auftritt)operator(.)ident(place)operator(.)ident(blank?) delimiter(%>)> - tag() -tag() - -inline)> +inline)> +inline)> + +tag() + tag(tag(>) + inline)> + inline)>tag()tag()plain(Samstag)tag()inline)> + tag() + tag(tag(>) + inline)> + tag() + tag(tag(>) + inline)> + inlineoperator(,) symbol(:controller) operator(=)operator(>) stringoperator(,) symbol(:action) operator(=)operator(>) symbol(:edit)operator(,) symbol(:id) operator(=)operator(>) ident(auftritt) delimiter(%>)> + tag() + tag(tag(>) + inlineoperator(\)) operator(+) string)delimiter(')> reserved(unless) ident(auftritt)operator(.)ident(place)operator(.)ident(blank?) delimiter(%>)> + tag() +tag() + +inline)> diff --git a/test/rhtml/suite.rb b/test/rhtml/suite.rb index c9cd989..aa10fff 100644 --- a/test/rhtml/suite.rb +++ b/test/rhtml/suite.rb @@ -1,9 +1,2 @@ -class RHTMLTest < CodeRaySuite - - @file = __FILE__ - LANG = :rhtml - EXTENSION = 'rhtml' - -end - -$suite << RHTMLTest.suite if $suite +class RHTML < CodeRay::TestCase +end diff --git a/test/ruby/1.out.raydebug b/test/ruby/1.out.raydebug index 31644b1..510e7c6 100644 --- a/test/ruby/1.out.raydebug +++ b/test/ruby/1.out.raydebug @@ -1,731 +1,731 @@ -ident(public) symbol(:<<) - -reserved(class) class(String) - reserved(def) method(/) ident(regex) - ident(scan)operator(()ident(regex)operator(\))operator(.)ident(first) - reserved(end) -reserved(end) - -reserved(module) class(Bytes) - constant(KILOBYTE)operator(,) constant(MEGABYTE)operator(,) constant(GIGABYTE)operator(,) constant(TERABYTE)operator(,) constant(PETABYTE) operator(=) operator(()integer(1)operator(..)integer(5)operator(\))operator(.)ident(map) operator({) operator(|)ident(x)operator(|) integer(2) operator(**) operator(()integer(10) operator(*) ident(x)operator(\)) operator(}) - constant(FactorOfSuffix) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(1)operator(\)) - ident(constants)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) - constant(FactorOfSuffix)operator([)ident(c)operator([)integer(0)operator(,)integer(1)operator(])operator(]) operator(=) ident(const_get) ident(c) - reserved(end) - - reserved(def) constant(Bytes)operator(.)ident(factor_of_suffix) ident(suff) - constant(FactorOfSuffix)operator([)ident(suff)operator(]) - reserved(end) - - reserved(def) constant(Bytes)operator(.)operator([]) ident(str) - ident(n)operator(,) ident(fac) operator(=) ident(str) operator(/) regexp - ident(n) operator(=) ident(n)operator(.)ident(to_i) - ident(fac) operator(=) ident(factor_of_suffix) ident(fac) - ident(n) operator(*) ident(fac) - reserved(end) -reserved(end) - -reserved(class) class(String) - reserved(def) method(to_bytes) - constant(Bytes)operator([)pre_constant(self)operator(]) - reserved(end) -reserved(end) - -ident(p) stringoperator(.)ident(to_bytes) -ident(p) string operator(%) operator([)constant(Bytes)operator(.)ident(constants)operator(.)ident(size)operator(,) pre_constant(self)operator(]) - -ident(p) string operator(/) regexp - -ident(p) string operator(+) regexp -ident(p) string operator(-) regexp -ident(p) string operator(*) regexp -ident(p) string operator(**) regexp -ident(p) string operator(%) regexp -ident(p) string operator(~) regexp - -ident(require) string -constant(S) operator(=) string operator(*) integer(100) operator(+) string operator(+) stringoperator(*)integer(4) -constant(T) operator(=) integer(200000) - -constant(Benchmark)operator(.)ident(bm)operator(()integer(1)operator(\)) reserved(do) operator(|)ident(bm)operator(|) - constant(GC)operator(.)ident(sweep) - ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()integer(?\\n)operator(\)) operator(}) operator(}) - constant(GC)operator(.)ident(sweep) - ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()stringoperator(\)) operator(}) operator(}) - constant(GC)operator(.)ident(sweep) - ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()regexpoperator(\)) operator(}) operator(}) - constant(GC)operator(.)ident(sweep) -reserved(end) - - reserved(def) method(next?)operator(()operator(\)) - operator(!)ident(end?) - reserved(end) - comment(# Rewinds the generator.) - reserved(def) method(rewind)operator(()operator(\)) - ident(initialize)operator(()pre_constant(nil)operator(,) operator(&)instance_variable(@block)operator(\)) reserved(if) instance_variable(@index)operator(.)ident(nonzero?) - - pre_constant(self) - reserved(end) - -ident(a) operator(=) operator([)operator(]) -ident(a) operator(<<) ident(a) -ident(p) ident(a) comment(#-> [[...]]) - -comment(# format.rb: Written by Tadayoshi Funaba 1999-2004) -comment(# $Id: format.rb,v 2.14 2004-11-06 10:58:40+09 tadf Exp $) - -ident(require) string - -reserved(class) class(Date) - - constant(MONTHS) operator(=) operator({) - string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) integer(4)operator(,) - string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6)operator(,) string operator(=)operator(>) integer(7)operator(,) string operator(=)operator(>) integer(8)operator(,) - stringoperator(=)operator(>) integer(9)operator(,) string operator(=)operator(>)integer(10)operator(,) string operator(=)operator(>)integer(11)operator(,) string operator(=)operator(>)integer(12) - operator(}) - - constant(DAYS) operator(=) operator({) - string operator(=)operator(>) integer(0)operator(,) string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) stringoperator(=)operator(>) integer(3)operator(,) - string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6) - operator(}) - - constant(ABBR_MONTHS) operator(=) operator({) - string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) integer(4)operator(,) - string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6)operator(,) string operator(=)operator(>) integer(7)operator(,) string operator(=)operator(>) integer(8)operator(,) - string operator(=)operator(>) integer(9)operator(,) string operator(=)operator(>)integer(10)operator(,) string operator(=)operator(>)integer(11)operator(,) string operator(=)operator(>)integer(12) - operator(}) - - constant(ABBR_DAYS) operator(=) operator({) - string operator(=)operator(>) integer(0)operator(,) string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) - string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6) - operator(}) - - constant(ZONES) operator(=) operator({) - string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(4)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(9)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(11)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-11)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-12)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-1)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) - stringoperator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-11)operator(*)integer(3600)operator(,) stringoperator(=)operator(>)integer(-12)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(4)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(5)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(6)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(7)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(9)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(11)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) - string operator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(13)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(12)operator(*)integer(3600) - operator(}) - - reserved(def) pre_constant(self)operator(.)ident(__strptime)operator(()ident(str)operator(,) ident(fmt)operator(,) ident(elem)operator(\)) - ident(fmt)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) operator(|)ident(c)operator(|) - ident(cc) operator(=) ident(c)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(case) ident(cc) - reserved(when) regexp - ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) constant(DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) operator(||) constant(ABBR_DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) - reserved(return) reserved(unless) ident(val) - ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(val) - reserved(when) stringoperator(,) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) constant(MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) operator(||) constant(ABBR_MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) - reserved(return) reserved(unless) ident(val) - ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - ident(elem)operator([)symbol(:cent)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(31)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:mday)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - ident(elem)operator([)symbol(:cwyear)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(99)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:cwyear)operator(]) operator(=) ident(val) - ident(elem)operator([)symbol(:cent)operator(]) operator(||=) reserved(if) ident(val) operator(>)operator(=) integer(69) reserved(then) integer(19) reserved(else) integer(20) reserved(end) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(24)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(val) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(12)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(366)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:yday)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(59)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:min)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(12)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(elem)operator([)symbol(:merid)operator(]) operator(=) reserved(if) global_variable($1)operator(.)ident(downcase) operator(==) string reserved(then) integer(0) reserved(else) integer(12) reserved(end) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(60)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:sec)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - ident(elem)operator([)symbol(:seconds)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(53)operator(\)) operator(===) ident(val) - ident(elem)operator([)reserved(if) ident(c) operator(==) string reserved(then) symbol(:wnum0) reserved(else) symbol(:wnum1) reserved(end)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(7)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:cwday)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(53)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:cweek)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(6)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(99)operator(\)) operator(===) ident(val) - ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(val) - ident(elem)operator([)symbol(:cent)operator(]) operator(||=) reserved(if) ident(val) operator(>)operator(=) integer(69) reserved(then) integer(19) reserved(else) integer(20) reserved(end) - reserved(when) stringoperator(,) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1) - ident(elem)operator([)symbol(:zone)operator(]) operator(=) ident(val) - ident(offset) operator(=) ident(zone_to_diff)operator(()ident(val)operator(\)) - ident(elem)operator([)symbol(:offset)operator(]) operator(=) ident(offset) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) -comment(=begin - when '%.' - return unless str.sub!(/\\A(\\d+\)/o, ''\) - val = $1.to_i.to_r / (10**$1.size\) - elem[:sec_fraction] = val -=end) - reserved(when) string - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(val) operator(=) global_variable($1)operator(.)ident(to_i) - ident(elem)operator([)symbol(:jd)operator(]) operator(=) ident(val) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(when) string - reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) - reserved(else) - reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()constant(Regexp)operator(.)ident(new)operator(()string operator(+) constant(Regexp)operator(.)ident(quote)operator(()ident(c)operator(\))operator(\))operator(,) stringoperator(\)) - reserved(end) - reserved(end) - - reserved(if) ident(cent) operator(=) ident(elem)operator(.)ident(delete)operator(()symbol(:cent)operator(\)) - reserved(if) ident(elem)operator([)symbol(:cwyear)operator(]) - ident(elem)operator([)symbol(:cwyear)operator(]) operator(+=) ident(cent) operator(*) integer(100) - reserved(end) - reserved(if) ident(elem)operator([)symbol(:year)operator(]) - ident(elem)operator([)symbol(:year)operator(]) operator(+=) ident(cent) operator(*) integer(100) - reserved(end) - reserved(end) - - reserved(if) ident(merid) operator(=) ident(elem)operator(.)ident(delete)operator(()symbol(:merid)operator(\)) - reserved(if) ident(elem)operator([)symbol(:hour)operator(]) - ident(elem)operator([)symbol(:hour)operator(]) operator(%=) integer(12) - ident(elem)operator([)symbol(:hour)operator(]) operator(+=) ident(merid) - reserved(end) - reserved(end) - - ident(str) - reserved(end) - - ident(private_class_method) symbol(:__strptime) - - reserved(def) pre_constant(self)operator(.)ident(_strptime)operator(()ident(str)operator(,) ident(fmt)operator(=)stringoperator(\)) - ident(elem) operator(=) operator({)operator(}) - ident(elem) reserved(if) ident(__strptime)operator(()ident(str)operator(.)ident(dup)operator(,) ident(fmt)operator(,) ident(elem)operator(\)) - reserved(end) - - constant(PARSE_MONTHPAT) operator(=) constant(ABBR_MONTHS)operator(.)ident(keys)operator(.)ident(join)operator(()stringoperator(\)) - constant(PARSE_DAYPAT) operator(=) constant(ABBR_DAYS)operator(.) ident(keys)operator(.)ident(join)operator(()stringoperator(\)) - - reserved(def) pre_constant(self)operator(.)ident(_parse)operator(()ident(str)operator(,) ident(comp)operator(=)pre_constant(false)operator(\)) - ident(str) operator(=) ident(str)operator(.)ident(dup) - - ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - - comment(# day) - reserved(if) ident(str)operator(.)ident(sub!)operator(()regexpcontent(\))char(\\S)content(*)delimiter(/)modifier(ino)>operator(,) stringoperator(\)) - ident(wday) operator(=) constant(ABBR_DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) - reserved(end) - - comment(# time) - reserved(if) ident(str)operator(.)ident(sub!)operator(() - regexpoperator(,) - stringoperator(\)) - ident(hour) operator(=) global_variable($1)operator(.)ident(to_i) - ident(min) operator(=) global_variable($2)operator(.)ident(to_i) - ident(sec) operator(=) global_variable($3)operator(.)ident(to_i) reserved(if) global_variable($3) - reserved(if) global_variable($4) - ident(sec_fraction) operator(=) global_variable($4)operator(.)ident(to_i)operator(.)ident(to_r) operator(/) operator(()integer(10)operator(**)global_variable($4)operator(.)ident(size)operator(\)) - reserved(end) - - reserved(if) global_variable($5) - ident(hour) operator(%=) integer(12) - reserved(if) global_variable($5)operator(.)ident(downcase) operator(==) string - ident(hour) operator(+=) integer(12) - reserved(end) - reserved(end) - - reserved(if) global_variable($6) - ident(zone) operator(=) global_variable($6) - reserved(end) - reserved(end) - - comment(# eu) - reserved(if) ident(str)operator(.)ident(sub!)operator(() - regexpcontent(\))char(\\S)content(* - (?: - )char(\\s)content(+ - (-?)char(\\d)content(+\) - \)? - )delimiter(/)modifier(inox)>operator(,) - stringoperator(\)) - ident(mday) operator(=) global_variable($1)operator(.)ident(to_i) - ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($2)operator(.)ident(downcase)operator(]) - - reserved(if) global_variable($3) - ident(year) operator(=) global_variable($3)operator(.)ident(to_i) - reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - reserved(end) - reserved(end) - - comment(# us) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(() - regexpcontent(\))char(\\S)content(* - )char(\\s)content(+ - ()char(\\d)content(+\))char(\\S)content(* - (?: - )char(\\s)content(+ - (-?)char(\\d)content(+\) - \)? - )delimiter(/)modifier(inox)>operator(,) - stringoperator(\)) - ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) - ident(mday) operator(=) global_variable($2)operator(.)ident(to_i) - - reserved(if) global_variable($3) - ident(year) operator(=) global_variable($3)operator(.)ident(to_i) - reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - reserved(end) - reserved(end) - - comment(# iso) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(year) operator(=) global_variable($1)operator(.)ident(to_i) - ident(mon) operator(=) global_variable($2)operator(.)ident(to_i) - ident(mday) operator(=) global_variable($3)operator(.)ident(to_i) - - reserved(if) global_variable($1)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - reserved(elsif) global_variable($3)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - ident(mday)operator(,) ident(mon)operator(,) ident(year) operator(=) ident(year)operator(,) ident(mon)operator(,) ident(mday) - reserved(end) - - comment(# jis) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(e) operator(=) operator({) stringoperator(=)operator(>)integer(1867)operator(,) - stringoperator(=)operator(>)integer(1911)operator(,) - stringoperator(=)operator(>)integer(1925)operator(,) - stringoperator(=)operator(>)integer(1988) - operator(})operator([)global_variable($1)operator(.)ident(downcase)operator(]) - ident(year) operator(=) global_variable($2)operator(.)ident(to_i) operator(+) ident(e) - ident(mon) operator(=) global_variable($3)operator(.)ident(to_i) - ident(mday) operator(=) global_variable($4)operator(.)ident(to_i) - - comment(# vms) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpcontent(\)[^-]*-(-?)char(\\d)content(+\))delimiter(/)modifier(ino)>operator(,) stringoperator(\)) - ident(mday) operator(=) global_variable($1)operator(.)ident(to_i) - ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($2)operator(.)ident(downcase)operator(]) - ident(year) operator(=) global_variable($3)operator(.)ident(to_i) - - reserved(if) global_variable($1)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - ident(year)operator(,) ident(mon)operator(,) ident(mday) operator(=) ident(mday)operator(,) ident(mon)operator(,) ident(year) - reserved(elsif) global_variable($3)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - reserved(end) - - comment(# sla) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - ident(mon) operator(=) global_variable($1)operator(.)ident(to_i) - ident(mday) operator(=) global_variable($2)operator(.)ident(to_i) - - reserved(if) global_variable($3) - ident(year) operator(=) global_variable($3)operator(.)ident(to_i) - reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - reserved(end) - reserved(end) - - reserved(if) global_variable($3) operator(&&) global_variable($1)operator(.)ident(size) operator(>) integer(2) - ident(comp) operator(=) pre_constant(false) - ident(year)operator(,) ident(mon)operator(,) ident(mday) operator(=) ident(mon)operator(,) ident(mday)operator(,) ident(year) - reserved(end) - - comment(# ddd) - reserved(elsif) ident(str)operator(.)ident(sub!)operator(() - regexpoperator(,) - stringoperator(\)) - reserved(case) global_variable($2)operator(.)ident(size) - reserved(when) integer(4) - ident(mon) operator(=) global_variable($2)operator([) integer(0)operator(,) integer(2)operator(])operator(.)ident(to_i) - ident(mday) operator(=) global_variable($2)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) - reserved(when) integer(6) - ident(year) operator(=) operator(()global_variable($1) operator(+) global_variable($2)operator([) integer(0)operator(,) integer(2)operator(])operator(\))operator(.)ident(to_i) - ident(mon) operator(=) global_variable($2)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) - ident(mday) operator(=) global_variable($2)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) - reserved(when) integer(8)operator(,) integer(10)operator(,) integer(12)operator(,) integer(14) - ident(year) operator(=) operator(()global_variable($1) operator(+) global_variable($2)operator([) integer(0)operator(,) integer(4)operator(])operator(\))operator(.)ident(to_i) - ident(mon) operator(=) global_variable($2)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) - ident(mday) operator(=) global_variable($2)operator([) integer(6)operator(,) integer(2)operator(])operator(.)ident(to_i) - ident(hour) operator(=) global_variable($2)operator([) integer(8)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(10) - ident(min) operator(=) global_variable($2)operator([)integer(10)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(12) - ident(sec) operator(=) global_variable($2)operator([)integer(12)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(14) - ident(comp) operator(=) pre_constant(false) - reserved(end) - reserved(if) global_variable($3) - reserved(case) global_variable($3)operator(.)ident(size) - reserved(when) integer(2)operator(,) integer(4)operator(,) integer(6) - ident(hour) operator(=) global_variable($3)operator([) integer(0)operator(,) integer(2)operator(])operator(.)ident(to_i) - ident(min) operator(=) global_variable($3)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($3)operator(.)ident(size) operator(>)operator(=) integer(4) - ident(sec) operator(=) global_variable($3)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($3)operator(.)ident(size) operator(>)operator(=) integer(6) - reserved(end) - reserved(end) - reserved(if) global_variable($4) - ident(sec_fraction) operator(=) global_variable($4)operator(.)ident(to_i)operator(.)ident(to_r) operator(/) operator(()integer(10)operator(**)global_variable($4)operator(.)ident(size)operator(\)) - reserved(end) - reserved(if) global_variable($5) - ident(zone) operator(=) global_variable($5) - reserved(end) - reserved(end) - - reserved(if) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(if) ident(year) - ident(year) operator(=) operator(-)ident(year) operator(+) integer(1) - reserved(end) - reserved(end) - - reserved(if) ident(comp) reserved(and) ident(year) - reserved(if) ident(year) operator(>)operator(=) integer(0) reserved(and) ident(year) operator(<=) integer(99) - reserved(if) ident(year) operator(>)operator(=) integer(69) - ident(year) operator(+=) integer(1900) - reserved(else) - ident(year) operator(+=) integer(2000) - reserved(end) - reserved(end) - reserved(end) - - ident(elem) operator(=) operator({)operator(}) - ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(year) reserved(if) ident(year) - ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(mon) reserved(if) ident(mon) - ident(elem)operator([)symbol(:mday)operator(]) operator(=) ident(mday) reserved(if) ident(mday) - ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(hour) reserved(if) ident(hour) - ident(elem)operator([)symbol(:min)operator(]) operator(=) ident(min) reserved(if) ident(min) - ident(elem)operator([)symbol(:sec)operator(]) operator(=) ident(sec) reserved(if) ident(sec) - ident(elem)operator([)symbol(:sec_fraction)operator(]) operator(=) ident(sec_fraction) reserved(if) ident(sec_fraction) - ident(elem)operator([)symbol(:zone)operator(]) operator(=) ident(zone) reserved(if) ident(zone) - ident(offset) operator(=) ident(zone_to_diff)operator(()ident(zone)operator(\)) reserved(if) ident(zone) - ident(elem)operator([)symbol(:offset)operator(]) operator(=) ident(offset) reserved(if) ident(offset) - ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(wday) reserved(if) ident(wday) - ident(elem) - reserved(end) - - reserved(def) pre_constant(self)operator(.)ident(zone_to_diff)operator(()ident(str)operator(\)) - ident(abb)operator(,) ident(dst) operator(=) ident(str)operator(.)ident(downcase)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - reserved(if) constant(ZONES)operator(.)ident(include?)operator(()ident(abb)operator(\)) - ident(offset) operator(=) constant(ZONES)operator([)ident(abb)operator(]) - ident(offset) operator(+=) integer(3600) reserved(if) ident(dst) - reserved(elsif) regexp operator(=)operator(~) ident(str) - ident(offset) operator(=) global_variable($2)operator(.)ident(to_i) operator(*) integer(3600) operator(+) global_variable($3)operator(.)ident(to_i) operator(*) integer(60) - ident(offset) operator(*=) integer(-1) reserved(if) global_variable($1) operator(==) string - reserved(end) - ident(offset) - reserved(end) - - reserved(def) method(strftime)operator(()ident(fmt)operator(=)stringoperator(\)) - ident(o) operator(=) string - ident(fmt)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) operator(|)ident(c)operator(|) - ident(cc) operator(=) ident(c)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(case) ident(cc) - reserved(when) stringoperator(;) ident(o) operator(<<) constant(DAYNAMES)operator([)ident(wday)operator(]) - reserved(when) stringoperator(;) ident(o) operator(<<) constant(ABBR_DAYNAMES)operator([)ident(wday)operator(]) - reserved(when) stringoperator(;) ident(o) operator(<<) constant(MONTHNAMES)operator([)ident(mon)operator(]) - reserved(when) stringoperator(;) ident(o) operator(<<) constant(ABBR_MONTHNAMES)operator([)ident(mon)operator(]) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(year) operator(/) float(100.0)operator(\))operator(.)ident(floor) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mday) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mday) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cwyear) comment(# ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(cwyear) operator(%) integer(100)operator(\)) comment(# ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(hour) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()operator(()ident(hour) operator(%) integer(12)operator(\))operator(.)ident(nonzero?) reserved(or) integer(12)operator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(yday) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(hour) comment(# AR,TZ,GL) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()operator(()ident(hour) operator(%) integer(12)operator(\))operator(.)ident(nonzero?) reserved(or) integer(12)operator(\)) comment(# AR,TZ,GL) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(min) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mon) - reserved(when) stringoperator(;) ident(o) operator(<<) string comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) reserved(if) ident(hour) operator(<) integer(12) reserved(then) string reserved(else) string reserved(end) comment(# GL) - reserved(when) stringoperator(;) ident(o) operator(<<) reserved(if) ident(hour) operator(<) integer(12) reserved(then) string reserved(else) string reserved(end) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# ID) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(sec) - reserved(when) string comment(# TZ,GL) - ident(d) operator(=) ident(ajd) operator(-) pre_constant(self)operator(.)ident(class)operator(.)ident(jd_to_ajd)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(civil_to_jd)operator(()integer(1970)operator(,)integer(1)operator(,)integer(1)operator(\))operator(,) integer(0)operator(\)) - ident(s) operator(=) operator(()ident(d) operator(*) integer(86400)operator(\))operator(.)ident(to_i) - ident(o) operator(<<) string operator(%) ident(s) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string comment(# P2,ID) - reserved(when) stringoperator(,) string - ident(a) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(civil_to_jd)operator(()ident(year)operator(,) integer(1)operator(,) integer(1)operator(,) ident(ns?)operator(\)) operator(+) integer(6) - ident(k) operator(=) reserved(if) ident(c) operator(==) string reserved(then) integer(0) reserved(else) integer(1) reserved(end) - ident(w) operator(=) operator(()ident(jd) operator(-) operator(()ident(a) operator(-) operator(()operator(()ident(a) operator(-) ident(k)operator(\)) operator(+) integer(1)operator(\)) operator(%) integer(7)operator(\)) operator(+) integer(7)operator(\)) operator(/) integer(7) - ident(o) operator(<<) string operator(%) ident(w) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cwday) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cweek) comment(# P2,ID) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# AR,TZ) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(wday) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(year) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(year) operator(%) integer(100)operator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) operator(()reserved(if) ident(offset)operator(.)ident(zero?) reserved(then) string reserved(else) ident(strftime)operator(()stringoperator(\)) reserved(end)operator(\)) - reserved(when) string comment(# ID) - ident(o) operator(<<) reserved(if) ident(offset) operator(<) integer(0) reserved(then) string reserved(else) string reserved(end) - ident(of) operator(=) ident(offset)operator(.)ident(abs) - ident(hh)operator(,) ident(fr) operator(=) ident(of)operator(.)ident(divmod)operator(()integer(1)operator(.)ident(to_r)operator(/)integer(24)operator(\)) - ident(mm) operator(=) ident(fr) operator(/) operator(()integer(1)operator(.)ident(to_r)operator(/)integer(1440)operator(\)) - ident(o) operator(<<) string operator(%) ident(hh) - ident(o) operator(<<) string operator(%) ident(mm) - reserved(when) stringoperator(;) ident(o) operator(<<) string - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# TZ) -comment(=begin - when '%.' - o << '%06d' % (sec_fraction / (1.to_r/86400/(10**6\)\)\) -=end) - reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(jd) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) - reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) - reserved(else)operator(;) ident(o) operator(<<) ident(c) - reserved(end) - reserved(end) - ident(o) - reserved(end) - -comment(# alias_method :format, :strftime) - - reserved(def) method(asctime)operator(()operator(\)) ident(strftime)operator(()stringoperator(\)) reserved(end) - - ident(alias_method) symbol(:ctime)operator(,) symbol(:asctime) - -reserved(end) - -reserved(class) class(DateTime) operator(<) constant(Date) - - reserved(def) pre_constant(self)operator(.)ident(_strptime)operator(()ident(str)operator(,) ident(fmt)operator(=)stringoperator(\)) - reserved(super)operator(()ident(str)operator(,) ident(fmt)operator(\)) - reserved(end) - - reserved(def) method(strftime)operator(()ident(fmt)operator(=)stringoperator(\)) - reserved(super)operator(()ident(fmt)operator(\)) - reserved(end) - -reserved(end) - -ident(require) string -ident(a) operator(=) operator([)integer(2)operator(,) integer(3)operator(,) integer(5)operator(,) integer(7)operator(,) integer(11)operator(]) -ident(b) operator(=) string -constant(SyncEnumerator)operator(.)ident(new)operator(()ident(a)operator(,) ident(b)operator(\))operator(.)ident(each) operator({) operator(|)ident(i)operator(,) ident(j)operator(|) - ident(puts) stringcontent( & )inlinedelimiter(")> -operator(}) - -reserved(class) class(Signature) operator(<) constant(Array) - reserved(def) method(===) ident(x) - ident(x)operator(.)ident(kind_of?) constant(Array) reserved(and) ident(zip)operator(()ident(x)operator(\))operator(.)ident(all?) operator({) operator(|)ident(me)operator(,) ident(it)operator(|) ident(me) operator(===) ident(it) operator(}) - reserved(end) -reserved(end) - -reserved(module) class(Chess) - - constant(BOARD_RANGE) operator(=) integer(1)operator(..)integer(8) - - reserved(class) class(Position) - - ident(attr_reader) symbol(:x)operator(,) symbol(:y) - - reserved(def) method(initialize) operator(*)ident(args) - instance_variable(@x)operator(,) instance_variable(@y) operator(=) reserved(case) ident(args) - reserved(when) constant(Signature)operator([)constant(Fixnum)operator(,) constant(Fixnum)operator(]) - ident(args) - reserved(when) constant(Signature)operator([)constant(String)operator(]) - constant(Position)operator(.)ident(decode) ident(args)operator(.)ident(first) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - ident(raise) constant(RuntimeError)operator(,) string operator(%) pre_constant(self) reserved(unless) constant(Position)operator(.)ident(valid?) instance_variable(@x)operator(,) instance_variable(@y) - reserved(end) - - reserved(def) method(inspect) - string operator(%) operator([)ident(x)operator(,) ident(y)operator(]) - reserved(end) - - reserved(def) constant(Position)operator(.)ident(decode) ident(pos) - ident(x)operator(,) ident(y) operator(=) ident(pos)operator(.)ident(split)operator(()stringoperator(\)) - reserved(return) ident(x)operator(.)ident(upcase)operator([)integer(0)operator(]) operator(-) integer(?A) operator(+) integer(1)operator(,) instance_variable(@y) operator(=) ident(y)operator([)integer(0)operator(]) operator(-) integer(?0) - reserved(end) - - reserved(def) constant(Position)operator(.)ident(valid?) ident(x)operator(,) ident(y) - constant(BOARD_RANGE)operator(.)ident(include?) ident(x) reserved(and) constant(BOARD_RANGE)operator(.)ident(include?) ident(y) - reserved(end) - reserved(end) - -reserved(end) - -ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()stringoperator(\)) -constant(SuperString) operator(=) constant(Class)operator(.)ident(new) constant(String) -ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()constant(SuperString)operator(.)ident(new)operator(()stringoperator(\))operator(\)) -ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()integer(3)operator(,) integer(6)operator(\)) -ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()integer(3)operator(,) integer(9)operator(\)) - -ident(require) string - -reserved(def) method(test_grammars) - operator([)stringoperator(,) stringoperator(,) stringoperator(,)operator(])operator(.)ident(map) operator({) operator(|)ident(g)operator(|) constant(Grammar)operator(.)ident(new) ident(g) operator(})string S -S --> Sb -S --> bAa -A --> aSc -A --> a -A --> aSb)delimiter( -EOG1)>string d -C --> ABC -B --> -B --> c -A --> B -A --> a)delimiter( -EOG2)>string -reserved(end) - -global_variable($trace) operator(=) pre_constant(false) -ident(test_grammars)operator(.)ident(each_with_index) reserved(do) operator(|)ident(g)operator(,) ident(i)operator(|) - ident(puts) stringcontent( is )inline reserved(if) ident(g)operator(.)ident(ll1?)delimiter(})>content(LL(1\).)delimiter(")> -reserved(end) +ident(public) symbol(:<<) + +reserved(class) class(String) + reserved(def) method(/) ident(regex) + ident(scan)operator(()ident(regex)operator(\))operator(.)ident(first) + reserved(end) +reserved(end) + +reserved(module) class(Bytes) + constant(KILOBYTE)operator(,) constant(MEGABYTE)operator(,) constant(GIGABYTE)operator(,) constant(TERABYTE)operator(,) constant(PETABYTE) operator(=) operator(()integer(1)operator(..)integer(5)operator(\))operator(.)ident(map) operator({) operator(|)ident(x)operator(|) integer(2) operator(**) operator(()integer(10) operator(*) ident(x)operator(\)) operator(}) + constant(FactorOfSuffix) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(1)operator(\)) + ident(constants)operator(.)ident(each) reserved(do) operator(|)ident(c)operator(|) + constant(FactorOfSuffix)operator([)ident(c)operator([)integer(0)operator(,)integer(1)operator(])operator(]) operator(=) ident(const_get) ident(c) + reserved(end) + + reserved(def) constant(Bytes)operator(.)ident(factor_of_suffix) ident(suff) + constant(FactorOfSuffix)operator([)ident(suff)operator(]) + reserved(end) + + reserved(def) constant(Bytes)operator(.)operator([]) ident(str) + ident(n)operator(,) ident(fac) operator(=) ident(str) operator(/) regexp + ident(n) operator(=) ident(n)operator(.)ident(to_i) + ident(fac) operator(=) ident(factor_of_suffix) ident(fac) + ident(n) operator(*) ident(fac) + reserved(end) +reserved(end) + +reserved(class) class(String) + reserved(def) method(to_bytes) + constant(Bytes)operator([)pre_constant(self)operator(]) + reserved(end) +reserved(end) + +ident(p) stringoperator(.)ident(to_bytes) +ident(p) string operator(%) operator([)constant(Bytes)operator(.)ident(constants)operator(.)ident(size)operator(,) pre_constant(self)operator(]) + +ident(p) string operator(/) regexp + +ident(p) string operator(+) regexp +ident(p) string operator(-) regexp +ident(p) string operator(*) regexp +ident(p) string operator(**) regexp +ident(p) string operator(%) regexp +ident(p) string operator(~) regexp + +ident(require) string +constant(S) operator(=) string operator(*) integer(100) operator(+) string operator(+) stringoperator(*)integer(4) +constant(T) operator(=) integer(200000) + +constant(Benchmark)operator(.)ident(bm)operator(()integer(1)operator(\)) reserved(do) operator(|)ident(bm)operator(|) + constant(GC)operator(.)ident(sweep) + ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()integer(?\\n)operator(\)) operator(}) operator(}) + constant(GC)operator(.)ident(sweep) + ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()stringoperator(\)) operator(}) operator(}) + constant(GC)operator(.)ident(sweep) + ident(bm)operator(.)ident(report)operator(()stringoperator(\)) operator({) constant(T)operator(.)ident(times) operator({) constant(S)operator(.)ident(index)operator(()regexpoperator(\)) operator(}) operator(}) + constant(GC)operator(.)ident(sweep) +reserved(end) + + reserved(def) method(next?)operator(()operator(\)) + operator(!)ident(end?) + reserved(end) + comment(# Rewinds the generator.) + reserved(def) method(rewind)operator(()operator(\)) + ident(initialize)operator(()pre_constant(nil)operator(,) operator(&)instance_variable(@block)operator(\)) reserved(if) instance_variable(@index)operator(.)ident(nonzero?) + + pre_constant(self) + reserved(end) + +ident(a) operator(=) operator([)operator(]) +ident(a) operator(<<) ident(a) +ident(p) ident(a) comment(#-> [[...]]) + +comment(# format.rb: Written by Tadayoshi Funaba 1999-2004) +comment(# $Id: format.rb,v 2.14 2004-11-06 10:58:40+09 tadf Exp $) + +ident(require) string + +reserved(class) class(Date) + + constant(MONTHS) operator(=) operator({) + string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) integer(4)operator(,) + string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6)operator(,) string operator(=)operator(>) integer(7)operator(,) string operator(=)operator(>) integer(8)operator(,) + stringoperator(=)operator(>) integer(9)operator(,) string operator(=)operator(>)integer(10)operator(,) string operator(=)operator(>)integer(11)operator(,) string operator(=)operator(>)integer(12) + operator(}) + + constant(DAYS) operator(=) operator({) + string operator(=)operator(>) integer(0)operator(,) string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) stringoperator(=)operator(>) integer(3)operator(,) + string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6) + operator(}) + + constant(ABBR_MONTHS) operator(=) operator({) + string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) string operator(=)operator(>) integer(4)operator(,) + string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6)operator(,) string operator(=)operator(>) integer(7)operator(,) string operator(=)operator(>) integer(8)operator(,) + string operator(=)operator(>) integer(9)operator(,) string operator(=)operator(>)integer(10)operator(,) string operator(=)operator(>)integer(11)operator(,) string operator(=)operator(>)integer(12) + operator(}) + + constant(ABBR_DAYS) operator(=) operator({) + string operator(=)operator(>) integer(0)operator(,) string operator(=)operator(>) integer(1)operator(,) string operator(=)operator(>) integer(2)operator(,) string operator(=)operator(>) integer(3)operator(,) + string operator(=)operator(>) integer(4)operator(,) string operator(=)operator(>) integer(5)operator(,) string operator(=)operator(>) integer(6) + operator(}) + + constant(ZONES) operator(=) operator({) + string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(4)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(9)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(11)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-5)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-6)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-7)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-11)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-12)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(0)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-1)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-4)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(-8)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(-9)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) + stringoperator(=)operator(>)integer(-10)operator(*)integer(3600)operator(,) string operator(=)operator(>)integer(-11)operator(*)integer(3600)operator(,) stringoperator(=)operator(>)integer(-12)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(1)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(2)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(3)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(4)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(5)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(6)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(7)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(8)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(9)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(11)operator(*)integer(3600)operator(,) string operator(=)operator(>) integer(10)operator(*)integer(3600)operator(,) + string operator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(12)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(13)operator(*)integer(3600)operator(,) stringoperator(=)operator(>) integer(12)operator(*)integer(3600) + operator(}) + + reserved(def) pre_constant(self)operator(.)ident(__strptime)operator(()ident(str)operator(,) ident(fmt)operator(,) ident(elem)operator(\)) + ident(fmt)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) operator(|)ident(c)operator(|) + ident(cc) operator(=) ident(c)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) + reserved(case) ident(cc) + reserved(when) regexp + ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) constant(DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) operator(||) constant(ABBR_DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) + reserved(return) reserved(unless) ident(val) + ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(val) + reserved(when) stringoperator(,) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) constant(MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) operator(||) constant(ABBR_MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) + reserved(return) reserved(unless) ident(val) + ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + ident(elem)operator([)symbol(:cent)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(31)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:mday)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + ident(elem)operator([)symbol(:cwyear)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(99)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:cwyear)operator(]) operator(=) ident(val) + ident(elem)operator([)symbol(:cent)operator(]) operator(||=) reserved(if) ident(val) operator(>)operator(=) integer(69) reserved(then) integer(19) reserved(else) integer(20) reserved(end) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(24)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(val) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(12)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(366)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:yday)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(59)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:min)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(12)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(elem)operator([)symbol(:merid)operator(]) operator(=) reserved(if) global_variable($1)operator(.)ident(downcase) operator(==) string reserved(then) integer(0) reserved(else) integer(12) reserved(end) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(60)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:sec)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + ident(elem)operator([)symbol(:seconds)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(53)operator(\)) operator(===) ident(val) + ident(elem)operator([)reserved(if) ident(c) operator(==) string reserved(then) symbol(:wnum0) reserved(else) symbol(:wnum1) reserved(end)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(7)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:cwday)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(1)operator(..)integer(53)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:cweek)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(6)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + reserved(return) reserved(unless) operator(()integer(0)operator(..)integer(99)operator(\)) operator(===) ident(val) + ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(val) + ident(elem)operator([)symbol(:cent)operator(]) operator(||=) reserved(if) ident(val) operator(>)operator(=) integer(69) reserved(then) integer(19) reserved(else) integer(20) reserved(end) + reserved(when) stringoperator(,) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1) + ident(elem)operator([)symbol(:zone)operator(]) operator(=) ident(val) + ident(offset) operator(=) ident(zone_to_diff)operator(()ident(val)operator(\)) + ident(elem)operator([)symbol(:offset)operator(]) operator(=) ident(offset) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) +comment(=begin + when '%.' + return unless str.sub!(/\\A(\\d+\)/o, ''\) + val = $1.to_i.to_r / (10**$1.size\) + elem[:sec_fraction] = val +=end) + reserved(when) string + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(val) operator(=) global_variable($1)operator(.)ident(to_i) + ident(elem)operator([)symbol(:jd)operator(]) operator(=) ident(val) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(when) string + reserved(return) reserved(unless) ident(__strptime)operator(()ident(str)operator(,) stringoperator(,) ident(elem)operator(\)) + reserved(else) + reserved(return) reserved(unless) ident(str)operator(.)ident(sub!)operator(()constant(Regexp)operator(.)ident(new)operator(()string operator(+) constant(Regexp)operator(.)ident(quote)operator(()ident(c)operator(\))operator(\))operator(,) stringoperator(\)) + reserved(end) + reserved(end) + + reserved(if) ident(cent) operator(=) ident(elem)operator(.)ident(delete)operator(()symbol(:cent)operator(\)) + reserved(if) ident(elem)operator([)symbol(:cwyear)operator(]) + ident(elem)operator([)symbol(:cwyear)operator(]) operator(+=) ident(cent) operator(*) integer(100) + reserved(end) + reserved(if) ident(elem)operator([)symbol(:year)operator(]) + ident(elem)operator([)symbol(:year)operator(]) operator(+=) ident(cent) operator(*) integer(100) + reserved(end) + reserved(end) + + reserved(if) ident(merid) operator(=) ident(elem)operator(.)ident(delete)operator(()symbol(:merid)operator(\)) + reserved(if) ident(elem)operator([)symbol(:hour)operator(]) + ident(elem)operator([)symbol(:hour)operator(]) operator(%=) integer(12) + ident(elem)operator([)symbol(:hour)operator(]) operator(+=) ident(merid) + reserved(end) + reserved(end) + + ident(str) + reserved(end) + + ident(private_class_method) symbol(:__strptime) + + reserved(def) pre_constant(self)operator(.)ident(_strptime)operator(()ident(str)operator(,) ident(fmt)operator(=)stringoperator(\)) + ident(elem) operator(=) operator({)operator(}) + ident(elem) reserved(if) ident(__strptime)operator(()ident(str)operator(.)ident(dup)operator(,) ident(fmt)operator(,) ident(elem)operator(\)) + reserved(end) + + constant(PARSE_MONTHPAT) operator(=) constant(ABBR_MONTHS)operator(.)ident(keys)operator(.)ident(join)operator(()stringoperator(\)) + constant(PARSE_DAYPAT) operator(=) constant(ABBR_DAYS)operator(.) ident(keys)operator(.)ident(join)operator(()stringoperator(\)) + + reserved(def) pre_constant(self)operator(.)ident(_parse)operator(()ident(str)operator(,) ident(comp)operator(=)pre_constant(false)operator(\)) + ident(str) operator(=) ident(str)operator(.)ident(dup) + + ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + + comment(# day) + reserved(if) ident(str)operator(.)ident(sub!)operator(()regexpcontent(\))char(\\S)content(*)delimiter(/)modifier(ino)>operator(,) stringoperator(\)) + ident(wday) operator(=) constant(ABBR_DAYS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) + reserved(end) + + comment(# time) + reserved(if) ident(str)operator(.)ident(sub!)operator(() + regexpoperator(,) + stringoperator(\)) + ident(hour) operator(=) global_variable($1)operator(.)ident(to_i) + ident(min) operator(=) global_variable($2)operator(.)ident(to_i) + ident(sec) operator(=) global_variable($3)operator(.)ident(to_i) reserved(if) global_variable($3) + reserved(if) global_variable($4) + ident(sec_fraction) operator(=) global_variable($4)operator(.)ident(to_i)operator(.)ident(to_r) operator(/) operator(()integer(10)operator(**)global_variable($4)operator(.)ident(size)operator(\)) + reserved(end) + + reserved(if) global_variable($5) + ident(hour) operator(%=) integer(12) + reserved(if) global_variable($5)operator(.)ident(downcase) operator(==) string + ident(hour) operator(+=) integer(12) + reserved(end) + reserved(end) + + reserved(if) global_variable($6) + ident(zone) operator(=) global_variable($6) + reserved(end) + reserved(end) + + comment(# eu) + reserved(if) ident(str)operator(.)ident(sub!)operator(() + regexpcontent(\))char(\\S)content(* + (?: + )char(\\s)content(+ + (-?)char(\\d)content(+\) + \)? + )delimiter(/)modifier(inox)>operator(,) + stringoperator(\)) + ident(mday) operator(=) global_variable($1)operator(.)ident(to_i) + ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($2)operator(.)ident(downcase)operator(]) + + reserved(if) global_variable($3) + ident(year) operator(=) global_variable($3)operator(.)ident(to_i) + reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + reserved(end) + reserved(end) + + comment(# us) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(() + regexpcontent(\))char(\\S)content(* + )char(\\s)content(+ + ()char(\\d)content(+\))char(\\S)content(* + (?: + )char(\\s)content(+ + (-?)char(\\d)content(+\) + \)? + )delimiter(/)modifier(inox)>operator(,) + stringoperator(\)) + ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($1)operator(.)ident(downcase)operator(]) + ident(mday) operator(=) global_variable($2)operator(.)ident(to_i) + + reserved(if) global_variable($3) + ident(year) operator(=) global_variable($3)operator(.)ident(to_i) + reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + reserved(end) + reserved(end) + + comment(# iso) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(year) operator(=) global_variable($1)operator(.)ident(to_i) + ident(mon) operator(=) global_variable($2)operator(.)ident(to_i) + ident(mday) operator(=) global_variable($3)operator(.)ident(to_i) + + reserved(if) global_variable($1)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + reserved(elsif) global_variable($3)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + ident(mday)operator(,) ident(mon)operator(,) ident(year) operator(=) ident(year)operator(,) ident(mon)operator(,) ident(mday) + reserved(end) + + comment(# jis) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(e) operator(=) operator({) stringoperator(=)operator(>)integer(1867)operator(,) + stringoperator(=)operator(>)integer(1911)operator(,) + stringoperator(=)operator(>)integer(1925)operator(,) + stringoperator(=)operator(>)integer(1988) + operator(})operator([)global_variable($1)operator(.)ident(downcase)operator(]) + ident(year) operator(=) global_variable($2)operator(.)ident(to_i) operator(+) ident(e) + ident(mon) operator(=) global_variable($3)operator(.)ident(to_i) + ident(mday) operator(=) global_variable($4)operator(.)ident(to_i) + + comment(# vms) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpcontent(\)[^-]*-(-?)char(\\d)content(+\))delimiter(/)modifier(ino)>operator(,) stringoperator(\)) + ident(mday) operator(=) global_variable($1)operator(.)ident(to_i) + ident(mon) operator(=) constant(ABBR_MONTHS)operator([)global_variable($2)operator(.)ident(downcase)operator(]) + ident(year) operator(=) global_variable($3)operator(.)ident(to_i) + + reserved(if) global_variable($1)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + ident(year)operator(,) ident(mon)operator(,) ident(mday) operator(=) ident(mday)operator(,) ident(mon)operator(,) ident(year) + reserved(elsif) global_variable($3)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + reserved(end) + + comment(# sla) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + ident(mon) operator(=) global_variable($1)operator(.)ident(to_i) + ident(mday) operator(=) global_variable($2)operator(.)ident(to_i) + + reserved(if) global_variable($3) + ident(year) operator(=) global_variable($3)operator(.)ident(to_i) + reserved(if) global_variable($3)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + reserved(end) + reserved(end) + + reserved(if) global_variable($3) operator(&&) global_variable($1)operator(.)ident(size) operator(>) integer(2) + ident(comp) operator(=) pre_constant(false) + ident(year)operator(,) ident(mon)operator(,) ident(mday) operator(=) ident(mon)operator(,) ident(mday)operator(,) ident(year) + reserved(end) + + comment(# ddd) + reserved(elsif) ident(str)operator(.)ident(sub!)operator(() + regexpoperator(,) + stringoperator(\)) + reserved(case) global_variable($2)operator(.)ident(size) + reserved(when) integer(4) + ident(mon) operator(=) global_variable($2)operator([) integer(0)operator(,) integer(2)operator(])operator(.)ident(to_i) + ident(mday) operator(=) global_variable($2)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) + reserved(when) integer(6) + ident(year) operator(=) operator(()global_variable($1) operator(+) global_variable($2)operator([) integer(0)operator(,) integer(2)operator(])operator(\))operator(.)ident(to_i) + ident(mon) operator(=) global_variable($2)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) + ident(mday) operator(=) global_variable($2)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) + reserved(when) integer(8)operator(,) integer(10)operator(,) integer(12)operator(,) integer(14) + ident(year) operator(=) operator(()global_variable($1) operator(+) global_variable($2)operator([) integer(0)operator(,) integer(4)operator(])operator(\))operator(.)ident(to_i) + ident(mon) operator(=) global_variable($2)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) + ident(mday) operator(=) global_variable($2)operator([) integer(6)operator(,) integer(2)operator(])operator(.)ident(to_i) + ident(hour) operator(=) global_variable($2)operator([) integer(8)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(10) + ident(min) operator(=) global_variable($2)operator([)integer(10)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(12) + ident(sec) operator(=) global_variable($2)operator([)integer(12)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($2)operator(.)ident(size) operator(>)operator(=) integer(14) + ident(comp) operator(=) pre_constant(false) + reserved(end) + reserved(if) global_variable($3) + reserved(case) global_variable($3)operator(.)ident(size) + reserved(when) integer(2)operator(,) integer(4)operator(,) integer(6) + ident(hour) operator(=) global_variable($3)operator([) integer(0)operator(,) integer(2)operator(])operator(.)ident(to_i) + ident(min) operator(=) global_variable($3)operator([) integer(2)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($3)operator(.)ident(size) operator(>)operator(=) integer(4) + ident(sec) operator(=) global_variable($3)operator([) integer(4)operator(,) integer(2)operator(])operator(.)ident(to_i) reserved(if) global_variable($3)operator(.)ident(size) operator(>)operator(=) integer(6) + reserved(end) + reserved(end) + reserved(if) global_variable($4) + ident(sec_fraction) operator(=) global_variable($4)operator(.)ident(to_i)operator(.)ident(to_r) operator(/) operator(()integer(10)operator(**)global_variable($4)operator(.)ident(size)operator(\)) + reserved(end) + reserved(if) global_variable($5) + ident(zone) operator(=) global_variable($5) + reserved(end) + reserved(end) + + reserved(if) ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(if) ident(year) + ident(year) operator(=) operator(-)ident(year) operator(+) integer(1) + reserved(end) + reserved(end) + + reserved(if) ident(comp) reserved(and) ident(year) + reserved(if) ident(year) operator(>)operator(=) integer(0) reserved(and) ident(year) operator(<=) integer(99) + reserved(if) ident(year) operator(>)operator(=) integer(69) + ident(year) operator(+=) integer(1900) + reserved(else) + ident(year) operator(+=) integer(2000) + reserved(end) + reserved(end) + reserved(end) + + ident(elem) operator(=) operator({)operator(}) + ident(elem)operator([)symbol(:year)operator(]) operator(=) ident(year) reserved(if) ident(year) + ident(elem)operator([)symbol(:mon)operator(]) operator(=) ident(mon) reserved(if) ident(mon) + ident(elem)operator([)symbol(:mday)operator(]) operator(=) ident(mday) reserved(if) ident(mday) + ident(elem)operator([)symbol(:hour)operator(]) operator(=) ident(hour) reserved(if) ident(hour) + ident(elem)operator([)symbol(:min)operator(]) operator(=) ident(min) reserved(if) ident(min) + ident(elem)operator([)symbol(:sec)operator(]) operator(=) ident(sec) reserved(if) ident(sec) + ident(elem)operator([)symbol(:sec_fraction)operator(]) operator(=) ident(sec_fraction) reserved(if) ident(sec_fraction) + ident(elem)operator([)symbol(:zone)operator(]) operator(=) ident(zone) reserved(if) ident(zone) + ident(offset) operator(=) ident(zone_to_diff)operator(()ident(zone)operator(\)) reserved(if) ident(zone) + ident(elem)operator([)symbol(:offset)operator(]) operator(=) ident(offset) reserved(if) ident(offset) + ident(elem)operator([)symbol(:wday)operator(]) operator(=) ident(wday) reserved(if) ident(wday) + ident(elem) + reserved(end) + + reserved(def) pre_constant(self)operator(.)ident(zone_to_diff)operator(()ident(str)operator(\)) + ident(abb)operator(,) ident(dst) operator(=) ident(str)operator(.)ident(downcase)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + reserved(if) constant(ZONES)operator(.)ident(include?)operator(()ident(abb)operator(\)) + ident(offset) operator(=) constant(ZONES)operator([)ident(abb)operator(]) + ident(offset) operator(+=) integer(3600) reserved(if) ident(dst) + reserved(elsif) regexp operator(=)operator(~) ident(str) + ident(offset) operator(=) global_variable($2)operator(.)ident(to_i) operator(*) integer(3600) operator(+) global_variable($3)operator(.)ident(to_i) operator(*) integer(60) + ident(offset) operator(*=) integer(-1) reserved(if) global_variable($1) operator(==) string + reserved(end) + ident(offset) + reserved(end) + + reserved(def) method(strftime)operator(()ident(fmt)operator(=)stringoperator(\)) + ident(o) operator(=) string + ident(fmt)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) operator(|)ident(c)operator(|) + ident(cc) operator(=) ident(c)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) + reserved(case) ident(cc) + reserved(when) stringoperator(;) ident(o) operator(<<) constant(DAYNAMES)operator([)ident(wday)operator(]) + reserved(when) stringoperator(;) ident(o) operator(<<) constant(ABBR_DAYNAMES)operator([)ident(wday)operator(]) + reserved(when) stringoperator(;) ident(o) operator(<<) constant(MONTHNAMES)operator([)ident(mon)operator(]) + reserved(when) stringoperator(;) ident(o) operator(<<) constant(ABBR_MONTHNAMES)operator([)ident(mon)operator(]) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(year) operator(/) float(100.0)operator(\))operator(.)ident(floor) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mday) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mday) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cwyear) comment(# ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(cwyear) operator(%) integer(100)operator(\)) comment(# ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(hour) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()operator(()ident(hour) operator(%) integer(12)operator(\))operator(.)ident(nonzero?) reserved(or) integer(12)operator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(yday) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(hour) comment(# AR,TZ,GL) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()operator(()ident(hour) operator(%) integer(12)operator(\))operator(.)ident(nonzero?) reserved(or) integer(12)operator(\)) comment(# AR,TZ,GL) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(min) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(mon) + reserved(when) stringoperator(;) ident(o) operator(<<) string comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) reserved(if) ident(hour) operator(<) integer(12) reserved(then) string reserved(else) string reserved(end) comment(# GL) + reserved(when) stringoperator(;) ident(o) operator(<<) reserved(if) ident(hour) operator(<) integer(12) reserved(then) string reserved(else) string reserved(end) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# ID) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(sec) + reserved(when) string comment(# TZ,GL) + ident(d) operator(=) ident(ajd) operator(-) pre_constant(self)operator(.)ident(class)operator(.)ident(jd_to_ajd)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(civil_to_jd)operator(()integer(1970)operator(,)integer(1)operator(,)integer(1)operator(\))operator(,) integer(0)operator(\)) + ident(s) operator(=) operator(()ident(d) operator(*) integer(86400)operator(\))operator(.)ident(to_i) + ident(o) operator(<<) string operator(%) ident(s) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string comment(# P2,ID) + reserved(when) stringoperator(,) string + ident(a) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(civil_to_jd)operator(()ident(year)operator(,) integer(1)operator(,) integer(1)operator(,) ident(ns?)operator(\)) operator(+) integer(6) + ident(k) operator(=) reserved(if) ident(c) operator(==) string reserved(then) integer(0) reserved(else) integer(1) reserved(end) + ident(w) operator(=) operator(()ident(jd) operator(-) operator(()ident(a) operator(-) operator(()operator(()ident(a) operator(-) ident(k)operator(\)) operator(+) integer(1)operator(\)) operator(%) integer(7)operator(\)) operator(+) integer(7)operator(\)) operator(/) integer(7) + ident(o) operator(<<) string operator(%) ident(w) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cwday) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(cweek) comment(# P2,ID) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# AR,TZ) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(wday) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(year) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) operator(()ident(year) operator(%) integer(100)operator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) operator(()reserved(if) ident(offset)operator(.)ident(zero?) reserved(then) string reserved(else) ident(strftime)operator(()stringoperator(\)) reserved(end)operator(\)) + reserved(when) string comment(# ID) + ident(o) operator(<<) reserved(if) ident(offset) operator(<) integer(0) reserved(then) string reserved(else) string reserved(end) + ident(of) operator(=) ident(offset)operator(.)ident(abs) + ident(hh)operator(,) ident(fr) operator(=) ident(of)operator(.)ident(divmod)operator(()integer(1)operator(.)ident(to_r)operator(/)integer(24)operator(\)) + ident(mm) operator(=) ident(fr) operator(/) operator(()integer(1)operator(.)ident(to_r)operator(/)integer(1440)operator(\)) + ident(o) operator(<<) string operator(%) ident(hh) + ident(o) operator(<<) string operator(%) ident(mm) + reserved(when) stringoperator(;) ident(o) operator(<<) string + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) comment(# TZ) +comment(=begin + when '%.' + o << '%06d' % (sec_fraction / (1.to_r/86400/(10**6\)\)\) +=end) + reserved(when) stringoperator(;) ident(o) operator(<<) string operator(%) ident(jd) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) + reserved(when) stringoperator(;) ident(o) operator(<<) ident(strftime)operator(()stringoperator(\)) + reserved(else)operator(;) ident(o) operator(<<) ident(c) + reserved(end) + reserved(end) + ident(o) + reserved(end) + +comment(# alias_method :format, :strftime) + + reserved(def) method(asctime)operator(()operator(\)) ident(strftime)operator(()stringoperator(\)) reserved(end) + + ident(alias_method) symbol(:ctime)operator(,) symbol(:asctime) + +reserved(end) + +reserved(class) class(DateTime) operator(<) constant(Date) + + reserved(def) pre_constant(self)operator(.)ident(_strptime)operator(()ident(str)operator(,) ident(fmt)operator(=)stringoperator(\)) + reserved(super)operator(()ident(str)operator(,) ident(fmt)operator(\)) + reserved(end) + + reserved(def) method(strftime)operator(()ident(fmt)operator(=)stringoperator(\)) + reserved(super)operator(()ident(fmt)operator(\)) + reserved(end) + +reserved(end) + +ident(require) string +ident(a) operator(=) operator([)integer(2)operator(,) integer(3)operator(,) integer(5)operator(,) integer(7)operator(,) integer(11)operator(]) +ident(b) operator(=) string +constant(SyncEnumerator)operator(.)ident(new)operator(()ident(a)operator(,) ident(b)operator(\))operator(.)ident(each) operator({) operator(|)ident(i)operator(,) ident(j)operator(|) + ident(puts) stringcontent( & )inlinedelimiter(")> +operator(}) + +reserved(class) class(Signature) operator(<) constant(Array) + reserved(def) method(===) ident(x) + ident(x)operator(.)ident(kind_of?) constant(Array) reserved(and) ident(zip)operator(()ident(x)operator(\))operator(.)ident(all?) operator({) operator(|)ident(me)operator(,) ident(it)operator(|) ident(me) operator(===) ident(it) operator(}) + reserved(end) +reserved(end) + +reserved(module) class(Chess) + + constant(BOARD_RANGE) operator(=) integer(1)operator(..)integer(8) + + reserved(class) class(Position) + + ident(attr_reader) symbol(:x)operator(,) symbol(:y) + + reserved(def) method(initialize) operator(*)ident(args) + instance_variable(@x)operator(,) instance_variable(@y) operator(=) reserved(case) ident(args) + reserved(when) constant(Signature)operator([)constant(Fixnum)operator(,) constant(Fixnum)operator(]) + ident(args) + reserved(when) constant(Signature)operator([)constant(String)operator(]) + constant(Position)operator(.)ident(decode) ident(args)operator(.)ident(first) + reserved(else) + ident(raise) constant(ArgumentError)operator(,) string + reserved(end) + ident(raise) constant(RuntimeError)operator(,) string operator(%) pre_constant(self) reserved(unless) constant(Position)operator(.)ident(valid?) instance_variable(@x)operator(,) instance_variable(@y) + reserved(end) + + reserved(def) method(inspect) + string operator(%) operator([)ident(x)operator(,) ident(y)operator(]) + reserved(end) + + reserved(def) constant(Position)operator(.)ident(decode) ident(pos) + ident(x)operator(,) ident(y) operator(=) ident(pos)operator(.)ident(split)operator(()stringoperator(\)) + reserved(return) ident(x)operator(.)ident(upcase)operator([)integer(0)operator(]) operator(-) integer(?A) operator(+) integer(1)operator(,) instance_variable(@y) operator(=) ident(y)operator([)integer(0)operator(]) operator(-) integer(?0) + reserved(end) + + reserved(def) constant(Position)operator(.)ident(valid?) ident(x)operator(,) ident(y) + constant(BOARD_RANGE)operator(.)ident(include?) ident(x) reserved(and) constant(BOARD_RANGE)operator(.)ident(include?) ident(y) + reserved(end) + reserved(end) + +reserved(end) + +ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()stringoperator(\)) +constant(SuperString) operator(=) constant(Class)operator(.)ident(new) constant(String) +ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()constant(SuperString)operator(.)ident(new)operator(()stringoperator(\))operator(\)) +ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()integer(3)operator(,) integer(6)operator(\)) +ident(p) constant(Chess)operator(::)constant(Position)operator(.)ident(new)operator(()integer(3)operator(,) integer(9)operator(\)) + +ident(require) string + +reserved(def) method(test_grammars) + operator([)stringoperator(,) stringoperator(,) stringoperator(,)operator(])operator(.)ident(map) operator({) operator(|)ident(g)operator(|) constant(Grammar)operator(.)ident(new) ident(g) operator(})string S +S --> Sb +S --> bAa +A --> aSc +A --> a +A --> aSb)delimiter( +EOG1)>string d +C --> ABC +B --> +B --> c +A --> B +A --> a)delimiter( +EOG2)>string +reserved(end) + +global_variable($trace) operator(=) pre_constant(false) +ident(test_grammars)operator(.)ident(each_with_index) reserved(do) operator(|)ident(g)operator(,) ident(i)operator(|) + ident(puts) stringcontent( is )inline reserved(if) ident(g)operator(.)ident(ll1?)delimiter(})>content(LL(1\).)delimiter(")> +reserved(end) diff --git a/test/ruby/besetzung.out.raydebug b/test/ruby/besetzung.out.raydebug index 13f9dc9..d65e4fc 100644 Binary files a/test/ruby/besetzung.out.raydebug and b/test/ruby/besetzung.out.raydebug differ diff --git a/test/ruby/class.out.raydebug b/test/ruby/class.out.raydebug index 0f79311..af7a63a 100644 --- a/test/ruby/class.out.raydebug +++ b/test/ruby/class.out.raydebug @@ -1,83 +1,83 @@ -global_variable($:) operator(<<) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string -ident(require) string -constant(CodeRay)operator(::)constant(Encoders)operator([)symbol(:tokens)operator(]) -constant(CodeRay)operator(::)constant(Encoders)operator([)symbol(:html)operator(]) - -ident(require) string -ident(include) constant(Test)operator(::)constant(Unit) - -reserved(class) class(CodeRaySuite) operator(<) constant(TestCase) - - reserved(def) pre_constant(self)operator(.)ident(dir) operator(&)ident(block) - instance_variable(@dir) operator(||=) constant(File)operator(.)ident(dirname)operator(()instance_variable(@file)operator(\)) - reserved(if) ident(block) - constant(Dir)operator(.)ident(chdir) instance_variable(@dir)operator(,) operator(&)ident(block) - reserved(end) - instance_variable(@dir) - reserved(end) - - reserved(def) method(dir) operator(&)ident(block) - pre_constant(self)operator(.)ident(class)operator(.)ident(dir) operator(&)ident(block) - reserved(end) - - reserved(def) method(extension) - string operator(+) pre_constant(self)operator(.)ident(class)operator(::)constant(EXTENSION) - reserved(end) - - reserved(def) method(lang) - pre_constant(self)operator(.)ident(class)operator(::)constant(LANG) - reserved(end) - - reserved(def) method(test_ALL) - constant(CodeRay)operator(::)constant(Scanners)operator(.)ident(load) ident(lang) - ident(tokenizer) operator(=) constant(CodeRay)operator(.)ident(tokens) - ident(highlighter) operator(=) constant(CodeRay)operator(.)ident(html) - - ident(dir) reserved(do) - reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) - ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) - ident(output) operator(=) ident(name) operator(+) string - ident(code) operator(=) constant(File)operator(.)ident(read)operator(()ident(input)operator(\)) - - ident(computed) operator(=) ident(tokenizer)operator(.)ident(encode) ident(code)operator(,) ident(lang) - - reserved(if) constant(File)operator(.)ident(exist?) ident(output) - ident(expected) operator(=) constant(File)operator(.)ident(read) ident(output) - ident(assert_equal)operator(()ident(expected)operator(,) ident(computed)operator(\)) - reserved(else) - constant(File)operator(.)ident(open)operator(()ident(output)operator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) ident(computed) reserved(end) - ident(puts) stringdelimiter(")> - reserved(end) - - ident(highlighted) operator(=) ident(highlighter)operator(.)ident(highlight_page) ident(code)operator(,) ident(lang) - constant(File)operator(.)ident(open)operator(()ident(name) operator(+) stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) ident(highlighted) reserved(end) - reserved(end) - reserved(end) - reserved(end) - -reserved(end) - -ident(require) string -global_variable($suite) operator(=) constant(TestSuite)operator(.)ident(new) - -reserved(def) method(load_suite) ident(name) - reserved(begin) - ident(require) ident(name) operator(+) string - reserved(rescue) constant(LoadError) - global_variable($stderr)operator(.)ident(puts) stringstring operator(+) ident(name)delimiter(})>content( not found - )delimiter( - ERR)> - pre_constant(false) - reserved(end) -reserved(end) - -reserved(if) ident(subsuite) operator(=) pre_constant(ARGV)operator(.)ident(first) - ident(load_suite)operator(()ident(subsuite)operator(\)) reserved(or) ident(exit) -reserved(else) - constant(Dir)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(suite)operator(|) ident(load_suite) ident(suite) operator(}) -reserved(end) - -ident(require) string -constant(UI)operator(::)constant(Console)operator(::)constant(TestRunner)operator(.)ident(run) global_variable($suite) +global_variable($:) operator(<<) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string +ident(require) string +constant(CodeRay)operator(::)constant(Encoders)operator([)symbol(:tokens)operator(]) +constant(CodeRay)operator(::)constant(Encoders)operator([)symbol(:html)operator(]) + +ident(require) string +ident(include) constant(Test)operator(::)constant(Unit) + +reserved(class) class(CodeRaySuite) operator(<) constant(TestCase) + + reserved(def) pre_constant(self)operator(.)ident(dir) operator(&)ident(block) + instance_variable(@dir) operator(||=) constant(File)operator(.)ident(dirname)operator(()instance_variable(@file)operator(\)) + reserved(if) ident(block) + constant(Dir)operator(.)ident(chdir) instance_variable(@dir)operator(,) operator(&)ident(block) + reserved(end) + instance_variable(@dir) + reserved(end) + + reserved(def) method(dir) operator(&)ident(block) + pre_constant(self)operator(.)ident(class)operator(.)ident(dir) operator(&)ident(block) + reserved(end) + + reserved(def) method(extension) + string operator(+) pre_constant(self)operator(.)ident(class)operator(::)constant(EXTENSION) + reserved(end) + + reserved(def) method(lang) + pre_constant(self)operator(.)ident(class)operator(::)constant(LANG) + reserved(end) + + reserved(def) method(test_ALL) + constant(CodeRay)operator(::)constant(Scanners)operator(.)ident(load) ident(lang) + ident(tokenizer) operator(=) constant(CodeRay)operator(.)ident(tokens) + ident(highlighter) operator(=) constant(CodeRay)operator(.)ident(html) + + ident(dir) reserved(do) + reserved(for) ident(input) reserved(in) constant(Dir)operator([)stringdelimiter(")>operator(]) + ident(name) operator(=) constant(File)operator(.)ident(basename)operator(()ident(input)operator(,) stringdelimiter(")>operator(\)) + ident(output) operator(=) ident(name) operator(+) string + ident(code) operator(=) constant(File)operator(.)ident(read)operator(()ident(input)operator(\)) + + ident(computed) operator(=) ident(tokenizer)operator(.)ident(encode) ident(code)operator(,) ident(lang) + + reserved(if) constant(File)operator(.)ident(exist?) ident(output) + ident(expected) operator(=) constant(File)operator(.)ident(read) ident(output) + ident(assert_equal)operator(()ident(expected)operator(,) ident(computed)operator(\)) + reserved(else) + constant(File)operator(.)ident(open)operator(()ident(output)operator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) ident(computed) reserved(end) + ident(puts) stringdelimiter(")> + reserved(end) + + ident(highlighted) operator(=) ident(highlighter)operator(.)ident(highlight_page) ident(code)operator(,) ident(lang) + constant(File)operator(.)ident(open)operator(()ident(name) operator(+) stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) ident(f)operator(.)ident(write) ident(highlighted) reserved(end) + reserved(end) + reserved(end) + reserved(end) + +reserved(end) + +ident(require) string +global_variable($suite) operator(=) constant(TestSuite)operator(.)ident(new) + +reserved(def) method(load_suite) ident(name) + reserved(begin) + ident(require) ident(name) operator(+) string + reserved(rescue) constant(LoadError) + global_variable($stderr)operator(.)ident(puts) stringstring operator(+) ident(name)delimiter(})>content( not found + )delimiter( + ERR)> + pre_constant(false) + reserved(end) +reserved(end) + +reserved(if) ident(subsuite) operator(=) pre_constant(ARGV)operator(.)ident(first) + ident(load_suite)operator(()ident(subsuite)operator(\)) reserved(or) ident(exit) +reserved(else) + constant(Dir)operator([)stringoperator(])operator(.)ident(each) operator({) operator(|)ident(suite)operator(|) ident(load_suite) ident(suite) operator(}) +reserved(end) + +ident(require) string +constant(UI)operator(::)constant(Console)operator(::)constant(TestRunner)operator(.)ident(run) global_variable($suite) diff --git a/test/ruby/comment.out.raydebug b/test/ruby/comment.out.raydebug index 5e03975..0e24ae3 100644 --- a/test/ruby/comment.out.raydebug +++ b/test/ruby/comment.out.raydebug @@ -1,17 +1,17 @@ -comment(=begin test -=end test) - -ident(bla) - - operator(=)reserved(begin) - - ident(__END__) - - -comment(__END__ -)comment(#CODE) - -ident(mangawobeegee) - -comment(#test\\) -ident(dasd) +comment(=begin test +=end test) + +ident(bla) + + operator(=)reserved(begin) + + ident(__END__) + + +comment(__END__ +)comment(#CODE) + +ident(mangawobeegee) + +comment(#test\\) +ident(dasd) diff --git a/test/ruby/evil.out.raydebug b/test/ruby/evil.out.raydebug index 44f381b..b1e3231 100644 --- a/test/ruby/evil.out.raydebug +++ b/test/ruby/evil.out.raydebug @@ -1,1123 +1,1123 @@ -ident(p)operator(()constant(String) operator(*)constant(Class)operator(\)) -reserved(class) class(String) -reserved(class) class(Class) -reserved(end) -reserved(end) -comment(#def String(x\) x.to_s end #it's already built-in. duh!) -reserved(def) constant(String)operator(.)operator(*)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)operator(<<)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:<<)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)operator(/)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:/)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)operator([])operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:[])operator(,)ident(right)operator(]) reserved(end) -ident(p)operator(()constant(String)operator(::)constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(::) constant(Class)operator(\)) -ident(p)operator(()constant(String) operator(::)constant(Class)operator(\)) -ident(p)operator(()constant(String) operator(::) constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(<<)constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(<<) constant(Class)operator(\)) -ident(p)operator(()constant(String) stringoperator(\)) string -ident(p)operator(()constant(String) operator(<<) constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(/)constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(/) constant(Class)operator(\)) -ident(p)operator(()constant(String) regexpoperator(\)) -ident(p)operator(()constant(String) operator(/) constant(Class)operator(\)) comment(#borken) -ident(p)operator(()constant(String)operator([)constant(Class)operator(])operator(\)) -ident(p)operator(()constant(String)operator([) constant(Class)operator(])operator(\)) -ident(p)operator(()constant(String) operator([)constant(Class)operator(])operator(\)) -ident(p)operator(()constant(String) operator([) constant(Class)operator(])operator(\)) -ident(p)operator(()constant(String)operator(*)constant(Class)operator(\)) -ident(p)operator(()constant(String)operator(*) constant(Class)operator(\)) -ident(p)operator(()constant(String) operator(*)constant(Class)operator(\)) -ident(p)operator(()constant(String) operator(*) constant(Class)operator(\)) -reserved(class) operator(<<)class(String) -reserved(undef) symbol(:*)operator(,)method(<<)operator(,)method(/)operator(,)method([]) -reserved(end) - - - -ident(p)operator(()pre_constant(false)operator(::)ident(to_s)operator(\)) -ident(p)operator(()pre_constant(false) operator(::)ident(to_s)operator(\)) -ident(p)operator(()pre_constant(false)operator(::) ident(to_s)operator(\)) -ident(p)operator(()pre_constant(false) operator(::) ident(to_s)operator(\)) - -reserved(class) class(C2) -reserved(class) operator(<<)class(self) - reserved(def) pre_constant(self)operator(.)ident(p8)operator(;) ident(p) integer(8) reserved(end) - reserved(alias) ident(p?) ident(p) - reserved(alias) ident(P?) ident(p) - reserved(alias) operator([)operator(]) ident(p) - reserved(alias) operator(<=>) ident(p) -reserved(end) - -ident(q)operator(=)integer(9) -constant(Q)operator(=)integer(99) - -ident(p)symbol(:p8) -pre_constant(false) operator(?) ident(p)operator(:) ident(p8) -ident(p) symbol(:p8) -pre_constant(false) operator(?) ident(p) operator(:) ident(p8) - -pre_constant(false) operator(?) ident(q)symbol(:p8) -pre_constant(false) operator(?) ident(q)operator(:) ident(p8) -pre_constant(false) operator(?) ident(q) symbol(:p8) -pre_constant(false) operator(?) ident(q) operator(:) ident(p8) - -comment(#false ? Q:p8 #gives ruby indigestion) -pre_constant(false) operator(?) constant(Q)operator(:) ident(p8) -comment(#false ? Q :p8 #gives ruby indigestion) -pre_constant(false) operator(?) constant(Q) operator(:) ident(p8) - -ident(p?)symbol(:p8) -pre_constant(false) operator(?) ident(p?)operator(:) ident(p8) -ident(p?) symbol(:p8) -pre_constant(false) operator(?) ident(p?) operator(:) ident(p8) - -ident(P?)symbol(:p8) -pre_constant(false) operator(?) ident(P?)operator(:) ident(p8) -ident(P?) symbol(:p8) -pre_constant(false) operator(?) ident(P?) operator(:) ident(p8) - -pre_constant(self)operator(.)operator([])symbol(:p8) -pre_constant(false) operator(?) pre_constant(self)operator(.)operator([])operator(:) ident(p8) -pre_constant(self)operator(.)operator([]) symbol(:p8) -pre_constant(false) operator(?) pre_constant(self)operator(.)operator([]) operator(:) ident(p8) - -pre_constant(self)operator(.)operator(<=>)symbol(:p8) -pre_constant(false) operator(?) pre_constant(self)operator(.)operator(<=>)operator(:) ident(p8) -pre_constant(self)operator(.)operator(<=>) symbol(:p8) -pre_constant(false) operator(?) pre_constant(self)operator(.)operator(<=>) operator(:) ident(p8) - -pre_constant(self) operator(<=>)symbol(:p8) -comment(#false ? self <=>: p8 #gives ruby indigestion) -pre_constant(self) operator(<=>) symbol(:p8) -comment(#false ? self <=> : p8 #gives ruby indigestion) -reserved(end) - -ident(p) stringoperator(+)stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))string - - -ident(p) stringstring -ident(mix)operator(=)pre_constant(nil) -ident(p) operator(/) integer(5)operator(/)ident(mix) - -reserved(module) class(M33) - ident(p)operator(=)string - constant(Q)operator(=)string - reserved(def) constant(Q)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) - pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)stringoperator(\)) - reserved(end) - reserved(def) ident(p)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) - pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)stringoperator(\)) - reserved(end) - reserved(def) pre_constant(self)operator(.)ident(p)operator(()operator(*)ident(a)operator(\))operator(;) reserved(super)operator(;) constant(Q) reserved(end) - instance_variable(@a)operator(=)integer(1) - global_variable($a)operator(=)integer(2) - - ident(p)operator(()ident(p)operator(~)integer(6)operator(\)) - ident(p)operator(()ident(p) operator(~)integer(6)operator(\)) - ident(p)operator(()ident(p)operator(~) integer(6)operator(\)) - ident(p)operator(()ident(p) operator(~) integer(6)operator(\)) - ident(p)operator(()ident(p)operator(*)integer(11)operator(\)) - ident(p)operator(()ident(p) operator(*)integer(11)operator(\)) - ident(p)operator(()ident(p)operator(*) integer(11)operator(\)) - ident(p)operator(()ident(p) operator(*) integer(11)operator(\)) - ident(p)operator(()ident(p)operator(&)ident(proc)operator({)operator(})operator(\)) - ident(p)operator(()ident(p) operator(&)ident(proc)operator({)operator(})operator(\)) - ident(p)operator(()ident(p)operator(&) ident(proc)operator({)operator(})operator(\)) - ident(p)operator(()ident(p) operator(&) ident(proc)operator({)operator(})operator(\)) - ident(p)operator(()ident(p) operator(!)integer(1)operator(\)) -comment(# p(p ?1\) #compile error, when p is var) - ident(p)operator(()ident(p) operator(!) integer(1)operator(\)) - ident(p)operator(()ident(p) operator(?) integer(1) operator(:) integer(6)operator(\)) - ident(p)operator(()ident(p)instance_variable(@a)operator(\)) - ident(p)operator(()ident(p) instance_variable(@a)operator(\)) -comment(# p(p@ a\) #wont) -comment(# p(p @ a\) #work ) - ident(p)operator(()ident(p)comment(#a) -operator(\)) - ident(p)operator(()ident(p) comment(#a) -operator(\)) - ident(p)operator(()ident(p)comment(# a) -operator(\)) - ident(p)operator(()ident(p) comment(# a) -operator(\)) - ident(p)operator(()ident(p)global_variable($a)operator(\)) - ident(p)operator(()ident(p) global_variable($a)operator(\)) -comment(# p(p$ a\) #wont) -comment(# p(p $ a\) #work) - ident(p)operator(()ident(p)operator(%)constant(Q)operator({)symbol(:foo)operator(})operator(\)) - ident(p)operator(()ident(p) stringoperator(\)) - ident(p)operator(()ident(p)operator(%) constant(Q)operator({)symbol(:foo)operator(})operator(\)) - ident(p)operator(()ident(p) operator(%) constant(Q)operator({)symbol(:foo)operator(})operator(\)) - ident(p)operator(()ident(p)operator(^)integer(6)operator(\)) - ident(p)operator(()ident(p) operator(^)integer(6)operator(\)) - ident(p)operator(()ident(p)operator(^) integer(6)operator(\)) - ident(p)operator(()ident(p) operator(^) integer(6)operator(\)) - ident(p)operator(()ident(p)operator(&)integer(7)operator(\)) - ident(p)operator(()ident(p) operator(&)ident(proc)operator({)integer(7)operator(})operator(\)) - ident(p)operator(()ident(p)operator(&) integer(7)operator(\)) - ident(p)operator(()ident(p) operator(&) integer(7)operator(\)) - ident(p)operator(()ident(p)operator(()integer(2)operator(\))operator(\)) - ident(p)operator(()ident(p) operator(()integer(2)operator(\))operator(\)) - ident(p)operator(()ident(p)operator(() integer(2)operator(\))operator(\)) - ident(p)operator(()ident(p) operator(() integer(2)operator(\))operator(\)) - ident(p)operator(()ident(p)operator(()ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p)operator(()operator(\))operator(\)) - ident(p)operator(()ident(p) operator(()ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p) operator(()operator(\))operator(\)) - ident(p)operator(()ident(p) operator(() ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p) operator(() operator(\))operator(\)) - ident(p)operator(()ident(p)operator(() ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p)operator(() operator(\))operator(\)) - ident(p)operator(()ident(p)operator(\)) - ident(p)operator(()operator(()ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p) operator(\)) - ident(p)operator(()operator(()ident(p) operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) ident(p)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) ident(p)operator(,)ident(p)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) ident(p)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) ident(p)operator(,)ident(p)operator(\))operator(\)) - ident(p)operator(()ident(p)integer(-0)operator(\)) - ident(p)operator(()ident(p) integer(-0)operator(\)) - ident(p)operator(()ident(p)operator(-) integer(0)operator(\)) - ident(p)operator(()ident(p) operator(-) integer(0)operator(\)) - ident(p)operator(()ident(p)integer(+9)operator(\)) - ident(p)operator(()ident(p) integer(+9)operator(\)) - ident(p)operator(()ident(p)operator(+) integer(9)operator(\)) - ident(p)operator(()ident(p) operator(+) integer(9)operator(\)) - ident(p)operator(()ident(p)operator([)integer(1)operator(])operator(\)) - ident(p)operator(()ident(p) operator([)integer(1)operator(])operator(\)) - ident(p)operator(()ident(p)operator([) integer(1)operator(])operator(\)) - ident(p)operator(()ident(p) operator([) integer(1)operator(])operator(\)) - ident(p)operator(()ident(p)operator({)integer(1)operator(})operator(\)) - ident(p)operator(()ident(p) operator({)integer(1)operator(})operator(\)) - ident(p)operator(()ident(p)operator({) integer(1)operator(})operator(\)) - ident(p)operator(()ident(p) operator({) integer(1)operator(})operator(\)) - ident(p)operator(()ident(p)operator(/)integer(1)operator(\)) - ident(p)operator(()ident(p) regexp integer(1)operator(\)) - ident(p)operator(()ident(p) operator(/) integer(22)operator(\)) - ident(p)operator(()ident(p)operator(.)ident(_)operator(\)) - ident(p)operator(()ident(p) operator(.)ident(_)operator(\)) - ident(p)operator(()ident(p)operator(.) ident(_)operator(\)) - ident(p)operator(()ident(p) operator(.) ident(_)operator(\)) - ident(p)operator(()pre_constant(false) operator(?) ident(p)symbol(:f)operator(\)) - ident(p)operator(()pre_constant(false) operator(?) ident(p) symbol(:f)operator(\)) - ident(p)operator(()pre_constant(false) operator(?) ident(p)operator(:) ident(f)operator(\)) - ident(p)operator(()pre_constant(false) operator(?) ident(p) operator(:) ident(f)operator(\)) - ident(p)operator(()operator(()ident(p)operator(;)integer(1)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) operator(;)integer(1)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p)operator(;) integer(1)operator(\))operator(\)) - ident(p)operator(()operator(()ident(p) operator(;) integer(1)operator(\))operator(\)) - ident(p)operator(()ident(p)operator(<)integer(1)operator(\)) - ident(p)operator(()ident(p) operator(<)integer(1)operator(\)) - ident(p)operator(()ident(p)operator(<) integer(1)operator(\)) - ident(p)operator(()ident(p) operator(<) integer(1)operator(\)) - ident(p)operator(()ident(p)operator(<<)integer(1)operator(\)) - ident(p)operator(()ident(p) stringoperator(\))string2\) - p(p >2\) - p(p> 2\) - p(p > 2\) - -end - -module M34 - p(p~6\) - p(p ~6\) - p(p~ 6\) - p(p ~ 6\) - p(p*[1]\) - p(p *[1]\) - p(p* [1]\) - p(p * [1]\) - p(p&proc{}\) - p(p &proc{}\) - p(p& proc{}\) - p(p & proc{}\) - p(p !1\) - p(p ?1\) - p(p ! 1\) - p(p ? 1 : 6\) - p(p@a\) - p(p @a\) -# p(p@ a\) #wont -# p(p @ a\) #work - - p(p#a -\) - p(p #a -\) - p(p# a -\) - p(p # a -\) - p(p$a\) - p(p $a\) -# p(p$ a\) #wont -# p(p $ a\) #work - p(p%Q{:foo}\) - p(p %Q{:foo}\) - p(p% Q{:foo}\) - p(p % Q{:foo}\) - p(p^6\) - p(p ^6\) - p(p^ 6\) - p(p ^ 6\) - p(p&7\) - p(p &proc{7}\) - p(p& 7\) - p(p & 7\) - p(p(2\)\) - p(p (2\)\) - p(p( 2\)\) - p(p ( 2\)\) - p(p(p\)\) - p(p(\)\) - p(p (p\)\) - p(p (\)\) - p(p ( p\)\) - p(p ( \)\) - p(p( p\)\) - p(p( \)\) - p(p\) - p((p\)\) - p(p \) - p((p \)\) - p((p p\)\) - p((p p,p\)\) - p((p p\)\) - p((p p,p\)\) - p(p-0\) - p(p -1\) - p(p- 0\) - p(p - 0\) - p(p+9\) - p(p +9\) - p(p+ 9\) - p(p + 9\) - p(p[1]\) - p(p [1]\) - p(p[ 1]\) - p(p [ 1]\) - p(p{1}\) - p(p {1}\) - p(p{ 1}\) - p(p { 1}\) - p(p/1\) - p(p /22/\) - p(p/ 1\) - p(p / 22\) - p(p._\) - p(p ._\) - p(p. _\) - p(p . _\) - p(p:f\) - p(p :f\) - p(false ? p: f\) - p(false ? p : f\) - p((p;1\)\) - p((p ;1\)\) - p((p; 1\)\) - p((p ; 1\)\) - p(p<1\) - p(p <1\) - p(p< 1\) - p(p < 1\) - p(p<<1\) - p(p <<1\) -foobar)delimiter( -1)> - ident(p)operator(()ident(p)operator(<<) integer(1)operator(\)) - ident(p)operator(()ident(p) operator(<<) integer(1)operator(\)) - ident(p)operator(()ident(p)stringoperator(\)) - ident(p)operator(()ident(p) stringoperator(\)) - ident(p)operator(()ident(p)stringoperator(\)) - ident(p)operator(()ident(p) stringoperator(\)) - ident(p)operator(()ident(p)stringoperator(\)) - ident(p)operator(()ident(p) stringoperator(\)) - ident(p)operator(()ident(p)stringoperator(\)) - ident(p)operator(()ident(p) stringoperator(\)) - ident(p)operator(()ident(p)operator(|)integer(4)operator(\)) - ident(p)operator(()ident(p) operator(|)integer(4)operator(\)) - ident(p)operator(()ident(p)operator(|) integer(4)operator(\)) - ident(p)operator(()ident(p) operator(|) integer(4)operator(\)) - ident(p)operator(()ident(p)operator(>)integer(2)operator(\)) - ident(p)operator(()ident(p) operator(>)integer(2)operator(\)) - ident(p)operator(()ident(p)operator(>) integer(2)operator(\)) - ident(p)operator(()ident(p) operator(>) integer(2)operator(\)) - -reserved(end) - - -reserved(def) method(bob)operator(()ident(x)operator(\)) ident(x) reserved(end) -reserved(def) method(bill)operator(()ident(x)operator(\)) ident(x) reserved(end) -ident(p)operator(()ident(bob) stringoperator(\)) -reserved(for) ident(bob) reserved(in) operator([)integer(100)operator(]) reserved(do) ident(p)operator(()ident(bob) stringoperator(\)) reserved(end) -ident(p)operator(()ident(bob) stringoperator(\)) -reserved(def) method(%)operator(()ident(n)operator(\)) ident(to_s)operator(+)stringdelimiter(")> reserved(end) -ident(p)operator(()ident(bill) stringoperator(\)) -reserved(begin) ident(sdjkfsjkdfsd)operator(;) reserved(rescue) constant(Object) operator(=)operator(>) ident(bill)operator(;) ident(p)operator(()ident(bill) stringoperator(\)) reserved(end) -ident(p)operator(()ident(bill) stringoperator(\)) -reserved(undef) method(%) - -reserved(class) class(Object) - -ident(public) symbol(:`) -reserved(def) method(`)operator(()ident(s)operator(\)) - ident(print) stringchar(\\n)delimiter(")> -reserved(end) -reserved(end) - -integer(69)operator(.)operator(`)operator(()stringoperator(\)) - -integer(79)operator(::)operator(`)operator(()stringoperator(\)) - -ident(p) symbol(:`) - -ident(p)operator({)operator(}) -ident(p) operator({)operator(}) -ident(a)operator(=)integer(5) -ident(p) ident(p) integer(+5) -ident(p) ident(a) integer(+5) - -reserved(def) pre_constant(nil)operator(.)operator(+)operator(()ident(x)operator(\)) operator(~)ident(x) reserved(end) -reserved(def) pre_constant(nil)operator(.)operator([])operator(()operator(*)ident(x)operator(\)) operator([)ident(x)operator(]) reserved(end) -ident(p)operator(() ident(p) operator(+) integer(5) operator(\)) -ident(p)operator(() ident(p) integer(+5) operator(\)) -ident(p)operator(() ident(p)integer(+5) operator(\)) -ident(p)operator(() ident(p)operator([)operator(]) operator(\)) -ident(p)operator(() ident(p) operator([)operator(]) operator(\)) -ident(p)operator(() ident(p) operator([) operator(]) operator(\)) -reserved(class) class(NilClass)operator(;) reserved(undef) method(+)operator(,)method([]) reserved(end) - -reserved(class) class(Foou) - ident(public) - reserved(def) method([]) ident(x)operator(=)integer(-100)operator(,)operator(&)ident(y)operator(;) ident(p) ident(x)operator(;) integer(100) reserved(end) -reserved(end) -ident(a0)operator(=)integer(8) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(!)pre_constant(false) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(!)pre_constant(false) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(~)integer(9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(~)integer(9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])integer(-9) comment(#op) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])integer(+9) comment(#op) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) integer(-9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) integer(+9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(<<)integer(9) comment(#op) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) string comment(#value)string -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(%)integer(9) comment(#op) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(/)integer(9) comment(#op) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) string comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(/)integer(9)operator(/) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])global_variable($9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])ident(a0) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) global_variable($9) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) ident(a0) comment(#value) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator({)integer(9)operator(}) comment(#lambda (op\)) -ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator({)integer(9)operator(}) comment(#lambda (op\)) - -reserved(if) ident(p) reserved(then) ident(p) reserved(end) - -ident(p)operator(()operator({)symbol(:foo)operator(=)operator(>)symbol(:bar)operator(})operator(\)) comment(#why does this work? i'd think that ':foo=' would be 1 token) -ident(p) constant(EMPTY) operator(=) integer(0) -ident(p) constant(BLACK) operator(=) integer(1) -ident(p) constant(WHITE) operator(=) operator(-) constant(BLACK) - - ident(a)operator(=)ident(b)operator(=)ident(c)operator(=)integer(0) - ident(a) operator(?) ident(b)symbol(:c) - ident(a) integer(?b)symbol(:c) - - ident(p)operator(()ident(a) operator(?) ident(b)symbol(:c)operator(\)) - ident(p)operator(()ident(a) integer(?b)symbol(:c)operator(\)) - - -ident(p)operator(~)integer(4) -ident(p)symbol(:f) -ident(p)operator(()operator(~)integer(4)operator(\))operator({)operator(}) -ident(p)operator(()symbol(:f)operator(\))operator({)operator(}) -ident(h)operator(=)operator({)operator(}) -ident(h)operator(.)ident(default)operator(=)symbol(:foo) - -ident(p) reserved(def) operator(()ident(h)operator(=)stringoperator(\))operator(.)ident(default)operator(=) ident(v)operator(;) ident(p) instance_variable(@v)operator(=)ident(v)operator(;)ident(v) reserved(end) -ident(p) ident(h) - -ident(p) ident(h)operator(.)ident(default)operator(=)symbol(:b) - -ident(x)operator(,) operator(()operator(*)ident(y)operator(\)) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) -ident(p) ident(x) -ident(p) ident(y) - -ident(x)operator(,) operator(*)ident(y) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) -ident(p) ident(x) -ident(p) ident(y) - -ident(x)operator(,) operator(*) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) -ident(p) ident(x) - - - -ident(p) ident(Array)operator(()stringoperator(\)) - - - -ident(p) operator(+)operator(()integer(4)operator(\)) -ident(p) operator(-)operator(()integer(4)operator(\)) - -ident(p) symbol - -reserved(class) class(Foop) - reserved(def) constant(Foop)operator(.)ident(bar) ident(a)operator(,)ident(b) - ident(p) ident(a)operator(,)ident(b) - reserved(end) -reserved(end) -constant(Foop)operator(.)ident(bar) integer(1)operator(,)integer(2) -constant(Foop)operator(::)ident(bar) integer(3)operator(,)integer(4) - - -reserved(class) class(Foop) - reserved(def) constant(Foop)operator(::)ident(baz) ident(a)operator(,)ident(b) - ident(p) symbol(:baz)operator(,)ident(a)operator(,)ident(b) - reserved(end) -reserved(end) -constant(Foop)operator(.)ident(baz) integer(5)operator(,)integer(6) -constant(Foop)operator(::)ident(baz) integer(7)operator(,)integer(8) - - - -ident(without_creating)operator(=)ident(widgetname)operator(=)pre_constant(nil) - reserved(if) ident(without_creating) operator(&&) operator(!)ident(widgetname) comment(#foo) - ident(fail) constant(ArgumentError)operator(,) - string - reserved(end) - - - -comment(=begin disable for now - -#class, module, and def should temporarily hide local variables -def mopsdfjskdf arg; arg*2 end -mopsdfjskdf=5 - class C - p mopsdfjskdf %(3\) #calls method - end - -module M - p mopsdfjskdf %(4\) #calls method -end - - def d - p mopsdfjskdf %(5\) #calls method - end -p d -p mopsdfjskdf %(6\) #reads variable -p proc{mopsdfjskdf %(7\)}[] #reads variable - -#fancy symbols not supported yet -p %s{symbol} -=end) - -comment(#multiple assignment test) -ident(proc) operator({) - ident(a)operator(,)ident(b)operator(,)ident(c)operator(,)ident(d)operator(,)ident(e)operator(,)ident(f)operator(,)ident(g)operator(,)ident(h)operator(,)ident(i)operator(,)ident(j)operator(,)ident(k)operator(=)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(,)integer(9)operator(,)integer(10)operator(,)integer(11) - ident(p)operator(()ident(b) stringoperator(\)) - ident(p)operator(()ident(a) stringoperator(\)) - ident(p)operator(()ident(k) stringoperator(\)) - ident(p)operator(()ident(p) stringoperator(\)) -operator(})operator(.)ident(call) - - -comment(=begin disable for now -p "#{<delimiter(})>delimiter(")> -ident(bim) -ident(baz) -ident(bof) -ident(foobar3) - -reserved(def) method(func) - ident(a)operator(,)ident(b)operator(,)operator(*) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) - ident(p) ident(a)operator(,)ident(b) - ident(a)operator(,)ident(b)operator(,) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) - ident(p) ident(a)operator(,)ident(b) - - ident(a)operator(,)ident(b) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) - ident(p) ident(a)operator(,)ident(b) - ident(a)operator(,)operator(*)ident(b) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) - ident(p) ident(a)operator(,)ident(b) - - ident(a)operator(,)ident(b)operator(,)operator(*)ident(c)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) - ident(a)operator(,)ident(b)operator(,)operator(*) ident(c)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) -reserved(end) -ident(func) - - -ident(p)operator(() regexpoperator(\)) -ident(p)operator(() regexp)delimiter(~)modifier(m)>operator(\)) - -ident(p) stringstringchar(\\ -)inlinedelimiter( -end)> - - - - - -ident(proc) operator({) - ident(h)operator(=)operator({)symbol(:a)operator(=)operator(>)operator(()ident(foo)operator(=)integer(100)operator(\))operator(}) - ident(p)operator(() ident(foo) stringoperator(\)) -operator(})operator(.)ident(call) - - -ident(p) stringdelimiter(})>delimiter(")> -ident(bim) -ident(baz) -ident(bof) -ident(foobar3) - -ident(p) stringstring -delimiter(})>delimiter(")> - -ident(p) string operator(;) ident(p) stringdelimiter(})>delimiter(")>stringstring -ident(p) stringoperator(.)ident(each)operator(()stringoperator(\))operator({)operator(|)ident(s)operator(|) stringoperator(+)ident(s)operator(}) delimiter(})>delimiter(")> -ident(jbvd)operator(|)ident(g4543ghb)operator(|)operator(!)instance_variable(@G)global_variable($dfsd)operator(|)ident(fafr)operator(|)ident(e) -operator(|)ident(s4e5rrwware)operator(|)constant(BBBBB)operator(|*)operator(&)operator(^)operator(()operator(*&)operator(^)operator(>)stringcomment(#{<)string - -reserved(def) method(foo)operator(()ident(a)operator(=)stringoperator(,)ident(b)operator(=)stringoperator(,)ident(c)operator(=)stringoperator(\))stringstringstring - - ident(a)operator(+)ident(b)operator(+)ident(c) - -reserved(end) -ident(p) ident(foo) - - - -global_variable($a)operator(=)integer(1) -instance_variable(@b)operator(=)integer(2) -class_variable(@@c)operator(=)integer(3) -ident(p) stringdelimiter(")> -ident(p) string -ident(p) string -ident(p) string -ident(p) string -ident(p) string -ident(p) stringdelimiter(")> -ident(p) string -ident(p) stringdelimiter(])> -ident(p) string -ident(p) shelldelimiter(`)> -ident(p) shell -ident(p)operator(()regexpdelimiter(/)>operator(\)) -comment(#p(/\\#$a \\#@b \\#@@c \\#{$a+@b+@@c}/\) #moved to w.rb) - -reserved(class) class(AA)operator(;) reserved(class) class(BB)operator(;) reserved(class) class(CC) -constant(FFOO)operator(=)integer(1) -reserved(end) reserved(end) reserved(end) - -ident(p) constant(AA)operator(::)constant(BB)operator(::)constant(CC)operator(::)constant(FFOO) - -ident(compile_body)operator(=)ident(outvar)operator(=)string - -reserved(if) pre_constant(false) - ident(method_src) operator(=) ident(c)operator(.)ident(compile)operator(()ident(template)operator(,) operator(()constant(HtmlCompiler)operator(::)constant(AnyData)operator(.)ident(new)operator(\))operator(\))operator(.)ident(join)operator(()stringoperator(\)) operator(+) - stringchar(\\n)delimiter(")> - ident(rescu) integer(-1) -reserved(end) - - ident(p)operator(()stringoperator(,) stringoperator(,) stringoperator(\))string - -reserved(def) method(add)operator(()operator(*)ident(args)operator(\)) - pre_constant(self)operator(.)operator(<<)operator(()operator(*)ident(args)operator(\)) -reserved(end) - - - -ident(val)operator(=)string - reserved(if) ident(val)operator(.)ident(include?) integer(?\\s) - ident(p) ident(val)operator(.)ident(split)operator(.)ident(collect)operator({)operator(|)ident(v)operator(|) operator(()ident(v)operator(\))operator(}) - reserved(end) -ident(p) stringdelimiter(")> -ident(p) string -reserved(class) class(Hosts) -reserved(end) -reserved(class) class(DNS) operator(<) constant(Hosts) -reserved(end) -reserved(def) method(intialize)operator(()ident(resolvers)operator(=)operator([)constant(Hosts)operator(.)ident(new)operator(,) constant(DNS)operator(.)ident(new)operator(])operator(\)) reserved(end) -reserved(def) method(environment)operator(()ident(env) operator(=) constant(File)operator(.)ident(basename)operator(()global_variable($0)operator(,) stringoperator(\))operator(\)) reserved(end) - -reserved(def) method(ssssss) operator(&)ident(block) -reserved(end) -reserved(def) method(params_quoted)operator(()ident(field_name)operator(,) ident(default)operator(\)) - reserved(if) ident(block_given?) reserved(then) reserved(yield) ident(field_name) reserved(else) ident(default) reserved(end) -reserved(end) -reserved(def) method(==)operator(()ident(o)operator(\)) integer(444) reserved(end) -reserved(def) constant(String)operator(.)ident(ffff4)operator(()operator(\)) pre_constant(self)operator(.)ident(to_s)operator(+)string reserved(end) - -ident(p) operator(*)operator([)operator(]) -reserved(for) ident(i) reserved(in) \ -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -comment(#() -reserved(for) ident(i) reserved(in) reserved(if) -pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) -comment(#\)) -operator(() -reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) -ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -ident(c)operator(=)ident(j)operator(=)integer(0) -reserved(until) reserved(while) ident(j)operator(<)integer(10) reserved(do) ident(j)operator(+=)integer(1) reserved(end)operator(.)ident(nil?) reserved(do) ident(p) string reserved(end) -reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) -reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - - -reserved(for) ident(i) reserved(in) operator(()ident(c)operator(;) -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) -operator(\)) -operator(() - -reserved(for) ident(i) reserved(in) operator(()reserved(begin) -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end)operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -reserved(for) ident(i) reserved(in) operator(() - -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -reserved(for) ident(i) reserved(in) operator(() -operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) - -operator(\)) - - -reserved(def) method(yy)operator(;)reserved(yield) reserved(end) - -ident(block)operator(=)ident(proc)operator({)ident(p) stringoperator(}) - -ident(yy) operator(&)ident(block) -ident(p)operator(()integer(1)operator(.)operator(+)integer(1)operator(\)) -ident(p) ident(pppp) - -reserved(module) class(M66) -ident(p)operator(()ident(proc) reserved(do) - ident(p)operator(=)integer(123) -reserved(end)operator(.)ident(call)operator(\)) - -ident(p) ident(proc) operator({) - ident(p)operator(=)integer(123) -operator(})operator(.)ident(call) - -ident(p) reserved(def) method(pppp) - ident(p)operator(=)integer(123) -reserved(end) -ident(p) reserved(module) class(Ppp) - ident(p)operator(=)integer(123) -reserved(end) -ident(p) reserved(class) class(Pppp) operator(<) constant(String) - ident(p)operator(=)integer(123) -reserved(end) -reserved(end) - - reserved(def) method(_make_regex)operator(()ident(str)operator(\)) operator(/)operator(()operator([)comment(#{Regexp.escape(str\)}]\)/n end) -ident(p) ident(_make_regex)operator(()stringoperator(\)) - - -ident(p) string - -ident(p) string - -ident(a)operator(=)ident(a)operator(.)ident(to_s) -reserved(class) operator(<<)class(a) - reserved(def) method(foobar) - pre_constant(self)operator(*)integer(101) - reserved(end) - reserved(alias) ident(eql?) operator(==) -reserved(end) - -ident(p) ident(a)operator(.)ident(foobar) - -ident(p)operator(()regexp>|)char(\\|)char(\\|)content(|)char(\\&)char(\\&)content(\)=|)char(\\&)char(\\&)content(|)char(\\|)char(\\|)content(\))delimiter(/)>operator(\)) -ident(p)operator(()symbol(:%)operator(\)) -ident(p)operator(() operator({) symbol(:class) operator(=)operator(>) ident(class_)operator(=)integer(0)operator(})operator(\)) -ident(p) ident(cls_name) operator(=) operator({)operator(})operator([)symbol(:class)operator(]) - - -ident(p) ident(foo) -ident(p) stringdelimiter(")> -ident(p) symbol(:p) -ident(p)operator(()symbol(:p)operator(\)) -ident(p)operator(()symboloperator(\)) -ident(p) symbol -ident(p)operator(()stringoperator(\)) -ident(p)operator(()regexpoperator(\)) -ident(p)operator(()regexpoperator(\)) -ident(p) integer(0x80) -ident(p) integer(?p) -ident(p) float(0.1) -ident(p) float(0.8) -ident(p) float(0.9) -ident(p)operator(()integer(-1)operator(\)) -ident(p) string -ident(p) string)delimiter(])> -ident(i)operator(=)integer(99) -ident(p) string)inlinecontent()char(\\n)delimiter(])> -ident(p)operator(()symbol(:side)operator(=)operator(>)symbol(:top)operator(\)) -ident(p) string -ident(p) string -ident(p) string -ident(p) string -ident(p) symbol(:+) -ident(p) integer(99) operator(/) integer(3) - -ident(a)operator(=)integer(99)operator(;)ident(b)operator(=)integer(3) -ident(p) integer(1)operator(+)operator(()ident(a) operator(/) ident(b)operator(\)) -ident(p) string -ident(p) string - -reserved(if) pre_constant(false) - ident(formatter)operator(.)ident(format_element)operator(()ident(element)operator(\)) reserved(do) - ident(amrita_expand_and_format1)operator(()ident(element)operator(,) ident(context)operator(,) ident(formatter)operator(\)) - reserved(end) -reserved(end) -reserved(if) pre_constant(false) - ident(ret) operator(=) stringstringcontent( - def parts_template - @@parts_template - end - - )inlineoperator(\))delimiter(})>content( - def amrita_expand_and_format(element, context, formatter\) - if element.tagname_symbol == :span and element.attrs.size == 0 - amrita_expand_and_format1(element, context, formatter\) - else - formatter.format_element(element\) do - amrita_expand_and_format1(element, context, formatter\) - end - end - end - - def amrita_expand_and_format1(element, context, formatter\) - )inlinecontent( - end)delimiter( - END)> - ident(j)operator(=)integer(55) -reserved(end) - -ident(p) string -ident(p) string -ident(p) string -ident(p) string -ident(p) string -ident(p) string - -ident(p) string -ident(p) string -ident(p)operator(()regexpoperator(\)) -ident(p)operator(()regexpoperator(\)) -ident(p) ident(proc) operator({) - ident(p) shell - ident(p) shell -operator(}) - - - -ident(p)operator(()regexpoperator(\)) -comment(#breakpoint) -ident(p) stringoperator(+)stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))string - -comment(=begin doesn't work -p <operator(]) -ident(p) string operator(+) stringstringstring - - - -ident(p) stringoperator(;) reserved(def)string -ident(koomblatz!)operator(()operator(\)) ident(p) string reserved(end) - -ident(koomblatz!) - -ident(p) ident(f) operator(=) float(3.7517675036461267e+17) -ident(p) global_variable($10) -ident(p) global_variable($1001) -ident(p)operator(() string operator(\))string - -reserved(def) method(jd_to_wday)operator(()ident(jd)operator(\)) operator(()ident(jd) operator(+) integer(1)operator(\)) operator(%) integer(7) reserved(end) -ident(p) ident(jd_to_wday)operator(()integer(98)operator(\)) - - -ident(p) ident(pre) operator(=) global_variable($`) -comment(=begin -=end) - -ident(p) stringstring - -ident(p) global_variable($-j)operator(=)integer(55) - -reserved(def) method(empty)operator(()operator(\)) reserved(end) - -ident(p) stringstring - -ident(label)operator(=)stringoperator(;)ident(tab)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(]) - ident(p) stringstringcontent( = arr = Array.new()inlinecontent(, nil\) -str = a = i = nil -idx = 0 -clist.each do |str| - str.split(',', -1\).each do |i| - arr[idx] = i.to_i unless i.empty? - idx += 1 - end -end -)delimiter( -S)> -reserved(def) method(printem1) ident(a)operator(,)ident(b)operator(,)ident(c) - ident(p)operator(()ident(a) integer(+77)operator(\)) - ident(p)operator(()ident(b) integer(+77)operator(\)) - ident(p)operator(()ident(c) integer(+77)operator(\)) -reserved(end) - -reserved(def) method(foobar)operator(()operator(\)) reserved(end) -reserved(def) method(foobar2) -reserved(end) - -reserved(def) method(printem0)operator(()ident(a)operator(\)) - ident(p)operator(()ident(a) integer(+77)operator(\)) -reserved(end) -reserved(def) method(printem0)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) - ident(p)operator(()ident(a) integer(+77)operator(\)) - ident(p)operator(()ident(b) integer(+77)operator(\)) - ident(p)operator(()ident(c) integer(+77)operator(\)) -reserved(end) -reserved(def) method(printem2) ident(a)operator(,)ident(b)operator(,)ident(c)operator(;) ident(p)operator(()ident(a) integer(+77)operator(\))operator(;) ident(p)operator(()ident(b) integer(+77)operator(\))operator(;) ident(p)operator(()ident(c) integer(+77)operator(\)) reserved(end) -reserved(def) method(three)operator(()operator(\)) operator(()integer(1)integer(+2)operator(\)) reserved(end) - -reserved(def) method(d)operator(;)reserved(end) -reserved(def) method(d)operator(()operator(\))reserved(end) -reserved(def) method(d)operator(()ident(dd)operator(\))reserved(end) - -reserved(def) method(printem) ident(a)operator(,)ident(b)operator(,)ident(c) - ident(p) ident(a)operator(;)ident(p) ident(b)operator(;)ident(p) ident(c) - ident(p)operator(()ident(a) integer(+77)operator(\)) - ident(p)operator(()ident(b) stringoperator(\)) -reserved(end) -ident(printem) integer(1)operator(,)integer(2)operator(,)integer(3) - -ident(a)operator(=)integer(1) -ident(p)operator(()ident(a) integer(+77)operator(\)) - -reserved(def) method(hhh)operator(()ident(a)operator(=)operator(()integer(1)integer(+2)operator(\))operator(\)) ident(a) reserved(end) - - - -reserved(END) operator({) - ident(p) string -operator(}) - - -ident(p) stringstring -ident(p) stringstring -ident(p) ident(proc)operator({)operator(||)operator(}) -reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) -ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) -ident(p) string -ident(c)operator(=)integer(0) - reserved(while) ident(c) operator(==) regexpoperator(;) reserved(end) - - - - - - - - +ident(p)operator(()constant(String) operator(*)constant(Class)operator(\)) +reserved(class) class(String) +reserved(class) class(Class) +reserved(end) +reserved(end) +comment(#def String(x\) x.to_s end #it's already built-in. duh!) +reserved(def) constant(String)operator(.)operator(*)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)operator(<<)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:<<)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)operator(/)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:/)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)operator([])operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:[])operator(,)ident(right)operator(]) reserved(end) +ident(p)operator(()constant(String)operator(::)constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(::) constant(Class)operator(\)) +ident(p)operator(()constant(String) operator(::)constant(Class)operator(\)) +ident(p)operator(()constant(String) operator(::) constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(<<)constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(<<) constant(Class)operator(\)) +ident(p)operator(()constant(String) stringoperator(\)) string +ident(p)operator(()constant(String) operator(<<) constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(/)constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(/) constant(Class)operator(\)) +ident(p)operator(()constant(String) regexpoperator(\)) +ident(p)operator(()constant(String) operator(/) constant(Class)operator(\)) comment(#borken) +ident(p)operator(()constant(String)operator([)constant(Class)operator(])operator(\)) +ident(p)operator(()constant(String)operator([) constant(Class)operator(])operator(\)) +ident(p)operator(()constant(String) operator([)constant(Class)operator(])operator(\)) +ident(p)operator(()constant(String) operator([) constant(Class)operator(])operator(\)) +ident(p)operator(()constant(String)operator(*)constant(Class)operator(\)) +ident(p)operator(()constant(String)operator(*) constant(Class)operator(\)) +ident(p)operator(()constant(String) operator(*)constant(Class)operator(\)) +ident(p)operator(()constant(String) operator(*) constant(Class)operator(\)) +reserved(class) operator(<<)class(String) +reserved(undef) symbol(:*)operator(,)method(<<)operator(,)method(/)operator(,)method([]) +reserved(end) + + + +ident(p)operator(()pre_constant(false)operator(::)ident(to_s)operator(\)) +ident(p)operator(()pre_constant(false) operator(::)ident(to_s)operator(\)) +ident(p)operator(()pre_constant(false)operator(::) ident(to_s)operator(\)) +ident(p)operator(()pre_constant(false) operator(::) ident(to_s)operator(\)) + +reserved(class) class(C2) +reserved(class) operator(<<)class(self) + reserved(def) pre_constant(self)operator(.)ident(p8)operator(;) ident(p) integer(8) reserved(end) + reserved(alias) ident(p?) ident(p) + reserved(alias) ident(P?) ident(p) + reserved(alias) operator([)operator(]) ident(p) + reserved(alias) operator(<=>) ident(p) +reserved(end) + +ident(q)operator(=)integer(9) +constant(Q)operator(=)integer(99) + +ident(p)symbol(:p8) +pre_constant(false) operator(?) ident(p)operator(:) ident(p8) +ident(p) symbol(:p8) +pre_constant(false) operator(?) ident(p) operator(:) ident(p8) + +pre_constant(false) operator(?) ident(q)symbol(:p8) +pre_constant(false) operator(?) ident(q)operator(:) ident(p8) +pre_constant(false) operator(?) ident(q) symbol(:p8) +pre_constant(false) operator(?) ident(q) operator(:) ident(p8) + +comment(#false ? Q:p8 #gives ruby indigestion) +pre_constant(false) operator(?) constant(Q)operator(:) ident(p8) +comment(#false ? Q :p8 #gives ruby indigestion) +pre_constant(false) operator(?) constant(Q) operator(:) ident(p8) + +ident(p?)symbol(:p8) +pre_constant(false) operator(?) ident(p?)operator(:) ident(p8) +ident(p?) symbol(:p8) +pre_constant(false) operator(?) ident(p?) operator(:) ident(p8) + +ident(P?)symbol(:p8) +pre_constant(false) operator(?) ident(P?)operator(:) ident(p8) +ident(P?) symbol(:p8) +pre_constant(false) operator(?) ident(P?) operator(:) ident(p8) + +pre_constant(self)operator(.)operator([])symbol(:p8) +pre_constant(false) operator(?) pre_constant(self)operator(.)operator([])operator(:) ident(p8) +pre_constant(self)operator(.)operator([]) symbol(:p8) +pre_constant(false) operator(?) pre_constant(self)operator(.)operator([]) operator(:) ident(p8) + +pre_constant(self)operator(.)operator(<=>)symbol(:p8) +pre_constant(false) operator(?) pre_constant(self)operator(.)operator(<=>)operator(:) ident(p8) +pre_constant(self)operator(.)operator(<=>) symbol(:p8) +pre_constant(false) operator(?) pre_constant(self)operator(.)operator(<=>) operator(:) ident(p8) + +pre_constant(self) operator(<=>)symbol(:p8) +comment(#false ? self <=>: p8 #gives ruby indigestion) +pre_constant(self) operator(<=>) symbol(:p8) +comment(#false ? self <=> : p8 #gives ruby indigestion) +reserved(end) + +ident(p) stringoperator(+)stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))string + + +ident(p) stringstring +ident(mix)operator(=)pre_constant(nil) +ident(p) operator(/) integer(5)operator(/)ident(mix) + +reserved(module) class(M33) + ident(p)operator(=)string + constant(Q)operator(=)string + reserved(def) constant(Q)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) + pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)stringoperator(\)) + reserved(end) + reserved(def) ident(p)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) + pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)stringoperator(\)) + reserved(end) + reserved(def) pre_constant(self)operator(.)ident(p)operator(()operator(*)ident(a)operator(\))operator(;) reserved(super)operator(;) constant(Q) reserved(end) + instance_variable(@a)operator(=)integer(1) + global_variable($a)operator(=)integer(2) + + ident(p)operator(()ident(p)operator(~)integer(6)operator(\)) + ident(p)operator(()ident(p) operator(~)integer(6)operator(\)) + ident(p)operator(()ident(p)operator(~) integer(6)operator(\)) + ident(p)operator(()ident(p) operator(~) integer(6)operator(\)) + ident(p)operator(()ident(p)operator(*)integer(11)operator(\)) + ident(p)operator(()ident(p) operator(*)integer(11)operator(\)) + ident(p)operator(()ident(p)operator(*) integer(11)operator(\)) + ident(p)operator(()ident(p) operator(*) integer(11)operator(\)) + ident(p)operator(()ident(p)operator(&)ident(proc)operator({)operator(})operator(\)) + ident(p)operator(()ident(p) operator(&)ident(proc)operator({)operator(})operator(\)) + ident(p)operator(()ident(p)operator(&) ident(proc)operator({)operator(})operator(\)) + ident(p)operator(()ident(p) operator(&) ident(proc)operator({)operator(})operator(\)) + ident(p)operator(()ident(p) operator(!)integer(1)operator(\)) +comment(# p(p ?1\) #compile error, when p is var) + ident(p)operator(()ident(p) operator(!) integer(1)operator(\)) + ident(p)operator(()ident(p) operator(?) integer(1) operator(:) integer(6)operator(\)) + ident(p)operator(()ident(p)instance_variable(@a)operator(\)) + ident(p)operator(()ident(p) instance_variable(@a)operator(\)) +comment(# p(p@ a\) #wont) +comment(# p(p @ a\) #work ) + ident(p)operator(()ident(p)comment(#a) +operator(\)) + ident(p)operator(()ident(p) comment(#a) +operator(\)) + ident(p)operator(()ident(p)comment(# a) +operator(\)) + ident(p)operator(()ident(p) comment(# a) +operator(\)) + ident(p)operator(()ident(p)global_variable($a)operator(\)) + ident(p)operator(()ident(p) global_variable($a)operator(\)) +comment(# p(p$ a\) #wont) +comment(# p(p $ a\) #work) + ident(p)operator(()ident(p)operator(%)constant(Q)operator({)symbol(:foo)operator(})operator(\)) + ident(p)operator(()ident(p) stringoperator(\)) + ident(p)operator(()ident(p)operator(%) constant(Q)operator({)symbol(:foo)operator(})operator(\)) + ident(p)operator(()ident(p) operator(%) constant(Q)operator({)symbol(:foo)operator(})operator(\)) + ident(p)operator(()ident(p)operator(^)integer(6)operator(\)) + ident(p)operator(()ident(p) operator(^)integer(6)operator(\)) + ident(p)operator(()ident(p)operator(^) integer(6)operator(\)) + ident(p)operator(()ident(p) operator(^) integer(6)operator(\)) + ident(p)operator(()ident(p)operator(&)integer(7)operator(\)) + ident(p)operator(()ident(p) operator(&)ident(proc)operator({)integer(7)operator(})operator(\)) + ident(p)operator(()ident(p)operator(&) integer(7)operator(\)) + ident(p)operator(()ident(p) operator(&) integer(7)operator(\)) + ident(p)operator(()ident(p)operator(()integer(2)operator(\))operator(\)) + ident(p)operator(()ident(p) operator(()integer(2)operator(\))operator(\)) + ident(p)operator(()ident(p)operator(() integer(2)operator(\))operator(\)) + ident(p)operator(()ident(p) operator(() integer(2)operator(\))operator(\)) + ident(p)operator(()ident(p)operator(()ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p)operator(()operator(\))operator(\)) + ident(p)operator(()ident(p) operator(()ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p) operator(()operator(\))operator(\)) + ident(p)operator(()ident(p) operator(() ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p) operator(() operator(\))operator(\)) + ident(p)operator(()ident(p)operator(() ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p)operator(() operator(\))operator(\)) + ident(p)operator(()ident(p)operator(\)) + ident(p)operator(()operator(()ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p) operator(\)) + ident(p)operator(()operator(()ident(p) operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) ident(p)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) ident(p)operator(,)ident(p)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) ident(p)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) ident(p)operator(,)ident(p)operator(\))operator(\)) + ident(p)operator(()ident(p)integer(-0)operator(\)) + ident(p)operator(()ident(p) integer(-0)operator(\)) + ident(p)operator(()ident(p)operator(-) integer(0)operator(\)) + ident(p)operator(()ident(p) operator(-) integer(0)operator(\)) + ident(p)operator(()ident(p)integer(+9)operator(\)) + ident(p)operator(()ident(p) integer(+9)operator(\)) + ident(p)operator(()ident(p)operator(+) integer(9)operator(\)) + ident(p)operator(()ident(p) operator(+) integer(9)operator(\)) + ident(p)operator(()ident(p)operator([)integer(1)operator(])operator(\)) + ident(p)operator(()ident(p) operator([)integer(1)operator(])operator(\)) + ident(p)operator(()ident(p)operator([) integer(1)operator(])operator(\)) + ident(p)operator(()ident(p) operator([) integer(1)operator(])operator(\)) + ident(p)operator(()ident(p)operator({)integer(1)operator(})operator(\)) + ident(p)operator(()ident(p) operator({)integer(1)operator(})operator(\)) + ident(p)operator(()ident(p)operator({) integer(1)operator(})operator(\)) + ident(p)operator(()ident(p) operator({) integer(1)operator(})operator(\)) + ident(p)operator(()ident(p)operator(/)integer(1)operator(\)) + ident(p)operator(()ident(p) regexp integer(1)operator(\)) + ident(p)operator(()ident(p) operator(/) integer(22)operator(\)) + ident(p)operator(()ident(p)operator(.)ident(_)operator(\)) + ident(p)operator(()ident(p) operator(.)ident(_)operator(\)) + ident(p)operator(()ident(p)operator(.) ident(_)operator(\)) + ident(p)operator(()ident(p) operator(.) ident(_)operator(\)) + ident(p)operator(()pre_constant(false) operator(?) ident(p)symbol(:f)operator(\)) + ident(p)operator(()pre_constant(false) operator(?) ident(p) symbol(:f)operator(\)) + ident(p)operator(()pre_constant(false) operator(?) ident(p)operator(:) ident(f)operator(\)) + ident(p)operator(()pre_constant(false) operator(?) ident(p) operator(:) ident(f)operator(\)) + ident(p)operator(()operator(()ident(p)operator(;)integer(1)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) operator(;)integer(1)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p)operator(;) integer(1)operator(\))operator(\)) + ident(p)operator(()operator(()ident(p) operator(;) integer(1)operator(\))operator(\)) + ident(p)operator(()ident(p)operator(<)integer(1)operator(\)) + ident(p)operator(()ident(p) operator(<)integer(1)operator(\)) + ident(p)operator(()ident(p)operator(<) integer(1)operator(\)) + ident(p)operator(()ident(p) operator(<) integer(1)operator(\)) + ident(p)operator(()ident(p)operator(<<)integer(1)operator(\)) + ident(p)operator(()ident(p) stringoperator(\))string2\) + p(p >2\) + p(p> 2\) + p(p > 2\) + +end + +module M34 + p(p~6\) + p(p ~6\) + p(p~ 6\) + p(p ~ 6\) + p(p*[1]\) + p(p *[1]\) + p(p* [1]\) + p(p * [1]\) + p(p&proc{}\) + p(p &proc{}\) + p(p& proc{}\) + p(p & proc{}\) + p(p !1\) + p(p ?1\) + p(p ! 1\) + p(p ? 1 : 6\) + p(p@a\) + p(p @a\) +# p(p@ a\) #wont +# p(p @ a\) #work + + p(p#a +\) + p(p #a +\) + p(p# a +\) + p(p # a +\) + p(p$a\) + p(p $a\) +# p(p$ a\) #wont +# p(p $ a\) #work + p(p%Q{:foo}\) + p(p %Q{:foo}\) + p(p% Q{:foo}\) + p(p % Q{:foo}\) + p(p^6\) + p(p ^6\) + p(p^ 6\) + p(p ^ 6\) + p(p&7\) + p(p &proc{7}\) + p(p& 7\) + p(p & 7\) + p(p(2\)\) + p(p (2\)\) + p(p( 2\)\) + p(p ( 2\)\) + p(p(p\)\) + p(p(\)\) + p(p (p\)\) + p(p (\)\) + p(p ( p\)\) + p(p ( \)\) + p(p( p\)\) + p(p( \)\) + p(p\) + p((p\)\) + p(p \) + p((p \)\) + p((p p\)\) + p((p p,p\)\) + p((p p\)\) + p((p p,p\)\) + p(p-0\) + p(p -1\) + p(p- 0\) + p(p - 0\) + p(p+9\) + p(p +9\) + p(p+ 9\) + p(p + 9\) + p(p[1]\) + p(p [1]\) + p(p[ 1]\) + p(p [ 1]\) + p(p{1}\) + p(p {1}\) + p(p{ 1}\) + p(p { 1}\) + p(p/1\) + p(p /22/\) + p(p/ 1\) + p(p / 22\) + p(p._\) + p(p ._\) + p(p. _\) + p(p . _\) + p(p:f\) + p(p :f\) + p(false ? p: f\) + p(false ? p : f\) + p((p;1\)\) + p((p ;1\)\) + p((p; 1\)\) + p((p ; 1\)\) + p(p<1\) + p(p <1\) + p(p< 1\) + p(p < 1\) + p(p<<1\) + p(p <<1\) +foobar)delimiter( +1)> + ident(p)operator(()ident(p)operator(<<) integer(1)operator(\)) + ident(p)operator(()ident(p) operator(<<) integer(1)operator(\)) + ident(p)operator(()ident(p)stringoperator(\)) + ident(p)operator(()ident(p) stringoperator(\)) + ident(p)operator(()ident(p)stringoperator(\)) + ident(p)operator(()ident(p) stringoperator(\)) + ident(p)operator(()ident(p)stringoperator(\)) + ident(p)operator(()ident(p) stringoperator(\)) + ident(p)operator(()ident(p)stringoperator(\)) + ident(p)operator(()ident(p) stringoperator(\)) + ident(p)operator(()ident(p)operator(|)integer(4)operator(\)) + ident(p)operator(()ident(p) operator(|)integer(4)operator(\)) + ident(p)operator(()ident(p)operator(|) integer(4)operator(\)) + ident(p)operator(()ident(p) operator(|) integer(4)operator(\)) + ident(p)operator(()ident(p)operator(>)integer(2)operator(\)) + ident(p)operator(()ident(p) operator(>)integer(2)operator(\)) + ident(p)operator(()ident(p)operator(>) integer(2)operator(\)) + ident(p)operator(()ident(p) operator(>) integer(2)operator(\)) + +reserved(end) + + +reserved(def) method(bob)operator(()ident(x)operator(\)) ident(x) reserved(end) +reserved(def) method(bill)operator(()ident(x)operator(\)) ident(x) reserved(end) +ident(p)operator(()ident(bob) stringoperator(\)) +reserved(for) ident(bob) reserved(in) operator([)integer(100)operator(]) reserved(do) ident(p)operator(()ident(bob) stringoperator(\)) reserved(end) +ident(p)operator(()ident(bob) stringoperator(\)) +reserved(def) method(%)operator(()ident(n)operator(\)) ident(to_s)operator(+)stringdelimiter(")> reserved(end) +ident(p)operator(()ident(bill) stringoperator(\)) +reserved(begin) ident(sdjkfsjkdfsd)operator(;) reserved(rescue) constant(Object) operator(=)operator(>) ident(bill)operator(;) ident(p)operator(()ident(bill) stringoperator(\)) reserved(end) +ident(p)operator(()ident(bill) stringoperator(\)) +reserved(undef) method(%) + +reserved(class) class(Object) + +ident(public) symbol(:`) +reserved(def) method(`)operator(()ident(s)operator(\)) + ident(print) stringchar(\\n)delimiter(")> +reserved(end) +reserved(end) + +integer(69)operator(.)operator(`)operator(()stringoperator(\)) + +integer(79)operator(::)operator(`)operator(()stringoperator(\)) + +ident(p) symbol(:`) + +ident(p)operator({)operator(}) +ident(p) operator({)operator(}) +ident(a)operator(=)integer(5) +ident(p) ident(p) integer(+5) +ident(p) ident(a) integer(+5) + +reserved(def) pre_constant(nil)operator(.)operator(+)operator(()ident(x)operator(\)) operator(~)ident(x) reserved(end) +reserved(def) pre_constant(nil)operator(.)operator([])operator(()operator(*)ident(x)operator(\)) operator([)ident(x)operator(]) reserved(end) +ident(p)operator(() ident(p) operator(+) integer(5) operator(\)) +ident(p)operator(() ident(p) integer(+5) operator(\)) +ident(p)operator(() ident(p)integer(+5) operator(\)) +ident(p)operator(() ident(p)operator([)operator(]) operator(\)) +ident(p)operator(() ident(p) operator([)operator(]) operator(\)) +ident(p)operator(() ident(p) operator([) operator(]) operator(\)) +reserved(class) class(NilClass)operator(;) reserved(undef) method(+)operator(,)method([]) reserved(end) + +reserved(class) class(Foou) + ident(public) + reserved(def) method([]) ident(x)operator(=)integer(-100)operator(,)operator(&)ident(y)operator(;) ident(p) ident(x)operator(;) integer(100) reserved(end) +reserved(end) +ident(a0)operator(=)integer(8) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(!)pre_constant(false) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(!)pre_constant(false) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(~)integer(9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(~)integer(9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])integer(-9) comment(#op) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])integer(+9) comment(#op) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) integer(-9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) integer(+9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(<<)integer(9) comment(#op) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) string comment(#value)string +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(%)integer(9) comment(#op) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator(/)integer(9) comment(#op) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) string comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator(/)integer(9)operator(/) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])global_variable($9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])ident(a0) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) global_variable($9) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) ident(a0) comment(#value) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([])operator({)integer(9)operator(}) comment(#lambda (op\)) +ident(p) constant(Foou)operator(.)ident(new)operator(.)operator([]) operator({)integer(9)operator(}) comment(#lambda (op\)) + +reserved(if) ident(p) reserved(then) ident(p) reserved(end) + +ident(p)operator(()operator({)symbol(:foo)operator(=)operator(>)symbol(:bar)operator(})operator(\)) comment(#why does this work? i'd think that ':foo=' would be 1 token) +ident(p) constant(EMPTY) operator(=) integer(0) +ident(p) constant(BLACK) operator(=) integer(1) +ident(p) constant(WHITE) operator(=) operator(-) constant(BLACK) + + ident(a)operator(=)ident(b)operator(=)ident(c)operator(=)integer(0) + ident(a) operator(?) ident(b)symbol(:c) + ident(a) integer(?b)symbol(:c) + + ident(p)operator(()ident(a) operator(?) ident(b)symbol(:c)operator(\)) + ident(p)operator(()ident(a) integer(?b)symbol(:c)operator(\)) + + +ident(p)operator(~)integer(4) +ident(p)symbol(:f) +ident(p)operator(()operator(~)integer(4)operator(\))operator({)operator(}) +ident(p)operator(()symbol(:f)operator(\))operator({)operator(}) +ident(h)operator(=)operator({)operator(}) +ident(h)operator(.)ident(default)operator(=)symbol(:foo) + +ident(p) reserved(def) operator(()ident(h)operator(=)stringoperator(\))operator(.)ident(default)operator(=) ident(v)operator(;) ident(p) instance_variable(@v)operator(=)ident(v)operator(;)ident(v) reserved(end) +ident(p) ident(h) + +ident(p) ident(h)operator(.)ident(default)operator(=)symbol(:b) + +ident(x)operator(,) operator(()operator(*)ident(y)operator(\)) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) +ident(p) ident(x) +ident(p) ident(y) + +ident(x)operator(,) operator(*)ident(y) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) +ident(p) ident(x) +ident(p) ident(y) + +ident(x)operator(,) operator(*) operator(=) operator([)symbol(:x)operator(,) symbol(:y)operator(,) symbol(:z)operator(]) +ident(p) ident(x) + + + +ident(p) ident(Array)operator(()stringoperator(\)) + + + +ident(p) operator(+)operator(()integer(4)operator(\)) +ident(p) operator(-)operator(()integer(4)operator(\)) + +ident(p) symbol + +reserved(class) class(Foop) + reserved(def) constant(Foop)operator(.)ident(bar) ident(a)operator(,)ident(b) + ident(p) ident(a)operator(,)ident(b) + reserved(end) +reserved(end) +constant(Foop)operator(.)ident(bar) integer(1)operator(,)integer(2) +constant(Foop)operator(::)ident(bar) integer(3)operator(,)integer(4) + + +reserved(class) class(Foop) + reserved(def) constant(Foop)operator(::)ident(baz) ident(a)operator(,)ident(b) + ident(p) symbol(:baz)operator(,)ident(a)operator(,)ident(b) + reserved(end) +reserved(end) +constant(Foop)operator(.)ident(baz) integer(5)operator(,)integer(6) +constant(Foop)operator(::)ident(baz) integer(7)operator(,)integer(8) + + + +ident(without_creating)operator(=)ident(widgetname)operator(=)pre_constant(nil) + reserved(if) ident(without_creating) operator(&&) operator(!)ident(widgetname) comment(#foo) + ident(fail) constant(ArgumentError)operator(,) + string + reserved(end) + + + +comment(=begin disable for now + +#class, module, and def should temporarily hide local variables +def mopsdfjskdf arg; arg*2 end +mopsdfjskdf=5 + class C + p mopsdfjskdf %(3\) #calls method + end + +module M + p mopsdfjskdf %(4\) #calls method +end + + def d + p mopsdfjskdf %(5\) #calls method + end +p d +p mopsdfjskdf %(6\) #reads variable +p proc{mopsdfjskdf %(7\)}[] #reads variable + +#fancy symbols not supported yet +p %s{symbol} +=end) + +comment(#multiple assignment test) +ident(proc) operator({) + ident(a)operator(,)ident(b)operator(,)ident(c)operator(,)ident(d)operator(,)ident(e)operator(,)ident(f)operator(,)ident(g)operator(,)ident(h)operator(,)ident(i)operator(,)ident(j)operator(,)ident(k)operator(=)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(,)integer(9)operator(,)integer(10)operator(,)integer(11) + ident(p)operator(()ident(b) stringoperator(\)) + ident(p)operator(()ident(a) stringoperator(\)) + ident(p)operator(()ident(k) stringoperator(\)) + ident(p)operator(()ident(p) stringoperator(\)) +operator(})operator(.)ident(call) + + +comment(=begin disable for now +p "#{<delimiter(})>delimiter(")> +ident(bim) +ident(baz) +ident(bof) +ident(foobar3) + +reserved(def) method(func) + ident(a)operator(,)ident(b)operator(,)operator(*) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) + ident(p) ident(a)operator(,)ident(b) + ident(a)operator(,)ident(b)operator(,) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) + ident(p) ident(a)operator(,)ident(b) + + ident(a)operator(,)ident(b) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) + ident(p) ident(a)operator(,)ident(b) + ident(a)operator(,)operator(*)ident(b) operator(=) operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) + ident(p) ident(a)operator(,)ident(b) + + ident(a)operator(,)ident(b)operator(,)operator(*)ident(c)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) + ident(a)operator(,)ident(b)operator(,)operator(*) ident(c)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(,)integer(5)operator(,)integer(6)operator(,)integer(7)operator(,)integer(8)operator(]) +reserved(end) +ident(func) + + +ident(p)operator(() regexpoperator(\)) +ident(p)operator(() regexp)delimiter(~)modifier(m)>operator(\)) + +ident(p) stringstringchar(\\ +)inlinedelimiter( +end)> + + + + + +ident(proc) operator({) + ident(h)operator(=)operator({)symbol(:a)operator(=)operator(>)operator(()ident(foo)operator(=)integer(100)operator(\))operator(}) + ident(p)operator(() ident(foo) stringoperator(\)) +operator(})operator(.)ident(call) + + +ident(p) stringdelimiter(})>delimiter(")> +ident(bim) +ident(baz) +ident(bof) +ident(foobar3) + +ident(p) stringstring +delimiter(})>delimiter(")> + +ident(p) string operator(;) ident(p) stringdelimiter(})>delimiter(")>stringstring +ident(p) stringoperator(.)ident(each)operator(()stringoperator(\))operator({)operator(|)ident(s)operator(|) stringoperator(+)ident(s)operator(}) delimiter(})>delimiter(")> +ident(jbvd)operator(|)ident(g4543ghb)operator(|)operator(!)instance_variable(@G)global_variable($dfsd)operator(|)ident(fafr)operator(|)ident(e) +operator(|)ident(s4e5rrwware)operator(|)constant(BBBBB)operator(|*)operator(&)operator(^)operator(()operator(*&)operator(^)operator(>)stringcomment(#{<)string + +reserved(def) method(foo)operator(()ident(a)operator(=)stringoperator(,)ident(b)operator(=)stringoperator(,)ident(c)operator(=)stringoperator(\))stringstringstring + + ident(a)operator(+)ident(b)operator(+)ident(c) + +reserved(end) +ident(p) ident(foo) + + + +global_variable($a)operator(=)integer(1) +instance_variable(@b)operator(=)integer(2) +class_variable(@@c)operator(=)integer(3) +ident(p) stringdelimiter(")> +ident(p) string +ident(p) string +ident(p) string +ident(p) string +ident(p) string +ident(p) stringdelimiter(")> +ident(p) string +ident(p) stringdelimiter(])> +ident(p) string +ident(p) shelldelimiter(`)> +ident(p) shell +ident(p)operator(()regexpdelimiter(/)>operator(\)) +comment(#p(/\\#$a \\#@b \\#@@c \\#{$a+@b+@@c}/\) #moved to w.rb) + +reserved(class) class(AA)operator(;) reserved(class) class(BB)operator(;) reserved(class) class(CC) +constant(FFOO)operator(=)integer(1) +reserved(end) reserved(end) reserved(end) + +ident(p) constant(AA)operator(::)constant(BB)operator(::)constant(CC)operator(::)constant(FFOO) + +ident(compile_body)operator(=)ident(outvar)operator(=)string + +reserved(if) pre_constant(false) + ident(method_src) operator(=) ident(c)operator(.)ident(compile)operator(()ident(template)operator(,) operator(()constant(HtmlCompiler)operator(::)constant(AnyData)operator(.)ident(new)operator(\))operator(\))operator(.)ident(join)operator(()stringoperator(\)) operator(+) + stringchar(\\n)delimiter(")> + ident(rescu) integer(-1) +reserved(end) + + ident(p)operator(()stringoperator(,) stringoperator(,) stringoperator(\))string + +reserved(def) method(add)operator(()operator(*)ident(args)operator(\)) + pre_constant(self)operator(.)operator(<<)operator(()operator(*)ident(args)operator(\)) +reserved(end) + + + +ident(val)operator(=)string + reserved(if) ident(val)operator(.)ident(include?) integer(?\\s) + ident(p) ident(val)operator(.)ident(split)operator(.)ident(collect)operator({)operator(|)ident(v)operator(|) operator(()ident(v)operator(\))operator(}) + reserved(end) +ident(p) stringdelimiter(")> +ident(p) string +reserved(class) class(Hosts) +reserved(end) +reserved(class) class(DNS) operator(<) constant(Hosts) +reserved(end) +reserved(def) method(intialize)operator(()ident(resolvers)operator(=)operator([)constant(Hosts)operator(.)ident(new)operator(,) constant(DNS)operator(.)ident(new)operator(])operator(\)) reserved(end) +reserved(def) method(environment)operator(()ident(env) operator(=) constant(File)operator(.)ident(basename)operator(()global_variable($0)operator(,) stringoperator(\))operator(\)) reserved(end) + +reserved(def) method(ssssss) operator(&)ident(block) +reserved(end) +reserved(def) method(params_quoted)operator(()ident(field_name)operator(,) ident(default)operator(\)) + reserved(if) ident(block_given?) reserved(then) reserved(yield) ident(field_name) reserved(else) ident(default) reserved(end) +reserved(end) +reserved(def) method(==)operator(()ident(o)operator(\)) integer(444) reserved(end) +reserved(def) constant(String)operator(.)ident(ffff4)operator(()operator(\)) pre_constant(self)operator(.)ident(to_s)operator(+)string reserved(end) + +ident(p) operator(*)operator([)operator(]) +reserved(for) ident(i) reserved(in) \ +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +comment(#() +reserved(for) ident(i) reserved(in) reserved(if) +pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) +comment(#\)) +operator(() +reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) +ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +ident(c)operator(=)ident(j)operator(=)integer(0) +reserved(until) reserved(while) ident(j)operator(<)integer(10) reserved(do) ident(j)operator(+=)integer(1) reserved(end)operator(.)ident(nil?) reserved(do) ident(p) string reserved(end) +reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) +reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + + +reserved(for) ident(i) reserved(in) operator(()ident(c)operator(;) +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) +operator(\)) +operator(() + +reserved(for) ident(i) reserved(in) operator(()reserved(begin) +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end)operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) reserved(then) ident(foob12345)operator(;) reserved(else) +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +reserved(for) ident(i) reserved(in) operator(() + +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +reserved(for) ident(i) reserved(in) operator(() +operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(])operator(\)) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) + +operator(\)) + + +reserved(def) method(yy)operator(;)reserved(yield) reserved(end) + +ident(block)operator(=)ident(proc)operator({)ident(p) stringoperator(}) + +ident(yy) operator(&)ident(block) +ident(p)operator(()integer(1)operator(.)operator(+)integer(1)operator(\)) +ident(p) ident(pppp) + +reserved(module) class(M66) +ident(p)operator(()ident(proc) reserved(do) + ident(p)operator(=)integer(123) +reserved(end)operator(.)ident(call)operator(\)) + +ident(p) ident(proc) operator({) + ident(p)operator(=)integer(123) +operator(})operator(.)ident(call) + +ident(p) reserved(def) method(pppp) + ident(p)operator(=)integer(123) +reserved(end) +ident(p) reserved(module) class(Ppp) + ident(p)operator(=)integer(123) +reserved(end) +ident(p) reserved(class) class(Pppp) operator(<) constant(String) + ident(p)operator(=)integer(123) +reserved(end) +reserved(end) + + reserved(def) method(_make_regex)operator(()ident(str)operator(\)) operator(/)operator(()operator([)comment(#{Regexp.escape(str\)}]\)/n end) +ident(p) ident(_make_regex)operator(()stringoperator(\)) + + +ident(p) string + +ident(p) string + +ident(a)operator(=)ident(a)operator(.)ident(to_s) +reserved(class) operator(<<)class(a) + reserved(def) method(foobar) + pre_constant(self)operator(*)integer(101) + reserved(end) + reserved(alias) ident(eql?) operator(==) +reserved(end) + +ident(p) ident(a)operator(.)ident(foobar) + +ident(p)operator(()regexp>|)char(\\|)char(\\|)content(|)char(\\&)char(\\&)content(\)=|)char(\\&)char(\\&)content(|)char(\\|)char(\\|)content(\))delimiter(/)>operator(\)) +ident(p)operator(()symbol(:%)operator(\)) +ident(p)operator(() operator({) symbol(:class) operator(=)operator(>) ident(class_)operator(=)integer(0)operator(})operator(\)) +ident(p) ident(cls_name) operator(=) operator({)operator(})operator([)symbol(:class)operator(]) + + +ident(p) ident(foo) +ident(p) stringdelimiter(")> +ident(p) symbol(:p) +ident(p)operator(()symbol(:p)operator(\)) +ident(p)operator(()symboloperator(\)) +ident(p) symbol +ident(p)operator(()stringoperator(\)) +ident(p)operator(()regexpoperator(\)) +ident(p)operator(()regexpoperator(\)) +ident(p) integer(0x80) +ident(p) integer(?p) +ident(p) float(0.1) +ident(p) float(0.8) +ident(p) float(0.9) +ident(p)operator(()integer(-1)operator(\)) +ident(p) string +ident(p) string)delimiter(])> +ident(i)operator(=)integer(99) +ident(p) string)inlinecontent()char(\\n)delimiter(])> +ident(p)operator(()symbol(:side)operator(=)operator(>)symbol(:top)operator(\)) +ident(p) string +ident(p) string +ident(p) string +ident(p) string +ident(p) symbol(:+) +ident(p) integer(99) operator(/) integer(3) + +ident(a)operator(=)integer(99)operator(;)ident(b)operator(=)integer(3) +ident(p) integer(1)operator(+)operator(()ident(a) operator(/) ident(b)operator(\)) +ident(p) string +ident(p) string + +reserved(if) pre_constant(false) + ident(formatter)operator(.)ident(format_element)operator(()ident(element)operator(\)) reserved(do) + ident(amrita_expand_and_format1)operator(()ident(element)operator(,) ident(context)operator(,) ident(formatter)operator(\)) + reserved(end) +reserved(end) +reserved(if) pre_constant(false) + ident(ret) operator(=) stringstringcontent( + def parts_template + @@parts_template + end + + )inlineoperator(\))delimiter(})>content( + def amrita_expand_and_format(element, context, formatter\) + if element.tagname_symbol == :span and element.attrs.size == 0 + amrita_expand_and_format1(element, context, formatter\) + else + formatter.format_element(element\) do + amrita_expand_and_format1(element, context, formatter\) + end + end + end + + def amrita_expand_and_format1(element, context, formatter\) + )inlinecontent( + end)delimiter( + END)> + ident(j)operator(=)integer(55) +reserved(end) + +ident(p) string +ident(p) string +ident(p) string +ident(p) string +ident(p) string +ident(p) string + +ident(p) string +ident(p) string +ident(p)operator(()regexpoperator(\)) +ident(p)operator(()regexpoperator(\)) +ident(p) ident(proc) operator({) + ident(p) shell + ident(p) shell +operator(}) + + + +ident(p)operator(()regexpoperator(\)) +comment(#breakpoint) +ident(p) stringoperator(+)stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))string + +comment(=begin doesn't work +p <operator(]) +ident(p) string operator(+) stringstringstring + + + +ident(p) stringoperator(;) reserved(def)string +ident(koomblatz!)operator(()operator(\)) ident(p) string reserved(end) + +ident(koomblatz!) + +ident(p) ident(f) operator(=) float(3.7517675036461267e+17) +ident(p) global_variable($10) +ident(p) global_variable($1001) +ident(p)operator(() string operator(\))string + +reserved(def) method(jd_to_wday)operator(()ident(jd)operator(\)) operator(()ident(jd) operator(+) integer(1)operator(\)) operator(%) integer(7) reserved(end) +ident(p) ident(jd_to_wday)operator(()integer(98)operator(\)) + + +ident(p) ident(pre) operator(=) global_variable($`) +comment(=begin +=end) + +ident(p) stringstring + +ident(p) global_variable($-j)operator(=)integer(55) + +reserved(def) method(empty)operator(()operator(\)) reserved(end) + +ident(p) stringstring + +ident(label)operator(=)stringoperator(;)ident(tab)operator(=)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(]) + ident(p) stringstringcontent( = arr = Array.new()inlinecontent(, nil\) +str = a = i = nil +idx = 0 +clist.each do |str| + str.split(',', -1\).each do |i| + arr[idx] = i.to_i unless i.empty? + idx += 1 + end +end +)delimiter( +S)> +reserved(def) method(printem1) ident(a)operator(,)ident(b)operator(,)ident(c) + ident(p)operator(()ident(a) integer(+77)operator(\)) + ident(p)operator(()ident(b) integer(+77)operator(\)) + ident(p)operator(()ident(c) integer(+77)operator(\)) +reserved(end) + +reserved(def) method(foobar)operator(()operator(\)) reserved(end) +reserved(def) method(foobar2) +reserved(end) + +reserved(def) method(printem0)operator(()ident(a)operator(\)) + ident(p)operator(()ident(a) integer(+77)operator(\)) +reserved(end) +reserved(def) method(printem0)operator(()ident(a)operator(,)ident(b)operator(,)ident(c)operator(\)) + ident(p)operator(()ident(a) integer(+77)operator(\)) + ident(p)operator(()ident(b) integer(+77)operator(\)) + ident(p)operator(()ident(c) integer(+77)operator(\)) +reserved(end) +reserved(def) method(printem2) ident(a)operator(,)ident(b)operator(,)ident(c)operator(;) ident(p)operator(()ident(a) integer(+77)operator(\))operator(;) ident(p)operator(()ident(b) integer(+77)operator(\))operator(;) ident(p)operator(()ident(c) integer(+77)operator(\)) reserved(end) +reserved(def) method(three)operator(()operator(\)) operator(()integer(1)integer(+2)operator(\)) reserved(end) + +reserved(def) method(d)operator(;)reserved(end) +reserved(def) method(d)operator(()operator(\))reserved(end) +reserved(def) method(d)operator(()ident(dd)operator(\))reserved(end) + +reserved(def) method(printem) ident(a)operator(,)ident(b)operator(,)ident(c) + ident(p) ident(a)operator(;)ident(p) ident(b)operator(;)ident(p) ident(c) + ident(p)operator(()ident(a) integer(+77)operator(\)) + ident(p)operator(()ident(b) stringoperator(\)) +reserved(end) +ident(printem) integer(1)operator(,)integer(2)operator(,)integer(3) + +ident(a)operator(=)integer(1) +ident(p)operator(()ident(a) integer(+77)operator(\)) + +reserved(def) method(hhh)operator(()ident(a)operator(=)operator(()integer(1)integer(+2)operator(\))operator(\)) ident(a) reserved(end) + + + +reserved(END) operator({) + ident(p) string +operator(}) + + +ident(p) stringstring +ident(p) stringstring +ident(p) ident(proc)operator({)operator(||)operator(}) +reserved(for) ident(i) reserved(in) reserved(if) pre_constant(false) +ident(foob12345)operator(;) reserved(else) operator([)integer(44)operator(,)integer(55)operator(,)integer(66)operator(,)integer(77)operator(,)integer(88)operator(]) reserved(end) reserved(do) ident(p) ident(i)operator(**)constant(Math)operator(.)ident(sqrt)operator(()ident(i)operator(\)) reserved(end) +ident(p) string +ident(c)operator(=)integer(0) + reserved(while) ident(c) operator(==) regexpoperator(;) reserved(end) + + + + + + + + diff --git a/test/ruby/example.out.raydebug b/test/ruby/example.out.raydebug index 4e16094..be68a13 100644 --- a/test/ruby/example.out.raydebug +++ b/test/ruby/example.out.raydebug @@ -1,3789 +1,3789 @@ -reserved(module) class(CodeRay) - reserved(module) class(Scanners) - -reserved(class) class(Ruby) operator(<) constant(Scanner) - - constant(RESERVED_WORDS) operator(=) operator([) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) - operator(]) - - constant(DEF_KEYWORDS) operator(=) operator([)stringoperator(]) - constant(MODULE_KEYWORDS) operator(=) operator([)stringoperator(,) stringoperator(]) - constant(DEF_NEW_STATE) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:initial)operator(\))operator(.) - ident(add)operator(()constant(DEF_KEYWORDS)operator(,) symbol(:def_expected)operator(\))operator(.) - ident(add)operator(()constant(MODULE_KEYWORDS)operator(,) symbol(:module_expected)operator(\)) - - constant(WORDS_ALLOWING_REGEXP) operator(=) operator([) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string - operator(]) - constant(REGEXP_ALLOWED) operator(=) constant(WordList)operator(.)ident(new)operator(()pre_constant(false)operator(\))operator(.) - ident(add)operator(()constant(WORDS_ALLOWING_REGEXP)operator(,) symbol(:set)operator(\)) - - constant(PREDEFINED_CONSTANTS) operator(=) operator([) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) - operator(]) - - constant(IDENT_KIND) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.) - ident(add)operator(()constant(RESERVED_WORDS)operator(,) symbol(:reserved)operator(\))operator(.) - ident(add)operator(()constant(PREDEFINED_CONSTANTS)operator(,) symbol(:pre_constant)operator(\)) - - constant(METHOD_NAME) operator(=) regexpcontent( [?!]? )delimiter(/)modifier(xo)> - constant(METHOD_NAME_EX) operator(=) regexpcontent( # common methods: split, foo=, empty?, gsub! - | )char(\\*)char(\\*)content(? # multiplication and power - | [-+~]@? # plus, minus - | [)char(\\/)content(%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system` - | )char(\\[)char(\\])content(=? # array getter and setter - | <=?>? | >=? # comparison, rocket operator - | << | >> # append or shift left, shift right - | ===? # simple equality and case equality - )delimiter(/)modifier(ox)> - constant(GLOBAL_VARIABLE) operator(=) regexpcontent( | )char(\\d)content(+ | [~&+`'=)char(\\/)content(,;_.<>!@0$?*":F)char(\\\\)content(] | -[a-zA-Z_0-9] \) )delimiter(/)modifier(ox)> - - constant(DOUBLEQ) operator(=) regexp - constant(SINGLEQ) operator(=) regexp - constant(STRING) operator(=) regexpcontent( | )inlinecontent( )delimiter(/)modifier(ox)> - constant(SHELL) operator(=) regexp - constant(REGEXP) operator(=) regexp - - constant(DECIMAL) operator(=) regexp comment(# doesn't recognize 09 as octal error) - constant(OCTAL) operator(=) regexp - constant(HEXADECIMAL) operator(=) regexp - constant(BINARY) operator(=) regexp - - constant(EXPONENT) operator(=) regexpcontent( )delimiter(/)modifier(ox)> - constant(FLOAT) operator(=) regexpcontent( (?: )inlinecontent( | )char(\\.)content( )inlinecontent( )inlinecontent(? \) )delimiter(/)> - constant(INTEGER) operator(=) regexpcontent(|)inlinecontent(|)inlinecontent(|)inlinedelimiter(/)> - - reserved(def) method(reset) - reserved(super) - instance_variable(@regexp_allowed) operator(=) pre_constant(false) - reserved(end) - - reserved(def) method(next_token) - reserved(return) reserved(if) instance_variable(@scanner)operator(.)ident(eos?) - - ident(kind) operator(=) symbol(:error) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) comment(# in every state) - ident(kind) operator(=) symbol(:space) - instance_variable(@regexp_allowed) operator(=) symbol(:set) reserved(if) instance_variable(@regexp_allowed) reserved(or) instance_variable(@scanner)operator(.)ident(matched)operator(.)ident(index)operator(()integer(?\\n)operator(\)) comment(# delayed flag setting) - - reserved(elsif) instance_variable(@state) operator(==) symbol(:def_expected) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent((?:)char(\\.)content(|::\)\)* | (?:@@?|$\)? )inlinecontent((?:)char(\\.)content(|::\) \) )inlinecontent( )delimiter(/)modifier(ox)>operator(\)) - ident(kind) operator(=) symbol(:method) - instance_variable(@state) operator(=) symbol(:initial) - reserved(else) - instance_variable(@scanner)operator(.)ident(getch) - reserved(end) - instance_variable(@state) operator(=) symbol(:initial) - - reserved(elsif) instance_variable(@state) operator(==) symbol(:module_expected) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(kind) operator(=) symbol(:operator) - reserved(else) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( (?:)char(\\.)content(|::\)\)* )inlinecontent( )delimiter(/)modifier(ox)>operator(\)) - ident(kind) operator(=) symbol(:method) - reserved(else) - instance_variable(@scanner)operator(.)ident(getch) - reserved(end) - instance_variable(@state) operator(=) symbol(:initial) - reserved(end) - - reserved(elsif) comment(# state == :initial) - comment(# IDENTIFIERS, KEYWORDS) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(GLOBAL_VARIABLE)operator(\)) - ident(kind) operator(=) symbol(:global_variable) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( )delimiter(/)modifier(ox)>operator(\)) - ident(kind) operator(=) symbol(:class_variable) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( )delimiter(/)modifier(ox)>operator(\)) - ident(kind) operator(=) symbol(:instance_variable) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(kind) operator(=) symbol(:comment) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(METHOD_NAME)operator(\)) - reserved(if) instance_variable(@last_token_dot) - ident(kind) operator(=) symbol(:ident) - reserved(else) - ident(matched) operator(=) instance_variable(@scanner)operator(.)ident(matched) - ident(kind) operator(=) constant(IDENT_KIND)operator([)ident(matched)operator(]) - reserved(if) ident(kind) operator(==) symbol(:ident) reserved(and) ident(matched) operator(=)operator(~) regexp - ident(kind) operator(=) symbol(:constant) - reserved(elsif) ident(kind) operator(==) symbol(:reserved) - instance_variable(@state) operator(=) constant(DEF_NEW_STATE)operator([)ident(matched)operator(]) - instance_variable(@regexp_allowed) operator(=) constant(REGEXP_ALLOWED)operator([)ident(matched)operator(]) - reserved(end) - reserved(end) - - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(STRING)operator(\)) - ident(kind) operator(=) symbol(:string) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SHELL)operator(\)) - ident(kind) operator(=) symbol(:shell) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(kind) operator(=) symbol(:string) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(and) instance_variable(@regexp_allowed) - instance_variable(@scanner)operator(.)ident(unscan) - instance_variable(@scanner)operator(.)ident(scan)operator(()constant(REGEXP)operator(\)) - ident(kind) operator(=) symbol(:regexp) -regexp#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^>#)char(\\\\)char(\\\\)content(]*\)*>?|([^a-zA-Z)char(\\\\)char(\\\\)content(]\)(?:(?!)char(\\1)content(\)[^#)char(\\\\)char(\\\\)content(]\)*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)(?:(?!)char(\\1)content(\)[^#)char(\\\\)char(\\\\)content(]\)*\)*)char(\\1)content(?\)|)char(\\()content([^\)#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^\)#)char(\\\\)char(\\\\)content(]*\)*)char(\\\))content(?|)char(\\[)content([^)char(\\])content(#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^)char(\\])content(#)char(\\\\)char(\\\\)content(]*\)*)char(\\])content(?|)char(\\{)content([^}#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^}#)char(\\\\)char(\\\\)content(]*\)*)char(\\})content(?|<[^>#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^>#)char(\\\\)char(\\\\)content(]*\)*>?|([^a-zA-Z)char(\\s)char(\\\\)char(\\\\)content(]\)(?:(?!)char(\\2)content(\)[^#)char(\\\\)char(\\\\)content(]\)*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)(?:(?!)char(\\2)content(\)[^#)char(\\\\)char(\\\\)content(]\)*\)*)char(\\2)content(?|)char(\\\\)char(\\\\)content([^#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#\)[^#)char(\\\\)char(\\\\)content(]*\)*)char(\\\\)char(\\\\)content(?\))delimiter(/)> - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent(|)inlinecontent(|)inlinecontent(\))delimiter(/)modifier(ox)>operator(\)) - ident(kind) operator(=) symbol(:symbol) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(kind) operator(=) symbol(:integer) - - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexp;,|&!(\))char(\\[)char(\\])content({}~?] | )char(\\.)char(\\.)content(?)char(\\.)content(? | ::? )delimiter(/)modifier(x)>operator(\)) - ident(kind) operator(=) symbol(:operator) - instance_variable(@regexp_allowed) operator(=) symbol(:set) reserved(if) instance_variable(@scanner)operator(.)ident(matched)operator([)integer(-1)operator(,)integer(1)operator(]) operator(=)operator(~) regexp|&^,)char(\\()char(\\[)content(+)char(\\-)char(\\/)char(\\*)content(%])char(\\z)delimiter(/)> - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(FLOAT)operator(\)) - ident(kind) operator(=) symbol(:float) - reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(INTEGER)operator(\)) - ident(kind) operator(=) symbol(:integer) - reserved(else) - instance_variable(@scanner)operator(.)ident(getch) - reserved(end) - reserved(end) - - ident(token) operator(=) constant(Token)operator(.)ident(new) instance_variable(@scanner)operator(.)ident(matched)operator(,) ident(kind) - - reserved(if) ident(kind) operator(==) symbol(:regexp) - ident(token)operator(.)ident(text) operator(<<) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - reserved(end) - - instance_variable(@regexp_allowed) operator(=) operator(()instance_variable(@regexp_allowed) operator(==) symbol(:set)operator(\)) comment(# delayed flag setting) - - ident(token) - reserved(end) -reserved(end) - -ident(register) constant(Ruby)operator(,) stringoperator(,) string - - reserved(end) -reserved(end) -reserved(class) class(Set) - ident(include) constant(Enumerable) - - comment(# Creates a new set containing the given objects.) - reserved(def) pre_constant(self)operator(.)operator([])operator(()operator(*)ident(ary)operator(\)) - ident(new)operator(()ident(ary)operator(\)) - reserved(end) - - comment(# Creates a new set containing the elements of the given enumerable) - comment(# object.) - comment(#) - comment(# If a block is given, the elements of enum are preprocessed by the) - comment(# given block.) - reserved(def) method(initialize)operator(()ident(enum) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(# :yields: o) - instance_variable(@hash) operator(||=) constant(Hash)operator(.)ident(new) - - ident(enum)operator(.)ident(nil?) reserved(and) reserved(return) - - reserved(if) ident(block) - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(block)operator([)ident(o)operator(])operator(\)) operator(}) - reserved(else) - ident(merge)operator(()ident(enum)operator(\)) - reserved(end) - reserved(end) - - comment(# Copy internal hash.) - reserved(def) method(initialize_copy)operator(()ident(orig)operator(\)) - instance_variable(@hash) operator(=) ident(orig)operator(.)ident(instance_eval)operator({)instance_variable(@hash)operator(})operator(.)ident(dup) - reserved(end) - - comment(# Returns the number of elements.) - reserved(def) method(size) - instance_variable(@hash)operator(.)ident(size) - reserved(end) - reserved(alias) ident(length) ident(size) - - comment(# Returns true if the set contains no elements.) - reserved(def) method(empty?) - instance_variable(@hash)operator(.)ident(empty?) - reserved(end) - - comment(# Removes all elements and returns self.) - reserved(def) method(clear) - instance_variable(@hash)operator(.)ident(clear) - pre_constant(self) - reserved(end) - - comment(# Replaces the contents of the set with the contents of the given) - comment(# enumerable object and returns self.) - reserved(def) method(replace)operator(()ident(enum)operator(\)) - reserved(if) ident(enum)operator(.)ident(class) operator(==) pre_constant(self)operator(.)ident(class) - instance_variable(@hash)operator(.)ident(replace)operator(()ident(enum)operator(.)ident(instance_eval) operator({) instance_variable(@hash) operator(})operator(\)) - reserved(else) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(clear) - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - pre_constant(self) - reserved(end) - - comment(# Converts the set to an array. The order of elements is uncertain.) - reserved(def) method(to_a) - instance_variable(@hash)operator(.)ident(keys) - reserved(end) - - reserved(def) method(flatten_merge)operator(()ident(set)operator(,) ident(seen) operator(=) constant(Set)operator(.)ident(new)operator(\)) - ident(set)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) - reserved(if) ident(e)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) - reserved(if) ident(seen)operator(.)ident(include?)operator(()ident(e_id) operator(=) ident(e)operator(.)ident(object_id)operator(\)) - ident(raise) constant(ArgumentError)operator(,) string - reserved(end) - - ident(seen)operator(.)ident(add)operator(()ident(e_id)operator(\)) - ident(flatten_merge)operator(()ident(e)operator(,) ident(seen)operator(\)) - ident(seen)operator(.)ident(delete)operator(()ident(e_id)operator(\)) - reserved(else) - ident(add)operator(()ident(e)operator(\)) - reserved(end) - operator(}) - - pre_constant(self) - reserved(end) - ident(protected) symbol(:flatten_merge) - - comment(# Returns a new set that is a copy of the set, flattening each) - comment(# containing set recursively.) - reserved(def) method(flatten) - pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(.)ident(flatten_merge)operator(()pre_constant(self)operator(\)) - reserved(end) - - comment(# Equivalent to Set#flatten, but replaces the receiver with the) - comment(# result in place. Returns nil if no modifications were made.) - reserved(def) method(flatten!) - reserved(if) ident(detect) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) operator(}) - ident(replace)operator(()ident(flatten)operator(()operator(\))operator(\)) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - comment(# Returns true if the set contains the given object.) - reserved(def) method(include?)operator(()ident(o)operator(\)) - instance_variable(@hash)operator(.)ident(include?)operator(()ident(o)operator(\)) - reserved(end) - reserved(alias) ident(member?) ident(include?) - - comment(# Returns true if the set is a superset of the given set.) - reserved(def) method(superset?)operator(()ident(set)operator(\)) - ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - reserved(return) pre_constant(false) reserved(if) ident(size) operator(<) ident(set)operator(.)ident(size) - ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(include?)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - comment(# Returns true if the set is a proper superset of the given set.) - reserved(def) method(proper_superset?)operator(()ident(set)operator(\)) - ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - reserved(return) pre_constant(false) reserved(if) ident(size) operator(<=) ident(set)operator(.)ident(size) - ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(include?)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - comment(# Returns true if the set is a subset of the given set.) - reserved(def) method(subset?)operator(()ident(set)operator(\)) - ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - reserved(return) pre_constant(false) reserved(if) ident(set)operator(.)ident(size) operator(<) ident(size) - ident(all?) operator({) operator(|)ident(o)operator(|) ident(set)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - comment(# Returns true if the set is a proper subset of the given set.) - reserved(def) method(proper_subset?)operator(()ident(set)operator(\)) - ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - reserved(return) pre_constant(false) reserved(if) ident(set)operator(.)ident(size) operator(<=) ident(size) - ident(all?) operator({) operator(|)ident(o)operator(|) ident(set)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - comment(# Calls the given block once for each element in the set, passing) - comment(# the element as parameter.) - reserved(def) method(each) - instance_variable(@hash)operator(.)ident(each_key) operator({) operator(|)ident(o)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) - pre_constant(self) - reserved(end) - - comment(# Adds the given object to the set and returns self. Use +merge+ to) - comment(# add several elements at once.) - reserved(def) method(add)operator(()ident(o)operator(\)) - instance_variable(@hash)operator([)ident(o)operator(]) operator(=) pre_constant(true) - pre_constant(self) - reserved(end) - reserved(alias) operator(<<) ident(add) - - comment(# Adds the given object to the set and returns self. If the) - comment(# object is already in the set, returns nil.) - reserved(def) method(add?)operator(()ident(o)operator(\)) - reserved(if) ident(include?)operator(()ident(o)operator(\)) - pre_constant(nil) - reserved(else) - ident(add)operator(()ident(o)operator(\)) - reserved(end) - reserved(end) - - comment(# Deletes the given object from the set and returns self. Use +subtract+ to) - comment(# delete several items at once.) - reserved(def) method(delete)operator(()ident(o)operator(\)) - instance_variable(@hash)operator(.)ident(delete)operator(()ident(o)operator(\)) - pre_constant(self) - reserved(end) - - comment(# Deletes the given object from the set and returns self. If the) - comment(# object is not in the set, returns nil.) - reserved(def) method(delete?)operator(()ident(o)operator(\)) - reserved(if) ident(include?)operator(()ident(o)operator(\)) - ident(delete)operator(()ident(o)operator(\)) - reserved(else) - pre_constant(nil) - reserved(end) - reserved(end) - - comment(# Deletes every element of the set for which block evaluates to) - comment(# true, and returns self.) - reserved(def) method(delete_if) - instance_variable(@hash)operator(.)ident(delete_if) operator({) operator(|)ident(o)operator(,)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) - pre_constant(self) - reserved(end) - - comment(# Do collect(\) destructively.) - reserved(def) method(collect!) - ident(set) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new) - ident(each) operator({) operator(|)ident(o)operator(|) ident(set) operator(<<) reserved(yield)operator(()ident(o)operator(\)) operator(}) - ident(replace)operator(()ident(set)operator(\)) - reserved(end) - reserved(alias) ident(map!) ident(collect!) - - comment(# Equivalent to Set#delete_if, but returns nil if no changes were) - comment(# made.) - reserved(def) method(reject!) - ident(n) operator(=) ident(size) - ident(delete_if) operator({) operator(|)ident(o)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) - ident(size) operator(==) ident(n) operator(?) pre_constant(nil) operator(:) pre_constant(self) - reserved(end) - - comment(# Merges the elements of the given enumerable object to the set and) - comment(# returns self.) - reserved(def) method(merge)operator(()ident(enum)operator(\)) - reserved(if) ident(enum)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) - instance_variable(@hash)operator(.)ident(update)operator(()ident(enum)operator(.)ident(instance_eval) operator({) instance_variable(@hash) operator(})operator(\)) - reserved(else) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - pre_constant(self) - reserved(end) - - comment(# Deletes every element that appears in the given enumerable object) - comment(# and returns self.) - reserved(def) method(subtract)operator(()ident(enum)operator(\)) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(delete)operator(()ident(o)operator(\)) operator(}) - pre_constant(self) - reserved(end) - - comment(# Returns a new set built by merging the set and the elements of the) - comment(# given enumerable object.) - reserved(def) method(|)operator(()ident(enum)operator(\)) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(dup)operator(.)ident(merge)operator(()ident(enum)operator(\)) - reserved(end) - reserved(alias) operator(+) operator(|) comment(##) - reserved(alias) ident(union) operator(|) comment(##) - - comment(# Returns a new set built by duplicating the set, removing every) - comment(# element that appears in the given enumerable object.) - reserved(def) method(-)operator(()ident(enum)operator(\)) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(dup)operator(.)ident(subtract)operator(()ident(enum)operator(\)) - reserved(end) - reserved(alias) ident(difference) operator(-) comment(##) - - comment(# Returns a new array containing elements common to the set and the) - comment(# given enumerable object.) - reserved(def) method(&)operator(()ident(enum)operator(\)) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(n) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new) - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(n)operator(.)ident(add)operator(()ident(o)operator(\)) reserved(if) ident(include?)operator(()ident(o)operator(\)) operator(}) - ident(n) - reserved(end) - reserved(alias) ident(intersection) operator(&) comment(##) - - comment(# Returns a new array containing elements exclusive between the set) - comment(# and the given enumerable object. (set ^ enum\) is equivalent to) - comment(# ((set | enum\) - (set & enum\)\).) - reserved(def) method(^)operator(()ident(enum)operator(\)) - ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string - ident(n) operator(=) ident(dup) - ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) reserved(if) ident(n)operator(.)ident(include?)operator(()ident(o)operator(\)) reserved(then) ident(n)operator(.)ident(delete)operator(()ident(o)operator(\)) reserved(else) ident(n)operator(.)ident(add)operator(()ident(o)operator(\)) reserved(end) operator(}) - ident(n) - reserved(end) - - comment(# Returns true if two sets are equal. The equality of each couple) - comment(# of elements is defined according to Object#eql?.) - reserved(def) method(==)operator(()ident(set)operator(\)) - ident(equal?)operator(()ident(set)operator(\)) reserved(and) reserved(return) pre_constant(true) - - ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) operator(&&) ident(size) operator(==) ident(set)operator(.)ident(size) reserved(or) reserved(return) pre_constant(false) - - ident(hash) operator(=) instance_variable(@hash)operator(.)ident(dup) - ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(hash)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) - reserved(end) - - reserved(def) method(hash) comment(# :nodoc:) - instance_variable(@hash)operator(.)ident(hash) - reserved(end) - - reserved(def) method(eql?)operator(()ident(o)operator(\)) comment(# :nodoc:) - reserved(return) pre_constant(false) reserved(unless) ident(o)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) - instance_variable(@hash)operator(.)ident(eql?)operator(()ident(o)operator(.)ident(instance_eval)operator({)instance_variable(@hash)operator(})operator(\)) - reserved(end) - - comment(# Classifies the set by the return value of the given block and) - comment(# returns a hash of {value => set of elements} pairs. The block is) - comment(# called once for each element of the set, passing the element as) - comment(# parameter.) - comment(#) - comment(# e.g.:) - comment(#) - comment(# require 'set') - comment(# files = Set.new(Dir.glob("*.rb"\)\)) - comment(# hash = files.classify { |f| File.mtime(f\).year }) - comment(# p hash # => {2000=>#,) - comment(# # 2001=>#,) - comment(# # 2002=>#}) - reserved(def) method(classify) comment(# :yields: o) - ident(h) operator(=) operator({)operator(}) - - ident(each) operator({) operator(|)ident(i)operator(|) - ident(x) operator(=) reserved(yield)operator(()ident(i)operator(\)) - operator(()ident(h)operator([)ident(x)operator(]) operator(||=) pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(\))operator(.)ident(add)operator(()ident(i)operator(\)) - operator(}) - - ident(h) - reserved(end) - - comment(# Divides the set into a set of subsets according to the commonality) - comment(# defined by the given block.) - comment(#) - comment(# If the arity of the block is 2, elements o1 and o2 are in common) - comment(# if block.call(o1, o2\) is true. Otherwise, elements o1 and o2 are) - comment(# in common if block.call(o1\) == block.call(o2\).) - comment(#) - comment(# e.g.:) - comment(#) - comment(# require 'set') - comment(# numbers = Set[1, 3, 4, 6, 9, 10, 11]) - comment(# set = numbers.divide { |i,j| (i - j\).abs == 1 }) - comment(# p set # => #,) - comment(# # #,) - comment(# # #,) - comment(# # #}>) - reserved(def) method(divide)operator(()operator(&)ident(func)operator(\)) - reserved(if) ident(func)operator(.)ident(arity) operator(==) integer(2) - ident(require) string - - reserved(class) operator(<<) class(dig) operator(=) operator({)operator(}) comment(# :nodoc:) - ident(include) constant(TSort) - - reserved(alias) ident(tsort_each_node) ident(each_key) - reserved(def) method(tsort_each_child)operator(()ident(node)operator(,) operator(&)ident(block)operator(\)) - ident(fetch)operator(()ident(node)operator(\))operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - reserved(end) - - ident(each) operator({) operator(|)ident(u)operator(|) - ident(dig)operator([)ident(u)operator(]) operator(=) ident(a) operator(=) operator([)operator(]) - ident(each)operator({) operator(|)ident(v)operator(|) ident(func)operator(.)ident(call)operator(()ident(u)operator(,) ident(v)operator(\)) reserved(and) ident(a) operator(<<) ident(v) operator(}) - operator(}) - - ident(set) operator(=) constant(Set)operator(.)ident(new)operator(()operator(\)) - ident(dig)operator(.)ident(each_strongly_connected_component) operator({) operator(|)ident(css)operator(|) - ident(set)operator(.)ident(add)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()ident(css)operator(\))operator(\)) - operator(}) - ident(set) - reserved(else) - constant(Set)operator(.)ident(new)operator(()ident(classify)operator(()operator(&)ident(func)operator(\))operator(.)ident(values)operator(\)) - reserved(end) - reserved(end) - - constant(InspectKey) operator(=) symbol(:__inspect_key__) comment(# :nodoc:) - - comment(# Returns a string containing a human-readable representation of the) - comment(# set. ("#"\)) - reserved(def) method(inspect) - ident(ids) operator(=) operator(()constant(Thread)operator(.)ident(current)operator([)constant(InspectKey)operator(]) operator(||=) operator([)operator(])operator(\)) - - reserved(if) ident(ids)operator(.)ident(include?)operator(()ident(object_id)operator(\)) - reserved(return) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\)) - reserved(end) - - reserved(begin) - ident(ids) operator(<<) ident(object_id) - reserved(return) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(,) ident(to_a)operator(.)ident(inspect)operator([)integer(1)operator(..)integer(-2)operator(])operator(\)) - reserved(ensure) - ident(ids)operator(.)ident(pop) - reserved(end) - reserved(end) - - reserved(def) method(pretty_print)operator(()ident(pp)operator(\)) comment(# :nodoc:) - ident(pp)operator(.)ident(text) ident(sprintf)operator(()stringoperator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\)) - ident(pp)operator(.)ident(nest)operator(()integer(1)operator(\)) operator({) - ident(pp)operator(.)ident(seplist)operator(()pre_constant(self)operator(\)) operator({) operator(|)ident(o)operator(|) - ident(pp)operator(.)ident(pp) ident(o) - operator(}) - operator(}) - ident(pp)operator(.)ident(text) string)delimiter(")> - reserved(end) - - reserved(def) method(pretty_print_cycle)operator(()ident(pp)operator(\)) comment(# :nodoc:) - ident(pp)operator(.)ident(text) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(,) ident(empty?) operator(?) string operator(:) stringoperator(\)) - reserved(end) -reserved(end) - -comment(# SortedSet implements a set which elements are sorted in order. See Set.) -reserved(class) class(SortedSet) operator(<) constant(Set) - class_variable(@@setup) operator(=) pre_constant(false) - - reserved(class) operator(<<) class(self) - reserved(def) method([])operator(()operator(*)ident(ary)operator(\)) comment(# :nodoc:) - ident(new)operator(()ident(ary)operator(\)) - reserved(end) - - reserved(def) method(setup) comment(# :nodoc:) - class_variable(@@setup) reserved(and) reserved(return) - - reserved(begin) - ident(require) string - - ident(module_eval) string - reserved(rescue) constant(LoadError) - ident(module_eval) string - reserved(end) - - class_variable(@@setup) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(def) method(initialize)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) - constant(SortedSet)operator(.)ident(setup) - ident(initialize)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) - -reserved(module) class(Enumerable) - comment(# Makes a set from the enumerable object with given arguments.) - reserved(def) method(to_set)operator(()ident(klass) operator(=) constant(Set)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - ident(klass)operator(.)ident(new)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) - reserved(end) -reserved(end) - -comment(# =begin) -comment(# == RestricedSet class) -comment(# RestricedSet implements a set with restrictions defined by a given) -comment(# block.) -comment(#) -comment(# === Super class) -comment(# Set) -comment(#) -comment(# === Class Methods) -comment(# --- RestricedSet::new(enum = nil\) { |o| ... }) -comment(# --- RestricedSet::new(enum = nil\) { |rset, o| ... }) -comment(# Creates a new restricted set containing the elements of the given) -comment(# enumerable object. Restrictions are defined by the given block.) -comment(#) -comment(# If the block's arity is 2, it is called with the RestrictedSet) -comment(# itself and an object to see if the object is allowed to be put in) -comment(# the set.) -comment(#) -comment(# Otherwise, the block is called with an object to see if the object) -comment(# is allowed to be put in the set.) -comment(#) -comment(# === Instance Methods) -comment(# --- restriction_proc) -comment(# Returns the restriction procedure of the set.) -comment(#) -comment(# =end) -comment(#) -comment(# class RestricedSet < Set) -comment(# def initialize(*args, &block\)) -comment(# @proc = block or raise ArgumentError, "missing a block") -comment(#) -comment(# if @proc.arity == 2) -comment(# instance_eval %{) -comment(# def add(o\)) -comment(# @hash[o] = true if @proc.call(self, o\)) -comment(# self) -comment(# end) -comment(# alias << add) -comment(#) -comment(# def add?(o\)) -comment(# if include?(o\) || !@proc.call(self, o\)) -comment(# nil) -comment(# else) -comment(# @hash[o] = true) -comment(# self) -comment(# end) -comment(# end) -comment(#) -comment(# def replace(enum\)) -comment(# enum.is_a?(Enumerable\) or raise ArgumentError, "value must be enumerable") -comment(# clear) -comment(# enum.each { |o| add(o\) }) -comment(#) -comment(# self) -comment(# end) -comment(#) -comment(# def merge(enum\)) -comment(# enum.is_a?(Enumerable\) or raise ArgumentError, "value must be enumerable") -comment(# enum.each { |o| add(o\) }) -comment(#) -comment(# self) -comment(# end) -comment(# }) -comment(# else) -comment(# instance_eval %{) -comment(# def add(o\)) -comment(# if @proc.call(o\)) -comment(# @hash[o] = true) -comment(# end) -comment(# self) -comment(# end) -comment(# alias << add) -comment(#) -comment(# def add?(o\)) -comment(# if include?(o\) || !@proc.call(o\)) -comment(# nil) -comment(# else) -comment(# @hash[o] = true) -comment(# self) -comment(# end) -comment(# end) -comment(# }) -comment(# end) -comment(#) -comment(# super(*args\)) -comment(# end) -comment(#) -comment(# def restriction_proc) -comment(# @proc) -comment(# end) -comment(# end) - -reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)integer(+4) -reserved(end) - -comment(# = rweb - CGI Support Library) -comment(#) -comment(# Author:: Johannes Barre (mailto:rweb@igels.net\)) -comment(# Copyright:: Copyright (c\) 2003, 04 by Johannes Barre) -comment(# License:: GNU Lesser General Public License (COPYING, http://www.gnu.org/copyleft/lesser.html\)) -comment(# Version:: 0.1.0) -comment(# CVS-ID:: $Id: rweb.rb 6 2004-06-16 15:56:26Z igel $) -comment(#) -comment(# == What is Rweb?) -comment(# Rweb is a replacement for the cgi class included in the ruby distribution.) -comment(#) -comment(# == How to use) -comment(#) -comment(# === Basics) -comment(#) -comment(# This class is made to be as easy as possible to use. An example:) -comment(#) -comment(# require "rweb") -comment(#) -comment(# web = Rweb.new) -comment(# web.out do) -comment(# web.puts "Hello world!") -comment(# end) -comment(#) -comment(# The visitor will get a simple "Hello World!" in his browser. Please notice,) -comment(# that won't set html-tags for you, so you should better do something like this:) -comment(#) -comment(# require "rweb") -comment(#) -comment(# web = Rweb.new) -comment(# web.out do) -comment(# web.puts "Hello world!") -comment(# end) -comment(#) -comment(# === Set headers) -comment(# Of course, it's also possible to tell the browser, that the content of this) -comment(# page is plain text instead of html code:) -comment(#) -comment(# require "rweb") -comment(#) -comment(# web = Rweb.new) -comment(# web.out do) -comment(# web.header("content-type: text/plain"\)) -comment(# web.puts "Hello plain world!") -comment(# end) -comment(#) -comment(# Please remember, headers can't be set after the page content has been send.) -comment(# You have to set all nessessary headers before the first puts oder print. It's) -comment(# possible to cache the content until everything is complete. Doing it this) -comment(# way, you can set headers everywhere.) -comment(#) -comment(# If you set a header twice, the second header will replace the first one. The) -comment(# header name is not casesensitive, it will allways converted in to the) -comment(# capitalised form suggested by the w3c (http://w3.org\)) -comment(#) -comment(# === Set cookies) -comment(# Setting cookies is quite easy:) -comment(# include 'rweb') -comment(#) -comment(# web = Rweb.new) -comment(# Cookie.new("Visits", web.cookies['visits'].to_i +1\)) -comment(# web.out do) -comment(# web.puts "Welcome back! You visited this page #{web.cookies['visits'].to_i +1} times") -comment(# end) -comment(#) -comment(# See the class Cookie for more details.) -comment(#) -comment(# === Get form and cookie values) -comment(# There are four ways to submit data from the browser to the server and your) -comment(# ruby script: via GET, POST, cookies and file upload. Rweb doesn't support) -comment(# file upload by now.) -comment(#) -comment(# include 'rweb') -comment(#) -comment(# web = Rweb.new) -comment(# web.out do) -comment(# web.print "action: #{web.get['action']} ") -comment(# web.puts "The value of the cookie 'visits' is #{web.cookies['visits']}") -comment(# web.puts "The post parameter 'test['x']' is #{web.post['test']['x']}") -comment(# end) - -constant(RWEB_VERSION) operator(=) string -constant(RWEB) operator(=) stringdelimiter(")> - -comment(#require 'rwebcookie' -> edit by bunny :-\)) - -reserved(class) class(Rweb) - comment(# All parameter submitted via the GET method are available in attribute) - comment(# get. This is Hash, where every parameter is available as a key-value) - comment(# pair.) - comment(#) - comment(# If your input tag has a name like this one, it's value will be available) - comment(# as web.get["fieldname"]) - comment(# ) - comment(# You can submit values as a Hash) - comment(# ) - comment(# ) - comment(# will be available as) - comment(# web.get["text"]["index"]) - comment(# web.get["text"]["index2"]) - comment(# Integers are also possible) - comment(# ) - comment(# ) - comment(# ) - comment(# will be available as) - comment(# web.get["int"][0] # First Field) - comment(# web.get["int"][1] # Second one) - comment(# Please notice, this doesn'd work like you might expect:) - comment(# ) - comment(# It will not be available as web.get["text"]["index"] but) - comment(# web.get["text[index]"]) - ident(attr_reader) symbol(:get) - - comment(# All parameters submitted via POST are available in the attribute post. It) - comment(# works like the get attribute.) - comment(# ) - comment(# will be available as) - comment(# web.post["text"][0]) - ident(attr_reader) symbol(:post) - - comment(# All cookies submitted by the browser are available in cookies. This is a) - comment(# Hash, where every cookie is a key-value pair.) - ident(attr_reader) symbol(:cookies) - - comment(# The name of the browser identification is submitted as USER_AGENT and) - comment(# available in this attribute.) - ident(attr_reader) symbol(:user_agent) - - comment(# The IP address of the client.) - ident(attr_reader) symbol(:remote_addr) - - comment(# Creates a new Rweb object. This should only done once. You can set various) - comment(# options via the settings hash.) - comment(#) - comment(# "cache" => true: Everything you script send to the client will be cached) - comment(# until the end of the out block or until flush is called. This way, you) - comment(# can modify headers and cookies even after printing something to the client.) - comment(#) - comment(# "safe" => level: Changes the $SAFE attribute. By default, $SAFE will be set) - comment(# to 1. If $SAFE is already higher than this value, it won't be changed.) - comment(#) - comment(# "silend" => true: Normaly, Rweb adds automaticly a header like this) - comment(# "X-Powered-By: Rweb/x.x.x (Ruby/y.y.y\)". With the silend option you can) - comment(# suppress this.) - reserved(def) method(initialize) operator(()ident(settings) operator(=) operator({)operator(})operator(\)) - comment(# {{{) - instance_variable(@header) operator(=) operator({)operator(}) - instance_variable(@cookies) operator(=) operator({)operator(}) - instance_variable(@get) operator(=) operator({)operator(}) - instance_variable(@post) operator(=) operator({)operator(}) - - comment(# Internal attributes) - instance_variable(@status) operator(=) pre_constant(nil) - instance_variable(@reasonPhrase) operator(=) pre_constant(nil) - instance_variable(@setcookies) operator(=) operator([)operator(]) - instance_variable(@output_started) operator(=) pre_constant(false)operator(;) - instance_variable(@output_allowed) operator(=) pre_constant(false)operator(;) - - instance_variable(@mod_ruby) operator(=) pre_constant(false) - instance_variable(@env) operator(=) constant(ENV)operator(.)ident(to_hash) - - reserved(if) reserved(defined?)operator(()constant(MOD_RUBY)operator(\)) - instance_variable(@output_method) operator(=) string - instance_variable(@mod_ruby) operator(=) pre_constant(true) - reserved(elsif) instance_variable(@env)operator([)stringoperator(]) operator(=)operator(~) regexp - instance_variable(@output_method) operator(=) string - reserved(else) - instance_variable(@output_method) operator(=) string - reserved(end) - - reserved(unless) ident(settings)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) - ident(raise) constant(TypeError)operator(,) string - reserved(end) - instance_variable(@settings) operator(=) ident(settings) - - reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@settings)operator([)stringoperator(]) operator(=) integer(1) - reserved(end) - - reserved(if) global_variable($SAFE) operator(<) instance_variable(@settings)operator([)stringoperator(]) - global_variable($SAFE) operator(=) instance_variable(@settings)operator([)stringoperator(]) - reserved(end) - - reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@settings)operator([)stringoperator(]) operator(=) pre_constant(false) - reserved(end) - - comment(# mod_ruby sets no QUERY_STRING variable, if no GET-Parameters are given) - reserved(unless) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) - instance_variable(@env)operator([)stringoperator(]) operator(=) string - reserved(end) - - comment(# Now we split the QUERY_STRING by the seperators & and ; or, if) - comment(# specified, settings['get seperator']) - reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(get_args) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()regexpoperator(\)) - reserved(else) - ident(get_args) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()instance_variable(@settings)operator([)stringoperator(])operator(\)) - reserved(end) - - ident(get_args)operator(.)ident(each) reserved(do) operator(|) ident(arg) operator(|) - ident(arg_key)operator(,) ident(arg_val) operator(=) ident(arg)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - ident(arg_key) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_key)operator(\)) - ident(arg_val) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_val)operator(\)) - - comment(# Parse names like name[0], name['text'] or name[]) - ident(pattern) operator(=) regexp - ident(keys) operator(=) operator([)operator(]) - reserved(while) ident(match) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(arg_key)operator(\)) - ident(arg_key) operator(=) ident(match)operator([)integer(1)operator(]) - ident(keys) operator(=) operator([)ident(match)operator([)integer(2)operator(])operator(]) operator(+) ident(keys) - reserved(end) - ident(keys) operator(=) operator([)ident(arg_key)operator(]) operator(+) ident(keys) - - ident(akt) operator(=) instance_variable(@get) - ident(last) operator(=) pre_constant(nil) - ident(lastkey) operator(=) pre_constant(nil) - ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - reserved(if) ident(key) operator(==) string - comment(# No key specified (like in "test[]"\), so we use the) - comment(# lowerst unused Integer as key) - ident(key) operator(=) integer(0) - reserved(while) ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - ident(key) operator(+=) integer(1) - reserved(end) - reserved(elsif) regexp operator(=)operator(~) ident(key) - comment(# If the index is numerical convert it to an Integer) - ident(key) operator(=) ident(key)operator(.)ident(to_i) - reserved(elsif) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string operator(||) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string - ident(key) operator(=) ident(key)operator([)integer(1)operator(,) ident(key)operator(.)ident(length)operator(()operator(\)) integer(-2)operator(]) - reserved(end) - reserved(if) operator(!)ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) operator(||) operator(!)ident(akt)operator([)ident(key)operator(])operator(.)ident(class) operator(==) constant(Hash) - comment(# create an empty Hash if there isn't already one) - ident(akt)operator([)ident(key)operator(]) operator(=) operator({)operator(}) - reserved(end) - ident(last) operator(=) ident(akt) - ident(lastkey) operator(=) ident(key) - ident(akt) operator(=) ident(akt)operator([)ident(key)operator(]) - reserved(end) - ident(last)operator([)ident(lastkey)operator(]) operator(=) ident(arg_val) - reserved(end) - - reserved(if) instance_variable(@env)operator([)stringoperator(]) operator(==) string - reserved(if) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) instance_variable(@env)operator([)stringoperator(]) operator(==) string operator(&&) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(post_args) operator(=) global_variable($stdin)operator(.)ident(read)operator(()instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_i)operator(\))operator(.)ident(split)operator(()regexpoperator(\)) - reserved(else) - ident(post_args) operator(=) global_variable($stdin)operator(.)ident(read)operator(()instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_i)operator(\))operator(.)ident(split)operator(()instance_variable(@settings)operator([)stringoperator(])operator(\)) - reserved(end) - ident(post_args)operator(.)ident(each) reserved(do) operator(|) ident(arg) operator(|) - ident(arg_key)operator(,) ident(arg_val) operator(=) ident(arg)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - ident(arg_key) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_key)operator(\)) - ident(arg_val) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_val)operator(\)) - - comment(# Parse names like name[0], name['text'] or name[]) - ident(pattern) operator(=) regexp - ident(keys) operator(=) operator([)operator(]) - reserved(while) ident(match) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(arg_key)operator(\)) - ident(arg_key) operator(=) ident(match)operator([)integer(1)operator(]) - ident(keys) operator(=) operator([)ident(match)operator([)integer(2)operator(])operator(]) operator(+) ident(keys) - reserved(end) - ident(keys) operator(=) operator([)ident(arg_key)operator(]) operator(+) ident(keys) - - ident(akt) operator(=) instance_variable(@post) - ident(last) operator(=) pre_constant(nil) - ident(lastkey) operator(=) pre_constant(nil) - ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) - reserved(if) ident(key) operator(==) string - comment(# No key specified (like in "test[]"\), so we use) - comment(# the lowerst unused Integer as key) - ident(key) operator(=) integer(0) - reserved(while) ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - ident(key) operator(+=) integer(1) - reserved(end) - reserved(elsif) regexp operator(=)operator(~) ident(key) - comment(# If the index is numerical convert it to an Integer) - ident(key) operator(=) ident(key)operator(.)ident(to_i) - reserved(elsif) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string operator(||) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string - ident(key) operator(=) ident(key)operator([)integer(1)operator(,) ident(key)operator(.)ident(length)operator(()operator(\)) integer(-2)operator(]) - reserved(end) - reserved(if) operator(!)ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) operator(||) operator(!)ident(akt)operator([)ident(key)operator(])operator(.)ident(class) operator(==) constant(Hash) - comment(# create an empty Hash if there isn't already one) - ident(akt)operator([)ident(key)operator(]) operator(=) operator({)operator(}) - reserved(end) - ident(last) operator(=) ident(akt) - ident(lastkey) operator(=) ident(key) - ident(akt) operator(=) ident(akt)operator([)ident(key)operator(]) - reserved(end) - ident(last)operator([)ident(lastkey)operator(]) operator(=) ident(arg_val) - reserved(end) - reserved(else) - comment(# Maybe we should print a warning here?) - global_variable($stderr)operator(.)ident(print)operator(()stringoperator(\)) - reserved(end) - reserved(end) - - reserved(if) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) - ident(cookie) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()regexpoperator(\)) - ident(cookie)operator(.)ident(each) reserved(do) operator(|) ident(c) operator(|) - ident(cookie_key)operator(,) ident(cookie_val) operator(=) ident(c)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - - instance_variable(@cookies) operator([)constant(Rweb)operator(::)ident(unescape)operator(()ident(cookie_key)operator(\))operator(]) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(cookie_val)operator(\)) - reserved(end) - reserved(end) - - reserved(if) reserved(defined?)operator(()instance_variable(@env)operator([)stringoperator(])operator(\)) - instance_variable(@user_agent) operator(=) instance_variable(@env)operator([)stringoperator(]) - reserved(else) - instance_variable(@user_agent) operator(=) pre_constant(nil)operator(;) - reserved(end) - - reserved(if) reserved(defined?)operator(()instance_variable(@env)operator([)stringoperator(])operator(\)) - instance_variable(@remote_addr) operator(=) instance_variable(@env)operator([)stringoperator(]) - reserved(else) - instance_variable(@remote_addr) operator(=) pre_constant(nil) - reserved(end) - comment(# }}}) - reserved(end) - - comment(# Prints a String to the client. If caching is enabled, the String will) - comment(# buffered until the end of the out block ends.) - reserved(def) method(print)operator(()ident(str) operator(=) stringoperator(\)) - comment(# {{{) - reserved(unless) instance_variable(@output_allowed) - ident(raise) string - reserved(end) - - reserved(if) instance_variable(@settings)operator([)stringoperator(]) - instance_variable(@buffer) operator(+=) operator([)ident(str)operator(.)ident(to_s)operator(]) - reserved(else) - reserved(unless) instance_variable(@output_started) - ident(sendHeaders) - reserved(end) - global_variable($stdout)operator(.)ident(print)operator(()ident(str)operator(\)) - reserved(end) - pre_constant(nil) - comment(# }}}) - reserved(end) - - comment(# Prints a String to the client and adds a line break at the end. Please) - comment(# remember, that a line break is not visible in HTML, use the
HTML-Tag) - comment(# for this. If caching is enabled, the String will buffered until the end) - comment(# of the out block ends.) - reserved(def) method(puts)operator(()ident(str) operator(=) stringoperator(\)) - comment(# {{{) - pre_constant(self)operator(.)ident(print)operator(()ident(str) operator(+) stringoperator(\)) - comment(# }}}) - reserved(end) - - comment(# Alias to print.) - reserved(def) method(write)operator(()ident(str) operator(=) stringoperator(\)) - comment(# {{{) - pre_constant(self)operator(.)ident(print)operator(()ident(str)operator(\)) - comment(# }}}) - reserved(end) - - comment(# If caching is enabled, all cached data are send to the cliend and the) - comment(# cache emptied.) - reserved(def) method(flush) - comment(# {{{) - reserved(unless) instance_variable(@output_allowed) - ident(raise) string - reserved(end) - ident(buffer) operator(=) instance_variable(@buffer)operator(.)ident(join) - - reserved(unless) instance_variable(@output_started) - ident(sendHeaders) - reserved(end) - global_variable($stdout)operator(.)ident(print)operator(()ident(buffer)operator(\)) - - instance_variable(@buffer) operator(=) operator([)operator(]) - comment(# }}}) - reserved(end) - - comment(# Sends one or more header to the client. All headers are cached just) - comment(# before body data are send to the client. If the same header are set) - comment(# twice, only the last value is send.) - comment(#) - comment(# Example:) - comment(# web.header("Last-Modified: Mon, 16 Feb 2004 20:15:41 GMT"\)) - comment(# web.header("Location: http://www.ruby-lang.org"\)) - comment(#) - comment(# You can specify more than one header at the time by doing something like) - comment(# this:) - comment(# web.header("Content-Type: text/plain\\nContent-Length: 383"\)) - comment(# or) - comment(# web.header(["Content-Type: text/plain", "Content-Length: 383"]\)) - reserved(def) method(header)operator(()ident(str)operator(\)) - comment(# {{{) - reserved(if) instance_variable(@output_started) - ident(raise) string - reserved(end) - reserved(unless) instance_variable(@output_allowed) - ident(raise) string - reserved(end) - reserved(if) ident(str)operator(.)ident(is_a?)constant(Array) - ident(str)operator(.)ident(each) reserved(do) operator(|) ident(value) operator(|) - pre_constant(self)operator(.)ident(header)operator(()ident(value)operator(\)) - reserved(end) - - reserved(elsif) ident(str)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(length) operator(>) integer(1) - ident(str)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|) ident(value) operator(|) - pre_constant(self)operator(.)ident(header)operator(()ident(value)operator(\)) - reserved(end) - - reserved(elsif) ident(str)operator(.)ident(is_a?) constant(String) - ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - - reserved(if) operator(()ident(str) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) - ident(pattern) operator(=) regexp - - ident(result) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(str)operator(\)) - pre_constant(self)operator(.)ident(setstatus)operator(()ident(result)operator([)integer(0)operator(])operator(,) ident(result)operator([)integer(1)operator(])operator(\)) - reserved(elsif) operator(()ident(str) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) - ident(pattern) operator(=) regexp - - ident(result) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(str)operator(\)) - pre_constant(self)operator(.)ident(setstatus)operator(()ident(result)operator([)integer(0)operator(])operator(,) ident(result)operator([)integer(1)operator(])operator(\)) - reserved(else) - ident(a) operator(=) ident(str)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - - instance_variable(@header)operator([)ident(a)operator([)integer(0)operator(])operator(.)ident(downcase)operator(]) operator(=) ident(a)operator([)integer(1)operator(]) - reserved(end) - reserved(end) - comment(# }}}) - reserved(end) - - comment(# Changes the status of this page. There are several codes like "200 OK",) - comment(# "302 Found", "404 Not Found" or "500 Internal Server Error". A list of) - comment(# all codes is available at) - comment(# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10) - comment(#) - comment(# You can just send the code number, the reason phrase will be added) - comment(# automaticly with the recommendations from the w3c if not specified. If) - comment(# you set the status twice or more, only the last status will be send.) - comment(# Examples:) - comment(# web.status("401 Unauthorized"\)) - comment(# web.status("410 Sad but true, this lonely page is gone :("\)) - comment(# web.status(206\)) - comment(# web.status("400"\)) - comment(#) - comment(# The default status is "200 OK". If a "Location" header is set, the) - comment(# default status is "302 Found".) - reserved(def) method(status)operator(()ident(str)operator(\)) - comment(# {{{) - reserved(if) instance_variable(@output_started) - ident(raise) string - reserved(end) - reserved(unless) instance_variable(@output_allowed) - ident(raise) string - reserved(end) - reserved(if) ident(str)operator(.)ident(is_a?)constant(Integer) - instance_variable(@status) operator(=) ident(str) - reserved(elsif) ident(str)operator(.)ident(is_a?)constant(String) - ident(p1) operator(=) regexp - ident(p2) operator(=) regexp - ident(p3) operator(=) regexp - - reserved(if) operator(()ident(a) operator(=) ident(p1)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) - reserved(if) operator(()ident(a) operator(=) ident(p2)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) - reserved(if) operator(()ident(a) operator(=) ident(p3)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) - ident(raise) constant(ArgumentError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(end) - reserved(end) - instance_variable(@status) operator(=) ident(a)operator([)integer(1)operator(])operator(.)ident(to_i) - reserved(if) ident(a)operator([)integer(2)operator(]) operator(!=) string - instance_variable(@reasonPhrase) operator(=) ident(a)operator([)integer(2)operator(]) - reserved(else) - instance_variable(@reasonPhrase) operator(=) ident(getReasonPhrase)operator(()instance_variable(@status)operator(\)) - reserved(end) - reserved(else) - ident(raise) constant(ArgumentError)operator(,) stringoperator(,) ident(caller) - reserved(end) - comment(# }}}) - reserved(end) - - comment(# Handles the output of your content and rescues all exceptions. Send all) - comment(# data in the block to this method. For example:) - comment(# web.out do) - comment(# web.header("Content-Type: text/plain"\)) - comment(# web.puts("Hello, plain world!"\)) - comment(# end) - reserved(def) method(out) - comment(# {{{) - instance_variable(@output_allowed) operator(=) pre_constant(true) - instance_variable(@buffer) operator(=) operator([)operator(])operator(;) comment(# We use an array as buffer, because it's more performant :\)) - - reserved(begin) - reserved(yield) - reserved(rescue) constant(Exception) operator(=)operator(>) ident(exception) - global_variable($stderr)operator(.)ident(puts) stringcontent(\): )inlinedelimiter(")> - global_variable($stderr)operator(.)ident(puts) ident(exception)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) - - reserved(unless) instance_variable(@output_started) - pre_constant(self)operator(.)ident(setstatus)operator(()integer(500)operator(\)) - instance_variable(@header) operator(=) operator({)operator(}) - reserved(end) - - reserved(unless) operator(()instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) instance_variable(@settings)operator([)stringoperator(]) operator(==) pre_constant(true)operator(\)) - reserved(unless) instance_variable(@output_started) - pre_constant(self)operator(.)ident(header)operator(()stringoperator(\)) - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - pre_constant(self)operator(.)ident(puts) string500 Internal Server Error)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - reserved(end) - reserved(if) instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(()instance_variable(@header)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) - pre_constant(self)operator(.)ident(puts) stringInternal Server Error)delimiter(")> - pre_constant(self)operator(.)ident(puts) stringThe server encountered an exception and was unable to complete your request.

)delimiter(")> - pre_constant(self)operator(.)ident(puts) stringThe exception has provided the following information:

)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)inlinecontent(: )inlinecontent( on)delimiter(")> - pre_constant(self)operator(.)ident(puts) - pre_constant(self)operator(.)ident(puts) stringoperator(\))delimiter(})>content()delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - pre_constant(self)operator(.)ident(puts) string)delimiter(")> - reserved(else) - pre_constant(self)operator(.)ident(puts) string - pre_constant(self)operator(.)ident(puts) string - pre_constant(self)operator(.)ident(puts) stringcontent(: )inlinedelimiter(")> - pre_constant(self)operator(.)ident(puts) - pre_constant(self)operator(.)ident(puts) ident(exception)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - - reserved(if) instance_variable(@settings)operator([)stringoperator(]) - ident(buffer) operator(=) instance_variable(@buffer)operator(.)ident(join) - - reserved(unless) instance_variable(@output_started) - reserved(unless) instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) - pre_constant(self)operator(.)ident(header)operator(()stringdelimiter(")>operator(\)) - reserved(end) - - ident(sendHeaders) - reserved(end) - global_variable($stdout)operator(.)ident(print)operator(()ident(buffer)operator(\)) - reserved(elsif) operator(!)instance_variable(@output_started) - ident(sendHeaders) - reserved(end) - instance_variable(@output_allowed) operator(=) pre_constant(false)operator(;) - comment(# }}}) - reserved(end) - - comment(# Decodes URL encoded data, %20 for example stands for a space.) - reserved(def) constant(Rweb)operator(.)ident(unescape)operator(()ident(str)operator(\)) - comment(# {{{) - reserved(if) reserved(defined?) ident(str) reserved(and) ident(str)operator(.)ident(is_a?) constant(String) - ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|) ident(s) operator(|) - ident(s)operator([)integer(1)operator(,)integer(2)operator(])operator(.)ident(hex)operator(.)ident(chr) - reserved(end) - reserved(end) - comment(# }}}) - reserved(end) - - ident(protected) - reserved(def) method(sendHeaders) - comment(# {{{) - - constant(Cookie)operator(.)ident(disallow) comment(# no more cookies can be set or modified) - reserved(if) operator(!)operator(()instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) instance_variable(@settings)operator([)stringoperator(]) operator(==) pre_constant(true)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) - reserved(if) instance_variable(@mod_ruby) - ident(header)operator(()stringcontent( (Ruby/)inlinecontent(, )inlinecontent(\))delimiter(")>operator(\))operator(;) - reserved(else) - ident(header)operator(()stringcontent( (Ruby/)inlinecontent(\))delimiter(")>operator(\))operator(;) - reserved(end) - reserved(end) - - reserved(if) instance_variable(@output_method) operator(==) string - reserved(if) operator(()operator(()instance_variable(@status) operator(==) pre_constant(nil) reserved(or) instance_variable(@status) operator(==) integer(200)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\))operator(\)) - ident(header)operator(()stringoperator(\)) - reserved(end) - - reserved(if) instance_variable(@status) operator(!=) pre_constant(nil) - global_variable($stdout)operator(.)ident(print) stringcontent( )inlinechar(\\r)char(\\n)delimiter(")> - reserved(end) - - instance_variable(@header)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(key) operator(=) ident(key) operator(*)integer(1) comment(# "unfreeze" key :\)) - ident(key)operator([)integer(0)operator(]) operator(=) ident(key)operator([)integer(0)operator(,)integer(1)operator(])operator(.)ident(upcase!)operator([)integer(0)operator(]) - - ident(key) operator(=) ident(key)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(char)operator(|) - string operator(+) ident(char)operator([)integer(1)operator(,)integer(1)operator(])operator(.)ident(upcase) - reserved(end) - - global_variable($stdout)operator(.)ident(print) stringcontent(: )inlinechar(\\r)char(\\n)delimiter(")> - reserved(end) - ident(cookies) operator(=) constant(Cookie)operator(.)ident(getHttpHeader) comment(# Get all cookies as an HTTP Header) - reserved(if) ident(cookies) - global_variable($stdout)operator(.)ident(print) ident(cookies) - reserved(end) - - global_variable($stdout)operator(.)ident(print) string - - reserved(elsif) instance_variable(@output_method) operator(==) string - reserved(elsif) instance_variable(@output_method) operator(==) string - ident(r) operator(=) constant(Apache)operator(.)ident(request) - - reserved(if) operator(()operator(()instance_variable(@status) operator(==) pre_constant(nil) reserved(or) instance_variable(@status) operator(==) integer(200)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\))operator(\)) - ident(header)operator(()stringoperator(\)) - reserved(end) - - reserved(if) instance_variable(@status) operator(!=) pre_constant(nil) - ident(r)operator(.)ident(status_line) operator(=) stringcontent( )inlinedelimiter(")> - reserved(end) - - ident(r)operator(.)ident(send_http_header) - instance_variable(@header)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) - ident(key) operator(=) ident(key) operator(*)integer(1) comment(# "unfreeze" key :\)) - - ident(key)operator([)integer(0)operator(]) operator(=) ident(key)operator([)integer(0)operator(,)integer(1)operator(])operator(.)ident(upcase!)operator([)integer(0)operator(]) - ident(key) operator(=) ident(key)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(char)operator(|) - string operator(+) ident(char)operator([)integer(1)operator(,)integer(1)operator(])operator(.)ident(upcase) - reserved(end) - ident(puts) stringcontent(: )inlinedelimiter(")> - comment(#r.headers_out[key] = value) - reserved(end) - reserved(end) - instance_variable(@output_started) operator(=) pre_constant(true) - comment(# }}}) - reserved(end) - - reserved(def) method(getReasonPhrase) operator(()ident(status)operator(\)) - comment(# {{{) - reserved(if) ident(status) operator(==) integer(100) - string - reserved(elsif) ident(status) operator(==) integer(101) - string - reserved(elsif) ident(status) operator(==) integer(200) - string - reserved(elsif) ident(status) operator(==) integer(201) - string - reserved(elsif) ident(status) operator(==) integer(202) - string - reserved(elsif) ident(status) operator(==) integer(203) - string - reserved(elsif) ident(status) operator(==) integer(204) - string - reserved(elsif) ident(status) operator(==) integer(205) - string - reserved(elsif) ident(status) operator(==) integer(206) - string - reserved(elsif) ident(status) operator(==) integer(300) - string - reserved(elsif) ident(status) operator(==) integer(301) - string - reserved(elsif) ident(status) operator(==) integer(302) - string - reserved(elsif) ident(status) operator(==) integer(303) - string - reserved(elsif) ident(status) operator(==) integer(304) - string - reserved(elsif) ident(status) operator(==) integer(305) - string - reserved(elsif) ident(status) operator(==) integer(307) - string - reserved(elsif) ident(status) operator(==) integer(400) - string - reserved(elsif) ident(status) operator(==) integer(401) - string - reserved(elsif) ident(status) operator(==) integer(402) - string - reserved(elsif) ident(status) operator(==) integer(403) - string - reserved(elsif) ident(status) operator(==) integer(404) - string - reserved(elsif) ident(status) operator(==) integer(405) - string - reserved(elsif) ident(status) operator(==) integer(406) - string - reserved(elsif) ident(status) operator(==) integer(407) - string - reserved(elsif) ident(status) operator(==) integer(408) - string - reserved(elsif) ident(status) operator(==) integer(409) - string - reserved(elsif) ident(status) operator(==) integer(410) - string - reserved(elsif) ident(status) operator(==) integer(411) - string - reserved(elsif) ident(status) operator(==) integer(412) - string - reserved(elsif) ident(status) operator(==) integer(413) - string - reserved(elsif) ident(status) operator(==) integer(414) - string - reserved(elsif) ident(status) operator(==) integer(415) - string - reserved(elsif) ident(status) operator(==) integer(416) - string - reserved(elsif) ident(status) operator(==) integer(417) - string - reserved(elsif) ident(status) operator(==) integer(500) - string - reserved(elsif) ident(status) operator(==) integer(501) - string - reserved(elsif) ident(status) operator(==) integer(502) - string - reserved(elsif) ident(status) operator(==) integer(503) - string - reserved(elsif) ident(status) operator(==) integer(504) - string - reserved(elsif) ident(status) operator(==) integer(505) - string - reserved(else) - ident(raise) string - reserved(end) - comment(# }}}) - reserved(end) -reserved(end) - -reserved(class) class(Cookie) - ident(attr_reader) symbol(:name)operator(,) symbol(:value)operator(,) symbol(:maxage)operator(,) symbol(:path)operator(,) symbol(:domain)operator(,) symbol(:secure)operator(,) symbol(:comment) - - comment(# Sets a cookie. Please see below for details of the attributes.) - reserved(def) method(initialize) operator(()ident(name)operator(,) ident(value) operator(=) pre_constant(nil)operator(,) ident(maxage) operator(=) pre_constant(nil)operator(,) ident(path) operator(=) pre_constant(nil)operator(,) ident(domain) operator(=) pre_constant(nil)operator(,) ident(secure) operator(=) pre_constant(false)operator(\)) - comment(# {{{) - comment(# HTTP headers (Cookies are a HTTP header\) can only set, while no content) - comment(# is send. So an exception will be raised, when @@allowed is set to false) - comment(# and a new cookie has set.) - reserved(unless) reserved(defined?)operator(()class_variable(@@allowed)operator(\)) - class_variable(@@allowed) operator(=) pre_constant(true) - reserved(end) - reserved(unless) class_variable(@@allowed) - ident(raise) string - reserved(end) - - reserved(unless) reserved(defined?)operator(()class_variable(@@list)operator(\)) - class_variable(@@list) operator(=) operator([)operator(]) - reserved(end) - class_variable(@@list) operator(+=) operator([)pre_constant(self)operator(]) - - reserved(unless) reserved(defined?)operator(()class_variable(@@type)operator(\)) - class_variable(@@type) operator(=) string - reserved(end) - - reserved(unless) ident(name)operator(.)ident(class) operator(==) constant(String) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(if) ident(value)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) ident(value)operator(.)ident(class) operator(==) constant(Float) - ident(value) operator(=) ident(value)operator(.)ident(to_s) - reserved(elsif) ident(value)operator(.)ident(class) operator(!=) constant(String) operator(&&) ident(value) operator(!=) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(if) ident(maxage)operator(.)ident(class) operator(==) constant(Time) - ident(maxage) operator(=) ident(maxage) operator(-) constant(Time)operator(.)ident(now) - reserved(elsif) operator(!)ident(maxage)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) operator(!)ident(maxage) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(unless) ident(path)operator(.)ident(class) operator(==) constant(String) operator(||) ident(path) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(unless) ident(domain)operator(.)ident(class) operator(==) constant(String) operator(||) ident(domain) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - reserved(unless) ident(secure) operator(==) pre_constant(true) operator(||) ident(secure) operator(==) pre_constant(false) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - - instance_variable(@name)operator(,) instance_variable(@value)operator(,) instance_variable(@maxage)operator(,) instance_variable(@path)operator(,) instance_variable(@domain)operator(,) instance_variable(@secure) operator(=) ident(name)operator(,) ident(value)operator(,) ident(maxage)operator(,) ident(path)operator(,) ident(domain)operator(,) ident(secure) - instance_variable(@comment) operator(=) pre_constant(nil) - comment(# }}}) - reserved(end) - - comment(# Modifies the value of this cookie. The information you want to store. If the) - comment(# value is nil, the cookie will be deleted by the client.) - comment(#) - comment(# This attribute can be a String, Integer or Float object or nil.) - reserved(def) method(value=)operator(()ident(value)operator(\)) - comment(# {{{) - reserved(if) ident(value)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) ident(value)operator(.)ident(class) operator(==) constant(Float) - ident(value) operator(=) ident(value)operator(.)ident(to_s) - reserved(elsif) ident(value)operator(.)ident(class) operator(!=) constant(String) operator(&&) ident(value) operator(!=) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@value) operator(=) ident(value) - comment(# }}}) - reserved(end) - - comment(# Modifies the maxage of this cookie. This attribute defines the lifetime of) - comment(# the cookie, in seconds. A value of 0 means the cookie should be discarded) - comment(# imediatly. If it set to nil, the cookie will be deleted when the browser) - comment(# will be closed.) - comment(#) - comment(# Attention: This is different from other implementations like PHP, where you) - comment(# gives the seconds since 1/1/1970 0:00:00 GMT.) - comment(#) - comment(# This attribute must be an Integer or Time object or nil.) - reserved(def) method(maxage=)operator(()ident(maxage)operator(\)) - comment(# {{{) - reserved(if) ident(maxage)operator(.)ident(class) operator(==) constant(Time) - ident(maxage) operator(=) ident(maxage) operator(-) constant(Time)operator(.)ident(now) - reserved(elsif) ident(maxage)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) operator(!)ident(maxage) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@maxage) operator(=) ident(maxage) - comment(# }}}) - reserved(end) - - comment(# Modifies the path value of this cookie. The client will send this cookie) - comment(# only, if the requested document is this directory or a subdirectory of it.) - comment(#) - comment(# The value of the attribute must be a String object or nil.) - reserved(def) method(path=)operator(()ident(path)operator(\)) - comment(# {{{) - reserved(unless) ident(path)operator(.)ident(class) operator(==) constant(String) operator(||) ident(path) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@path) operator(=) ident(path) - comment(# }}}) - reserved(end) - - comment(# Modifies the domain value of this cookie. The client will send this cookie) - comment(# only if it's connected with this domain (or a subdomain, if the first) - comment(# character is a dot like in ".ruby-lang.org"\)) - comment(#) - comment(# The value of this attribute must be a String or nil.) - reserved(def) method(domain=)operator(()ident(domain)operator(\)) - comment(# {{{) - reserved(unless) ident(domain)operator(.)ident(class) operator(==) constant(String) operator(||) ident(domain) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@domain) operator(=) ident(domain) - comment(# }}}) - reserved(end) - - comment(# Modifies the secure flag of this cookie. If it's true, the client will only) - comment(# send this cookie if it is secured connected with us.) - comment(#) - comment(# The value od this attribute has to be true or false.) - reserved(def) method(secure=)operator(()ident(secure)operator(\)) - comment(# {{{) - reserved(unless) ident(secure) operator(==) pre_constant(true) operator(||) ident(secure) operator(==) pre_constant(false) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@secure) operator(=) ident(secure) - comment(# }}}) - reserved(end) - - comment(# Modifies the comment value of this cookie. The comment won't be send, if) - comment(# type is "netscape".) - reserved(def) method(comment=)operator(()ident(comment)operator(\)) - comment(# {{{) - reserved(unless) ident(comment)operator(.)ident(class) operator(==) constant(String) operator(||) ident(comment) operator(==) pre_constant(nil) - ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) - reserved(end) - instance_variable(@comment) operator(=) ident(comment) - comment(# }}}) - reserved(end) - - comment(# Changes the type of all cookies.) - comment(# Allowed values are RFC2109 and netscape (default\).) - reserved(def) constant(Cookie)operator(.)ident(type)operator(=)operator(()ident(type)operator(\)) - comment(# {{{) - reserved(unless) class_variable(@@allowed) - ident(raise) string - reserved(end) - reserved(unless) ident(type)operator(.)ident(downcase) operator(==) string operator(&&) ident(type)operator(.)ident(downcase) operator(==) string - ident(raise) string - reserved(end) - class_variable(@@type) operator(=) ident(type)operator(;) - comment(# }}}) - reserved(end) - - comment(# After sending this message, no cookies can be set or modified. Use it, when) - comment(# HTTP-Headers are send. Rweb does this for you.) - reserved(def) constant(Cookie)operator(.)ident(disallow) - comment(# {{{) - class_variable(@@allowed) operator(=) pre_constant(false) - pre_constant(true) - comment(# }}}) - reserved(end) - - comment(# Returns a HTTP header (type String\) with all cookies. Rweb does this for) - comment(# you.) - reserved(def) constant(Cookie)operator(.)ident(getHttpHeader) - comment(# {{{) - reserved(if) reserved(defined?)operator(()class_variable(@@list)operator(\)) - reserved(if) class_variable(@@type) operator(==) string - ident(str) operator(=) string - class_variable(@@list)operator(.)ident(each) reserved(do) operator(|)ident(cookie)operator(|) - reserved(if) ident(cookie)operator(.)ident(value) operator(==) pre_constant(nil) - ident(cookie)operator(.)ident(maxage) operator(=) integer(0) - ident(cookie)operator(.)ident(value) operator(=) string - reserved(end) - comment(# TODO: Name and value should be escaped!) - ident(str) operator(+=) stringcontent(=)inlinedelimiter(")> - reserved(unless) ident(cookie)operator(.)ident(maxage) operator(==) pre_constant(nil) - ident(expire) operator(=) constant(Time)operator(.)ident(now) operator(+) ident(cookie)operator(.)ident(maxage) - ident(expire)operator(.)ident(gmtime) - ident(str) operator(+=) stringoperator(\))delimiter(})>delimiter(")> - reserved(end) - reserved(unless) ident(cookie)operator(.)ident(domain) operator(==) pre_constant(nil) - ident(str) operator(+=) stringdelimiter(")> - reserved(end) - reserved(unless) ident(cookie)operator(.)ident(path) operator(==) pre_constant(nil) - ident(str) operator(+=) stringdelimiter(")> - reserved(end) - reserved(if) ident(cookie)operator(.)ident(secure) - ident(str) operator(+=) string - reserved(end) - ident(str) operator(+=) string - reserved(end) - reserved(return) ident(str) - reserved(else) comment(# type == "RFC2109") - ident(str) operator(=) string - ident(comma) operator(=) pre_constant(false)operator(;) - - class_variable(@@list)operator(.)ident(each) reserved(do) operator(|)ident(cookie)operator(|) - reserved(if) ident(cookie)operator(.)ident(value) operator(==) pre_constant(nil) - ident(cookie)operator(.)ident(maxage) operator(=) integer(0) - ident(cookie)operator(.)ident(value) operator(=) string - reserved(end) - reserved(if) ident(comma) - ident(str) operator(+=) string - reserved(end) - ident(comma) operator(=) pre_constant(true) - - ident(str) operator(+=) stringcontent(=)char(\\")inlinechar(\\")delimiter(")> - reserved(unless) ident(cookie)operator(.)ident(maxage) operator(==) pre_constant(nil) - ident(str) operator(+=) stringchar(\\")delimiter(")> - reserved(end) - reserved(unless) ident(cookie)operator(.)ident(domain) operator(==) pre_constant(nil) - ident(str) operator(+=) stringchar(\\")delimiter(")> - reserved(end) - reserved(unless) ident(cookie)operator(.)ident(path) operator(==) pre_constant(nil) - ident(str) operator(+=) stringchar(\\")delimiter(")> - reserved(end) - reserved(if) ident(cookie)operator(.)ident(secure) - ident(str) operator(+=) string - reserved(end) - reserved(unless) ident(cookie)operator(.)ident(comment) operator(==) pre_constant(nil) - ident(str) operator(+=) stringchar(\\")delimiter(")> - reserved(end) - ident(str) operator(+=) string - reserved(end) - ident(str) - reserved(end) - reserved(else) - pre_constant(false) - reserved(end) - comment(# }}}) - reserved(end) -reserved(end) - -ident(require) string - -reserved(module) class(BBCode) - constant(DEBUG) operator(=) pre_constant(true) - - ident(use) stringoperator(,) stringoperator(,) stringoperator(,) string - -comment(=begin - The Parser class takes care of the encoding. - It scans the given BBCode (as plain text\), finds tags - and smilies and also makes links of urls in text. - - Normal text is send directly to the encoder. - - If a tag was found, an instance of a Tag subclass is created - to handle the case. - - The @tagstack manages tag nesting and ensures valid HTML. -=end) - - reserved(class) class(Parser) - reserved(class) class(Attribute) - comment(# flatten and use only one empty_arg) - reserved(def) pre_constant(self)operator(.)ident(create) ident(attr) - ident(attr) operator(=) ident(flatten) ident(attr) - reserved(return) class_variable(@@empty_attr) reserved(if) ident(attr)operator(.)ident(empty?) - ident(new) ident(attr) - reserved(end) - - ident(private_class_method) symbol(:new) - - comment(# remove leading and trailing whitespace; concat lines) - reserved(def) pre_constant(self)operator(.)ident(flatten) ident(attr) - ident(attr)operator(.)ident(strip)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - comment(# -> ^ and $ can only match at begin and end now) - reserved(end) - - constant(ATTRIBUTE_SCAN) operator(=) regexp - - reserved(def) pre_constant(self)operator(.)ident(parse) ident(source) - ident(source) operator(=) ident(source)operator(.)ident(dup) - comment(# empty_tag: the tag looks like [... /]) - comment(# slice!: this deletes the \\s*/] at the end) - comment(# \\s+ because [url=http://rubybb.org/forum/] is NOT an empty tag.) - comment(# In RubyBBCode, you can use [url=http://rubybb.org/forum/ /], and this has to be) - comment(# interpreted correctly.) - ident(empty_tag) operator(=) ident(source)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) reserved(or) ident(source)operator(.)ident(slice!)operator(()regexpoperator(\)) - ident(debug) string operator(+) ident(source)operator(.)ident(inspect) operator(+) string )delimiter(')> operator(+) ident(empty_tag)operator(.)ident(inspect) - comment(#-> we have now an attr that's EITHER empty OR begins and ends with non-whitespace.) - - ident(attr) operator(=) constant(Hash)operator(.)ident(new) - ident(attr)operator([)symbol(:flags)operator(]) operator(=) operator([)operator(]) - ident(source)operator(.)ident(scan)operator(()constant(ATTRIBUTE_SCAN)operator(\)) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) - reserved(if) reserved(not) ident(value) - ident(attr)operator([)symbol(:flags)operator(]) operator(<<) ident(unescape)operator(()ident(key)operator(\)) - reserved(else) - reserved(next) reserved(if) ident(value)operator(.)ident(empty?) reserved(and) ident(key)operator(.)ident(empty?) - ident(attr)operator([)ident(unescape)operator(()ident(key)operator(\))operator(]) operator(=) ident(unescape)operator(()ident(value)operator(\)) - reserved(end) - operator(}) - ident(debug) ident(attr)operator(.)ident(inspect) - - reserved(return) ident(empty_tag)operator(,) ident(attr) - reserved(end) - - reserved(def) pre_constant(self)operator(.)ident(unescape_char) ident(esc) - ident(esc)operator([)integer(1)operator(]) - reserved(end) - - reserved(def) pre_constant(self)operator(.)ident(unquote) ident(qt) - ident(qt)operator([)integer(1)operator(..)integer(-1)operator(])operator(.)ident(chomp)operator(()stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(esc)operator(|) ident(unescape_char) ident(esc) operator(}) - reserved(end) - - reserved(def) pre_constant(self)operator(.)ident(unescape) ident(str) - ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) - reserved(if) global_variable($1) - ident(unescape_char) global_variable($1) - reserved(else) - ident(unquote) global_variable($2) - reserved(end) - operator(}) - reserved(end) - - ident(include) constant(Enumerable) - reserved(def) method(each) operator(&)ident(block) - instance_variable(@args)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) - reserved(end) - - ident(attr_reader) symbol(:source)operator(,) symbol(:args)operator(,) symbol(:value) - - reserved(def) method(initialize) ident(source) - instance_variable(@source) operator(=) ident(source) - ident(debug) string operator(%) ident(source) - instance_variable(@empty_tag)operator(,) instance_variable(@attr) operator(=) constant(Attribute)operator(.)ident(parse) ident(source) - instance_variable(@value) operator(=) instance_variable(@attr)operator([)stringoperator(])operator(.)ident(to_s) - reserved(end) - - reserved(def) method(empty?) - pre_constant(self) operator(==) class_variable(@@empty_attr) - reserved(end) - - reserved(def) method(empty_tag?) - instance_variable(@empty_tag) - reserved(end) - - reserved(def) method([]) operator(*)ident(keys) - ident(res) operator(=) instance_variable(@attr)operator([)operator(*)ident(keys)operator(]) - reserved(end) - - reserved(def) method(flags) - ident(attr)operator([)symbol(:flags)operator(]) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@attr) - reserved(end) - - reserved(def) method(inspect) - string operator(+) instance_variable(@attr)operator(.)ident(inspect) operator(+) operator(()instance_variable(@empty_tag) operator(?) string operator(:) stringoperator(\)) operator(+) string - reserved(end) - reserved(end) - reserved(class) class(Attribute) - class_variable(@@empty_attr) operator(=) ident(new) string - reserved(end) - reserved(end) - - reserved(class) class(Parser) - reserved(def) constant(Parser)operator(.)ident(flatten) ident(str) - comment(# replace mac & dos newlines with unix style) - ident(str)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - reserved(def) method(initialize) ident(input) operator(=) string - comment(# input manager) - instance_variable(@scanner) operator(=) constant(StringScanner)operator(.)ident(new) string - comment(# output manager) - instance_variable(@encoder) operator(=) constant(Encoder)operator(.)ident(new) - instance_variable(@output) operator(=) string - comment(# tag manager) - instance_variable(@tagstack) operator(=) constant(TagStack)operator(.)ident(new)operator(()instance_variable(@encoder)operator(\)) - - instance_variable(@do_magic) operator(=) pre_constant(true) - comment(# set the input) - ident(feed) ident(input) - reserved(end) - - comment(# if you want, you can feed a parser instance after creating,) - comment(# or even feed it repeatedly.) - reserved(def) method(feed) ident(food) - instance_variable(@scanner)operator(.)ident(string) operator(=) constant(Parser)operator(.)ident(flatten) ident(food) - reserved(end) - - comment(# parse through the string using parse_token) - reserved(def) method(parse) - ident(parse_token) reserved(until) instance_variable(@scanner)operator(.)ident(eos?) - instance_variable(@tagstack)operator(.)ident(close_all) - instance_variable(@output) operator(=) ident(parse_magic) instance_variable(@encoder)operator(.)ident(output) - reserved(end) - - reserved(def) method(output) - instance_variable(@output) - reserved(end) - - comment(# ok, internals start here) - ident(private) - comment(# the default output functions. everything should use them or the tags.) - reserved(def) method(add_text) ident(text) operator(=) instance_variable(@scanner)operator(.)ident(matched) - instance_variable(@encoder)operator(.)ident(add_text) ident(text) - reserved(end) - - comment(# use this carefully) - reserved(def) method(add_html) ident(html) - instance_variable(@encoder)operator(.)ident(add_html) ident(html) - reserved(end) - - comment(# highlights the text as error) - reserved(def) method(add_garbage) ident(garbage) - ident(add_html) string)delimiter(')> reserved(if) constant(DEBUG) - ident(add_text) ident(garbage) - ident(add_html) string)delimiter(')> reserved(if) constant(DEBUG) - reserved(end) - - comment(# unknown and incorrectly nested tags are ignored and) - comment(# sent as plaintext (garbage in - garbage out\).) - comment(# in debug mode, garbage is marked with lime background.) - reserved(def) method(garbage_out) ident(start) - instance_variable(@scanner)operator(.)ident(pos) operator(=) ident(start) - ident(garbage) operator(=) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(debug) string operator(+) ident(garbage) - ident(add_garbage) ident(garbage) - reserved(end) - - comment(# simple text; everything but [, \\[ allowed) - constant(SIMPLE_TEXT_SCAN_) operator(=) regexp - constant(SIMPLE_TEXT_SCAN) operator(=) regexp - -comment(=begin - - WHAT IS A TAG? - ============== - - Tags in BBCode can be much more than just a simple [b]. - I use many terms here to differ the parts of each tag. - - Basic scheme: - [ code ] - TAG START TAG INFO TAG END - - Most tags need a second tag to close the range it opened. - This is done with CLOSING TAGS: - [/code] - or by using empty tags that have no content and close themselfes: - [url=winamp.com /] - You surely know this from HTML. - These slashes define the TAG KIND = normal|closing|empty and - cannot be used together. - - Everything between [ and ] and expluding the slashes is called the - TAG INFO. This info may contain: - - TAG ID - - TAG NAME including the tag id - - attributes - - The TAG ID is the first char of the info: - - TAG | ID - ----------+---- - [quote] | q - [±] | & - ["[b]"] | " - [/url] | u - [---] | - - - As you can see, the tag id shows the TAG TYPE, it can be a - normal tag, a formatting tag or an entity. - Therefor, the parser first scans the id to decide how to go - on with parsing. -=end) - comment(# tag) - comment(# TODO more complex expression allowing) - comment(# [quote="[ladico]"] and [quote=\\[ladico\\]] to be correct tags) - constant(TAG_BEGIN_SCAN) operator(=) regexp - constant(TAG_END_SCAN) operator(=) regexp - constant(CLOSE_TAG_SCAN) operator(=) regexp - constant(UNCLOSED_TAG_SCAN) operator(=) regexp - - constant(CLASSIC_TAG_SCAN) operator(=) regexp - - constant(SEPARATOR_TAG_SCAN) operator(=) regexp - - constant(FORMAT_TAG_SCAN) operator(=) regexp - - constant(QUOTED_SCAN) operator(=) regexp - - constant(ENTITY_SCAN) operator(=) regexp - - constant(SMILEY_SCAN) operator(=) constant(Smileys)operator(::)constant(SMILEY_PATTERN) - - comment(# this is the main parser loop that separates) - comment(# text - everything until "[") - comment(# from) - comment(# tags - starting with "[", ending with "]") - reserved(def) method(parse_token) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SIMPLE_TEXT_SCAN)operator(\)) - ident(add_text) - reserved(else) - ident(handle_tag) - reserved(end) - reserved(end) - - reserved(def) method(handle_tag) - ident(tag_start) operator(=) instance_variable(@scanner)operator(.)ident(pos) - - reserved(unless) instance_variable(@scanner)operator(.)ident(scan) constant(TAG_BEGIN_SCAN) - ident(garbage_out) ident(tag_start) - reserved(return) - reserved(end) - - ident(closing)operator(,) ident(id) operator(=) instance_variable(@scanner)operator([)integer(1)operator(])operator(,) instance_variable(@scanner)operator([)integer(2)operator(]) - comment(#debug 'handle_tag(%p\)' % @scanner.matched) - - ident(handled) operator(=) - reserved(case) ident(id) - - reserved(when) regexp - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(CLASSIC_TAG_SCAN)operator(\)) - reserved(if) ident(handle_classic_tag)operator(()ident(id) operator(+) instance_variable(@scanner)operator(.)ident(matched)operator(,) ident(closing)operator(\)) - ident(already_closed) operator(=) pre_constant(true) - reserved(end) - reserved(end) - - reserved(when) string - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SEPARATOR_TAG_SCAN)operator(\)) - ident(handle_asterisk) ident(tag_start)operator(,) ident(id) operator(+) instance_variable(@scanner)operator(.)ident(matched) - pre_constant(true) - reserved(end) - - reserved(when) string - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(FORMAT_TAG_SCAN)operator(\)) - comment(#format = id + @scanner.matched) - instance_variable(@encoder)operator(.)ident(add_html) string)char(\\n)delimiter(")> - pre_constant(true) - reserved(end) - - reserved(when) string - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(QUOTED_SCAN)operator(\)) - instance_variable(@encoder)operator(.)ident(add_text) ident(unescape)operator(()instance_variable(@scanner)operator([)integer(1)operator(])operator(\)) - pre_constant(true) - reserved(end) - - reserved(when) string - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(ENTITY_SCAN)operator(\)) - instance_variable(@encoder)operator(.)ident(add_entity) instance_variable(@scanner)operator([)integer(1)operator(]) - pre_constant(true) - reserved(end) - - reserved(when) constant(Smileys)operator(::)constant(SMILEY_START_CHARSET) - instance_variable(@scanner)operator(.)ident(pos) operator(=) instance_variable(@scanner)operator(.)ident(pos) operator(-) integer(1) comment(# (ungetch\)) - reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SMILEY_SCAN)operator(\)) - instance_variable(@encoder)operator(.)ident(add_html) constant(Smileys)operator(.)ident(smiley_to_image)operator(()instance_variable(@scanner)operator(.)ident(matched)operator(\)) - pre_constant(true) - reserved(end) - - reserved(end) comment(# case) - - reserved(return) ident(garbage_out)operator(()ident(tag_start)operator(\)) reserved(unless) ident(handled) - - instance_variable(@scanner)operator(.)ident(scan)operator(()constant(TAG_END_SCAN)operator(\)) reserved(unless) ident(already_closed) - reserved(end) - - constant(ATTRIBUTES_SCAN) operator(=) regexp - - reserved(def) method(handle_classic_tag) ident(name)operator(,) ident(closing) - ident(debug) string operator(+) operator(()ident(closing) operator(?) string operator(:) stringoperator(\)) operator(+) ident(name) - comment(# flatten) - ident(name)operator(.)ident(downcase!) - ident(tag_class) operator(=) constant(TAG_LIST)operator([)ident(name)operator(]) - reserved(return) reserved(unless) ident(tag_class) - - comment(#debug((opening ? 'OPEN ' : 'CLOSE '\) + tag_class.name\)) - - comment(# create an attribute object to handle it) - instance_variable(@scanner)operator(.)ident(scan)operator(()constant(ATTRIBUTES_SCAN)operator(\)) - comment(#debug name + ':' + @scanner[1]) - ident(attr) operator(=) constant(Attribute)operator(.)ident(create) instance_variable(@scanner)operator([)integer(1)operator(]) - comment(#debug 'ATTRIBUTES %p ' % attr #unless attr.empty?) - - comment(#debug 'closing: %p; name=%s, attr=%p' % [closing, name, attr]) - - comment(# OPEN) - reserved(if) reserved(not) ident(closing) reserved(and) ident(tag) operator(=) instance_variable(@tagstack)operator(.)ident(try_open_class)operator(()ident(tag_class)operator(,) ident(attr)operator(\)) - comment(#debug 'opening') - ident(tag)operator(.)ident(do_open) instance_variable(@scanner) - comment(# this should be done by the tag itself.) - reserved(if) ident(attr)operator(.)ident(empty_tag?) - ident(tag)operator(.)ident(handle_empty) - instance_variable(@tagstack)operator(.)ident(close_tag) - reserved(elsif) ident(tag)operator(.)ident(special_content?) - ident(handle_special_content)operator(()ident(tag)operator(\)) - instance_variable(@tagstack)operator(.)ident(close_tag) - comment(# # ignore asterisks directly after the opening; these are phpBBCode) - comment(# elsif tag.respond_to? :asterisk) - comment(# debug 'SKIP ASTERISKS: ' if @scanner.skip(ASTERISK_TAGS_SCAN\)) - reserved(end) - - comment(# CLOSE) - reserved(elsif) instance_variable(@tagstack)operator(.)ident(try_close_class)operator(()ident(tag_class)operator(\)) - comment(#debug 'closing') - comment(# GARBAGE) - reserved(else) - reserved(return) - reserved(end) - - pre_constant(true) - reserved(end) - - reserved(def) method(handle_asterisk) ident(tag_start)operator(,) ident(stars) - comment(#debug 'ASTERISK: ' + stars.to_s) - comment(# rule for asterisk tags: they belong to the last tag) - comment(# that handles them. tags opened after this tag are closed.) - comment(# if no open tag uses them, all are closed.) - ident(tag) operator(=) instance_variable(@tagstack)operator(.)ident(close_all_until) operator({) operator(|)ident(tag)operator(|) ident(tag)operator(.)ident(respond_to?) symbol(:asterisk) operator(}) - reserved(unless) ident(tag) reserved(and) ident(tag)operator(.)ident(asterisk) ident(stars)operator(,) instance_variable(@scanner) - ident(garbage_out) ident(tag_start) - reserved(end) - reserved(end) - - reserved(def) method(handle_special_content) ident(tag) - ident(scanned) operator(=) instance_variable(@scanner)operator(.)ident(scan_until)operator(()ident(tag)operator(.)ident(closing_tag)operator(\)) - reserved(if) ident(scanned) - ident(scanned)operator(.)ident(slice!)operator(()operator(-)operator(()instance_variable(@scanner)operator(.)ident(matched)operator(.)ident(size)operator(\))operator(..)integer(-1)operator(\)) - reserved(else) - ident(scanned) operator(=) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) - reserved(end) - comment(#debug 'SPECIAL CONTENT: ' + scanned) - ident(tag)operator(.)ident(handle_content)operator(()ident(scanned)operator(\)) - reserved(end) - - reserved(def) method(unescape) ident(text) - comment(# input: correctly formatted quoted string (without the quotes\)) - ident(text)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) global_variable($1) reserved(or) global_variable($&) operator(}) - reserved(end) - - - comment(# MAGIC FEAUTURES) - - constant(URL_PATTERN) operator(=) regexp)char(\\w)content({3,}\):)char(\\/)char(\\/)content(\))char(\\S)content(+)delimiter(/)> - constant(EMAIL_PATTERN) operator(=) regexp[)char(\\w)char(\\-)content(_.]+\)@[)char(\\w)char(\\-)char(\\.)content(]+)char(\\.)char(\\w)content(+)delimiter(/)> - - constant(HAS_MAGIC) operator(=) regexpcontent(]|(?i:www|ftp\))delimiter(/)> - - constant(MAGIC_PATTERN) operator(=) constant(Regexp)operator(.)ident(new)operator(()string operator(%) - operator([)constant(Smileys)operator(::)constant(MAGIC_SMILEY_PATTERN)operator(,) constant(URL_PATTERN)operator(,) constant(EMAIL_PATTERN)operator(])operator(.)ident(map) operator({) operator(|)ident(pattern)operator(|) - ident(pattern)operator(.)ident(to_s) - operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(\)) - - constant(IS_SMILEY_PATTERN) operator(=) constant(Regexp)operator(.)ident(new)operator(()string operator(%) constant(Smileys)operator(::)constant(SMILEY_START_CHARSET)operator(.)ident(to_s) operator(\)) - constant(IS_URL_PATTERN) operator(=) regexp)char(\\w)content(+\):)char(\\/)char(\\/)content(\))delimiter(/)> - constant(URL_STARTS_WITH_PROTOCOL) operator(=) regexp - constant(IS_EMAIL_PATTERN) operator(=) regexp - - reserved(def) method(to_magic) ident(text) - comment(# debug MAGIC_PATTERN.to_s) - ident(text)operator(.)ident(gsub!)operator(()constant(MAGIC_PATTERN)operator(\)) operator({) - ident(magic) operator(=) global_variable($2) - global_variable($1) operator(+) reserved(case) ident(magic) - reserved(when) constant(IS_SMILEY_PATTERN) - constant(Smileys)operator(.)ident(smiley_to_img) ident(magic) - reserved(when) constant(IS_URL_PATTERN) - ident(last) operator(=) ident(magic)operator(.)ident(slice_punctation!) comment(# no punctation in my URL) - ident(href) operator(=) ident(magic) - ident(href)operator(.)ident(insert)operator(()integer(0)operator(,) stringoperator(\)) reserved(unless) ident(magic) operator(=)operator(~) constant(URL_STARTS_WITH_PROTOCOL) - string)delimiter(')> operator(+) ident(magic) operator(+) string)delimiter(')> operator(+) ident(last) - reserved(when) constant(IS_EMAIL_PATTERN) - ident(last) operator(=) ident(magic)operator(.)ident(slice_punctation!) - string)delimiter(')> operator(+) ident(magic) operator(+) string)delimiter(')> operator(+) ident(last) - reserved(else) - ident(raise) string operator(+) ident(magic) operator(+) string - reserved(end) - operator(}) - ident(text) - reserved(end) - - comment(# handles smileys and urls) - reserved(def) method(parse_magic) ident(html) - reserved(return) ident(html) reserved(unless) instance_variable(@do_magic) - ident(scanner) operator(=) constant(StringScanner)operator(.)ident(new) ident(html) - ident(out) operator(=) string - reserved(while) ident(scanner)operator(.)ident(rest?) - reserved(if) ident(scanner)operator(.)ident(scan)operator(()regexp | pre)char(\\W)content( .*? <)char(\\/)content(pre> | [^>]* > \) )delimiter(/)modifier(mx)>operator(\)) - ident(out) operator(<<) ident(scanner)operator(.)ident(matched) - reserved(elsif) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(out) operator(<<) ident(to_magic)operator(()ident(scanner)operator(.)ident(matched)operator(\)) - - comment(# this should never happen) - reserved(elsif) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(raise) string - reserved(end) - reserved(end) - ident(out) - reserved(end) - reserved(end) comment(# Parser) -reserved(end) - -reserved(class) class(String) - reserved(def) method(slice_punctation!) - ident(slice!)operator(()regexpoperator(\))operator(.)ident(to_s) comment(# return '' instead of nil) - reserved(end) -reserved(end) - -comment(#) -comment(# = Grammar) -comment(#) -comment(# An implementation of common algorithms on grammars.) -comment(#) -comment(# This is used by Shinobu, a visualization tool for educating compiler-building.) -comment(#) -comment(# Thanks to Andreas Kunert for his wonderful LR(k\) Pamphlet (German, see http://www.informatik.hu-berlin.de/~kunert/papers/lr-analyse\), and Aho/Sethi/Ullman for their Dragon Book.) -comment(#) -comment(# Homepage:: http://shinobu.cYcnus.de (not existing yet\)) -comment(# Author:: murphy (Kornelius Kalnbach\)) -comment(# Copyright:: (cc\) 2005 cYcnus) -comment(# License:: GPL) -comment(# Version:: 0.2.0 (2005-03-27\)) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -ident(require) string -ident(require) string - -comment(# = Grammar) -comment(#) -comment(# == Syntax) -comment(#) -comment(# === Rules) -comment(#) -comment(# Each line is a rule.) -comment(# The syntax is) -comment(#) -comment(# left - right) -comment(#) -comment(# where +left+ and +right+ can be uppercase and lowercase letters,) -comment(# and - can be any combination of <, >, - or whitespace.) -comment(#) -comment(# === Symbols) -comment(#) -comment(# Uppercase letters stand for meta symbols, lowercase for terminals.) -comment(#) -comment(# You can make epsilon-derivations by leaving empty.) -comment(#) -comment(# === Example) -comment(# S - Ac) -comment(# A - Sc) -comment(# A - b) -comment(# A -) -reserved(class) class(Grammar) - - ident(attr_reader) symbol(:tracer) - comment(# Creates a new Grammar.) - comment(# If $trace is true, the algorithms explain (textual\) what they do to $stdout.) - reserved(def) method(initialize) ident(data)operator(,) ident(tracer) operator(=) constant(Tracer)operator(.)ident(new) - instance_variable(@tracer) operator(=) ident(tracer) - instance_variable(@rules) operator(=) constant(Rules)operator(.)ident(new) - instance_variable(@terminals)operator(,) instance_variable(@meta_symbols) operator(=) constant(SortedSet)operator(.)ident(new)operator(,) constant(Array)operator(.)ident(new) - instance_variable(@start_symbol) operator(=) pre_constant(nil) - ident(add_rules) ident(data) - reserved(end) - - ident(attr_reader) symbol(:meta_symbols)operator(,) symbol(:terminals)operator(,) symbol(:rules)operator(,) symbol(:start_symbol) - - ident(alias_method) symbol(:sigma)operator(,) symbol(:terminals) - ident(alias_method) symbol(:alphabet)operator(,) symbol(:terminals) - ident(alias_method) symbol(:variables)operator(,) symbol(:meta_symbols) - ident(alias_method) symbol(:nonterminals)operator(,) symbol(:meta_symbols) - - comment(# A string representation of the grammar for debugging.) - reserved(def) method(inspect) ident(productions_too) operator(=) pre_constant(false) - string operator(%) - operator([) - ident(meta_symbols)operator(.)ident(join)operator(()stringoperator(\))operator(,) - ident(terminals)operator(.)ident(join)operator(()stringoperator(\))operator(,) - reserved(if) ident(productions_too) - instance_variable(@rules)operator(.)ident(inspect) - reserved(else) - instance_variable(@rules)operator(.)ident(size) - reserved(end)operator(,) - ident(start_symbol) - operator(]) - reserved(end) - - comment(# Add rules to the grammar. +rules+ should be a String or respond to +scan+ in a similar way.) - comment(#) - comment(# Syntax: see Grammar.) - reserved(def) method(add_rules) ident(grammar) - instance_variable(@rules) operator(=) constant(Rules)operator(.)ident(parse) ident(grammar) reserved(do) operator(|)ident(rule)operator(|) - instance_variable(@start_symbol) operator(||=) ident(rule)operator(.)ident(left) - instance_variable(@meta_symbols) operator(<<) ident(rule)operator(.)ident(left) - instance_variable(@terminals)operator(.)ident(merge) ident(rule)operator(.)ident(right)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(select) operator({) operator(|)ident(s)operator(|) ident(terminal?) ident(s) operator(}) - reserved(end) - instance_variable(@meta_symbols)operator(.)ident(uniq!) - ident(update) - reserved(end) - - comment(# Returns a hash acting as FIRST operator, so that) - comment(# first["ABC"] is FIRST(ABC\).) - comment(# See http://en.wikipedia.org/wiki/LL_parser "Constructing an LL(1\) parsing table" for details.) - reserved(def) method(first) - ident(first_operator) - reserved(end) - - comment(# Returns a hash acting as FOLLOW operator, so that) - comment(# first["A"] is FOLLOW(A\).) - comment(# See http://en.wikipedia.org/wiki/LL_parser "Constructing an LL(1\) parsing table" for details.) - reserved(def) method(follow) - ident(follow_operator) - reserved(end) - - constant(LLError) operator(=) constant(Class)operator(.)ident(new)operator(()constant(Exception)operator(\)) - constant(LLErrorType1) operator(=) constant(Class)operator(.)ident(new)operator(()constant(LLError)operator(\)) - constant(LLErrorType2) operator(=) constant(Class)operator(.)ident(new)operator(()constant(LLError)operator(\)) - - comment(# Tests if the grammar is LL(1\).) - reserved(def) method(ll1?) - reserved(begin) - reserved(for) ident(meta) reserved(in) instance_variable(@meta_symbols) - ident(first_sets) operator(=) instance_variable(@rules)operator([)ident(meta)operator(])operator(.)ident(map) operator({) operator(|)ident(alpha)operator(|) ident(first)operator([)ident(alpha)operator(]) operator(}) - ident(first_sets)operator(.)ident(inject)operator(()constant(Set)operator([)operator(])operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) - reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) - ident(raise) constant(LLErrorType1) - reserved(end) - ident(already_used)operator(.)ident(merge) ident(another_first_set) - reserved(end) - - reserved(if) ident(first)operator([)ident(meta)operator(])operator(.)ident(include?) constant(EPSILON) reserved(and) reserved(not) ident(first)operator([)ident(meta)operator(])operator(.)ident(disjoint?) ident(follow)operator([)ident(meta)operator(]) - ident(raise) constant(LLErrorType2) - reserved(end) - reserved(end) - reserved(rescue) constant(LLError) - pre_constant(false) - reserved(else) - pre_constant(true) - reserved(end) - reserved(end) - -ident(private) - - reserved(def) method(first_operator) - instance_variable(@first) operator(||=) constant(FirstOperator)operator(.)ident(new) pre_constant(self) - reserved(end) - - reserved(def) method(follow_operator) - instance_variable(@follow) operator(||=) constant(FollowOperator)operator(.)ident(new) pre_constant(self) - reserved(end) - - reserved(def) method(update) - instance_variable(@first) operator(=) instance_variable(@follow) operator(=) pre_constant(nil) - reserved(end) - -reserved(end) - -reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)integer(+4) -reserved(end) - -ident(require) string - -reserved(class) class(TestCaseGrammar) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) - - ident(include) constant(Grammar)operator(::)constant(Symbols) - - reserved(def) method(fifo) ident(s) - constant(Set)operator([)operator(*)ident(s)operator(.)ident(split)operator(()stringoperator(\))operator(]) - reserved(end) - - reserved(def) method(test_fifo) - ident(assert_equal) constant(Set)operator([)operator(])operator(,) ident(fifo)operator(()stringoperator(\)) - ident(assert_equal) constant(Set)operator([)constant(EPSILON)operator(,) constant(END_OF_INPUT)operator(,) stringoperator(,) stringoperator(])operator(,) ident(fifo)operator(()stringoperator(\)) - reserved(end) - - constant(TEST_GRAMMAR_1) operator(=) stringstring - - reserved(def) method(test_symbols) - ident(assert) constant(EPSILON) - ident(assert) constant(END_OF_INPUT) - reserved(end) - - reserved(def) method(test_first_1) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) - - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()ident(f)operator([)stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_follow_1) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) - - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(end) - - - constant(TEST_GRAMMAR_2) operator(=) stringstring - - reserved(def) method(test_first_2) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) - - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(end) - - reserved(def) method(test_follow_2) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) - - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(end) - - constant(LLError) operator(=) constant(Grammar)operator(::)constant(LLError) - - constant(TEST_GRAMMAR_3) operator(=) stringstring - - constant(NoError) operator(=) constant(Class)operator(.)ident(new)operator(()constant(Exception)operator(\)) - - reserved(def) method(test_first_3) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) - - comment(# Grammar 3 is LL(1\), so all first-sets must be disjoint.) - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) - ident(r) operator(=) ident(g)operator(.)ident(rules)operator([)ident(m)operator(]) - ident(firsts) operator(=) ident(r)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(f)operator([)ident(x)operator(]) operator(})operator(.)ident(to_set) - ident(assert_nothing_raised) reserved(do) - ident(firsts)operator(.)ident(inject)operator(()constant(Set)operator(.)ident(new)operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) - ident(raise) constant(LLError)operator(,) string reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) - ident(already_used)operator(.)ident(merge) ident(another_first_set) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_follow_3) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) - - comment(# Grammar 3 is not LL(1\), because epsilon is in FIRST(S\),) - comment(# but FIRST(S\) and FOLLOW(S\) are not disjoint.) - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) - ident(first_m) operator(=) ident(g)operator(.)ident(first)operator([)ident(m)operator(]) - reserved(next) reserved(unless) ident(first_m)operator(.)ident(include?) constant(EPSILON) - ident(assert_raise)operator(()ident(m) operator(==) string operator(?) constant(LLError) operator(:) constant(NoError)operator(\)) reserved(do) - reserved(if) ident(first_m)operator(.)ident(disjoint?) ident(f)operator([)ident(m)operator(]) - ident(raise) constant(NoError) comment(# this is fun :D) - reserved(else) - ident(raise) constant(LLError) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - constant(TEST_GRAMMAR_3b) operator(=) stringstring - - reserved(def) method(test_first_3b) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3b) - - comment(# Grammar 3b is NOT LL(1\), since not all first-sets are disjoint.) - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) - reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) - ident(r) operator(=) ident(g)operator(.)ident(rules)operator([)ident(m)operator(]) - ident(firsts) operator(=) ident(r)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(f)operator([)ident(x)operator(]) operator(}) - ident(assert_raise)operator(()ident(m) operator(==) string operator(?) constant(LLError) operator(:) constant(NoError)operator(\)) reserved(do) - ident(firsts)operator(.)ident(inject)operator(()constant(Set)operator(.)ident(new)operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) - ident(raise) constant(LLError)operator(,) string reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) - ident(already_used)operator(.)ident(merge) ident(another_first_set) - reserved(end) - ident(raise) constant(NoError) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_follow_3b) - ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3b) - - comment(# Although Grammar 3b is NOT LL(1\), the FOLLOW-condition is satisfied.) - ident(f) operator(=) pre_constant(nil) - ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) - reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) - ident(first_m) operator(=) ident(g)operator(.)ident(first)operator([)ident(m)operator(]) - reserved(next) reserved(unless) ident(first_m)operator(.)ident(include?) constant(EPSILON) - ident(assert_raise)operator(()constant(NoError)operator(\)) reserved(do) - reserved(if) ident(first_m)operator(.)ident(disjoint?) ident(f)operator([)ident(m)operator(]) - ident(raise) constant(NoError) comment(# this is fun :D) - reserved(else) - ident(raise) constant(LLError) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(test_ll1?) - ident(assert_equal) pre_constant(false)operator(,) constant(Grammar)operator(.)ident(new)operator(()constant(TEST_GRAMMAR_3)operator(\))operator(.)ident(ll1?)operator(,) string - ident(assert_equal) pre_constant(false)operator(,) constant(Grammar)operator(.)ident(new)operator(()constant(TEST_GRAMMAR_3b)operator(\))operator(.)ident(ll1?)operator(,) string - reserved(end) - - reserved(def) method(test_new) - ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) string operator(}) - ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) operator(}) - ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) operator(}) - ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) operator(}) - ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) operator(+) constant(TEST_GRAMMAR_2) operator(+) constant(TEST_GRAMMAR_3) operator(}) - ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Grammar)operator(.)ident(new) string operator(}) - reserved(end) -reserved(end) - -comment(# vim:foldmethod=syntax) - -comment(#!/usr/bin/env ruby) - -ident(require) string - -ident(include) constant(Fox) - -reserved(class) class(Window) operator(<) constant(FXMainWindow) - reserved(def) method(initialize)operator(()ident(app)operator(\)) - reserved(super)operator(()ident(app)operator(,) ident(app)operator(.)ident(appName) operator(+) stringoperator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) constant(DECOR_ALL)operator(,) integer(0)operator(,) integer(0)operator(,) integer(800)operator(,) integer(600)operator(,) integer(0)operator(,) integer(0)operator(\)) - - comment(# {{{ menubar) - ident(menubar) operator(=) constant(FXMenuBar)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(\)) - - ident(filemenu) operator(=) constant(FXMenuPane)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - - constant(FXMenuCommand)operator(.)ident(new)operator(()ident(filemenu)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(getApp)operator(()operator(\))operator(\))operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(,) ident(method)operator(()symbol(:start)operator(\))operator(\)) - constant(FXMenuCommand)operator(.)ident(new)operator(()ident(filemenu)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(getApp)operator(()operator(\))operator(,) constant(FXApp)operator(::)constant(ID_QUIT)operator(\)) - constant(FXMenuTitle)operator(.)ident(new)operator(()ident(menubar)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(filemenu)operator(\)) - comment(# }}} menubar) - - comment(# {{{ statusbar) - instance_variable(@statusbar) operator(=) constant(FXStatusBar)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_BOTTOM)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(STATUSBAR_WITH_DRAGCORNER)operator(\)) - comment(# }}} statusbar) - - comment(# {{{ window content) - ident(horizontalsplitt) operator(=) constant(FXSplitter)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(SPLITTER_VERTICAL)operator(|)constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL)operator(\)) - - - instance_variable(@productions) operator(=) constant(FXList)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FIX_HEIGHT)operator(|)constant(LIST_SINGLESELECT)operator(\)) - instance_variable(@productions)operator(.)ident(height) operator(=) integer(100) - - instance_variable(@result) operator(=) constant(FXTable)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_FILL)operator(\)) - instance_variable(@result)operator(.)ident(height) operator(=) integer(200) - instance_variable(@result)operator(.)ident(setTableSize)operator(()integer(2)operator(,) integer(2)operator(,) pre_constant(false)operator(\)) - instance_variable(@result)operator(.)ident(rowHeaderWidth) operator(=) integer(0) - - ident(header) operator(=) instance_variable(@result)operator(.)ident(columnHeader) - ident(header)operator(.)ident(setItemText) integer(0)operator(,) string - ident(header)operator(.)ident(setItemText) integer(1)operator(,) string - reserved(for) ident(item) reserved(in) ident(header) - ident(item)operator(.)ident(justification) operator(=) constant(FXHeaderItem)operator(::)constant(CENTER_X) - reserved(end) - - instance_variable(@debug) operator(=) constant(FXText)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_SIDE_BOTTOM)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FIX_HEIGHT)operator(\)) - instance_variable(@debug)operator(.)ident(height) operator(=) integer(200) - - comment(# }}} window content) - reserved(end) - - reserved(def) method(load_grammar) ident(grammar) - instance_variable(@tracer) operator(=) constant(FirstTracer)operator(.)ident(new)operator(()pre_constant(self)operator(\)) - instance_variable(@grammar) operator(=) constant(Grammar)operator(.)ident(new) ident(grammar)operator(,) instance_variable(@tracer) - instance_variable(@rules_indexes) operator(=) constant(Hash)operator(.)ident(new) - instance_variable(@grammar)operator(.)ident(rules)operator(.)ident(each_with_index) reserved(do) operator(|)ident(rule)operator(,) ident(i)operator(|) - instance_variable(@productions)operator(.)ident(appendItem) ident(rule)operator(.)ident(inspect) - instance_variable(@rules_indexes)operator([)ident(rule)operator(]) operator(=) ident(i) - reserved(end) - reserved(end) - - reserved(def) method(create) - reserved(super) - ident(show)operator(()constant(PLACEMENT_SCREEN)operator(\)) - reserved(end) - - reserved(def) method(rule) ident(rule) - instance_variable(@productions)operator(.)ident(selectItem) instance_variable(@rules_indexes)operator([)ident(rule)operator(]) - ident(sleep) float(0.1) - reserved(end) - - reserved(def) method(iterate) ident(i) - ident(setTitle) ident(i)operator(.)ident(to_s) - ident(sleep) float(0.1) - reserved(end) - - reserved(def) method(missing) ident(what) - instance_variable(@debug)operator(.)ident(appendText) ident(what) operator(+) string - ident(sleep) float(0.1) - reserved(end) - - reserved(def) method(start) ident(sender)operator(,) ident(sel)operator(,) ident(pointer) - constant(Thread)operator(.)ident(new) reserved(do) - reserved(begin) - instance_variable(@grammar)operator(.)ident(first) - reserved(rescue) operator(=)operator(>) ident(boom) - instance_variable(@debug)operator(.)ident(appendText) operator([)ident(boom)operator(.)ident(to_s)operator(,) operator(*)ident(boom)operator(.)ident(backtrace)operator(])operator(.)ident(join)operator(()stringoperator(\)) - reserved(end) - reserved(end) - reserved(end) - -reserved(end) - -global_variable($:) operator(<<) string -ident(require) string - -ident(require) string - -ident(app) operator(=) constant(FXApp)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - -comment(# fenster erzeugen) -ident(window) operator(=) constant(Window)operator(.)ident(new) ident(app) - -reserved(unless) pre_constant(ARGV)operator(.)ident(empty?) - ident(grammar) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator(.)ident(first)operator(\)) -reserved(else) - ident(grammar) operator(=) stringstring S -S --> Sb -S --> bAa -A --> aSc -A --> a -A --> aSb)delimiter( - EOG1)> -reserved(end) - -ident(window)operator(.)ident(load_grammar) ident(grammar) - -ident(app)operator(.)ident(create) -ident(app)operator(.)ident(run) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(module) class(WhyTheLuckyStiff) - reserved(class) class(Book) - ident(attr_accessor) symbol(:author)operator(,) symbol(:title)operator(,) symbol(:terms)operator(,) symbol(:image)operator(,) symbol(:teaser)operator(,) - symbol(:chapters)operator(,) symbol(:expansion_paks)operator(,) symbol(:encoding)operator(,) symbol(:credits) - reserved(def) method([]) ident(x) - instance_variable(@lang)operator(.)ident(fetch)operator(()ident(x)operator(\)) reserved(do) - ident(warn) ident(warning) operator(=) stringcontent('!])delimiter(")> - ident(warning) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) constant(Book)operator(::)ident(load)operator(() ident(file_name) operator(\)) - constant(YAML)operator(::)ident(load)operator(() constant(File)operator(.)ident(open)operator(() ident(file_name) operator(\)) operator(\)) - reserved(end) - - reserved(class) class(Section) - ident(attr_accessor) symbol(:index)operator(,) symbol(:header)operator(,) symbol(:content) - reserved(def) method(initialize)operator(() ident(i)operator(,) ident(h)operator(,) ident(c) operator(\)) - instance_variable(@index)operator(,) instance_variable(@header)operator(,) instance_variable(@content) operator(=) ident(i)operator(,) ident(h)operator(,) constant(RedCloth)operator(::)ident(new)operator(() ident(c)operator(.)ident(to_s) operator(\)) - reserved(end) - reserved(end) - - reserved(class) class(Sidebar) - ident(attr_accessor) symbol(:title)operator(,) symbol(:content) - reserved(end) - - constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) - constant(YAML)operator(::)ident(object_maker)operator(() constant(Sidebar)operator(,) string operator(=)operator(>) ident(val)operator(.)ident(keys)operator(.)ident(first)operator(,) string operator(=)operator(>) constant(RedCloth)operator(::)ident(new)operator(() ident(val)operator(.)ident(values)operator(.)ident(first) operator(\)) operator(\)) - reserved(end) - reserved(class) class(Chapter) - ident(attr_accessor) symbol(:index)operator(,) symbol(:title)operator(,) symbol(:sections) - reserved(def) method(initialize)operator(() ident(i)operator(,) ident(t)operator(,) ident(sects) operator(\)) - instance_variable(@index) operator(=) ident(i) - instance_variable(@title) operator(=) ident(t) - ident(i) operator(=) integer(0) - instance_variable(@sections) operator(=) ident(sects)operator(.)ident(collect) reserved(do) operator(|)ident(s)operator(|) - reserved(if) ident(s)operator(.)ident(respond_to?)operator(() symbol(:keys) operator(\)) - ident(i) operator(+=) integer(1) - constant(Section)operator(.)ident(new)operator(() ident(i)operator(,) ident(s)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(s)operator(.)ident(values)operator(.)ident(first) operator(\)) - reserved(else) - ident(s) - reserved(end) - reserved(end) - reserved(end) - reserved(end) - - constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) - operator([)stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(chaptype)operator(|) - ident(i) operator(=) integer(0) - ident(val)operator([)ident(chaptype)operator(])operator(.)ident(collect!) reserved(do) operator(|)ident(c)operator(|) - ident(i) operator(+=) integer(1) - constant(Chapter)operator(::)ident(new)operator(() ident(i)operator(,) ident(c)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(c)operator(.)ident(values)operator(.)ident(first) operator(\)) - reserved(end) - reserved(end) - ident(val)operator([)stringoperator(])operator(.)ident(collect!) reserved(do) operator(|)ident(t)operator(|) - constant(Section)operator(::)ident(new)operator(() integer(1)operator(,) ident(t)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(t)operator(.)ident(values)operator(.)ident(first) operator(\)) - reserved(end) - ident(val)operator([)stringoperator(]) operator(=) constant(RedCloth)operator(::)ident(new)operator(() ident(val)operator([)stringoperator(]) operator(\)) - constant(YAML)operator(::)ident(object_maker)operator(() constant(Book)operator(,) ident(val) operator(\)) - reserved(end) - - reserved(class) class(Image) - ident(attr_accessor) symbol(:file_name) - reserved(end) - - constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) - constant(YAML)operator(::)ident(object_maker)operator(() constant(Image)operator(,) string operator(=)operator(>) string operator(+) ident(val) operator(\)) - reserved(end) -reserved(end) - -comment(#) -comment(# Convert the book to HTML) -comment(#) -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - reserved(unless) pre_constant(ARGV)operator([)integer(0)operator(]) - ident(puts) stringcontent( [/path/to/save/html])delimiter(")> - ident(exit) - reserved(end) - - ident(site_path) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) - ident(book) operator(=) constant(WhyTheLuckyStiff)operator(::)constant(Book)operator(::)ident(load)operator(() string operator(\)) - ident(chapter) operator(=) pre_constant(nil) - - comment(# Write index page) - ident(index_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) - constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) - ident(out) operator(<<) ident(index_tpl)operator(.)ident(result) - reserved(end) - - ident(book)operator(.)ident(chapters) operator(=) ident(book)operator(.)ident(chapters)operator([)integer(0)operator(,)integer(3)operator(]) reserved(if) pre_constant(ARGV)operator(.)ident(include?) string - - comment(# Write chapter pages) - ident(chapter_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) - ident(book)operator(.)ident(chapters)operator(.)ident(each) reserved(do) operator(|)ident(chapter)operator(|) - constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) stringcontent(.html)delimiter(")> operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) - ident(out) operator(<<) ident(chapter_tpl)operator(.)ident(result) - reserved(end) - reserved(end) - ident(exit) reserved(if) pre_constant(ARGV)operator(.)ident(include?) string - - comment(# Write expansion pak pages) - ident(expak_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) - ident(book)operator(.)ident(expansion_paks)operator(.)ident(each) reserved(do) operator(|)ident(pak)operator(|) - constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) stringcontent(.html)delimiter(")> operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) - ident(out) operator(<<) ident(expak_tpl)operator(.)ident(result)operator(() ident(binding) operator(\)) - reserved(end) - reserved(end) - - comment(# Write printable version) - ident(print_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) - constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) - ident(out) operator(<<) ident(print_tpl)operator(.)ident(result) - reserved(end) - - comment(# Copy css + images into site) - ident(copy_list) operator(=) operator([)stringoperator(]) operator(+) - constant(Dir)operator([)stringoperator(])operator(.)ident(find_all) operator({) operator(|)ident(image)operator(|) ident(image) operator(=)operator(~) regexp operator(}) - - constant(File)operator(.)ident(makedirs)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\)) operator(\)) - ident(copy_list)operator(.)ident(each) reserved(do) operator(|)ident(copy_file)operator(|) - constant(File)operator(.)ident(copy)operator(() ident(copy_file)operator(,) constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) ident(copy_file) operator(\)) operator(\)) - reserved(end) -reserved(end) - -comment(#!/usr/bin/env ruby) - -ident(require) string -reserved(begin) - ident(require) string -reserved(rescue) constant(LoadError) - ident(require) string - constant(MSG) operator(=) stringstring - ident(missingDependency)operator(()constant(MSG)operator(\)) -reserved(end) - - -ident(include) constant(Fox) -ident(include) constant(Math) - -constant(Deg2Rad) operator(=) constant(Math)operator(::)constant(PI) operator(/) integer(180) - -constant(D_MAX) operator(=) integer(6) -constant(SQUARE_SIZE) operator(=) float(2.0) operator(/) constant(D_MAX) -constant(SQUARE_DISTANCE) operator(=) float(4.0) operator(/) constant(D_MAX) -constant(AMPLITUDE) operator(=) constant(SQUARE_SIZE) -constant(LAMBDA) operator(=) constant(D_MAX)operator(.)ident(to_f) operator(/) integer(2) - -reserved(class) class(GLTestWindow) operator(<) constant(FXMainWindow) - - comment(# How often our timer will fire (in milliseconds\)) - constant(TIMER_INTERVAL) operator(=) integer(500) - - comment(# Rotate the boxes when a timer message is received) - reserved(def) method(onTimeout)operator(()ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(\)) - instance_variable(@angle) operator(+=) float(10.0) -comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) - ident(drawScene)operator(()operator(\)) - instance_variable(@timer) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addTimeout)operator(()constant(TIMER_INTERVAL)operator(,) ident(method)operator(()symbol(:onTimeout)operator(\))operator(\)) - reserved(end) - - comment(# Rotate the boxes when a chore message is received) - reserved(def) method(onChore)operator(()ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(\)) - instance_variable(@angle) operator(+=) float(10.0) -comment(# @angle %= 360.0) -comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) - ident(drawScene)operator(()operator(\)) - instance_variable(@chore) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addChore)operator(()ident(method)operator(()symbol(:onChore)operator(\))operator(\)) - reserved(end) - - comment(# Draw the GL scene) - reserved(def) method(drawScene) - ident(lightPosition) operator(=) operator([)float(15.0)operator(,) float(10.0)operator(,) float(5.0)operator(,) float(1.0)operator(]) - ident(lightAmbient) operator(=) operator([) float(0.1)operator(,) float(0.1)operator(,) float(0.1)operator(,) float(1.0)operator(]) - ident(lightDiffuse) operator(=) operator([) float(0.9)operator(,) float(0.9)operator(,) float(0.9)operator(,) float(1.0)operator(]) - ident(redMaterial) operator(=) operator([) float(0.0)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(1.0)operator(]) - ident(blueMaterial) operator(=) operator([) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(,) float(1.0)operator(]) - - ident(width) operator(=) instance_variable(@glcanvas)operator(.)ident(width)operator(.)ident(to_f) - ident(height) operator(=) instance_variable(@glcanvas)operator(.)ident(height)operator(.)ident(to_f) - ident(aspect) operator(=) ident(width)operator(/)ident(height) - - comment(# Make context current) - instance_variable(@glcanvas)operator(.)ident(makeCurrent)operator(()operator(\)) - - constant(GL)operator(.)ident(Viewport)operator(()integer(0)operator(,) integer(0)operator(,) instance_variable(@glcanvas)operator(.)ident(width)operator(,) instance_variable(@glcanvas)operator(.)ident(height)operator(\)) - - constant(GL)operator(.)ident(ClearColor)operator(()float(1.0)operator(/)integer(256)operator(,) float(0.0)operator(,) float(5.0)operator(/)integer(256)operator(,) float(1.0)operator(\)) - constant(GL)operator(.)ident(Clear)operator(()constant(GL)operator(::)constant(COLOR_BUFFER_BIT)operator(|)constant(GL)operator(::)constant(DEPTH_BUFFER_BIT)operator(\)) - constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(DEPTH_TEST)operator(\)) - - constant(GL)operator(.)ident(Disable)operator(()constant(GL)operator(::)constant(DITHER)operator(\)) - - constant(GL)operator(.)ident(MatrixMode)operator(()constant(GL)operator(::)constant(PROJECTION)operator(\)) - constant(GL)operator(.)ident(LoadIdentity)operator(()operator(\)) - constant(GLU)operator(.)ident(Perspective)operator(()float(30.0)operator(,) ident(aspect)operator(,) float(1.0)operator(,) float(100.0)operator(\)) - - constant(GL)operator(.)ident(MatrixMode)operator(()constant(GL)operator(::)constant(MODELVIEW)operator(\)) - constant(GL)operator(.)ident(LoadIdentity)operator(()operator(\)) - constant(GLU)operator(.)ident(LookAt)operator(()float(5.0)operator(,) float(10.0)operator(,) float(15.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(\)) - - constant(GL)operator(.)ident(ShadeModel)operator(()constant(GL)operator(::)constant(SMOOTH)operator(\)) - constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(POSITION)operator(,) ident(lightPosition)operator(\)) - constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(lightAmbient)operator(\)) - constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(lightDiffuse)operator(\)) - constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(LIGHT0)operator(\)) - constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(LIGHTING)operator(\)) - - constant(GL)operator(.)ident(Rotated)operator(()float(0.1)operator(*)instance_variable(@angle)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(\)) - reserved(for) ident(x) reserved(in) operator(-)constant(D_MAX)operator(..)constant(D_MAX) - reserved(for) ident(y) reserved(in) operator(-)constant(D_MAX)operator(..)constant(D_MAX) - ident(h1) operator(=) operator(()ident(x) operator(+) ident(y) operator(-) integer(2)operator(\))operator(.)ident(abs) - ident(h2) operator(=) operator(()ident(y) operator(-) ident(x) operator(+) integer(1)operator(\))operator(.)ident(abs) - constant(GL)operator(.)constant(PushMatrix) - ident(c) operator(=) operator([)integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(]) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) - - constant(GL)operator(.)ident(Translated)operator(() - ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) - constant(AMPLITUDE) operator(*) ident(h1)operator(,) - ident(x) operator(*) constant(SQUARE_DISTANCE) - operator(\)) - - constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) - constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) - - constant(GL)operator(.)constant(PopMatrix) - - constant(GL)operator(.)constant(PushMatrix) - ident(c) operator(=) operator([)integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(1)operator(]) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) - - constant(GL)operator(.)ident(Translated)operator(() - ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) - constant(AMPLITUDE) operator(*) ident(h2)operator(,) - ident(x) operator(*) constant(SQUARE_DISTANCE) - operator(\)) - - constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) - constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) - - constant(GL)operator(.)constant(PopMatrix) - - constant(GL)operator(.)constant(PushMatrix) - ident(c) operator(=) operator([)float(0.0) operator(+) operator(()ident(x)operator(/)float(10.0)operator(\))operator(,) float(0.0) operator(+) operator(()ident(y)operator(/)float(10.0)operator(\))operator(,) integer(0)operator(,) integer(1)operator(]) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) - constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) - - constant(GL)operator(.)ident(Translated)operator(() - ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) - integer(0)operator(,) - ident(x) operator(*) constant(SQUARE_DISTANCE) - operator(\)) - - constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) - constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) - - constant(GL)operator(.)constant(PopMatrix) - reserved(end) - reserved(end) - - comment(# Swap if it is double-buffered) - reserved(if) instance_variable(@glvisual)operator(.)ident(isDoubleBuffer) - instance_variable(@glcanvas)operator(.)ident(swapBuffers) - reserved(end) - - comment(# Make context non-current) - instance_variable(@glcanvas)operator(.)ident(makeNonCurrent) - reserved(end) - - reserved(def) method(initialize)operator(()ident(app)operator(\)) - comment(# Invoke the base class initializer) - reserved(super)operator(()ident(app)operator(,) stringoperator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) constant(DECOR_ALL)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1024)operator(,) integer(768)operator(\)) - - comment(# Construct the main window elements) - ident(frame) operator(=) constant(FXHorizontalFrame)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(\)) - ident(frame)operator(.)ident(padLeft)operator(,) ident(frame)operator(.)ident(padRight) operator(=) integer(0)operator(,) integer(0) - ident(frame)operator(.)ident(padTop)operator(,) ident(frame)operator(.)ident(padBottom) operator(=) integer(0)operator(,) integer(0) - - comment(# Left pane to contain the glcanvas) - ident(glcanvasFrame) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(frame)operator(,) - constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(glcanvasFrame)operator(.)ident(padLeft)operator(,) ident(glcanvasFrame)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(glcanvasFrame)operator(.)ident(padTop)operator(,) ident(glcanvasFrame)operator(.)ident(padBottom) operator(=) integer(10)operator(,) integer(10) - - comment(# Label above the glcanvas) - constant(FXLabel)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) - constant(JUSTIFY_CENTER_X)operator(|)constant(LAYOUT_FILL_X)operator(\)) - - comment(# Horizontal divider line) - constant(FXHorizontalSeparator)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) constant(SEPARATOR_GROOVE)operator(|)constant(LAYOUT_FILL_X)operator(\)) - - comment(# Drawing glcanvas) - ident(glpanel) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) operator(()constant(FRAME_SUNKEN)operator(|)constant(FRAME_THICK)operator(|) - constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\))operator(\)) - ident(glpanel)operator(.)ident(padLeft)operator(,) ident(glpanel)operator(.)ident(padRight) operator(=) integer(0)operator(,) integer(0) - ident(glpanel)operator(.)ident(padTop)operator(,) ident(glpanel)operator(.)ident(padBottom) operator(=) integer(0)operator(,) integer(0) - - comment(# A visual to draw OpenGL) - instance_variable(@glvisual) operator(=) constant(FXGLVisual)operator(.)ident(new)operator(()ident(getApp)operator(()operator(\))operator(,) constant(VISUAL_DOUBLEBUFFER)operator(\)) - - comment(# Drawing glcanvas) - instance_variable(@glcanvas) operator(=) constant(FXGLCanvas)operator(.)ident(new)operator(()ident(glpanel)operator(,) instance_variable(@glvisual)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) - constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - instance_variable(@glcanvas)operator(.)ident(connect)operator(()constant(SEL_PAINT)operator(\)) operator({) - ident(drawScene) - operator(}) - instance_variable(@glcanvas)operator(.)ident(connect)operator(()constant(SEL_CONFIGURE)operator(\)) operator({) - reserved(if) instance_variable(@glcanvas)operator(.)ident(makeCurrent) - constant(GL)operator(.)ident(Viewport)operator(()integer(0)operator(,) integer(0)operator(,) instance_variable(@glcanvas)operator(.)ident(width)operator(,) instance_variable(@glcanvas)operator(.)ident(height)operator(\)) - instance_variable(@glcanvas)operator(.)ident(makeNonCurrent) - reserved(end) - operator(}) - - comment(# Right pane for the buttons) - ident(buttonFrame) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(frame)operator(,) constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(buttonFrame)operator(.)ident(padLeft)operator(,) ident(buttonFrame)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(buttonFrame)operator(.)ident(padTop)operator(,) ident(buttonFrame)operator(.)ident(padBottom) operator(=) integer(10)operator(,) integer(10) - - comment(# Label above the buttons) - constant(FXLabel)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) - constant(JUSTIFY_CENTER_X)operator(|)constant(LAYOUT_FILL_X)operator(\)) - - comment(# Horizontal divider line) - constant(FXHorizontalSeparator)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) constant(SEPARATOR_RIDGE)operator(|)constant(LAYOUT_FILL_X)operator(\)) - - comment(# Spin according to timer) - ident(spinTimerBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) - stringoperator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(spinTimerBtn)operator(.)ident(padLeft)operator(,) ident(spinTimerBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(spinTimerBtn)operator(.)ident(padTop)operator(,) ident(spinTimerBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) - ident(spinTimerBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) - instance_variable(@spinning) operator(=) pre_constant(true) - instance_variable(@timer) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addTimeout)operator(()constant(TIMER_INTERVAL)operator(,) ident(method)operator(()symbol(:onTimeout)operator(\))operator(\)) - operator(}) - ident(spinTimerBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) - instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(disable) operator(:) ident(sender)operator(.)ident(enable) - operator(}) - - comment(# Spin according to chore) - ident(spinChoreBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) - stringoperator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(spinChoreBtn)operator(.)ident(padLeft)operator(,) ident(spinChoreBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(spinChoreBtn)operator(.)ident(padTop)operator(,) ident(spinChoreBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) - ident(spinChoreBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) - instance_variable(@spinning) operator(=) pre_constant(true) - instance_variable(@chore) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addChore)operator(()ident(method)operator(()symbol(:onChore)operator(\))operator(\)) - operator(}) - ident(spinChoreBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) - instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(disable) operator(:) ident(sender)operator(.)ident(enable) - operator(}) - - comment(# Stop spinning) - ident(stopBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) - stringoperator(,) pre_constant(nil)operator(,) - pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(stopBtn)operator(.)ident(padLeft)operator(,) ident(stopBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(stopBtn)operator(.)ident(padTop)operator(,) ident(stopBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) - ident(stopBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) - instance_variable(@spinning) operator(=) pre_constant(false) - reserved(if) instance_variable(@timer) - ident(getApp)operator(()operator(\))operator(.)ident(removeTimeout)operator(()instance_variable(@timer)operator(\)) - instance_variable(@timer) operator(=) pre_constant(nil) - reserved(end) - reserved(if) instance_variable(@chore) - ident(getApp)operator(()operator(\))operator(.)ident(removeChore)operator(()instance_variable(@chore)operator(\)) - instance_variable(@chore) operator(=) pre_constant(nil) - reserved(end) - operator(}) - ident(stopBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) - instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(enable) operator(:) ident(sender)operator(.)ident(disable) - operator(}) - - comment(# Exit button) - ident(exitBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) - ident(getApp)operator(()operator(\))operator(,) constant(FXApp)operator(::)constant(ID_QUIT)operator(,) - constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) - ident(exitBtn)operator(.)ident(padLeft)operator(,) ident(exitBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) - ident(exitBtn)operator(.)ident(padTop)operator(,) ident(exitBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) - - comment(# Make a tooltip) - constant(FXTooltip)operator(.)ident(new)operator(()ident(getApp)operator(()operator(\))operator(\)) - - comment(# Initialize private variables) - instance_variable(@spinning) operator(=) pre_constant(false) - instance_variable(@chore) operator(=) pre_constant(nil) - instance_variable(@timer) operator(=) pre_constant(nil) - instance_variable(@angle) operator(=) float(0.0) - instance_variable(@size) operator(=) float(0.5) - reserved(end) - - comment(# Create and initialize) - reserved(def) method(create) - reserved(super) - ident(show)operator(()constant(PLACEMENT_SCREEN)operator(\)) - reserved(end) -reserved(end) - -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - comment(# Construct the application) - ident(application) operator(=) constant(FXApp)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - - comment(# To ensure that the chores-based spin will run as fast as possible,) - comment(# we can disable the chore in FXRuby's event loop that tries to schedule) - comment(# other threads. This is OK for this program because there aren't any) - comment(# other Ruby threads running.) - - comment(#application.disableThreads) - - comment(# Construct the main window) - constant(GLTestWindow)operator(.)ident(new)operator(()ident(application)operator(\)) - - comment(# Create the app's windows) - ident(application)operator(.)ident(create) - - comment(# Run the application) - ident(application)operator(.)ident(run) -reserved(end) - -reserved(class) class(Facelet) - ident(attr_accessor) symbol(:color) - reserved(def) method(initialize)operator(()ident(color)operator(\)) - instance_variable(@color) operator(=) ident(color) - reserved(end) - - reserved(def) method(to_s) - instance_variable(@color) - reserved(end) -reserved(end) - -reserved(class) class(Edge) - ident(attr_accessor) symbol(:facelets)operator(,) symbol(:colors) - - reserved(def) method(initialize)operator(()ident(facelets)operator(\)) - instance_variable(@facelets) operator(=) ident(facelets) - instance_variable(@colors) operator(=) instance_variable(@facelets)operator(.)ident(map) operator({) operator(|)ident(fl)operator(|) ident(fl)operator(.)ident(color) operator(}) - reserved(end) - - reserved(def) method(apply)operator(()ident(edge)operator(\)) - instance_variable(@facelets)operator(.)ident(each_with_index) operator({) operator(|)ident(fl)operator(,) ident(i)operator(|) - ident(fl)operator(.)ident(color) operator(=) ident(edge)operator(.)ident(colors)operator([)ident(i)operator(]) - operator(}) - reserved(end) - - reserved(def) method(inspect) - string operator(%) ident(facelets) - reserved(end) -reserved(end) - -reserved(class) class(Side) - ident(attr_reader) symbol(:num)operator(,) symbol(:facelets) - ident(attr_accessor) symbol(:sides) - - reserved(def) method(initialize)operator(()ident(num)operator(\)) - instance_variable(@num) operator(=) ident(num) - instance_variable(@sides) operator(=) operator([)operator(]) - instance_variable(@facelets) operator(=) operator([)operator(]) - instance_variable(@fl_by_side) operator(=) operator({)operator(}) - reserved(end) - - comment(# facelets & sides) - comment(# 0) - comment(# 0 1 2) - comment(# 3 3 4 5 1) - comment(# 6 7 8) - comment(# 2) - - reserved(def) method(facelets=)operator(()ident(facelets)operator(\)) - instance_variable(@facelets) operator(=) ident(facelets)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(Facelet)operator(.)ident(new)operator(()ident(c)operator(\)) operator(}) - ident(init_facelet) integer(0)operator(,) integer(3)operator(,)integer(0) - ident(init_facelet) integer(1)operator(,) integer(0) - ident(init_facelet) integer(2)operator(,) integer(0)operator(,)integer(1) - ident(init_facelet) integer(3)operator(,) integer(3) - ident(init_facelet) integer(5)operator(,) integer(1) - ident(init_facelet) integer(6)operator(,) integer(2)operator(,)integer(3) - ident(init_facelet) integer(7)operator(,) integer(2) - ident(init_facelet) integer(8)operator(,) integer(1)operator(,)integer(2) - reserved(end) - - reserved(def) method(<=>)operator(()ident(side)operator(\)) - pre_constant(self)operator(.)ident(num) operator(<=>) ident(side)operator(.)ident(num) - reserved(end) - - reserved(def) method(init_facelet)operator(()ident(pos)operator(,) operator(*)ident(side_nums)operator(\)) - ident(sides) operator(=) ident(side_nums)operator(.)ident(map) operator({) operator(|)ident(num)operator(|) instance_variable(@sides)operator([)ident(num)operator(]) operator(})operator(.)ident(sort) - instance_variable(@fl_by_side)operator([)ident(sides)operator(]) operator(=) ident(pos) - reserved(end) - - reserved(def) method([]=)operator(()ident(color)operator(,) operator(*)ident(sides)operator(\)) - instance_variable(@facelets)operator([)instance_variable(@fl_by_side)operator([)ident(sides)operator(.)ident(sort)operator(])operator(])operator(.)ident(color) operator(=) ident(color) - reserved(end) - - reserved(def) method(values_at)operator(()operator(*)ident(sides)operator(\)) - ident(sides)operator(.)ident(map) operator({) operator(|)ident(sides)operator(|) instance_variable(@facelets)operator([)instance_variable(@fl_by_side)operator([)ident(sides)operator(.)ident(sort)operator(])operator(]) operator(}) - reserved(end) - - reserved(def) method(inspect)operator(()ident(range)operator(=)pre_constant(nil)operator(\)) - reserved(if) ident(range) - instance_variable(@facelets)operator(.)ident(values_at)operator(()operator(*)operator(()ident(range)operator(.)ident(to_a)operator(\))operator(\))operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(num)operator(|) instance_variable(@facelets)operator([)ident(num)operator(.)ident(to_i)operator(]) operator(})operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(side)operator(|) instance_variable(@sides)operator([)ident(side)operator([)integer(0)operator(])operator(-)integer(?A)operator(])operator(.)ident(num)operator(.)ident(to_s) operator(})string - reserved(end) - reserved(end) - - reserved(def) method(get_edge)operator(()ident(side)operator(\)) - ident(trio) operator(=) operator(()integer(-1)operator(..)integer(1)operator(\))operator(.)ident(map) operator({) operator(|)ident(x)operator(|) operator(()ident(side) operator(+) ident(x)operator(\)) operator(%) integer(4) operator(}) - ident(prev_side)operator(,) ident(this_side)operator(,) ident(next_side) operator(=) instance_variable(@sides)operator(.)ident(values_at)operator(()operator(*)ident(trio)operator(\)) - ident(e) operator(=) constant(Edge)operator(.)ident(new)operator(() - pre_constant(self) operator(.)ident(values_at)operator(() operator([)ident(this_side)operator(])operator(,) operator([)ident(this_side)operator(,) ident(next_side)operator(]) operator(\)) operator(+) - ident(this_side)operator(.)ident(values_at)operator(() operator([)pre_constant(self)operator(,) ident(prev_side)operator(])operator(,) operator([)pre_constant(self) operator(])operator(,) operator([)pre_constant(self)operator(,) ident(next_side)operator(]) operator(\)) - operator(\)) - comment(#puts 'Edge created for side %d: ' % side + e.inspect) - ident(e) - reserved(end) - - reserved(def) method(turn)operator(()ident(dir)operator(\)) - comment(#p 'turn side %d in %d' % [num, dir]) - ident(edges) operator(=) operator(()integer(0)operator(..)integer(3)operator(\))operator(.)ident(map) operator({) operator(|)ident(n)operator(|) ident(get_edge) ident(n) operator(}) - reserved(for) ident(i) reserved(in) integer(0)operator(..)integer(3) - ident(edges)operator([)ident(i)operator(])operator(.)ident(apply) ident(edges)operator([)operator(()ident(i)operator(-)ident(dir)operator(\)) operator(%) integer(4)operator(]) - reserved(end) - reserved(end) -reserved(end) - -reserved(class) class(Cube) - reserved(def) method(initialize) - instance_variable(@sides) operator(=) operator([)operator(]) - stringoperator(.)ident(each_with_index) operator({) operator(|)ident(side)operator(,) ident(i)operator(|) - ident(eval)operator(()stringcontent(] = @)inlinecontent( = Side.new()inlinecontent(\))delimiter(")>operator(\)) - operator(}) - instance_variable(@left)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@front)operator(,) instance_variable(@bottom)operator(,) instance_variable(@back)operator(]) - instance_variable(@front)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@right)operator(,) instance_variable(@bottom)operator(,) instance_variable(@left)operator(]) - instance_variable(@right)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@back)operator(,) instance_variable(@bottom)operator(,) instance_variable(@front)operator(]) - instance_variable(@back)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@left)operator(,) instance_variable(@bottom)operator(,) instance_variable(@right)operator(]) - instance_variable(@top)operator(.)ident(sides) operator(=) operator([)instance_variable(@back)operator(,) instance_variable(@right)operator(,) instance_variable(@front)operator(,) instance_variable(@left)operator(]) - instance_variable(@bottom)operator(.)ident(sides) operator(=) operator([)instance_variable(@front)operator(,) instance_variable(@right)operator(,) instance_variable(@back)operator(,) instance_variable(@left)operator(]) - reserved(end) - - reserved(def) method(read_facelets)operator(()ident(fs)operator(\)) - ident(pattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\))string - ident(md) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(fs)operator(\))operator(.)ident(to_a) - - instance_variable(@top)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(1)operator(,)integer(2)operator(,)integer(3)operator(\))operator(\)) - instance_variable(@left)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(4)operator(,)integer(8)operator(,)integer(12)operator(\))operator(\)) - instance_variable(@front)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(5)operator(,)integer(9)operator(,)integer(13)operator(\))operator(\)) - instance_variable(@right)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(6)operator(,)integer(10)operator(,)integer(14)operator(\))operator(\)) - instance_variable(@back)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(7)operator(,)integer(11)operator(,)integer(15)operator(\))operator(\)) - instance_variable(@bottom)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(16)operator(,)integer(17)operator(,)integer(18)operator(\))operator(\)) - reserved(end) - - reserved(def) method(turn)operator(()ident(side)operator(,) ident(dir)operator(\)) - comment(#p 'turn %d in %d' % [side, dir]) - instance_variable(@sides)operator([)ident(side)operator(])operator(.)ident(turn)operator(()ident(dir)operator(\)) - comment(#puts inspect) - reserved(end) - - reserved(def) method(inspect) - stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) instance_variable(@sides)operator([)global_variable($1)operator(.)ident(to_i)operator(])operator(.)ident(inspect)operator(()constant(Range)operator(.)ident(new)operator(()global_variable($2)operator(.)ident(to_i)operator(,) global_variable($3)operator(.)ident(to_i)operator(\))operator(\)) operator(})string - reserved(end) - -ident(private) - reserved(def) method(parse_facelets)operator(()ident(rows)operator(\)) - ident(rows)operator(.)ident(join)operator(.)ident(delete)operator(()stringoperator(\))operator(.)ident(split)operator(()regexpoperator(\)) - reserved(end) -reserved(end) - -comment(#$stdin = DATA) - -ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(puts) stringcontent(:)delimiter(")> - ident(fs) operator(=) string - integer(9)operator(.)ident(times) operator({) ident(fs) operator(<<) ident(gets) operator(}) - ident(cube) operator(=) constant(Cube)operator(.)ident(new) - ident(cube)operator(.)ident(read_facelets) ident(fs) - ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(t)operator(|) - ident(side)operator(,) ident(dir) operator(=) ident(gets)operator(.)ident(split)operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(to_i)operator(}) - ident(cube)operator(.)ident(turn)operator(()ident(side)operator(,) ident(dir)operator(\)) - reserved(end) - ident(puts) ident(cube)operator(.)ident(inspect) - ident(puts) -reserved(end) - -comment(# 2004 by murphy ) -comment(# GPL) -reserved(class) class(Scenario) - reserved(class) class(TimePoint) - ident(attr_reader) symbol(:data) - reserved(def) method(initialize) operator(*)ident(data) - instance_variable(@data) operator(=) ident(data) - reserved(end) - - reserved(def) method([]) ident(i) - instance_variable(@data)operator([)ident(i)operator(]) reserved(or) integer(0) - reserved(end) - - ident(include) constant(Comparable) - reserved(def) method(<=>) ident(tp) - ident(r) operator(=) integer(0) - operator([)instance_variable(@data)operator(.)ident(size)operator(,) ident(tp)operator(.)ident(data)operator(.)ident(size)operator(])operator(.)ident(max)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(r) operator(=) pre_constant(self)operator([)ident(i)operator(]) operator(<=>) ident(tp)operator([)ident(i)operator(]) - reserved(return) ident(r) reserved(if) ident(r)operator(.)ident(nonzero?) - reserved(end) - integer(0) - reserved(end) - - reserved(def) method(-) ident(tp) - ident(r) operator(=) operator([)operator(]) - operator([)instance_variable(@data)operator(.)ident(size)operator(,) ident(tp)operator(.)ident(data)operator(.)ident(size)operator(])operator(.)ident(max)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) - ident(r) operator(<<) pre_constant(self)operator([)ident(i)operator(]) operator(-) ident(tp)operator([)ident(i)operator(]) - reserved(end) - ident(r) - reserved(end) - - reserved(def) method(inspect) - comment(# 01/01/1800 00:00:00) - string operator(%) instance_variable(@data)operator(.)ident(values_at)operator(()integer(1)operator(,) integer(2)operator(,) integer(0)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(\)) - reserved(end) - reserved(end) - - constant(ONE_HOUR) operator(=) constant(TimePoint)operator(.)ident(new) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0) - - constant(APPOINTMENT_PATTERN) operator(=) regexp - - reserved(def) method(initialize) ident(io) - instance_variable(@team_size) operator(=) ident(io)operator(.)ident(gets)operator(.)ident(to_i) - instance_variable(@data) operator(=) operator([) operator([)constant(TimePoint)operator(.)ident(new)operator(()integer(1800)operator(,) integer(01)operator(,) integer(01)operator(,) integer(00)operator(,) integer(00)operator(,) integer(00)operator(\))operator(,) instance_variable(@team_size)operator(]) operator(]) - instance_variable(@team_size)operator(.)ident(times) reserved(do) comment(# each team member) - ident(io)operator(.)ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) comment(# each appointment) - ident(m) operator(=) constant(APPOINTMENT_PATTERN)operator(.)ident(match) ident(io)operator(.)ident(gets) - instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()operator(*)ident(m)operator(.)ident(captures)operator([)integer(0)operator(,)integer(6)operator(])operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(to_i) operator(})operator(\))operator(,) integer(-1)operator(]) - instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()operator(*)ident(m)operator(.)ident(captures)operator([)integer(6)operator(,)integer(6)operator(])operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(to_i) operator(})operator(\))operator(,) integer(+1)operator(]) - reserved(end) - reserved(end) - instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()integer(2200)operator(,) integer(01)operator(,) integer(01)operator(,) integer(00)operator(,) integer(00)operator(,) integer(00)operator(\))operator(,) operator(-)instance_variable(@team_size)operator(]) - reserved(end) - - reserved(def) method(print_time_plan) - ident(n) operator(=) integer(0) - ident(appointment) operator(=) pre_constant(nil) - ident(no_appointment) operator(=) pre_constant(true) - instance_variable(@data)operator(.)ident(sort_by) operator({) operator(|)ident(x)operator(|) ident(x)operator([)integer(0)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) - ident(tp)operator(,) ident(action) operator(=) operator(*)ident(x) - ident(n) operator(+=) ident(action) - comment(# at any time during the meeting, at least two team members need to be there) - comment(# and at most one team member is allowed to be absent) - reserved(if) ident(n) operator(>)operator(=) integer(2) reserved(and) operator(()instance_variable(@team_size) operator(-) ident(n)operator(\)) operator(<=) integer(1) - ident(appointment) operator(||=) ident(tp) - reserved(else) - reserved(if) ident(appointment) - comment(# the meeting should be at least one hour in length) - reserved(if) constant(TimePoint)operator(.)ident(new)operator(()operator(*)operator(()ident(tp) operator(-) ident(appointment)operator(\))operator(\)) operator(>)operator(=) constant(ONE_HOUR) - ident(puts) string operator(%) operator([)ident(appointment)operator(,) ident(tp)operator(]) - ident(no_appointment) operator(=) pre_constant(false) - reserved(end) - ident(appointment) operator(=) pre_constant(false) - reserved(end) - reserved(end) - reserved(end) - ident(puts) string reserved(if) ident(no_appointment) - reserved(end) -reserved(end) - -comment(# read the data) -pre_constant(DATA)operator(.)ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(si)operator(|) comment(# each scenario) - ident(puts) string operator(%) operator(()ident(si) operator(+) integer(1)operator(\)) - ident(sc) operator(=) constant(Scenario)operator(.)ident(new) pre_constant(DATA) - ident(sc)operator(.)ident(print_time_plan) - ident(puts) -reserved(end) - -comment(#__END__) -integer(2) -integer(3) -integer(3) -integer(2002) integer(06) integer(28) integer(15) integer(00) integer(00) integer(2002) integer(06) integer(28) integer(18) integer(00) integer(00) constant(TUD) constant(Contest) constant(Practice) constant(Session) -integer(2002) integer(06) integer(29) integer(10) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(15) integer(00) integer(00) constant(TUD) constant(Contest) -integer(2002) integer(11) integer(15) integer(15) integer(00) integer(00) integer(2002) integer(11) integer(17) integer(23) integer(00) integer(00) constant(NWERC) constant(Delft) -integer(4) -integer(2002) integer(06) integer(25) integer(13) integer(30) integer(00) integer(2002) integer(06) integer(25) integer(15) integer(30) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Semifinal) constant(I) -integer(2002) integer(06) integer(26) integer(13) integer(30) integer(00) integer(2002) integer(06) integer(26) integer(15) integer(30) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Semifinal) constant(II) -integer(2002) integer(06) integer(29) integer(13) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(15) integer(00) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Third) constant(Place) -integer(2002) integer(06) integer(30) integer(13) integer(00) integer(00) integer(2002) integer(06) integer(30) integer(15) integer(00) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Final) -integer(1) -integer(2002) integer(06) integer(01) integer(00) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(18) integer(00) integer(00) constant(Preparation) ident(of) constant(Problem) constant(Set) -integer(2) -integer(1) -integer(1800) integer(01) integer(01) integer(00) integer(00) integer(00) integer(2200) integer(01) integer(01) integer(00) integer(00) integer(00) constant(Solving) constant(Problem) integer(8) -integer(0) - -ident(require) string -ident(require) string -ident(require) string -ident(require) string - -reserved(class) class(Fixnum) - comment(# Treat char as a digit and return it's value as Fixnum.) - comment(# Returns nonsense for non-digits.) - comment(# Examples:) - comment(# ) - comment(# RUBY_VERSION[0].digit == '1.8.2'[0].digit == 1) - comment(# ) - comment(#) - comment(# ) - comment(# ?6.digit == 6) - comment(# ) - comment(#) - comment(# ) - comment(# ?A.digit == 17) - comment(# ) - reserved(def) method(digit) - pre_constant(self) operator(-) integer(?0) - reserved(end) -reserved(end) - -comment(##) -comment(# Stellt einen einfachen Scanner für die lexikalische Analyse der Sprache Pas-0 dar.) -comment(#) -comment(# @author Andreas Kunert) -comment(# Ruby port by murphy) -reserved(class) class(Scanner) - - ident(include) constant(TokenConsts) - - ident(attr_reader) symbol(:line)operator(,) symbol(:pos) - - comment(# To allow Scanner.new without parameters.) - constant(DUMMY_INPUT) operator(=) string - reserved(def) constant(DUMMY_INPUT)operator(.)ident(getc) - pre_constant(nil) - reserved(end) - - comment(##) - comment(# Erzeugt einen Scanner, der als Eingabe das übergebene IO benutzt.) - reserved(def) method(initialize) ident(input) operator(=) constant(DUMMY_INPUT) - instance_variable(@line) operator(=) integer(1) - instance_variable(@pos) operator(=) integer(0) - - reserved(begin) - instance_variable(@input) operator(=) ident(input) - instance_variable(@next_char) operator(=) instance_variable(@input)operator(.)ident(getc) - reserved(rescue) constant(IOError) comment(# TODO show the reason!) - constant(Error)operator(.)ident(ioError) - ident(raise) - reserved(end) - reserved(end) - - comment(##) - comment(# Liest das nchste Zeichen von der Eingabe.) - reserved(def) method(read_next_char) - reserved(begin) - instance_variable(@pos) operator(+=) integer(1) - instance_variable(@current_char) operator(=) instance_variable(@next_char) - instance_variable(@next_char) operator(=) instance_variable(@input)operator(.)ident(getc) - reserved(rescue) constant(IOError) - constant(Error)operator(.)ident(ioError) - ident(raise) - reserved(end) - reserved(end) - - comment(##) - comment(# Sucht das nächste Symbol, identifiziert es, instantiiert ein entsprechendes) - comment(# PascalSymbol-Objekt und gibt es zurück.) - comment(# @see Symbol) - comment(# @return das gefundene Symbol als PascalSymbol-Objekt) - reserved(def) method(get_symbol) - ident(current_symbol) operator(=) pre_constant(nil) - reserved(until) ident(current_symbol) - ident(read_next_char) - - reserved(if) instance_variable(@current_char)operator(.)ident(alpha?) - ident(identifier) operator(=) instance_variable(@current_char)operator(.)ident(chr) - reserved(while) instance_variable(@next_char)operator(.)ident(alpha?) reserved(or) instance_variable(@next_char)operator(.)ident(digit?) - ident(identifier) operator(<<) instance_variable(@next_char) - ident(read_next_char) - reserved(end) - ident(current_symbol) operator(=) ident(handle_identifier)operator(()ident(identifier)operator(.)ident(upcase)operator(\)) - reserved(elsif) instance_variable(@current_char)operator(.)ident(digit?) - ident(current_symbol) operator(=) ident(number) - reserved(else) - reserved(case) instance_variable(@current_char) - reserved(when) integer(?\\s) - comment(# ignore) - reserved(when) integer(?\\n) - ident(new_line) - reserved(when) pre_constant(nil) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(EOP) - reserved(when) integer(?{) - ident(comment) - - reserved(when) integer(?:) - reserved(if) instance_variable(@next_char) operator(==) integer(?=) - ident(read_next_char) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(BECOMES) - reserved(else) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(COLON) - reserved(end) - - reserved(when) integer(?<) - reserved(if) operator(()instance_variable(@next_char) operator(==) integer(?=)operator(\)) - ident(read_next_char) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LEQSY) - reserved(elsif) operator(()instance_variable(@next_char) operator(==) integer(?>)operator(\)) - ident(read_next_char) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(NEQSY) - reserved(else) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LSSSY) - reserved(end) - - reserved(when) integer(?>) - reserved(if) operator(()instance_variable(@next_char) operator(==) integer(?=)operator(\)) - ident(read_next_char) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(GEQSY) - reserved(else) - ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(GRTSY) - reserved(end) - - reserved(when) integer(?.) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(PERIOD) - reserved(when) integer(?() reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LPARENT) - reserved(when) integer(?,) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(COMMA) - reserved(when) integer(?*) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(TIMES) - reserved(when) integer(?/) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(SLASH) - reserved(when) integer(?+) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(PLUS) - reserved(when) integer(?-) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(MINUS) - reserved(when) integer(?=) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(EQLSY) - reserved(when) integer(?\)) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(RPARENT) - reserved(when) integer(?;) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(SEMICOLON) - reserved(else) - constant(Error)operator(.)ident(error)operator(()integer(100)operator(,) instance_variable(@line)operator(,) instance_variable(@pos)operator(\)) reserved(if) instance_variable(@current_char) operator(>) integer(?\\s) - reserved(end) - reserved(end) - reserved(end) - ident(current_symbol) - reserved(end) - -ident(private) - comment(##) - comment(# Versucht, in dem gegebenen String ein Schlüsselwort zu erkennen.) - comment(# Sollte dabei ein Keyword gefunden werden, so gibt er ein PascalSymbol-Objekt zurück, das) - comment(# das entsprechende Keyword repräsentiert. Ansonsten besteht die Rückgabe aus) - comment(# einem SymbolIdent-Objekt (abgeleitet von PascalSymbol\), das den String 1:1 enthält) - comment(# @see symbol) - comment(# @return falls Keyword gefunden, zugehöriges PascalSymbol, sonst SymbolIdent) - reserved(def) method(handle_identifier) ident(identifier) - reserved(if) ident(sym) operator(=) constant(KEYWORD_SYMBOLS)operator([)ident(identifier)operator(]) - constant(PascalSymbol)operator(.)ident(new) ident(sym) - reserved(else) - constant(SymbolIdent)operator(.)ident(new) ident(identifier) - reserved(end) - reserved(end) - - constant(MAXINT) operator(=) integer(2)operator(**)integer(31) operator(-) integer(1) - constant(MAXINT_DIV_10) operator(=) constant(MAXINT) operator(/) integer(10) - constant(MAXINT_MOD_10) operator(=) constant(MAXINT) operator(%) integer(10) - comment(##) - comment(# Versucht, aus dem gegebenen Zeichen und den folgenden eine Zahl zusammenzusetzen.) - comment(# Dabei wird der relativ intuitive Algorithmus benutzt, die endgültige Zahl bei) - comment(# jeder weiteren Ziffer mit 10 zu multiplizieren und diese dann mit der Ziffer zu) - comment(# addieren. Sonderfälle bestehen dann nur noch in der Behandlung von reellen Zahlen.) - comment(#
) - comment(# Treten dabei kein Punkt oder ein E auf, so gibt diese Methode ein SymbolIntCon-Objekt) - comment(# zurück, ansonsten (reelle Zahl\) ein SymbolRealCon-Objekt. Beide Symbole enthalten) - comment(# jeweils die Zahlwerte.) - comment(#
) - comment(# Anmerkung: Diese Funktion ist mit Hilfe der Java/Ruby-API deutlich leichter zu realisieren.) - comment(# Sie wurde dennoch so implementiert, um den Algorithmus zu demonstrieren) - comment(# @see symbol) - comment(# @return SymbolIntcon- oder SymbolRealcon-Objekt, das den Zahlwert enthält) - reserved(def) method(number) - ident(is_integer) operator(=) pre_constant(true) - ident(integer_too_long) operator(=) pre_constant(false) - ident(exponent) operator(=) integer(0) - ident(exp_counter) operator(=) integer(-1) - ident(exp_sign) operator(=) integer(1) - - ident(integer_mantisse) operator(=) instance_variable(@current_char)operator(.)ident(digit) - - reserved(while) operator(()instance_variable(@next_char)operator(.)ident(digit?) reserved(and) ident(integer_mantisse) operator(<) constant(MAXINT_DIV_10)operator(\)) reserved(or) - operator(()ident(integer_mantisse) operator(==) constant(MAXINT_DIV_10) reserved(and) instance_variable(@next_char)operator(.)ident(digit) operator(<=) constant(MAXINT_MOD_10)operator(\)) - ident(integer_mantisse) operator(*=) integer(10) - ident(integer_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) - ident(read_next_char) - reserved(end) - - ident(real_mantisse) operator(=) ident(integer_mantisse) - - reserved(while) instance_variable(@next_char)operator(.)ident(digit?) - ident(integer_too_long) operator(=) pre_constant(true) - ident(real_mantisse) operator(*=) integer(10) - ident(real_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) - ident(read_next_char) - reserved(end) - reserved(if) instance_variable(@next_char) operator(==) integer(?.) - ident(read_next_char) - ident(is_integer) operator(=) pre_constant(false) - reserved(unless) instance_variable(@next_char)operator(.)ident(digit?) - constant(Error)operator(.)ident(error) integer(101)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) - reserved(end) - reserved(while) instance_variable(@next_char)operator(.)ident(digit?) - ident(real_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) operator(*) operator(()integer(10) operator(**) ident(exp_counter)operator(\)) - ident(read_next_char) - ident(exp_counter) operator(-=) integer(1) - reserved(end) - reserved(end) - reserved(if) instance_variable(@next_char) operator(==) integer(?E) - ident(is_integer) operator(=) pre_constant(false) - ident(read_next_char) - reserved(if) instance_variable(@next_char) operator(==) integer(?-) - ident(exp_sign) operator(=) integer(-1) - ident(read_next_char) - reserved(end) - reserved(unless) instance_variable(@next_char)operator(.)ident(digit?) - constant(Error)operator(.)ident(error) integer(101)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) - reserved(end) - reserved(while) instance_variable(@next_char)operator(.)ident(digit?) - ident(exponent) operator(*=) integer(10) - ident(exponent) operator(+=) instance_variable(@next_char)operator(.)ident(digit) - ident(read_next_char) - reserved(end) - reserved(end) - - reserved(if) ident(is_integer) - reserved(if) ident(integer_too_long) - constant(Error)operator(.)ident(error) integer(102)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) - reserved(end) - constant(SymbolIntcon)operator(.)ident(new) ident(integer_mantisse) - reserved(else) - constant(SymbolRealcon)operator(.)ident(new) ident(real_mantisse) operator(*) operator(()integer(10) operator(**) operator(()ident(exp_sign) operator(*) ident(exponent)operator(\))operator(\)) - reserved(end) - reserved(end) - - comment(##) - comment(# Sorgt für ein Überlesen von Kommentaren.) - comment(# Es werden einfach alle Zeichen bis zu einer schließenden Klammer eingelesen) - comment(# und verworfen.) - reserved(def) method(comment) - reserved(while) instance_variable(@current_char) operator(!=) integer(?}) - ident(forbid_eop) - ident(new_line) reserved(if) instance_variable(@current_char) operator(==) integer(?\\n) - ident(read_next_char) - reserved(end) - reserved(end) - - reserved(def) method(new_line) - instance_variable(@line) operator(+=) integer(1) - instance_variable(@pos) operator(=) integer(0) - reserved(end) - - reserved(def) method(forbid_eop) - reserved(if) ident(eop?) - constant(Error)operator(.)ident(error) integer(103)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) - reserved(end) - ident(exit) - reserved(end) - - reserved(def) method(eop?) - instance_variable(@current_char)operator(.)ident(nil?) - reserved(end) -reserved(end) - -comment(##) -comment(# Läßt ein Testprogramm ablaufen.) -comment(# Dieses erzeugt sich ein Scanner-Objekt und ruft an diesem kontinuierlich bis zum Dateiende) -comment(# get_symbol auf.) -reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - ident(scan) operator(=) constant(Scanner)operator(.)ident(new)operator(()constant(File)operator(.)ident(new)operator(()pre_constant(ARGV)operator([)integer(0)operator(]) operator(||) stringoperator(\))operator(\)) - ident(loop) reserved(do) - ident(c) operator(=) ident(scan)operator(.)ident(get_symbol) - ident(puts) ident(c) - reserved(break) reserved(if) ident(c)operator(.)ident(typ) operator(==) constant(TokenConsts)operator(::)constant(EOP) - reserved(end) -reserved(end) - +reserved(module) class(CodeRay) + reserved(module) class(Scanners) + +reserved(class) class(Ruby) operator(<) constant(Scanner) + + constant(RESERVED_WORDS) operator(=) operator([) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) + operator(]) + + constant(DEF_KEYWORDS) operator(=) operator([)stringoperator(]) + constant(MODULE_KEYWORDS) operator(=) operator([)stringoperator(,) stringoperator(]) + constant(DEF_NEW_STATE) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:initial)operator(\))operator(.) + ident(add)operator(()constant(DEF_KEYWORDS)operator(,) symbol(:def_expected)operator(\))operator(.) + ident(add)operator(()constant(MODULE_KEYWORDS)operator(,) symbol(:module_expected)operator(\)) + + constant(WORDS_ALLOWING_REGEXP) operator(=) operator([) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) string + operator(]) + constant(REGEXP_ALLOWED) operator(=) constant(WordList)operator(.)ident(new)operator(()pre_constant(false)operator(\))operator(.) + ident(add)operator(()constant(WORDS_ALLOWING_REGEXP)operator(,) symbol(:set)operator(\)) + + constant(PREDEFINED_CONSTANTS) operator(=) operator([) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + operator(]) + + constant(IDENT_KIND) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.) + ident(add)operator(()constant(RESERVED_WORDS)operator(,) symbol(:reserved)operator(\))operator(.) + ident(add)operator(()constant(PREDEFINED_CONSTANTS)operator(,) symbol(:pre_constant)operator(\)) + + constant(METHOD_NAME) operator(=) regexpcontent( [?!]? )delimiter(/)modifier(xo)> + constant(METHOD_NAME_EX) operator(=) regexpcontent( # common methods: split, foo=, empty?, gsub! + | )char(\\*)char(\\*)content(? # multiplication and power + | [-+~]@? # plus, minus + | [)char(\\/)content(%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system` + | )char(\\[)char(\\])content(=? # array getter and setter + | <=?>? | >=? # comparison, rocket operator + | << | >> # append or shift left, shift right + | ===? # simple equality and case equality + )delimiter(/)modifier(ox)> + constant(GLOBAL_VARIABLE) operator(=) regexpcontent( | )char(\\d)content(+ | [~&+`'=)char(\\/)content(,;_.<>!@0$?*":F)char(\\\\)content(] | -[a-zA-Z_0-9] \) )delimiter(/)modifier(ox)> + + constant(DOUBLEQ) operator(=) regexp + constant(SINGLEQ) operator(=) regexp + constant(STRING) operator(=) regexpcontent( | )inlinecontent( )delimiter(/)modifier(ox)> + constant(SHELL) operator(=) regexp + constant(REGEXP) operator(=) regexp + + constant(DECIMAL) operator(=) regexp comment(# doesn't recognize 09 as octal error) + constant(OCTAL) operator(=) regexp + constant(HEXADECIMAL) operator(=) regexp + constant(BINARY) operator(=) regexp + + constant(EXPONENT) operator(=) regexpcontent( )delimiter(/)modifier(ox)> + constant(FLOAT) operator(=) regexpcontent( (?: )inlinecontent( | )char(\\.)content( )inlinecontent( )inlinecontent(? \) )delimiter(/)> + constant(INTEGER) operator(=) regexpcontent(|)inlinecontent(|)inlinecontent(|)inlinedelimiter(/)> + + reserved(def) method(reset) + reserved(super) + instance_variable(@regexp_allowed) operator(=) pre_constant(false) + reserved(end) + + reserved(def) method(next_token) + reserved(return) reserved(if) instance_variable(@scanner)operator(.)ident(eos?) + + ident(kind) operator(=) symbol(:error) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) comment(# in every state) + ident(kind) operator(=) symbol(:space) + instance_variable(@regexp_allowed) operator(=) symbol(:set) reserved(if) instance_variable(@regexp_allowed) reserved(or) instance_variable(@scanner)operator(.)ident(matched)operator(.)ident(index)operator(()integer(?\\n)operator(\)) comment(# delayed flag setting) + + reserved(elsif) instance_variable(@state) operator(==) symbol(:def_expected) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent((?:)char(\\.)content(|::\)\)* | (?:@@?|$\)? )inlinecontent((?:)char(\\.)content(|::\) \) )inlinecontent( )delimiter(/)modifier(ox)>operator(\)) + ident(kind) operator(=) symbol(:method) + instance_variable(@state) operator(=) symbol(:initial) + reserved(else) + instance_variable(@scanner)operator(.)ident(getch) + reserved(end) + instance_variable(@state) operator(=) symbol(:initial) + + reserved(elsif) instance_variable(@state) operator(==) symbol(:module_expected) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(kind) operator(=) symbol(:operator) + reserved(else) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( (?:)char(\\.)content(|::\)\)* )inlinecontent( )delimiter(/)modifier(ox)>operator(\)) + ident(kind) operator(=) symbol(:method) + reserved(else) + instance_variable(@scanner)operator(.)ident(getch) + reserved(end) + instance_variable(@state) operator(=) symbol(:initial) + reserved(end) + + reserved(elsif) comment(# state == :initial) + comment(# IDENTIFIERS, KEYWORDS) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(GLOBAL_VARIABLE)operator(\)) + ident(kind) operator(=) symbol(:global_variable) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( )delimiter(/)modifier(ox)>operator(\)) + ident(kind) operator(=) symbol(:class_variable) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent( )delimiter(/)modifier(ox)>operator(\)) + ident(kind) operator(=) symbol(:instance_variable) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(kind) operator(=) symbol(:comment) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(METHOD_NAME)operator(\)) + reserved(if) instance_variable(@last_token_dot) + ident(kind) operator(=) symbol(:ident) + reserved(else) + ident(matched) operator(=) instance_variable(@scanner)operator(.)ident(matched) + ident(kind) operator(=) constant(IDENT_KIND)operator([)ident(matched)operator(]) + reserved(if) ident(kind) operator(==) symbol(:ident) reserved(and) ident(matched) operator(=)operator(~) regexp + ident(kind) operator(=) symbol(:constant) + reserved(elsif) ident(kind) operator(==) symbol(:reserved) + instance_variable(@state) operator(=) constant(DEF_NEW_STATE)operator([)ident(matched)operator(]) + instance_variable(@regexp_allowed) operator(=) constant(REGEXP_ALLOWED)operator([)ident(matched)operator(]) + reserved(end) + reserved(end) + + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(STRING)operator(\)) + ident(kind) operator(=) symbol(:string) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SHELL)operator(\)) + ident(kind) operator(=) symbol(:shell) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(kind) operator(=) symbol(:string) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) reserved(and) instance_variable(@regexp_allowed) + instance_variable(@scanner)operator(.)ident(unscan) + instance_variable(@scanner)operator(.)ident(scan)operator(()constant(REGEXP)operator(\)) + ident(kind) operator(=) symbol(:regexp) +regexp#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^>#)char(\\\\)char(\\\\)content(]*\)*>?|([^a-zA-Z)char(\\\\)char(\\\\)content(]\)(?:(?!)char(\\1)content(\)[^#)char(\\\\)char(\\\\)content(]\)*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)(?:(?!)char(\\1)content(\)[^#)char(\\\\)char(\\\\)content(]\)*\)*)char(\\1)content(?\)|)char(\\()content([^\)#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^\)#)char(\\\\)char(\\\\)content(]*\)*)char(\\\))content(?|)char(\\[)content([^)char(\\])content(#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^)char(\\])content(#)char(\\\\)char(\\\\)content(]*\)*)char(\\])content(?|)char(\\{)content([^}#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^}#)char(\\\\)char(\\\\)content(]*\)*)char(\\})content(?|<[^>#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)[^>#)char(\\\\)char(\\\\)content(]*\)*>?|([^a-zA-Z)char(\\s)char(\\\\)char(\\\\)content(]\)(?:(?!)char(\\2)content(\)[^#)char(\\\\)char(\\\\)content(]\)*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#|)char(\\\\)char(\\\\)content(.\)(?:(?!)char(\\2)content(\)[^#)char(\\\\)char(\\\\)content(]\)*\)*)char(\\2)content(?|)char(\\\\)char(\\\\)content([^#)char(\\\\)char(\\\\)content(]*(?:(?:#)char(\\{)content(.*?)char(\\})content(|#\)[^#)char(\\\\)char(\\\\)content(]*\)*)char(\\\\)char(\\\\)content(?\))delimiter(/)> + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpcontent(|)inlinecontent(|)inlinecontent(\))delimiter(/)modifier(ox)>operator(\)) + ident(kind) operator(=) symbol(:symbol) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(kind) operator(=) symbol(:integer) + + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()regexp;,|&!(\))char(\\[)char(\\])content({}~?] | )char(\\.)char(\\.)content(?)char(\\.)content(? | ::? )delimiter(/)modifier(x)>operator(\)) + ident(kind) operator(=) symbol(:operator) + instance_variable(@regexp_allowed) operator(=) symbol(:set) reserved(if) instance_variable(@scanner)operator(.)ident(matched)operator([)integer(-1)operator(,)integer(1)operator(]) operator(=)operator(~) regexp|&^,)char(\\()char(\\[)content(+)char(\\-)char(\\/)char(\\*)content(%])char(\\z)delimiter(/)> + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(FLOAT)operator(\)) + ident(kind) operator(=) symbol(:float) + reserved(elsif) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(INTEGER)operator(\)) + ident(kind) operator(=) symbol(:integer) + reserved(else) + instance_variable(@scanner)operator(.)ident(getch) + reserved(end) + reserved(end) + + ident(token) operator(=) constant(Token)operator(.)ident(new) instance_variable(@scanner)operator(.)ident(matched)operator(,) ident(kind) + + reserved(if) ident(kind) operator(==) symbol(:regexp) + ident(token)operator(.)ident(text) operator(<<) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + reserved(end) + + instance_variable(@regexp_allowed) operator(=) operator(()instance_variable(@regexp_allowed) operator(==) symbol(:set)operator(\)) comment(# delayed flag setting) + + ident(token) + reserved(end) +reserved(end) + +ident(register) constant(Ruby)operator(,) stringoperator(,) string + + reserved(end) +reserved(end) +reserved(class) class(Set) + ident(include) constant(Enumerable) + + comment(# Creates a new set containing the given objects.) + reserved(def) pre_constant(self)operator(.)operator([])operator(()operator(*)ident(ary)operator(\)) + ident(new)operator(()ident(ary)operator(\)) + reserved(end) + + comment(# Creates a new set containing the elements of the given enumerable) + comment(# object.) + comment(#) + comment(# If a block is given, the elements of enum are preprocessed by the) + comment(# given block.) + reserved(def) method(initialize)operator(()ident(enum) operator(=) pre_constant(nil)operator(,) operator(&)ident(block)operator(\)) comment(# :yields: o) + instance_variable(@hash) operator(||=) constant(Hash)operator(.)ident(new) + + ident(enum)operator(.)ident(nil?) reserved(and) reserved(return) + + reserved(if) ident(block) + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(block)operator([)ident(o)operator(])operator(\)) operator(}) + reserved(else) + ident(merge)operator(()ident(enum)operator(\)) + reserved(end) + reserved(end) + + comment(# Copy internal hash.) + reserved(def) method(initialize_copy)operator(()ident(orig)operator(\)) + instance_variable(@hash) operator(=) ident(orig)operator(.)ident(instance_eval)operator({)instance_variable(@hash)operator(})operator(.)ident(dup) + reserved(end) + + comment(# Returns the number of elements.) + reserved(def) method(size) + instance_variable(@hash)operator(.)ident(size) + reserved(end) + reserved(alias) ident(length) ident(size) + + comment(# Returns true if the set contains no elements.) + reserved(def) method(empty?) + instance_variable(@hash)operator(.)ident(empty?) + reserved(end) + + comment(# Removes all elements and returns self.) + reserved(def) method(clear) + instance_variable(@hash)operator(.)ident(clear) + pre_constant(self) + reserved(end) + + comment(# Replaces the contents of the set with the contents of the given) + comment(# enumerable object and returns self.) + reserved(def) method(replace)operator(()ident(enum)operator(\)) + reserved(if) ident(enum)operator(.)ident(class) operator(==) pre_constant(self)operator(.)ident(class) + instance_variable(@hash)operator(.)ident(replace)operator(()ident(enum)operator(.)ident(instance_eval) operator({) instance_variable(@hash) operator(})operator(\)) + reserved(else) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(clear) + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + pre_constant(self) + reserved(end) + + comment(# Converts the set to an array. The order of elements is uncertain.) + reserved(def) method(to_a) + instance_variable(@hash)operator(.)ident(keys) + reserved(end) + + reserved(def) method(flatten_merge)operator(()ident(set)operator(,) ident(seen) operator(=) constant(Set)operator(.)ident(new)operator(\)) + ident(set)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) + reserved(if) ident(e)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) + reserved(if) ident(seen)operator(.)ident(include?)operator(()ident(e_id) operator(=) ident(e)operator(.)ident(object_id)operator(\)) + ident(raise) constant(ArgumentError)operator(,) string + reserved(end) + + ident(seen)operator(.)ident(add)operator(()ident(e_id)operator(\)) + ident(flatten_merge)operator(()ident(e)operator(,) ident(seen)operator(\)) + ident(seen)operator(.)ident(delete)operator(()ident(e_id)operator(\)) + reserved(else) + ident(add)operator(()ident(e)operator(\)) + reserved(end) + operator(}) + + pre_constant(self) + reserved(end) + ident(protected) symbol(:flatten_merge) + + comment(# Returns a new set that is a copy of the set, flattening each) + comment(# containing set recursively.) + reserved(def) method(flatten) + pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(.)ident(flatten_merge)operator(()pre_constant(self)operator(\)) + reserved(end) + + comment(# Equivalent to Set#flatten, but replaces the receiver with the) + comment(# result in place. Returns nil if no modifications were made.) + reserved(def) method(flatten!) + reserved(if) ident(detect) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) operator(}) + ident(replace)operator(()ident(flatten)operator(()operator(\))operator(\)) + reserved(else) + pre_constant(nil) + reserved(end) + reserved(end) + + comment(# Returns true if the set contains the given object.) + reserved(def) method(include?)operator(()ident(o)operator(\)) + instance_variable(@hash)operator(.)ident(include?)operator(()ident(o)operator(\)) + reserved(end) + reserved(alias) ident(member?) ident(include?) + + comment(# Returns true if the set is a superset of the given set.) + reserved(def) method(superset?)operator(()ident(set)operator(\)) + ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + reserved(return) pre_constant(false) reserved(if) ident(size) operator(<) ident(set)operator(.)ident(size) + ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(include?)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + comment(# Returns true if the set is a proper superset of the given set.) + reserved(def) method(proper_superset?)operator(()ident(set)operator(\)) + ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + reserved(return) pre_constant(false) reserved(if) ident(size) operator(<=) ident(set)operator(.)ident(size) + ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(include?)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + comment(# Returns true if the set is a subset of the given set.) + reserved(def) method(subset?)operator(()ident(set)operator(\)) + ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + reserved(return) pre_constant(false) reserved(if) ident(set)operator(.)ident(size) operator(<) ident(size) + ident(all?) operator({) operator(|)ident(o)operator(|) ident(set)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + comment(# Returns true if the set is a proper subset of the given set.) + reserved(def) method(proper_subset?)operator(()ident(set)operator(\)) + ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + reserved(return) pre_constant(false) reserved(if) ident(set)operator(.)ident(size) operator(<=) ident(size) + ident(all?) operator({) operator(|)ident(o)operator(|) ident(set)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + comment(# Calls the given block once for each element in the set, passing) + comment(# the element as parameter.) + reserved(def) method(each) + instance_variable(@hash)operator(.)ident(each_key) operator({) operator(|)ident(o)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) + pre_constant(self) + reserved(end) + + comment(# Adds the given object to the set and returns self. Use +merge+ to) + comment(# add several elements at once.) + reserved(def) method(add)operator(()ident(o)operator(\)) + instance_variable(@hash)operator([)ident(o)operator(]) operator(=) pre_constant(true) + pre_constant(self) + reserved(end) + reserved(alias) operator(<<) ident(add) + + comment(# Adds the given object to the set and returns self. If the) + comment(# object is already in the set, returns nil.) + reserved(def) method(add?)operator(()ident(o)operator(\)) + reserved(if) ident(include?)operator(()ident(o)operator(\)) + pre_constant(nil) + reserved(else) + ident(add)operator(()ident(o)operator(\)) + reserved(end) + reserved(end) + + comment(# Deletes the given object from the set and returns self. Use +subtract+ to) + comment(# delete several items at once.) + reserved(def) method(delete)operator(()ident(o)operator(\)) + instance_variable(@hash)operator(.)ident(delete)operator(()ident(o)operator(\)) + pre_constant(self) + reserved(end) + + comment(# Deletes the given object from the set and returns self. If the) + comment(# object is not in the set, returns nil.) + reserved(def) method(delete?)operator(()ident(o)operator(\)) + reserved(if) ident(include?)operator(()ident(o)operator(\)) + ident(delete)operator(()ident(o)operator(\)) + reserved(else) + pre_constant(nil) + reserved(end) + reserved(end) + + comment(# Deletes every element of the set for which block evaluates to) + comment(# true, and returns self.) + reserved(def) method(delete_if) + instance_variable(@hash)operator(.)ident(delete_if) operator({) operator(|)ident(o)operator(,)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) + pre_constant(self) + reserved(end) + + comment(# Do collect(\) destructively.) + reserved(def) method(collect!) + ident(set) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new) + ident(each) operator({) operator(|)ident(o)operator(|) ident(set) operator(<<) reserved(yield)operator(()ident(o)operator(\)) operator(}) + ident(replace)operator(()ident(set)operator(\)) + reserved(end) + reserved(alias) ident(map!) ident(collect!) + + comment(# Equivalent to Set#delete_if, but returns nil if no changes were) + comment(# made.) + reserved(def) method(reject!) + ident(n) operator(=) ident(size) + ident(delete_if) operator({) operator(|)ident(o)operator(|) reserved(yield)operator(()ident(o)operator(\)) operator(}) + ident(size) operator(==) ident(n) operator(?) pre_constant(nil) operator(:) pre_constant(self) + reserved(end) + + comment(# Merges the elements of the given enumerable object to the set and) + comment(# returns self.) + reserved(def) method(merge)operator(()ident(enum)operator(\)) + reserved(if) ident(enum)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) + instance_variable(@hash)operator(.)ident(update)operator(()ident(enum)operator(.)ident(instance_eval) operator({) instance_variable(@hash) operator(})operator(\)) + reserved(else) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(add)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + pre_constant(self) + reserved(end) + + comment(# Deletes every element that appears in the given enumerable object) + comment(# and returns self.) + reserved(def) method(subtract)operator(()ident(enum)operator(\)) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(delete)operator(()ident(o)operator(\)) operator(}) + pre_constant(self) + reserved(end) + + comment(# Returns a new set built by merging the set and the elements of the) + comment(# given enumerable object.) + reserved(def) method(|)operator(()ident(enum)operator(\)) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(dup)operator(.)ident(merge)operator(()ident(enum)operator(\)) + reserved(end) + reserved(alias) operator(+) operator(|) comment(##) + reserved(alias) ident(union) operator(|) comment(##) + + comment(# Returns a new set built by duplicating the set, removing every) + comment(# element that appears in the given enumerable object.) + reserved(def) method(-)operator(()ident(enum)operator(\)) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(dup)operator(.)ident(subtract)operator(()ident(enum)operator(\)) + reserved(end) + reserved(alias) ident(difference) operator(-) comment(##) + + comment(# Returns a new array containing elements common to the set and the) + comment(# given enumerable object.) + reserved(def) method(&)operator(()ident(enum)operator(\)) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(n) operator(=) pre_constant(self)operator(.)ident(class)operator(.)ident(new) + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) ident(n)operator(.)ident(add)operator(()ident(o)operator(\)) reserved(if) ident(include?)operator(()ident(o)operator(\)) operator(}) + ident(n) + reserved(end) + reserved(alias) ident(intersection) operator(&) comment(##) + + comment(# Returns a new array containing elements exclusive between the set) + comment(# and the given enumerable object. (set ^ enum\) is equivalent to) + comment(# ((set | enum\) - (set & enum\)\).) + reserved(def) method(^)operator(()ident(enum)operator(\)) + ident(enum)operator(.)ident(is_a?)operator(()constant(Enumerable)operator(\)) reserved(or) ident(raise) constant(ArgumentError)operator(,) string + ident(n) operator(=) ident(dup) + ident(enum)operator(.)ident(each) operator({) operator(|)ident(o)operator(|) reserved(if) ident(n)operator(.)ident(include?)operator(()ident(o)operator(\)) reserved(then) ident(n)operator(.)ident(delete)operator(()ident(o)operator(\)) reserved(else) ident(n)operator(.)ident(add)operator(()ident(o)operator(\)) reserved(end) operator(}) + ident(n) + reserved(end) + + comment(# Returns true if two sets are equal. The equality of each couple) + comment(# of elements is defined according to Object#eql?.) + reserved(def) method(==)operator(()ident(set)operator(\)) + ident(equal?)operator(()ident(set)operator(\)) reserved(and) reserved(return) pre_constant(true) + + ident(set)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) operator(&&) ident(size) operator(==) ident(set)operator(.)ident(size) reserved(or) reserved(return) pre_constant(false) + + ident(hash) operator(=) instance_variable(@hash)operator(.)ident(dup) + ident(set)operator(.)ident(all?) operator({) operator(|)ident(o)operator(|) ident(hash)operator(.)ident(include?)operator(()ident(o)operator(\)) operator(}) + reserved(end) + + reserved(def) method(hash) comment(# :nodoc:) + instance_variable(@hash)operator(.)ident(hash) + reserved(end) + + reserved(def) method(eql?)operator(()ident(o)operator(\)) comment(# :nodoc:) + reserved(return) pre_constant(false) reserved(unless) ident(o)operator(.)ident(is_a?)operator(()constant(Set)operator(\)) + instance_variable(@hash)operator(.)ident(eql?)operator(()ident(o)operator(.)ident(instance_eval)operator({)instance_variable(@hash)operator(})operator(\)) + reserved(end) + + comment(# Classifies the set by the return value of the given block and) + comment(# returns a hash of {value => set of elements} pairs. The block is) + comment(# called once for each element of the set, passing the element as) + comment(# parameter.) + comment(#) + comment(# e.g.:) + comment(#) + comment(# require 'set') + comment(# files = Set.new(Dir.glob("*.rb"\)\)) + comment(# hash = files.classify { |f| File.mtime(f\).year }) + comment(# p hash # => {2000=>#,) + comment(# # 2001=>#,) + comment(# # 2002=>#}) + reserved(def) method(classify) comment(# :yields: o) + ident(h) operator(=) operator({)operator(}) + + ident(each) operator({) operator(|)ident(i)operator(|) + ident(x) operator(=) reserved(yield)operator(()ident(i)operator(\)) + operator(()ident(h)operator([)ident(x)operator(]) operator(||=) pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(\))operator(.)ident(add)operator(()ident(i)operator(\)) + operator(}) + + ident(h) + reserved(end) + + comment(# Divides the set into a set of subsets according to the commonality) + comment(# defined by the given block.) + comment(#) + comment(# If the arity of the block is 2, elements o1 and o2 are in common) + comment(# if block.call(o1, o2\) is true. Otherwise, elements o1 and o2 are) + comment(# in common if block.call(o1\) == block.call(o2\).) + comment(#) + comment(# e.g.:) + comment(#) + comment(# require 'set') + comment(# numbers = Set[1, 3, 4, 6, 9, 10, 11]) + comment(# set = numbers.divide { |i,j| (i - j\).abs == 1 }) + comment(# p set # => #,) + comment(# # #,) + comment(# # #,) + comment(# # #}>) + reserved(def) method(divide)operator(()operator(&)ident(func)operator(\)) + reserved(if) ident(func)operator(.)ident(arity) operator(==) integer(2) + ident(require) string + + reserved(class) operator(<<) class(dig) operator(=) operator({)operator(}) comment(# :nodoc:) + ident(include) constant(TSort) + + reserved(alias) ident(tsort_each_node) ident(each_key) + reserved(def) method(tsort_each_child)operator(()ident(node)operator(,) operator(&)ident(block)operator(\)) + ident(fetch)operator(()ident(node)operator(\))operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) + reserved(end) + reserved(end) + + ident(each) operator({) operator(|)ident(u)operator(|) + ident(dig)operator([)ident(u)operator(]) operator(=) ident(a) operator(=) operator([)operator(]) + ident(each)operator({) operator(|)ident(v)operator(|) ident(func)operator(.)ident(call)operator(()ident(u)operator(,) ident(v)operator(\)) reserved(and) ident(a) operator(<<) ident(v) operator(}) + operator(}) + + ident(set) operator(=) constant(Set)operator(.)ident(new)operator(()operator(\)) + ident(dig)operator(.)ident(each_strongly_connected_component) operator({) operator(|)ident(css)operator(|) + ident(set)operator(.)ident(add)operator(()pre_constant(self)operator(.)ident(class)operator(.)ident(new)operator(()ident(css)operator(\))operator(\)) + operator(}) + ident(set) + reserved(else) + constant(Set)operator(.)ident(new)operator(()ident(classify)operator(()operator(&)ident(func)operator(\))operator(.)ident(values)operator(\)) + reserved(end) + reserved(end) + + constant(InspectKey) operator(=) symbol(:__inspect_key__) comment(# :nodoc:) + + comment(# Returns a string containing a human-readable representation of the) + comment(# set. ("#"\)) + reserved(def) method(inspect) + ident(ids) operator(=) operator(()constant(Thread)operator(.)ident(current)operator([)constant(InspectKey)operator(]) operator(||=) operator([)operator(])operator(\)) + + reserved(if) ident(ids)operator(.)ident(include?)operator(()ident(object_id)operator(\)) + reserved(return) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\)) + reserved(end) + + reserved(begin) + ident(ids) operator(<<) ident(object_id) + reserved(return) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(,) ident(to_a)operator(.)ident(inspect)operator([)integer(1)operator(..)integer(-2)operator(])operator(\)) + reserved(ensure) + ident(ids)operator(.)ident(pop) + reserved(end) + reserved(end) + + reserved(def) method(pretty_print)operator(()ident(pp)operator(\)) comment(# :nodoc:) + ident(pp)operator(.)ident(text) ident(sprintf)operator(()stringoperator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(\)) + ident(pp)operator(.)ident(nest)operator(()integer(1)operator(\)) operator({) + ident(pp)operator(.)ident(seplist)operator(()pre_constant(self)operator(\)) operator({) operator(|)ident(o)operator(|) + ident(pp)operator(.)ident(pp) ident(o) + operator(}) + operator(}) + ident(pp)operator(.)ident(text) string)delimiter(")> + reserved(end) + + reserved(def) method(pretty_print_cycle)operator(()ident(pp)operator(\)) comment(# :nodoc:) + ident(pp)operator(.)ident(text) ident(sprintf)operator(()string)delimiter(')>operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(name)operator(,) ident(empty?) operator(?) string operator(:) stringoperator(\)) + reserved(end) +reserved(end) + +comment(# SortedSet implements a set which elements are sorted in order. See Set.) +reserved(class) class(SortedSet) operator(<) constant(Set) + class_variable(@@setup) operator(=) pre_constant(false) + + reserved(class) operator(<<) class(self) + reserved(def) method([])operator(()operator(*)ident(ary)operator(\)) comment(# :nodoc:) + ident(new)operator(()ident(ary)operator(\)) + reserved(end) + + reserved(def) method(setup) comment(# :nodoc:) + class_variable(@@setup) reserved(and) reserved(return) + + reserved(begin) + ident(require) string + + ident(module_eval) string + reserved(rescue) constant(LoadError) + ident(module_eval) string + reserved(end) + + class_variable(@@setup) operator(=) pre_constant(true) + reserved(end) + reserved(end) + + reserved(def) method(initialize)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) + constant(SortedSet)operator(.)ident(setup) + ident(initialize)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) + reserved(end) +reserved(end) + +reserved(module) class(Enumerable) + comment(# Makes a set from the enumerable object with given arguments.) + reserved(def) method(to_set)operator(()ident(klass) operator(=) constant(Set)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) + ident(klass)operator(.)ident(new)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) + reserved(end) +reserved(end) + +comment(# =begin) +comment(# == RestricedSet class) +comment(# RestricedSet implements a set with restrictions defined by a given) +comment(# block.) +comment(#) +comment(# === Super class) +comment(# Set) +comment(#) +comment(# === Class Methods) +comment(# --- RestricedSet::new(enum = nil\) { |o| ... }) +comment(# --- RestricedSet::new(enum = nil\) { |rset, o| ... }) +comment(# Creates a new restricted set containing the elements of the given) +comment(# enumerable object. Restrictions are defined by the given block.) +comment(#) +comment(# If the block's arity is 2, it is called with the RestrictedSet) +comment(# itself and an object to see if the object is allowed to be put in) +comment(# the set.) +comment(#) +comment(# Otherwise, the block is called with an object to see if the object) +comment(# is allowed to be put in the set.) +comment(#) +comment(# === Instance Methods) +comment(# --- restriction_proc) +comment(# Returns the restriction procedure of the set.) +comment(#) +comment(# =end) +comment(#) +comment(# class RestricedSet < Set) +comment(# def initialize(*args, &block\)) +comment(# @proc = block or raise ArgumentError, "missing a block") +comment(#) +comment(# if @proc.arity == 2) +comment(# instance_eval %{) +comment(# def add(o\)) +comment(# @hash[o] = true if @proc.call(self, o\)) +comment(# self) +comment(# end) +comment(# alias << add) +comment(#) +comment(# def add?(o\)) +comment(# if include?(o\) || !@proc.call(self, o\)) +comment(# nil) +comment(# else) +comment(# @hash[o] = true) +comment(# self) +comment(# end) +comment(# end) +comment(#) +comment(# def replace(enum\)) +comment(# enum.is_a?(Enumerable\) or raise ArgumentError, "value must be enumerable") +comment(# clear) +comment(# enum.each { |o| add(o\) }) +comment(#) +comment(# self) +comment(# end) +comment(#) +comment(# def merge(enum\)) +comment(# enum.is_a?(Enumerable\) or raise ArgumentError, "value must be enumerable") +comment(# enum.each { |o| add(o\) }) +comment(#) +comment(# self) +comment(# end) +comment(# }) +comment(# else) +comment(# instance_eval %{) +comment(# def add(o\)) +comment(# if @proc.call(o\)) +comment(# @hash[o] = true) +comment(# end) +comment(# self) +comment(# end) +comment(# alias << add) +comment(#) +comment(# def add?(o\)) +comment(# if include?(o\) || !@proc.call(o\)) +comment(# nil) +comment(# else) +comment(# @hash[o] = true) +comment(# self) +comment(# end) +comment(# end) +comment(# }) +comment(# end) +comment(#) +comment(# super(*args\)) +comment(# end) +comment(#) +comment(# def restriction_proc) +comment(# @proc) +comment(# end) +comment(# end) + +reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) + ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)integer(+4) +reserved(end) + +comment(# = rweb - CGI Support Library) +comment(#) +comment(# Author:: Johannes Barre (mailto:rweb@igels.net\)) +comment(# Copyright:: Copyright (c\) 2003, 04 by Johannes Barre) +comment(# License:: GNU Lesser General Public License (COPYING, http://www.gnu.org/copyleft/lesser.html\)) +comment(# Version:: 0.1.0) +comment(# CVS-ID:: $Id: rweb.rb 6 2004-06-16 15:56:26Z igel $) +comment(#) +comment(# == What is Rweb?) +comment(# Rweb is a replacement for the cgi class included in the ruby distribution.) +comment(#) +comment(# == How to use) +comment(#) +comment(# === Basics) +comment(#) +comment(# This class is made to be as easy as possible to use. An example:) +comment(#) +comment(# require "rweb") +comment(#) +comment(# web = Rweb.new) +comment(# web.out do) +comment(# web.puts "Hello world!") +comment(# end) +comment(#) +comment(# The visitor will get a simple "Hello World!" in his browser. Please notice,) +comment(# that won't set html-tags for you, so you should better do something like this:) +comment(#) +comment(# require "rweb") +comment(#) +comment(# web = Rweb.new) +comment(# web.out do) +comment(# web.puts "Hello world!") +comment(# end) +comment(#) +comment(# === Set headers) +comment(# Of course, it's also possible to tell the browser, that the content of this) +comment(# page is plain text instead of html code:) +comment(#) +comment(# require "rweb") +comment(#) +comment(# web = Rweb.new) +comment(# web.out do) +comment(# web.header("content-type: text/plain"\)) +comment(# web.puts "Hello plain world!") +comment(# end) +comment(#) +comment(# Please remember, headers can't be set after the page content has been send.) +comment(# You have to set all nessessary headers before the first puts oder print. It's) +comment(# possible to cache the content until everything is complete. Doing it this) +comment(# way, you can set headers everywhere.) +comment(#) +comment(# If you set a header twice, the second header will replace the first one. The) +comment(# header name is not casesensitive, it will allways converted in to the) +comment(# capitalised form suggested by the w3c (http://w3.org\)) +comment(#) +comment(# === Set cookies) +comment(# Setting cookies is quite easy:) +comment(# include 'rweb') +comment(#) +comment(# web = Rweb.new) +comment(# Cookie.new("Visits", web.cookies['visits'].to_i +1\)) +comment(# web.out do) +comment(# web.puts "Welcome back! You visited this page #{web.cookies['visits'].to_i +1} times") +comment(# end) +comment(#) +comment(# See the class Cookie for more details.) +comment(#) +comment(# === Get form and cookie values) +comment(# There are four ways to submit data from the browser to the server and your) +comment(# ruby script: via GET, POST, cookies and file upload. Rweb doesn't support) +comment(# file upload by now.) +comment(#) +comment(# include 'rweb') +comment(#) +comment(# web = Rweb.new) +comment(# web.out do) +comment(# web.print "action: #{web.get['action']} ") +comment(# web.puts "The value of the cookie 'visits' is #{web.cookies['visits']}") +comment(# web.puts "The post parameter 'test['x']' is #{web.post['test']['x']}") +comment(# end) + +constant(RWEB_VERSION) operator(=) string +constant(RWEB) operator(=) stringdelimiter(")> + +comment(#require 'rwebcookie' -> edit by bunny :-\)) + +reserved(class) class(Rweb) + comment(# All parameter submitted via the GET method are available in attribute) + comment(# get. This is Hash, where every parameter is available as a key-value) + comment(# pair.) + comment(#) + comment(# If your input tag has a name like this one, it's value will be available) + comment(# as web.get["fieldname"]) + comment(# ) + comment(# You can submit values as a Hash) + comment(# ) + comment(# ) + comment(# will be available as) + comment(# web.get["text"]["index"]) + comment(# web.get["text"]["index2"]) + comment(# Integers are also possible) + comment(# ) + comment(# ) + comment(# ) + comment(# will be available as) + comment(# web.get["int"][0] # First Field) + comment(# web.get["int"][1] # Second one) + comment(# Please notice, this doesn'd work like you might expect:) + comment(# ) + comment(# It will not be available as web.get["text"]["index"] but) + comment(# web.get["text[index]"]) + ident(attr_reader) symbol(:get) + + comment(# All parameters submitted via POST are available in the attribute post. It) + comment(# works like the get attribute.) + comment(# ) + comment(# will be available as) + comment(# web.post["text"][0]) + ident(attr_reader) symbol(:post) + + comment(# All cookies submitted by the browser are available in cookies. This is a) + comment(# Hash, where every cookie is a key-value pair.) + ident(attr_reader) symbol(:cookies) + + comment(# The name of the browser identification is submitted as USER_AGENT and) + comment(# available in this attribute.) + ident(attr_reader) symbol(:user_agent) + + comment(# The IP address of the client.) + ident(attr_reader) symbol(:remote_addr) + + comment(# Creates a new Rweb object. This should only done once. You can set various) + comment(# options via the settings hash.) + comment(#) + comment(# "cache" => true: Everything you script send to the client will be cached) + comment(# until the end of the out block or until flush is called. This way, you) + comment(# can modify headers and cookies even after printing something to the client.) + comment(#) + comment(# "safe" => level: Changes the $SAFE attribute. By default, $SAFE will be set) + comment(# to 1. If $SAFE is already higher than this value, it won't be changed.) + comment(#) + comment(# "silend" => true: Normaly, Rweb adds automaticly a header like this) + comment(# "X-Powered-By: Rweb/x.x.x (Ruby/y.y.y\)". With the silend option you can) + comment(# suppress this.) + reserved(def) method(initialize) operator(()ident(settings) operator(=) operator({)operator(})operator(\)) + comment(# {{{) + instance_variable(@header) operator(=) operator({)operator(}) + instance_variable(@cookies) operator(=) operator({)operator(}) + instance_variable(@get) operator(=) operator({)operator(}) + instance_variable(@post) operator(=) operator({)operator(}) + + comment(# Internal attributes) + instance_variable(@status) operator(=) pre_constant(nil) + instance_variable(@reasonPhrase) operator(=) pre_constant(nil) + instance_variable(@setcookies) operator(=) operator([)operator(]) + instance_variable(@output_started) operator(=) pre_constant(false)operator(;) + instance_variable(@output_allowed) operator(=) pre_constant(false)operator(;) + + instance_variable(@mod_ruby) operator(=) pre_constant(false) + instance_variable(@env) operator(=) constant(ENV)operator(.)ident(to_hash) + + reserved(if) reserved(defined?)operator(()constant(MOD_RUBY)operator(\)) + instance_variable(@output_method) operator(=) string + instance_variable(@mod_ruby) operator(=) pre_constant(true) + reserved(elsif) instance_variable(@env)operator([)stringoperator(]) operator(=)operator(~) regexp + instance_variable(@output_method) operator(=) string + reserved(else) + instance_variable(@output_method) operator(=) string + reserved(end) + + reserved(unless) ident(settings)operator(.)ident(is_a?)operator(()constant(Hash)operator(\)) + ident(raise) constant(TypeError)operator(,) string + reserved(end) + instance_variable(@settings) operator(=) ident(settings) + + reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) + instance_variable(@settings)operator([)stringoperator(]) operator(=) integer(1) + reserved(end) + + reserved(if) global_variable($SAFE) operator(<) instance_variable(@settings)operator([)stringoperator(]) + global_variable($SAFE) operator(=) instance_variable(@settings)operator([)stringoperator(]) + reserved(end) + + reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) + instance_variable(@settings)operator([)stringoperator(]) operator(=) pre_constant(false) + reserved(end) + + comment(# mod_ruby sets no QUERY_STRING variable, if no GET-Parameters are given) + reserved(unless) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) + instance_variable(@env)operator([)stringoperator(]) operator(=) string + reserved(end) + + comment(# Now we split the QUERY_STRING by the seperators & and ; or, if) + comment(# specified, settings['get seperator']) + reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) + ident(get_args) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()regexpoperator(\)) + reserved(else) + ident(get_args) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()instance_variable(@settings)operator([)stringoperator(])operator(\)) + reserved(end) + + ident(get_args)operator(.)ident(each) reserved(do) operator(|) ident(arg) operator(|) + ident(arg_key)operator(,) ident(arg_val) operator(=) ident(arg)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + ident(arg_key) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_key)operator(\)) + ident(arg_val) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_val)operator(\)) + + comment(# Parse names like name[0], name['text'] or name[]) + ident(pattern) operator(=) regexp + ident(keys) operator(=) operator([)operator(]) + reserved(while) ident(match) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(arg_key)operator(\)) + ident(arg_key) operator(=) ident(match)operator([)integer(1)operator(]) + ident(keys) operator(=) operator([)ident(match)operator([)integer(2)operator(])operator(]) operator(+) ident(keys) + reserved(end) + ident(keys) operator(=) operator([)ident(arg_key)operator(]) operator(+) ident(keys) + + ident(akt) operator(=) instance_variable(@get) + ident(last) operator(=) pre_constant(nil) + ident(lastkey) operator(=) pre_constant(nil) + ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) + reserved(if) ident(key) operator(==) string + comment(# No key specified (like in "test[]"\), so we use the) + comment(# lowerst unused Integer as key) + ident(key) operator(=) integer(0) + reserved(while) ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) + ident(key) operator(+=) integer(1) + reserved(end) + reserved(elsif) regexp operator(=)operator(~) ident(key) + comment(# If the index is numerical convert it to an Integer) + ident(key) operator(=) ident(key)operator(.)ident(to_i) + reserved(elsif) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string operator(||) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string + ident(key) operator(=) ident(key)operator([)integer(1)operator(,) ident(key)operator(.)ident(length)operator(()operator(\)) integer(-2)operator(]) + reserved(end) + reserved(if) operator(!)ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) operator(||) operator(!)ident(akt)operator([)ident(key)operator(])operator(.)ident(class) operator(==) constant(Hash) + comment(# create an empty Hash if there isn't already one) + ident(akt)operator([)ident(key)operator(]) operator(=) operator({)operator(}) + reserved(end) + ident(last) operator(=) ident(akt) + ident(lastkey) operator(=) ident(key) + ident(akt) operator(=) ident(akt)operator([)ident(key)operator(]) + reserved(end) + ident(last)operator([)ident(lastkey)operator(]) operator(=) ident(arg_val) + reserved(end) + + reserved(if) instance_variable(@env)operator([)stringoperator(]) operator(==) string + reserved(if) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) operator(&&) instance_variable(@env)operator([)stringoperator(]) operator(==) string operator(&&) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) + reserved(unless) instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) + ident(post_args) operator(=) global_variable($stdin)operator(.)ident(read)operator(()instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_i)operator(\))operator(.)ident(split)operator(()regexpoperator(\)) + reserved(else) + ident(post_args) operator(=) global_variable($stdin)operator(.)ident(read)operator(()instance_variable(@env)operator([)stringoperator(])operator(.)ident(to_i)operator(\))operator(.)ident(split)operator(()instance_variable(@settings)operator([)stringoperator(])operator(\)) + reserved(end) + ident(post_args)operator(.)ident(each) reserved(do) operator(|) ident(arg) operator(|) + ident(arg_key)operator(,) ident(arg_val) operator(=) ident(arg)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + ident(arg_key) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_key)operator(\)) + ident(arg_val) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(arg_val)operator(\)) + + comment(# Parse names like name[0], name['text'] or name[]) + ident(pattern) operator(=) regexp + ident(keys) operator(=) operator([)operator(]) + reserved(while) ident(match) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(arg_key)operator(\)) + ident(arg_key) operator(=) ident(match)operator([)integer(1)operator(]) + ident(keys) operator(=) operator([)ident(match)operator([)integer(2)operator(])operator(]) operator(+) ident(keys) + reserved(end) + ident(keys) operator(=) operator([)ident(arg_key)operator(]) operator(+) ident(keys) + + ident(akt) operator(=) instance_variable(@post) + ident(last) operator(=) pre_constant(nil) + ident(lastkey) operator(=) pre_constant(nil) + ident(keys)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(|) + reserved(if) ident(key) operator(==) string + comment(# No key specified (like in "test[]"\), so we use) + comment(# the lowerst unused Integer as key) + ident(key) operator(=) integer(0) + reserved(while) ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) + ident(key) operator(+=) integer(1) + reserved(end) + reserved(elsif) regexp operator(=)operator(~) ident(key) + comment(# If the index is numerical convert it to an Integer) + ident(key) operator(=) ident(key)operator(.)ident(to_i) + reserved(elsif) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string operator(||) ident(key)operator([)integer(0)operator(])operator(.)ident(chr) operator(==) string + ident(key) operator(=) ident(key)operator([)integer(1)operator(,) ident(key)operator(.)ident(length)operator(()operator(\)) integer(-2)operator(]) + reserved(end) + reserved(if) operator(!)ident(akt)operator(.)ident(has_key?)operator(()ident(key)operator(\)) operator(||) operator(!)ident(akt)operator([)ident(key)operator(])operator(.)ident(class) operator(==) constant(Hash) + comment(# create an empty Hash if there isn't already one) + ident(akt)operator([)ident(key)operator(]) operator(=) operator({)operator(}) + reserved(end) + ident(last) operator(=) ident(akt) + ident(lastkey) operator(=) ident(key) + ident(akt) operator(=) ident(akt)operator([)ident(key)operator(]) + reserved(end) + ident(last)operator([)ident(lastkey)operator(]) operator(=) ident(arg_val) + reserved(end) + reserved(else) + comment(# Maybe we should print a warning here?) + global_variable($stderr)operator(.)ident(print)operator(()stringoperator(\)) + reserved(end) + reserved(end) + + reserved(if) instance_variable(@env)operator(.)ident(has_key?)operator(()stringoperator(\)) + ident(cookie) operator(=) instance_variable(@env)operator([)stringoperator(])operator(.)ident(split)operator(()regexpoperator(\)) + ident(cookie)operator(.)ident(each) reserved(do) operator(|) ident(c) operator(|) + ident(cookie_key)operator(,) ident(cookie_val) operator(=) ident(c)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + + instance_variable(@cookies) operator([)constant(Rweb)operator(::)ident(unescape)operator(()ident(cookie_key)operator(\))operator(]) operator(=) constant(Rweb)operator(::)ident(unescape)operator(()ident(cookie_val)operator(\)) + reserved(end) + reserved(end) + + reserved(if) reserved(defined?)operator(()instance_variable(@env)operator([)stringoperator(])operator(\)) + instance_variable(@user_agent) operator(=) instance_variable(@env)operator([)stringoperator(]) + reserved(else) + instance_variable(@user_agent) operator(=) pre_constant(nil)operator(;) + reserved(end) + + reserved(if) reserved(defined?)operator(()instance_variable(@env)operator([)stringoperator(])operator(\)) + instance_variable(@remote_addr) operator(=) instance_variable(@env)operator([)stringoperator(]) + reserved(else) + instance_variable(@remote_addr) operator(=) pre_constant(nil) + reserved(end) + comment(# }}}) + reserved(end) + + comment(# Prints a String to the client. If caching is enabled, the String will) + comment(# buffered until the end of the out block ends.) + reserved(def) method(print)operator(()ident(str) operator(=) stringoperator(\)) + comment(# {{{) + reserved(unless) instance_variable(@output_allowed) + ident(raise) string + reserved(end) + + reserved(if) instance_variable(@settings)operator([)stringoperator(]) + instance_variable(@buffer) operator(+=) operator([)ident(str)operator(.)ident(to_s)operator(]) + reserved(else) + reserved(unless) instance_variable(@output_started) + ident(sendHeaders) + reserved(end) + global_variable($stdout)operator(.)ident(print)operator(()ident(str)operator(\)) + reserved(end) + pre_constant(nil) + comment(# }}}) + reserved(end) + + comment(# Prints a String to the client and adds a line break at the end. Please) + comment(# remember, that a line break is not visible in HTML, use the
HTML-Tag) + comment(# for this. If caching is enabled, the String will buffered until the end) + comment(# of the out block ends.) + reserved(def) method(puts)operator(()ident(str) operator(=) stringoperator(\)) + comment(# {{{) + pre_constant(self)operator(.)ident(print)operator(()ident(str) operator(+) stringoperator(\)) + comment(# }}}) + reserved(end) + + comment(# Alias to print.) + reserved(def) method(write)operator(()ident(str) operator(=) stringoperator(\)) + comment(# {{{) + pre_constant(self)operator(.)ident(print)operator(()ident(str)operator(\)) + comment(# }}}) + reserved(end) + + comment(# If caching is enabled, all cached data are send to the cliend and the) + comment(# cache emptied.) + reserved(def) method(flush) + comment(# {{{) + reserved(unless) instance_variable(@output_allowed) + ident(raise) string + reserved(end) + ident(buffer) operator(=) instance_variable(@buffer)operator(.)ident(join) + + reserved(unless) instance_variable(@output_started) + ident(sendHeaders) + reserved(end) + global_variable($stdout)operator(.)ident(print)operator(()ident(buffer)operator(\)) + + instance_variable(@buffer) operator(=) operator([)operator(]) + comment(# }}}) + reserved(end) + + comment(# Sends one or more header to the client. All headers are cached just) + comment(# before body data are send to the client. If the same header are set) + comment(# twice, only the last value is send.) + comment(#) + comment(# Example:) + comment(# web.header("Last-Modified: Mon, 16 Feb 2004 20:15:41 GMT"\)) + comment(# web.header("Location: http://www.ruby-lang.org"\)) + comment(#) + comment(# You can specify more than one header at the time by doing something like) + comment(# this:) + comment(# web.header("Content-Type: text/plain\\nContent-Length: 383"\)) + comment(# or) + comment(# web.header(["Content-Type: text/plain", "Content-Length: 383"]\)) + reserved(def) method(header)operator(()ident(str)operator(\)) + comment(# {{{) + reserved(if) instance_variable(@output_started) + ident(raise) string + reserved(end) + reserved(unless) instance_variable(@output_allowed) + ident(raise) string + reserved(end) + reserved(if) ident(str)operator(.)ident(is_a?)constant(Array) + ident(str)operator(.)ident(each) reserved(do) operator(|) ident(value) operator(|) + pre_constant(self)operator(.)ident(header)operator(()ident(value)operator(\)) + reserved(end) + + reserved(elsif) ident(str)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(length) operator(>) integer(1) + ident(str)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|) ident(value) operator(|) + pre_constant(self)operator(.)ident(header)operator(()ident(value)operator(\)) + reserved(end) + + reserved(elsif) ident(str)operator(.)ident(is_a?) constant(String) + ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + + reserved(if) operator(()ident(str) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) + ident(pattern) operator(=) regexp + + ident(result) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(str)operator(\)) + pre_constant(self)operator(.)ident(setstatus)operator(()ident(result)operator([)integer(0)operator(])operator(,) ident(result)operator([)integer(1)operator(])operator(\)) + reserved(elsif) operator(()ident(str) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) + ident(pattern) operator(=) regexp + + ident(result) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(str)operator(\)) + pre_constant(self)operator(.)ident(setstatus)operator(()ident(result)operator([)integer(0)operator(])operator(,) ident(result)operator([)integer(1)operator(])operator(\)) + reserved(else) + ident(a) operator(=) ident(str)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + + instance_variable(@header)operator([)ident(a)operator([)integer(0)operator(])operator(.)ident(downcase)operator(]) operator(=) ident(a)operator([)integer(1)operator(]) + reserved(end) + reserved(end) + comment(# }}}) + reserved(end) + + comment(# Changes the status of this page. There are several codes like "200 OK",) + comment(# "302 Found", "404 Not Found" or "500 Internal Server Error". A list of) + comment(# all codes is available at) + comment(# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10) + comment(#) + comment(# You can just send the code number, the reason phrase will be added) + comment(# automaticly with the recommendations from the w3c if not specified. If) + comment(# you set the status twice or more, only the last status will be send.) + comment(# Examples:) + comment(# web.status("401 Unauthorized"\)) + comment(# web.status("410 Sad but true, this lonely page is gone :("\)) + comment(# web.status(206\)) + comment(# web.status("400"\)) + comment(#) + comment(# The default status is "200 OK". If a "Location" header is set, the) + comment(# default status is "302 Found".) + reserved(def) method(status)operator(()ident(str)operator(\)) + comment(# {{{) + reserved(if) instance_variable(@output_started) + ident(raise) string + reserved(end) + reserved(unless) instance_variable(@output_allowed) + ident(raise) string + reserved(end) + reserved(if) ident(str)operator(.)ident(is_a?)constant(Integer) + instance_variable(@status) operator(=) ident(str) + reserved(elsif) ident(str)operator(.)ident(is_a?)constant(String) + ident(p1) operator(=) regexp + ident(p2) operator(=) regexp + ident(p3) operator(=) regexp + + reserved(if) operator(()ident(a) operator(=) ident(p1)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) + reserved(if) operator(()ident(a) operator(=) ident(p2)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) + reserved(if) operator(()ident(a) operator(=) ident(p3)operator(.)ident(match)operator(()ident(str)operator(\))operator(\)) operator(==) pre_constant(nil) + ident(raise) constant(ArgumentError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(end) + reserved(end) + instance_variable(@status) operator(=) ident(a)operator([)integer(1)operator(])operator(.)ident(to_i) + reserved(if) ident(a)operator([)integer(2)operator(]) operator(!=) string + instance_variable(@reasonPhrase) operator(=) ident(a)operator([)integer(2)operator(]) + reserved(else) + instance_variable(@reasonPhrase) operator(=) ident(getReasonPhrase)operator(()instance_variable(@status)operator(\)) + reserved(end) + reserved(else) + ident(raise) constant(ArgumentError)operator(,) stringoperator(,) ident(caller) + reserved(end) + comment(# }}}) + reserved(end) + + comment(# Handles the output of your content and rescues all exceptions. Send all) + comment(# data in the block to this method. For example:) + comment(# web.out do) + comment(# web.header("Content-Type: text/plain"\)) + comment(# web.puts("Hello, plain world!"\)) + comment(# end) + reserved(def) method(out) + comment(# {{{) + instance_variable(@output_allowed) operator(=) pre_constant(true) + instance_variable(@buffer) operator(=) operator([)operator(])operator(;) comment(# We use an array as buffer, because it's more performant :\)) + + reserved(begin) + reserved(yield) + reserved(rescue) constant(Exception) operator(=)operator(>) ident(exception) + global_variable($stderr)operator(.)ident(puts) stringcontent(\): )inlinedelimiter(")> + global_variable($stderr)operator(.)ident(puts) ident(exception)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) + + reserved(unless) instance_variable(@output_started) + pre_constant(self)operator(.)ident(setstatus)operator(()integer(500)operator(\)) + instance_variable(@header) operator(=) operator({)operator(}) + reserved(end) + + reserved(unless) operator(()instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) instance_variable(@settings)operator([)stringoperator(]) operator(==) pre_constant(true)operator(\)) + reserved(unless) instance_variable(@output_started) + pre_constant(self)operator(.)ident(header)operator(()stringoperator(\)) + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + pre_constant(self)operator(.)ident(puts) string500 Internal Server Error)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + reserved(end) + reserved(if) instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(()instance_variable(@header)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(\)) operator(==) integer(0) + pre_constant(self)operator(.)ident(puts) stringInternal Server Error)delimiter(")> + pre_constant(self)operator(.)ident(puts) stringThe server encountered an exception and was unable to complete your request.

)delimiter(")> + pre_constant(self)operator(.)ident(puts) stringThe exception has provided the following information:

)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)inlinecontent(: )inlinecontent( on)delimiter(")> + pre_constant(self)operator(.)ident(puts) + pre_constant(self)operator(.)ident(puts) stringoperator(\))delimiter(})>content()delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + pre_constant(self)operator(.)ident(puts) string)delimiter(")> + reserved(else) + pre_constant(self)operator(.)ident(puts) string + pre_constant(self)operator(.)ident(puts) string + pre_constant(self)operator(.)ident(puts) stringcontent(: )inlinedelimiter(")> + pre_constant(self)operator(.)ident(puts) + pre_constant(self)operator(.)ident(puts) ident(exception)operator(.)ident(backtrace)operator(.)ident(join)operator(()stringoperator(\)) + reserved(end) + reserved(end) + reserved(end) + + reserved(if) instance_variable(@settings)operator([)stringoperator(]) + ident(buffer) operator(=) instance_variable(@buffer)operator(.)ident(join) + + reserved(unless) instance_variable(@output_started) + reserved(unless) instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) + pre_constant(self)operator(.)ident(header)operator(()stringdelimiter(")>operator(\)) + reserved(end) + + ident(sendHeaders) + reserved(end) + global_variable($stdout)operator(.)ident(print)operator(()ident(buffer)operator(\)) + reserved(elsif) operator(!)instance_variable(@output_started) + ident(sendHeaders) + reserved(end) + instance_variable(@output_allowed) operator(=) pre_constant(false)operator(;) + comment(# }}}) + reserved(end) + + comment(# Decodes URL encoded data, %20 for example stands for a space.) + reserved(def) constant(Rweb)operator(.)ident(unescape)operator(()ident(str)operator(\)) + comment(# {{{) + reserved(if) reserved(defined?) ident(str) reserved(and) ident(str)operator(.)ident(is_a?) constant(String) + ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|) ident(s) operator(|) + ident(s)operator([)integer(1)operator(,)integer(2)operator(])operator(.)ident(hex)operator(.)ident(chr) + reserved(end) + reserved(end) + comment(# }}}) + reserved(end) + + ident(protected) + reserved(def) method(sendHeaders) + comment(# {{{) + + constant(Cookie)operator(.)ident(disallow) comment(# no more cookies can be set or modified) + reserved(if) operator(!)operator(()instance_variable(@settings)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) instance_variable(@settings)operator([)stringoperator(]) operator(==) pre_constant(true)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) + reserved(if) instance_variable(@mod_ruby) + ident(header)operator(()stringcontent( (Ruby/)inlinecontent(, )inlinecontent(\))delimiter(")>operator(\))operator(;) + reserved(else) + ident(header)operator(()stringcontent( (Ruby/)inlinecontent(\))delimiter(")>operator(\))operator(;) + reserved(end) + reserved(end) + + reserved(if) instance_variable(@output_method) operator(==) string + reserved(if) operator(()operator(()instance_variable(@status) operator(==) pre_constant(nil) reserved(or) instance_variable(@status) operator(==) integer(200)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\))operator(\)) + ident(header)operator(()stringoperator(\)) + reserved(end) + + reserved(if) instance_variable(@status) operator(!=) pre_constant(nil) + global_variable($stdout)operator(.)ident(print) stringcontent( )inlinechar(\\r)char(\\n)delimiter(")> + reserved(end) + + instance_variable(@header)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) + ident(key) operator(=) ident(key) operator(*)integer(1) comment(# "unfreeze" key :\)) + ident(key)operator([)integer(0)operator(]) operator(=) ident(key)operator([)integer(0)operator(,)integer(1)operator(])operator(.)ident(upcase!)operator([)integer(0)operator(]) + + ident(key) operator(=) ident(key)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(char)operator(|) + string operator(+) ident(char)operator([)integer(1)operator(,)integer(1)operator(])operator(.)ident(upcase) + reserved(end) + + global_variable($stdout)operator(.)ident(print) stringcontent(: )inlinechar(\\r)char(\\n)delimiter(")> + reserved(end) + ident(cookies) operator(=) constant(Cookie)operator(.)ident(getHttpHeader) comment(# Get all cookies as an HTTP Header) + reserved(if) ident(cookies) + global_variable($stdout)operator(.)ident(print) ident(cookies) + reserved(end) + + global_variable($stdout)operator(.)ident(print) string + + reserved(elsif) instance_variable(@output_method) operator(==) string + reserved(elsif) instance_variable(@output_method) operator(==) string + ident(r) operator(=) constant(Apache)operator(.)ident(request) + + reserved(if) operator(()operator(()instance_variable(@status) operator(==) pre_constant(nil) reserved(or) instance_variable(@status) operator(==) integer(200)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()stringoperator(\))operator(\)) + ident(header)operator(()stringoperator(\)) + reserved(end) + + reserved(if) instance_variable(@status) operator(!=) pre_constant(nil) + ident(r)operator(.)ident(status_line) operator(=) stringcontent( )inlinedelimiter(")> + reserved(end) + + ident(r)operator(.)ident(send_http_header) + instance_variable(@header)operator(.)ident(each) reserved(do) operator(|)ident(key)operator(,) ident(value)operator(|) + ident(key) operator(=) ident(key) operator(*)integer(1) comment(# "unfreeze" key :\)) + + ident(key)operator([)integer(0)operator(]) operator(=) ident(key)operator([)integer(0)operator(,)integer(1)operator(])operator(.)ident(upcase!)operator([)integer(0)operator(]) + ident(key) operator(=) ident(key)operator(.)ident(gsub)operator(()regexpoperator(\)) reserved(do) operator(|)ident(char)operator(|) + string operator(+) ident(char)operator([)integer(1)operator(,)integer(1)operator(])operator(.)ident(upcase) + reserved(end) + ident(puts) stringcontent(: )inlinedelimiter(")> + comment(#r.headers_out[key] = value) + reserved(end) + reserved(end) + instance_variable(@output_started) operator(=) pre_constant(true) + comment(# }}}) + reserved(end) + + reserved(def) method(getReasonPhrase) operator(()ident(status)operator(\)) + comment(# {{{) + reserved(if) ident(status) operator(==) integer(100) + string + reserved(elsif) ident(status) operator(==) integer(101) + string + reserved(elsif) ident(status) operator(==) integer(200) + string + reserved(elsif) ident(status) operator(==) integer(201) + string + reserved(elsif) ident(status) operator(==) integer(202) + string + reserved(elsif) ident(status) operator(==) integer(203) + string + reserved(elsif) ident(status) operator(==) integer(204) + string + reserved(elsif) ident(status) operator(==) integer(205) + string + reserved(elsif) ident(status) operator(==) integer(206) + string + reserved(elsif) ident(status) operator(==) integer(300) + string + reserved(elsif) ident(status) operator(==) integer(301) + string + reserved(elsif) ident(status) operator(==) integer(302) + string + reserved(elsif) ident(status) operator(==) integer(303) + string + reserved(elsif) ident(status) operator(==) integer(304) + string + reserved(elsif) ident(status) operator(==) integer(305) + string + reserved(elsif) ident(status) operator(==) integer(307) + string + reserved(elsif) ident(status) operator(==) integer(400) + string + reserved(elsif) ident(status) operator(==) integer(401) + string + reserved(elsif) ident(status) operator(==) integer(402) + string + reserved(elsif) ident(status) operator(==) integer(403) + string + reserved(elsif) ident(status) operator(==) integer(404) + string + reserved(elsif) ident(status) operator(==) integer(405) + string + reserved(elsif) ident(status) operator(==) integer(406) + string + reserved(elsif) ident(status) operator(==) integer(407) + string + reserved(elsif) ident(status) operator(==) integer(408) + string + reserved(elsif) ident(status) operator(==) integer(409) + string + reserved(elsif) ident(status) operator(==) integer(410) + string + reserved(elsif) ident(status) operator(==) integer(411) + string + reserved(elsif) ident(status) operator(==) integer(412) + string + reserved(elsif) ident(status) operator(==) integer(413) + string + reserved(elsif) ident(status) operator(==) integer(414) + string + reserved(elsif) ident(status) operator(==) integer(415) + string + reserved(elsif) ident(status) operator(==) integer(416) + string + reserved(elsif) ident(status) operator(==) integer(417) + string + reserved(elsif) ident(status) operator(==) integer(500) + string + reserved(elsif) ident(status) operator(==) integer(501) + string + reserved(elsif) ident(status) operator(==) integer(502) + string + reserved(elsif) ident(status) operator(==) integer(503) + string + reserved(elsif) ident(status) operator(==) integer(504) + string + reserved(elsif) ident(status) operator(==) integer(505) + string + reserved(else) + ident(raise) string + reserved(end) + comment(# }}}) + reserved(end) +reserved(end) + +reserved(class) class(Cookie) + ident(attr_reader) symbol(:name)operator(,) symbol(:value)operator(,) symbol(:maxage)operator(,) symbol(:path)operator(,) symbol(:domain)operator(,) symbol(:secure)operator(,) symbol(:comment) + + comment(# Sets a cookie. Please see below for details of the attributes.) + reserved(def) method(initialize) operator(()ident(name)operator(,) ident(value) operator(=) pre_constant(nil)operator(,) ident(maxage) operator(=) pre_constant(nil)operator(,) ident(path) operator(=) pre_constant(nil)operator(,) ident(domain) operator(=) pre_constant(nil)operator(,) ident(secure) operator(=) pre_constant(false)operator(\)) + comment(# {{{) + comment(# HTTP headers (Cookies are a HTTP header\) can only set, while no content) + comment(# is send. So an exception will be raised, when @@allowed is set to false) + comment(# and a new cookie has set.) + reserved(unless) reserved(defined?)operator(()class_variable(@@allowed)operator(\)) + class_variable(@@allowed) operator(=) pre_constant(true) + reserved(end) + reserved(unless) class_variable(@@allowed) + ident(raise) string + reserved(end) + + reserved(unless) reserved(defined?)operator(()class_variable(@@list)operator(\)) + class_variable(@@list) operator(=) operator([)operator(]) + reserved(end) + class_variable(@@list) operator(+=) operator([)pre_constant(self)operator(]) + + reserved(unless) reserved(defined?)operator(()class_variable(@@type)operator(\)) + class_variable(@@type) operator(=) string + reserved(end) + + reserved(unless) ident(name)operator(.)ident(class) operator(==) constant(String) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(if) ident(value)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) ident(value)operator(.)ident(class) operator(==) constant(Float) + ident(value) operator(=) ident(value)operator(.)ident(to_s) + reserved(elsif) ident(value)operator(.)ident(class) operator(!=) constant(String) operator(&&) ident(value) operator(!=) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(if) ident(maxage)operator(.)ident(class) operator(==) constant(Time) + ident(maxage) operator(=) ident(maxage) operator(-) constant(Time)operator(.)ident(now) + reserved(elsif) operator(!)ident(maxage)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) operator(!)ident(maxage) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(unless) ident(path)operator(.)ident(class) operator(==) constant(String) operator(||) ident(path) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(unless) ident(domain)operator(.)ident(class) operator(==) constant(String) operator(||) ident(domain) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + reserved(unless) ident(secure) operator(==) pre_constant(true) operator(||) ident(secure) operator(==) pre_constant(false) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + + instance_variable(@name)operator(,) instance_variable(@value)operator(,) instance_variable(@maxage)operator(,) instance_variable(@path)operator(,) instance_variable(@domain)operator(,) instance_variable(@secure) operator(=) ident(name)operator(,) ident(value)operator(,) ident(maxage)operator(,) ident(path)operator(,) ident(domain)operator(,) ident(secure) + instance_variable(@comment) operator(=) pre_constant(nil) + comment(# }}}) + reserved(end) + + comment(# Modifies the value of this cookie. The information you want to store. If the) + comment(# value is nil, the cookie will be deleted by the client.) + comment(#) + comment(# This attribute can be a String, Integer or Float object or nil.) + reserved(def) method(value=)operator(()ident(value)operator(\)) + comment(# {{{) + reserved(if) ident(value)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) ident(value)operator(.)ident(class) operator(==) constant(Float) + ident(value) operator(=) ident(value)operator(.)ident(to_s) + reserved(elsif) ident(value)operator(.)ident(class) operator(!=) constant(String) operator(&&) ident(value) operator(!=) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@value) operator(=) ident(value) + comment(# }}}) + reserved(end) + + comment(# Modifies the maxage of this cookie. This attribute defines the lifetime of) + comment(# the cookie, in seconds. A value of 0 means the cookie should be discarded) + comment(# imediatly. If it set to nil, the cookie will be deleted when the browser) + comment(# will be closed.) + comment(#) + comment(# Attention: This is different from other implementations like PHP, where you) + comment(# gives the seconds since 1/1/1970 0:00:00 GMT.) + comment(#) + comment(# This attribute must be an Integer or Time object or nil.) + reserved(def) method(maxage=)operator(()ident(maxage)operator(\)) + comment(# {{{) + reserved(if) ident(maxage)operator(.)ident(class) operator(==) constant(Time) + ident(maxage) operator(=) ident(maxage) operator(-) constant(Time)operator(.)ident(now) + reserved(elsif) ident(maxage)operator(.)ident(class)operator(.)ident(superclass) operator(==) constant(Integer) operator(||) operator(!)ident(maxage) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@maxage) operator(=) ident(maxage) + comment(# }}}) + reserved(end) + + comment(# Modifies the path value of this cookie. The client will send this cookie) + comment(# only, if the requested document is this directory or a subdirectory of it.) + comment(#) + comment(# The value of the attribute must be a String object or nil.) + reserved(def) method(path=)operator(()ident(path)operator(\)) + comment(# {{{) + reserved(unless) ident(path)operator(.)ident(class) operator(==) constant(String) operator(||) ident(path) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@path) operator(=) ident(path) + comment(# }}}) + reserved(end) + + comment(# Modifies the domain value of this cookie. The client will send this cookie) + comment(# only if it's connected with this domain (or a subdomain, if the first) + comment(# character is a dot like in ".ruby-lang.org"\)) + comment(#) + comment(# The value of this attribute must be a String or nil.) + reserved(def) method(domain=)operator(()ident(domain)operator(\)) + comment(# {{{) + reserved(unless) ident(domain)operator(.)ident(class) operator(==) constant(String) operator(||) ident(domain) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@domain) operator(=) ident(domain) + comment(# }}}) + reserved(end) + + comment(# Modifies the secure flag of this cookie. If it's true, the client will only) + comment(# send this cookie if it is secured connected with us.) + comment(#) + comment(# The value od this attribute has to be true or false.) + reserved(def) method(secure=)operator(()ident(secure)operator(\)) + comment(# {{{) + reserved(unless) ident(secure) operator(==) pre_constant(true) operator(||) ident(secure) operator(==) pre_constant(false) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@secure) operator(=) ident(secure) + comment(# }}}) + reserved(end) + + comment(# Modifies the comment value of this cookie. The comment won't be send, if) + comment(# type is "netscape".) + reserved(def) method(comment=)operator(()ident(comment)operator(\)) + comment(# {{{) + reserved(unless) ident(comment)operator(.)ident(class) operator(==) constant(String) operator(||) ident(comment) operator(==) pre_constant(nil) + ident(raise) constant(TypeError)operator(,) stringoperator(,) ident(caller) + reserved(end) + instance_variable(@comment) operator(=) ident(comment) + comment(# }}}) + reserved(end) + + comment(# Changes the type of all cookies.) + comment(# Allowed values are RFC2109 and netscape (default\).) + reserved(def) constant(Cookie)operator(.)ident(type)operator(=)operator(()ident(type)operator(\)) + comment(# {{{) + reserved(unless) class_variable(@@allowed) + ident(raise) string + reserved(end) + reserved(unless) ident(type)operator(.)ident(downcase) operator(==) string operator(&&) ident(type)operator(.)ident(downcase) operator(==) string + ident(raise) string + reserved(end) + class_variable(@@type) operator(=) ident(type)operator(;) + comment(# }}}) + reserved(end) + + comment(# After sending this message, no cookies can be set or modified. Use it, when) + comment(# HTTP-Headers are send. Rweb does this for you.) + reserved(def) constant(Cookie)operator(.)ident(disallow) + comment(# {{{) + class_variable(@@allowed) operator(=) pre_constant(false) + pre_constant(true) + comment(# }}}) + reserved(end) + + comment(# Returns a HTTP header (type String\) with all cookies. Rweb does this for) + comment(# you.) + reserved(def) constant(Cookie)operator(.)ident(getHttpHeader) + comment(# {{{) + reserved(if) reserved(defined?)operator(()class_variable(@@list)operator(\)) + reserved(if) class_variable(@@type) operator(==) string + ident(str) operator(=) string + class_variable(@@list)operator(.)ident(each) reserved(do) operator(|)ident(cookie)operator(|) + reserved(if) ident(cookie)operator(.)ident(value) operator(==) pre_constant(nil) + ident(cookie)operator(.)ident(maxage) operator(=) integer(0) + ident(cookie)operator(.)ident(value) operator(=) string + reserved(end) + comment(# TODO: Name and value should be escaped!) + ident(str) operator(+=) stringcontent(=)inlinedelimiter(")> + reserved(unless) ident(cookie)operator(.)ident(maxage) operator(==) pre_constant(nil) + ident(expire) operator(=) constant(Time)operator(.)ident(now) operator(+) ident(cookie)operator(.)ident(maxage) + ident(expire)operator(.)ident(gmtime) + ident(str) operator(+=) stringoperator(\))delimiter(})>delimiter(")> + reserved(end) + reserved(unless) ident(cookie)operator(.)ident(domain) operator(==) pre_constant(nil) + ident(str) operator(+=) stringdelimiter(")> + reserved(end) + reserved(unless) ident(cookie)operator(.)ident(path) operator(==) pre_constant(nil) + ident(str) operator(+=) stringdelimiter(")> + reserved(end) + reserved(if) ident(cookie)operator(.)ident(secure) + ident(str) operator(+=) string + reserved(end) + ident(str) operator(+=) string + reserved(end) + reserved(return) ident(str) + reserved(else) comment(# type == "RFC2109") + ident(str) operator(=) string + ident(comma) operator(=) pre_constant(false)operator(;) + + class_variable(@@list)operator(.)ident(each) reserved(do) operator(|)ident(cookie)operator(|) + reserved(if) ident(cookie)operator(.)ident(value) operator(==) pre_constant(nil) + ident(cookie)operator(.)ident(maxage) operator(=) integer(0) + ident(cookie)operator(.)ident(value) operator(=) string + reserved(end) + reserved(if) ident(comma) + ident(str) operator(+=) string + reserved(end) + ident(comma) operator(=) pre_constant(true) + + ident(str) operator(+=) stringcontent(=)char(\\")inlinechar(\\")delimiter(")> + reserved(unless) ident(cookie)operator(.)ident(maxage) operator(==) pre_constant(nil) + ident(str) operator(+=) stringchar(\\")delimiter(")> + reserved(end) + reserved(unless) ident(cookie)operator(.)ident(domain) operator(==) pre_constant(nil) + ident(str) operator(+=) stringchar(\\")delimiter(")> + reserved(end) + reserved(unless) ident(cookie)operator(.)ident(path) operator(==) pre_constant(nil) + ident(str) operator(+=) stringchar(\\")delimiter(")> + reserved(end) + reserved(if) ident(cookie)operator(.)ident(secure) + ident(str) operator(+=) string + reserved(end) + reserved(unless) ident(cookie)operator(.)ident(comment) operator(==) pre_constant(nil) + ident(str) operator(+=) stringchar(\\")delimiter(")> + reserved(end) + ident(str) operator(+=) string + reserved(end) + ident(str) + reserved(end) + reserved(else) + pre_constant(false) + reserved(end) + comment(# }}}) + reserved(end) +reserved(end) + +ident(require) string + +reserved(module) class(BBCode) + constant(DEBUG) operator(=) pre_constant(true) + + ident(use) stringoperator(,) stringoperator(,) stringoperator(,) string + +comment(=begin + The Parser class takes care of the encoding. + It scans the given BBCode (as plain text\), finds tags + and smilies and also makes links of urls in text. + + Normal text is send directly to the encoder. + + If a tag was found, an instance of a Tag subclass is created + to handle the case. + + The @tagstack manages tag nesting and ensures valid HTML. +=end) + + reserved(class) class(Parser) + reserved(class) class(Attribute) + comment(# flatten and use only one empty_arg) + reserved(def) pre_constant(self)operator(.)ident(create) ident(attr) + ident(attr) operator(=) ident(flatten) ident(attr) + reserved(return) class_variable(@@empty_attr) reserved(if) ident(attr)operator(.)ident(empty?) + ident(new) ident(attr) + reserved(end) + + ident(private_class_method) symbol(:new) + + comment(# remove leading and trailing whitespace; concat lines) + reserved(def) pre_constant(self)operator(.)ident(flatten) ident(attr) + ident(attr)operator(.)ident(strip)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) + comment(# -> ^ and $ can only match at begin and end now) + reserved(end) + + constant(ATTRIBUTE_SCAN) operator(=) regexp + + reserved(def) pre_constant(self)operator(.)ident(parse) ident(source) + ident(source) operator(=) ident(source)operator(.)ident(dup) + comment(# empty_tag: the tag looks like [... /]) + comment(# slice!: this deletes the \\s*/] at the end) + comment(# \\s+ because [url=http://rubybb.org/forum/] is NOT an empty tag.) + comment(# In RubyBBCode, you can use [url=http://rubybb.org/forum/ /], and this has to be) + comment(# interpreted correctly.) + ident(empty_tag) operator(=) ident(source)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) reserved(or) ident(source)operator(.)ident(slice!)operator(()regexpoperator(\)) + ident(debug) string operator(+) ident(source)operator(.)ident(inspect) operator(+) string )delimiter(')> operator(+) ident(empty_tag)operator(.)ident(inspect) + comment(#-> we have now an attr that's EITHER empty OR begins and ends with non-whitespace.) + + ident(attr) operator(=) constant(Hash)operator(.)ident(new) + ident(attr)operator([)symbol(:flags)operator(]) operator(=) operator([)operator(]) + ident(source)operator(.)ident(scan)operator(()constant(ATTRIBUTE_SCAN)operator(\)) operator({) operator(|)ident(key)operator(,) ident(value)operator(|) + reserved(if) reserved(not) ident(value) + ident(attr)operator([)symbol(:flags)operator(]) operator(<<) ident(unescape)operator(()ident(key)operator(\)) + reserved(else) + reserved(next) reserved(if) ident(value)operator(.)ident(empty?) reserved(and) ident(key)operator(.)ident(empty?) + ident(attr)operator([)ident(unescape)operator(()ident(key)operator(\))operator(]) operator(=) ident(unescape)operator(()ident(value)operator(\)) + reserved(end) + operator(}) + ident(debug) ident(attr)operator(.)ident(inspect) + + reserved(return) ident(empty_tag)operator(,) ident(attr) + reserved(end) + + reserved(def) pre_constant(self)operator(.)ident(unescape_char) ident(esc) + ident(esc)operator([)integer(1)operator(]) + reserved(end) + + reserved(def) pre_constant(self)operator(.)ident(unquote) ident(qt) + ident(qt)operator([)integer(1)operator(..)integer(-1)operator(])operator(.)ident(chomp)operator(()stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(esc)operator(|) ident(unescape_char) ident(esc) operator(}) + reserved(end) + + reserved(def) pre_constant(self)operator(.)ident(unescape) ident(str) + ident(str)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) + reserved(if) global_variable($1) + ident(unescape_char) global_variable($1) + reserved(else) + ident(unquote) global_variable($2) + reserved(end) + operator(}) + reserved(end) + + ident(include) constant(Enumerable) + reserved(def) method(each) operator(&)ident(block) + instance_variable(@args)operator(.)ident(each)operator(()operator(&)ident(block)operator(\)) + reserved(end) + + ident(attr_reader) symbol(:source)operator(,) symbol(:args)operator(,) symbol(:value) + + reserved(def) method(initialize) ident(source) + instance_variable(@source) operator(=) ident(source) + ident(debug) string operator(%) ident(source) + instance_variable(@empty_tag)operator(,) instance_variable(@attr) operator(=) constant(Attribute)operator(.)ident(parse) ident(source) + instance_variable(@value) operator(=) instance_variable(@attr)operator([)stringoperator(])operator(.)ident(to_s) + reserved(end) + + reserved(def) method(empty?) + pre_constant(self) operator(==) class_variable(@@empty_attr) + reserved(end) + + reserved(def) method(empty_tag?) + instance_variable(@empty_tag) + reserved(end) + + reserved(def) method([]) operator(*)ident(keys) + ident(res) operator(=) instance_variable(@attr)operator([)operator(*)ident(keys)operator(]) + reserved(end) + + reserved(def) method(flags) + ident(attr)operator([)symbol(:flags)operator(]) + reserved(end) + + reserved(def) method(to_s) + instance_variable(@attr) + reserved(end) + + reserved(def) method(inspect) + string operator(+) instance_variable(@attr)operator(.)ident(inspect) operator(+) operator(()instance_variable(@empty_tag) operator(?) string operator(:) stringoperator(\)) operator(+) string + reserved(end) + reserved(end) + reserved(class) class(Attribute) + class_variable(@@empty_attr) operator(=) ident(new) string + reserved(end) + reserved(end) + + reserved(class) class(Parser) + reserved(def) constant(Parser)operator(.)ident(flatten) ident(str) + comment(# replace mac & dos newlines with unix style) + ident(str)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) + reserved(end) + + reserved(def) method(initialize) ident(input) operator(=) string + comment(# input manager) + instance_variable(@scanner) operator(=) constant(StringScanner)operator(.)ident(new) string + comment(# output manager) + instance_variable(@encoder) operator(=) constant(Encoder)operator(.)ident(new) + instance_variable(@output) operator(=) string + comment(# tag manager) + instance_variable(@tagstack) operator(=) constant(TagStack)operator(.)ident(new)operator(()instance_variable(@encoder)operator(\)) + + instance_variable(@do_magic) operator(=) pre_constant(true) + comment(# set the input) + ident(feed) ident(input) + reserved(end) + + comment(# if you want, you can feed a parser instance after creating,) + comment(# or even feed it repeatedly.) + reserved(def) method(feed) ident(food) + instance_variable(@scanner)operator(.)ident(string) operator(=) constant(Parser)operator(.)ident(flatten) ident(food) + reserved(end) + + comment(# parse through the string using parse_token) + reserved(def) method(parse) + ident(parse_token) reserved(until) instance_variable(@scanner)operator(.)ident(eos?) + instance_variable(@tagstack)operator(.)ident(close_all) + instance_variable(@output) operator(=) ident(parse_magic) instance_variable(@encoder)operator(.)ident(output) + reserved(end) + + reserved(def) method(output) + instance_variable(@output) + reserved(end) + + comment(# ok, internals start here) + ident(private) + comment(# the default output functions. everything should use them or the tags.) + reserved(def) method(add_text) ident(text) operator(=) instance_variable(@scanner)operator(.)ident(matched) + instance_variable(@encoder)operator(.)ident(add_text) ident(text) + reserved(end) + + comment(# use this carefully) + reserved(def) method(add_html) ident(html) + instance_variable(@encoder)operator(.)ident(add_html) ident(html) + reserved(end) + + comment(# highlights the text as error) + reserved(def) method(add_garbage) ident(garbage) + ident(add_html) string)delimiter(')> reserved(if) constant(DEBUG) + ident(add_text) ident(garbage) + ident(add_html) string)delimiter(')> reserved(if) constant(DEBUG) + reserved(end) + + comment(# unknown and incorrectly nested tags are ignored and) + comment(# sent as plaintext (garbage in - garbage out\).) + comment(# in debug mode, garbage is marked with lime background.) + reserved(def) method(garbage_out) ident(start) + instance_variable(@scanner)operator(.)ident(pos) operator(=) ident(start) + ident(garbage) operator(=) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(debug) string operator(+) ident(garbage) + ident(add_garbage) ident(garbage) + reserved(end) + + comment(# simple text; everything but [, \\[ allowed) + constant(SIMPLE_TEXT_SCAN_) operator(=) regexp + constant(SIMPLE_TEXT_SCAN) operator(=) regexp + +comment(=begin + + WHAT IS A TAG? + ============== + + Tags in BBCode can be much more than just a simple [b]. + I use many terms here to differ the parts of each tag. + + Basic scheme: + [ code ] + TAG START TAG INFO TAG END + + Most tags need a second tag to close the range it opened. + This is done with CLOSING TAGS: + [/code] + or by using empty tags that have no content and close themselfes: + [url=winamp.com /] + You surely know this from HTML. + These slashes define the TAG KIND = normal|closing|empty and + cannot be used together. + + Everything between [ and ] and expluding the slashes is called the + TAG INFO. This info may contain: + - TAG ID + - TAG NAME including the tag id + - attributes + + The TAG ID is the first char of the info: + + TAG | ID + ----------+---- + [quote] | q + [±] | & + ["[b]"] | " + [/url] | u + [---] | - + + As you can see, the tag id shows the TAG TYPE, it can be a + normal tag, a formatting tag or an entity. + Therefor, the parser first scans the id to decide how to go + on with parsing. +=end) + comment(# tag) + comment(# TODO more complex expression allowing) + comment(# [quote="[ladico]"] and [quote=\\[ladico\\]] to be correct tags) + constant(TAG_BEGIN_SCAN) operator(=) regexp + constant(TAG_END_SCAN) operator(=) regexp + constant(CLOSE_TAG_SCAN) operator(=) regexp + constant(UNCLOSED_TAG_SCAN) operator(=) regexp + + constant(CLASSIC_TAG_SCAN) operator(=) regexp + + constant(SEPARATOR_TAG_SCAN) operator(=) regexp + + constant(FORMAT_TAG_SCAN) operator(=) regexp + + constant(QUOTED_SCAN) operator(=) regexp + + constant(ENTITY_SCAN) operator(=) regexp + + constant(SMILEY_SCAN) operator(=) constant(Smileys)operator(::)constant(SMILEY_PATTERN) + + comment(# this is the main parser loop that separates) + comment(# text - everything until "[") + comment(# from) + comment(# tags - starting with "[", ending with "]") + reserved(def) method(parse_token) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SIMPLE_TEXT_SCAN)operator(\)) + ident(add_text) + reserved(else) + ident(handle_tag) + reserved(end) + reserved(end) + + reserved(def) method(handle_tag) + ident(tag_start) operator(=) instance_variable(@scanner)operator(.)ident(pos) + + reserved(unless) instance_variable(@scanner)operator(.)ident(scan) constant(TAG_BEGIN_SCAN) + ident(garbage_out) ident(tag_start) + reserved(return) + reserved(end) + + ident(closing)operator(,) ident(id) operator(=) instance_variable(@scanner)operator([)integer(1)operator(])operator(,) instance_variable(@scanner)operator([)integer(2)operator(]) + comment(#debug 'handle_tag(%p\)' % @scanner.matched) + + ident(handled) operator(=) + reserved(case) ident(id) + + reserved(when) regexp + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(CLASSIC_TAG_SCAN)operator(\)) + reserved(if) ident(handle_classic_tag)operator(()ident(id) operator(+) instance_variable(@scanner)operator(.)ident(matched)operator(,) ident(closing)operator(\)) + ident(already_closed) operator(=) pre_constant(true) + reserved(end) + reserved(end) + + reserved(when) string + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SEPARATOR_TAG_SCAN)operator(\)) + ident(handle_asterisk) ident(tag_start)operator(,) ident(id) operator(+) instance_variable(@scanner)operator(.)ident(matched) + pre_constant(true) + reserved(end) + + reserved(when) string + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(FORMAT_TAG_SCAN)operator(\)) + comment(#format = id + @scanner.matched) + instance_variable(@encoder)operator(.)ident(add_html) string)char(\\n)delimiter(")> + pre_constant(true) + reserved(end) + + reserved(when) string + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(QUOTED_SCAN)operator(\)) + instance_variable(@encoder)operator(.)ident(add_text) ident(unescape)operator(()instance_variable(@scanner)operator([)integer(1)operator(])operator(\)) + pre_constant(true) + reserved(end) + + reserved(when) string + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(ENTITY_SCAN)operator(\)) + instance_variable(@encoder)operator(.)ident(add_entity) instance_variable(@scanner)operator([)integer(1)operator(]) + pre_constant(true) + reserved(end) + + reserved(when) constant(Smileys)operator(::)constant(SMILEY_START_CHARSET) + instance_variable(@scanner)operator(.)ident(pos) operator(=) instance_variable(@scanner)operator(.)ident(pos) operator(-) integer(1) comment(# (ungetch\)) + reserved(if) instance_variable(@scanner)operator(.)ident(scan)operator(()constant(SMILEY_SCAN)operator(\)) + instance_variable(@encoder)operator(.)ident(add_html) constant(Smileys)operator(.)ident(smiley_to_image)operator(()instance_variable(@scanner)operator(.)ident(matched)operator(\)) + pre_constant(true) + reserved(end) + + reserved(end) comment(# case) + + reserved(return) ident(garbage_out)operator(()ident(tag_start)operator(\)) reserved(unless) ident(handled) + + instance_variable(@scanner)operator(.)ident(scan)operator(()constant(TAG_END_SCAN)operator(\)) reserved(unless) ident(already_closed) + reserved(end) + + constant(ATTRIBUTES_SCAN) operator(=) regexp + + reserved(def) method(handle_classic_tag) ident(name)operator(,) ident(closing) + ident(debug) string operator(+) operator(()ident(closing) operator(?) string operator(:) stringoperator(\)) operator(+) ident(name) + comment(# flatten) + ident(name)operator(.)ident(downcase!) + ident(tag_class) operator(=) constant(TAG_LIST)operator([)ident(name)operator(]) + reserved(return) reserved(unless) ident(tag_class) + + comment(#debug((opening ? 'OPEN ' : 'CLOSE '\) + tag_class.name\)) + + comment(# create an attribute object to handle it) + instance_variable(@scanner)operator(.)ident(scan)operator(()constant(ATTRIBUTES_SCAN)operator(\)) + comment(#debug name + ':' + @scanner[1]) + ident(attr) operator(=) constant(Attribute)operator(.)ident(create) instance_variable(@scanner)operator([)integer(1)operator(]) + comment(#debug 'ATTRIBUTES %p ' % attr #unless attr.empty?) + + comment(#debug 'closing: %p; name=%s, attr=%p' % [closing, name, attr]) + + comment(# OPEN) + reserved(if) reserved(not) ident(closing) reserved(and) ident(tag) operator(=) instance_variable(@tagstack)operator(.)ident(try_open_class)operator(()ident(tag_class)operator(,) ident(attr)operator(\)) + comment(#debug 'opening') + ident(tag)operator(.)ident(do_open) instance_variable(@scanner) + comment(# this should be done by the tag itself.) + reserved(if) ident(attr)operator(.)ident(empty_tag?) + ident(tag)operator(.)ident(handle_empty) + instance_variable(@tagstack)operator(.)ident(close_tag) + reserved(elsif) ident(tag)operator(.)ident(special_content?) + ident(handle_special_content)operator(()ident(tag)operator(\)) + instance_variable(@tagstack)operator(.)ident(close_tag) + comment(# # ignore asterisks directly after the opening; these are phpBBCode) + comment(# elsif tag.respond_to? :asterisk) + comment(# debug 'SKIP ASTERISKS: ' if @scanner.skip(ASTERISK_TAGS_SCAN\)) + reserved(end) + + comment(# CLOSE) + reserved(elsif) instance_variable(@tagstack)operator(.)ident(try_close_class)operator(()ident(tag_class)operator(\)) + comment(#debug 'closing') + comment(# GARBAGE) + reserved(else) + reserved(return) + reserved(end) + + pre_constant(true) + reserved(end) + + reserved(def) method(handle_asterisk) ident(tag_start)operator(,) ident(stars) + comment(#debug 'ASTERISK: ' + stars.to_s) + comment(# rule for asterisk tags: they belong to the last tag) + comment(# that handles them. tags opened after this tag are closed.) + comment(# if no open tag uses them, all are closed.) + ident(tag) operator(=) instance_variable(@tagstack)operator(.)ident(close_all_until) operator({) operator(|)ident(tag)operator(|) ident(tag)operator(.)ident(respond_to?) symbol(:asterisk) operator(}) + reserved(unless) ident(tag) reserved(and) ident(tag)operator(.)ident(asterisk) ident(stars)operator(,) instance_variable(@scanner) + ident(garbage_out) ident(tag_start) + reserved(end) + reserved(end) + + reserved(def) method(handle_special_content) ident(tag) + ident(scanned) operator(=) instance_variable(@scanner)operator(.)ident(scan_until)operator(()ident(tag)operator(.)ident(closing_tag)operator(\)) + reserved(if) ident(scanned) + ident(scanned)operator(.)ident(slice!)operator(()operator(-)operator(()instance_variable(@scanner)operator(.)ident(matched)operator(.)ident(size)operator(\))operator(..)integer(-1)operator(\)) + reserved(else) + ident(scanned) operator(=) instance_variable(@scanner)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) + reserved(end) + comment(#debug 'SPECIAL CONTENT: ' + scanned) + ident(tag)operator(.)ident(handle_content)operator(()ident(scanned)operator(\)) + reserved(end) + + reserved(def) method(unescape) ident(text) + comment(# input: correctly formatted quoted string (without the quotes\)) + ident(text)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) global_variable($1) reserved(or) global_variable($&) operator(}) + reserved(end) + + + comment(# MAGIC FEAUTURES) + + constant(URL_PATTERN) operator(=) regexp)char(\\w)content({3,}\):)char(\\/)char(\\/)content(\))char(\\S)content(+)delimiter(/)> + constant(EMAIL_PATTERN) operator(=) regexp[)char(\\w)char(\\-)content(_.]+\)@[)char(\\w)char(\\-)char(\\.)content(]+)char(\\.)char(\\w)content(+)delimiter(/)> + + constant(HAS_MAGIC) operator(=) regexpcontent(]|(?i:www|ftp\))delimiter(/)> + + constant(MAGIC_PATTERN) operator(=) constant(Regexp)operator(.)ident(new)operator(()string operator(%) + operator([)constant(Smileys)operator(::)constant(MAGIC_SMILEY_PATTERN)operator(,) constant(URL_PATTERN)operator(,) constant(EMAIL_PATTERN)operator(])operator(.)ident(map) operator({) operator(|)ident(pattern)operator(|) + ident(pattern)operator(.)ident(to_s) + operator(})operator(.)ident(join)operator(()stringoperator(\)) operator(\)) + + constant(IS_SMILEY_PATTERN) operator(=) constant(Regexp)operator(.)ident(new)operator(()string operator(%) constant(Smileys)operator(::)constant(SMILEY_START_CHARSET)operator(.)ident(to_s) operator(\)) + constant(IS_URL_PATTERN) operator(=) regexp)char(\\w)content(+\):)char(\\/)char(\\/)content(\))delimiter(/)> + constant(URL_STARTS_WITH_PROTOCOL) operator(=) regexp + constant(IS_EMAIL_PATTERN) operator(=) regexp + + reserved(def) method(to_magic) ident(text) + comment(# debug MAGIC_PATTERN.to_s) + ident(text)operator(.)ident(gsub!)operator(()constant(MAGIC_PATTERN)operator(\)) operator({) + ident(magic) operator(=) global_variable($2) + global_variable($1) operator(+) reserved(case) ident(magic) + reserved(when) constant(IS_SMILEY_PATTERN) + constant(Smileys)operator(.)ident(smiley_to_img) ident(magic) + reserved(when) constant(IS_URL_PATTERN) + ident(last) operator(=) ident(magic)operator(.)ident(slice_punctation!) comment(# no punctation in my URL) + ident(href) operator(=) ident(magic) + ident(href)operator(.)ident(insert)operator(()integer(0)operator(,) stringoperator(\)) reserved(unless) ident(magic) operator(=)operator(~) constant(URL_STARTS_WITH_PROTOCOL) + string)delimiter(')> operator(+) ident(magic) operator(+) string)delimiter(')> operator(+) ident(last) + reserved(when) constant(IS_EMAIL_PATTERN) + ident(last) operator(=) ident(magic)operator(.)ident(slice_punctation!) + string)delimiter(')> operator(+) ident(magic) operator(+) string)delimiter(')> operator(+) ident(last) + reserved(else) + ident(raise) string operator(+) ident(magic) operator(+) string + reserved(end) + operator(}) + ident(text) + reserved(end) + + comment(# handles smileys and urls) + reserved(def) method(parse_magic) ident(html) + reserved(return) ident(html) reserved(unless) instance_variable(@do_magic) + ident(scanner) operator(=) constant(StringScanner)operator(.)ident(new) ident(html) + ident(out) operator(=) string + reserved(while) ident(scanner)operator(.)ident(rest?) + reserved(if) ident(scanner)operator(.)ident(scan)operator(()regexp | pre)char(\\W)content( .*? <)char(\\/)content(pre> | [^>]* > \) )delimiter(/)modifier(mx)>operator(\)) + ident(out) operator(<<) ident(scanner)operator(.)ident(matched) + reserved(elsif) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(out) operator(<<) ident(to_magic)operator(()ident(scanner)operator(.)ident(matched)operator(\)) + + comment(# this should never happen) + reserved(elsif) ident(scanner)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(raise) string + reserved(end) + reserved(end) + ident(out) + reserved(end) + reserved(end) comment(# Parser) +reserved(end) + +reserved(class) class(String) + reserved(def) method(slice_punctation!) + ident(slice!)operator(()regexpoperator(\))operator(.)ident(to_s) comment(# return '' instead of nil) + reserved(end) +reserved(end) + +comment(#) +comment(# = Grammar) +comment(#) +comment(# An implementation of common algorithms on grammars.) +comment(#) +comment(# This is used by Shinobu, a visualization tool for educating compiler-building.) +comment(#) +comment(# Thanks to Andreas Kunert for his wonderful LR(k\) Pamphlet (German, see http://www.informatik.hu-berlin.de/~kunert/papers/lr-analyse\), and Aho/Sethi/Ullman for their Dragon Book.) +comment(#) +comment(# Homepage:: http://shinobu.cYcnus.de (not existing yet\)) +comment(# Author:: murphy (Kornelius Kalnbach\)) +comment(# Copyright:: (cc\) 2005 cYcnus) +comment(# License:: GPL) +comment(# Version:: 0.2.0 (2005-03-27\)) + +ident(require) string +ident(require) string +ident(require) string +ident(require) string +ident(require) string + +ident(require) string +ident(require) string + +comment(# = Grammar) +comment(#) +comment(# == Syntax) +comment(#) +comment(# === Rules) +comment(#) +comment(# Each line is a rule.) +comment(# The syntax is) +comment(#) +comment(# left - right) +comment(#) +comment(# where +left+ and +right+ can be uppercase and lowercase letters,) +comment(# and - can be any combination of <, >, - or whitespace.) +comment(#) +comment(# === Symbols) +comment(#) +comment(# Uppercase letters stand for meta symbols, lowercase for terminals.) +comment(#) +comment(# You can make epsilon-derivations by leaving empty.) +comment(#) +comment(# === Example) +comment(# S - Ac) +comment(# A - Sc) +comment(# A - b) +comment(# A -) +reserved(class) class(Grammar) + + ident(attr_reader) symbol(:tracer) + comment(# Creates a new Grammar.) + comment(# If $trace is true, the algorithms explain (textual\) what they do to $stdout.) + reserved(def) method(initialize) ident(data)operator(,) ident(tracer) operator(=) constant(Tracer)operator(.)ident(new) + instance_variable(@tracer) operator(=) ident(tracer) + instance_variable(@rules) operator(=) constant(Rules)operator(.)ident(new) + instance_variable(@terminals)operator(,) instance_variable(@meta_symbols) operator(=) constant(SortedSet)operator(.)ident(new)operator(,) constant(Array)operator(.)ident(new) + instance_variable(@start_symbol) operator(=) pre_constant(nil) + ident(add_rules) ident(data) + reserved(end) + + ident(attr_reader) symbol(:meta_symbols)operator(,) symbol(:terminals)operator(,) symbol(:rules)operator(,) symbol(:start_symbol) + + ident(alias_method) symbol(:sigma)operator(,) symbol(:terminals) + ident(alias_method) symbol(:alphabet)operator(,) symbol(:terminals) + ident(alias_method) symbol(:variables)operator(,) symbol(:meta_symbols) + ident(alias_method) symbol(:nonterminals)operator(,) symbol(:meta_symbols) + + comment(# A string representation of the grammar for debugging.) + reserved(def) method(inspect) ident(productions_too) operator(=) pre_constant(false) + string operator(%) + operator([) + ident(meta_symbols)operator(.)ident(join)operator(()stringoperator(\))operator(,) + ident(terminals)operator(.)ident(join)operator(()stringoperator(\))operator(,) + reserved(if) ident(productions_too) + instance_variable(@rules)operator(.)ident(inspect) + reserved(else) + instance_variable(@rules)operator(.)ident(size) + reserved(end)operator(,) + ident(start_symbol) + operator(]) + reserved(end) + + comment(# Add rules to the grammar. +rules+ should be a String or respond to +scan+ in a similar way.) + comment(#) + comment(# Syntax: see Grammar.) + reserved(def) method(add_rules) ident(grammar) + instance_variable(@rules) operator(=) constant(Rules)operator(.)ident(parse) ident(grammar) reserved(do) operator(|)ident(rule)operator(|) + instance_variable(@start_symbol) operator(||=) ident(rule)operator(.)ident(left) + instance_variable(@meta_symbols) operator(<<) ident(rule)operator(.)ident(left) + instance_variable(@terminals)operator(.)ident(merge) ident(rule)operator(.)ident(right)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(select) operator({) operator(|)ident(s)operator(|) ident(terminal?) ident(s) operator(}) + reserved(end) + instance_variable(@meta_symbols)operator(.)ident(uniq!) + ident(update) + reserved(end) + + comment(# Returns a hash acting as FIRST operator, so that) + comment(# first["ABC"] is FIRST(ABC\).) + comment(# See http://en.wikipedia.org/wiki/LL_parser "Constructing an LL(1\) parsing table" for details.) + reserved(def) method(first) + ident(first_operator) + reserved(end) + + comment(# Returns a hash acting as FOLLOW operator, so that) + comment(# first["A"] is FOLLOW(A\).) + comment(# See http://en.wikipedia.org/wiki/LL_parser "Constructing an LL(1\) parsing table" for details.) + reserved(def) method(follow) + ident(follow_operator) + reserved(end) + + constant(LLError) operator(=) constant(Class)operator(.)ident(new)operator(()constant(Exception)operator(\)) + constant(LLErrorType1) operator(=) constant(Class)operator(.)ident(new)operator(()constant(LLError)operator(\)) + constant(LLErrorType2) operator(=) constant(Class)operator(.)ident(new)operator(()constant(LLError)operator(\)) + + comment(# Tests if the grammar is LL(1\).) + reserved(def) method(ll1?) + reserved(begin) + reserved(for) ident(meta) reserved(in) instance_variable(@meta_symbols) + ident(first_sets) operator(=) instance_variable(@rules)operator([)ident(meta)operator(])operator(.)ident(map) operator({) operator(|)ident(alpha)operator(|) ident(first)operator([)ident(alpha)operator(]) operator(}) + ident(first_sets)operator(.)ident(inject)operator(()constant(Set)operator([)operator(])operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) + reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) + ident(raise) constant(LLErrorType1) + reserved(end) + ident(already_used)operator(.)ident(merge) ident(another_first_set) + reserved(end) + + reserved(if) ident(first)operator([)ident(meta)operator(])operator(.)ident(include?) constant(EPSILON) reserved(and) reserved(not) ident(first)operator([)ident(meta)operator(])operator(.)ident(disjoint?) ident(follow)operator([)ident(meta)operator(]) + ident(raise) constant(LLErrorType2) + reserved(end) + reserved(end) + reserved(rescue) constant(LLError) + pre_constant(false) + reserved(else) + pre_constant(true) + reserved(end) + reserved(end) + +ident(private) + + reserved(def) method(first_operator) + instance_variable(@first) operator(||=) constant(FirstOperator)operator(.)ident(new) pre_constant(self) + reserved(end) + + reserved(def) method(follow_operator) + instance_variable(@follow) operator(||=) constant(FollowOperator)operator(.)ident(new) pre_constant(self) + reserved(end) + + reserved(def) method(update) + instance_variable(@first) operator(=) instance_variable(@follow) operator(=) pre_constant(nil) + reserved(end) + +reserved(end) + +reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) + ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)integer(+4) +reserved(end) + +ident(require) string + +reserved(class) class(TestCaseGrammar) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) + + ident(include) constant(Grammar)operator(::)constant(Symbols) + + reserved(def) method(fifo) ident(s) + constant(Set)operator([)operator(*)ident(s)operator(.)ident(split)operator(()stringoperator(\))operator(]) + reserved(end) + + reserved(def) method(test_fifo) + ident(assert_equal) constant(Set)operator([)operator(])operator(,) ident(fifo)operator(()stringoperator(\)) + ident(assert_equal) constant(Set)operator([)constant(EPSILON)operator(,) constant(END_OF_INPUT)operator(,) stringoperator(,) stringoperator(])operator(,) ident(fifo)operator(()stringoperator(\)) + reserved(end) + + constant(TEST_GRAMMAR_1) operator(=) stringstring + + reserved(def) method(test_symbols) + ident(assert) constant(EPSILON) + ident(assert) constant(END_OF_INPUT) + reserved(end) + + reserved(def) method(test_first_1) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) + + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(EPSILON)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()ident(f)operator([)stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(end) + + reserved(def) method(test_follow_1) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) + + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(end) + + + constant(TEST_GRAMMAR_2) operator(=) stringstring + + reserved(def) method(test_first_2) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) + + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(end) + + reserved(def) method(test_follow_2) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) + + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(end) + + constant(LLError) operator(=) constant(Grammar)operator(::)constant(LLError) + + constant(TEST_GRAMMAR_3) operator(=) stringstring + + constant(NoError) operator(=) constant(Class)operator(.)ident(new)operator(()constant(Exception)operator(\)) + + reserved(def) method(test_first_3) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) + + comment(# Grammar 3 is LL(1\), so all first-sets must be disjoint.) + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) + ident(r) operator(=) ident(g)operator(.)ident(rules)operator([)ident(m)operator(]) + ident(firsts) operator(=) ident(r)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(f)operator([)ident(x)operator(]) operator(})operator(.)ident(to_set) + ident(assert_nothing_raised) reserved(do) + ident(firsts)operator(.)ident(inject)operator(()constant(Set)operator(.)ident(new)operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) + ident(raise) constant(LLError)operator(,) string reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) + ident(already_used)operator(.)ident(merge) ident(another_first_set) + reserved(end) + reserved(end) + reserved(end) + reserved(end) + + reserved(def) method(test_follow_3) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) + + comment(# Grammar 3 is not LL(1\), because epsilon is in FIRST(S\),) + comment(# but FIRST(S\) and FOLLOW(S\) are not disjoint.) + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(,) constant(END_OF_INPUT)operator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) + ident(first_m) operator(=) ident(g)operator(.)ident(first)operator([)ident(m)operator(]) + reserved(next) reserved(unless) ident(first_m)operator(.)ident(include?) constant(EPSILON) + ident(assert_raise)operator(()ident(m) operator(==) string operator(?) constant(LLError) operator(:) constant(NoError)operator(\)) reserved(do) + reserved(if) ident(first_m)operator(.)ident(disjoint?) ident(f)operator([)ident(m)operator(]) + ident(raise) constant(NoError) comment(# this is fun :D) + reserved(else) + ident(raise) constant(LLError) + reserved(end) + reserved(end) + reserved(end) + reserved(end) + + constant(TEST_GRAMMAR_3b) operator(=) stringstring + + reserved(def) method(test_first_3b) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3b) + + comment(# Grammar 3b is NOT LL(1\), since not all first-sets are disjoint.) + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(first) operator(}) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)stringoperator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + ident(assert_equal)operator(()constant(Set)operator([)constant(EPSILON)operator(,) stringoperator(])operator(,) ident(f)operator([)stringoperator(])operator(\)) + reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) + ident(r) operator(=) ident(g)operator(.)ident(rules)operator([)ident(m)operator(]) + ident(firsts) operator(=) ident(r)operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(f)operator([)ident(x)operator(]) operator(}) + ident(assert_raise)operator(()ident(m) operator(==) string operator(?) constant(LLError) operator(:) constant(NoError)operator(\)) reserved(do) + ident(firsts)operator(.)ident(inject)operator(()constant(Set)operator(.)ident(new)operator(\)) reserved(do) operator(|)ident(already_used)operator(,) ident(another_first_set)operator(|) + ident(raise) constant(LLError)operator(,) string reserved(unless) ident(already_used)operator(.)ident(disjoint?) ident(another_first_set) + ident(already_used)operator(.)ident(merge) ident(another_first_set) + reserved(end) + ident(raise) constant(NoError) + reserved(end) + reserved(end) + reserved(end) + + reserved(def) method(test_follow_3b) + ident(g) operator(=) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3b) + + comment(# Although Grammar 3b is NOT LL(1\), the FOLLOW-condition is satisfied.) + ident(f) operator(=) pre_constant(nil) + ident(assert_nothing_raised) operator({) ident(f) operator(=) ident(g)operator(.)ident(follow) operator(}) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + ident(assert_equal)operator(()ident(fifo)operator(()stringoperator(\))operator(,) ident(f)operator([)stringoperator(])operator(,) stringoperator(\)) + reserved(for) ident(m) reserved(in) ident(g)operator(.)ident(meta_symbols) + ident(first_m) operator(=) ident(g)operator(.)ident(first)operator([)ident(m)operator(]) + reserved(next) reserved(unless) ident(first_m)operator(.)ident(include?) constant(EPSILON) + ident(assert_raise)operator(()constant(NoError)operator(\)) reserved(do) + reserved(if) ident(first_m)operator(.)ident(disjoint?) ident(f)operator([)ident(m)operator(]) + ident(raise) constant(NoError) comment(# this is fun :D) + reserved(else) + ident(raise) constant(LLError) + reserved(end) + reserved(end) + reserved(end) + reserved(end) + + reserved(def) method(test_ll1?) + ident(assert_equal) pre_constant(false)operator(,) constant(Grammar)operator(.)ident(new)operator(()constant(TEST_GRAMMAR_3)operator(\))operator(.)ident(ll1?)operator(,) string + ident(assert_equal) pre_constant(false)operator(,) constant(Grammar)operator(.)ident(new)operator(()constant(TEST_GRAMMAR_3b)operator(\))operator(.)ident(ll1?)operator(,) string + reserved(end) + + reserved(def) method(test_new) + ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) string operator(}) + ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) operator(}) + ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_2) operator(}) + ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_3) operator(}) + ident(assert_nothing_raised) operator({) constant(Grammar)operator(.)ident(new) constant(TEST_GRAMMAR_1) operator(+) constant(TEST_GRAMMAR_2) operator(+) constant(TEST_GRAMMAR_3) operator(}) + ident(assert_raise)operator(()constant(ArgumentError)operator(\)) operator({) constant(Grammar)operator(.)ident(new) string operator(}) + reserved(end) +reserved(end) + +comment(# vim:foldmethod=syntax) + +comment(#!/usr/bin/env ruby) + +ident(require) string + +ident(include) constant(Fox) + +reserved(class) class(Window) operator(<) constant(FXMainWindow) + reserved(def) method(initialize)operator(()ident(app)operator(\)) + reserved(super)operator(()ident(app)operator(,) ident(app)operator(.)ident(appName) operator(+) stringoperator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) constant(DECOR_ALL)operator(,) integer(0)operator(,) integer(0)operator(,) integer(800)operator(,) integer(600)operator(,) integer(0)operator(,) integer(0)operator(\)) + + comment(# {{{ menubar) + ident(menubar) operator(=) constant(FXMenuBar)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(\)) + + ident(filemenu) operator(=) constant(FXMenuPane)operator(.)ident(new)operator(()pre_constant(self)operator(\)) + + constant(FXMenuCommand)operator(.)ident(new)operator(()ident(filemenu)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(getApp)operator(()operator(\))operator(\))operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(,) ident(method)operator(()symbol(:start)operator(\))operator(\)) + constant(FXMenuCommand)operator(.)ident(new)operator(()ident(filemenu)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(getApp)operator(()operator(\))operator(,) constant(FXApp)operator(::)constant(ID_QUIT)operator(\)) + constant(FXMenuTitle)operator(.)ident(new)operator(()ident(menubar)operator(,) stringoperator(,) pre_constant(nil)operator(,) ident(filemenu)operator(\)) + comment(# }}} menubar) + + comment(# {{{ statusbar) + instance_variable(@statusbar) operator(=) constant(FXStatusBar)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_BOTTOM)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(STATUSBAR_WITH_DRAGCORNER)operator(\)) + comment(# }}} statusbar) + + comment(# {{{ window content) + ident(horizontalsplitt) operator(=) constant(FXSplitter)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(SPLITTER_VERTICAL)operator(|)constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL)operator(\)) + + + instance_variable(@productions) operator(=) constant(FXList)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FIX_HEIGHT)operator(|)constant(LIST_SINGLESELECT)operator(\)) + instance_variable(@productions)operator(.)ident(height) operator(=) integer(100) + + instance_variable(@result) operator(=) constant(FXTable)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_FILL)operator(\)) + instance_variable(@result)operator(.)ident(height) operator(=) integer(200) + instance_variable(@result)operator(.)ident(setTableSize)operator(()integer(2)operator(,) integer(2)operator(,) pre_constant(false)operator(\)) + instance_variable(@result)operator(.)ident(rowHeaderWidth) operator(=) integer(0) + + ident(header) operator(=) instance_variable(@result)operator(.)ident(columnHeader) + ident(header)operator(.)ident(setItemText) integer(0)operator(,) string + ident(header)operator(.)ident(setItemText) integer(1)operator(,) string + reserved(for) ident(item) reserved(in) ident(header) + ident(item)operator(.)ident(justification) operator(=) constant(FXHeaderItem)operator(::)constant(CENTER_X) + reserved(end) + + instance_variable(@debug) operator(=) constant(FXText)operator(.)ident(new)operator(()ident(horizontalsplitt)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) constant(LAYOUT_SIDE_BOTTOM)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FIX_HEIGHT)operator(\)) + instance_variable(@debug)operator(.)ident(height) operator(=) integer(200) + + comment(# }}} window content) + reserved(end) + + reserved(def) method(load_grammar) ident(grammar) + instance_variable(@tracer) operator(=) constant(FirstTracer)operator(.)ident(new)operator(()pre_constant(self)operator(\)) + instance_variable(@grammar) operator(=) constant(Grammar)operator(.)ident(new) ident(grammar)operator(,) instance_variable(@tracer) + instance_variable(@rules_indexes) operator(=) constant(Hash)operator(.)ident(new) + instance_variable(@grammar)operator(.)ident(rules)operator(.)ident(each_with_index) reserved(do) operator(|)ident(rule)operator(,) ident(i)operator(|) + instance_variable(@productions)operator(.)ident(appendItem) ident(rule)operator(.)ident(inspect) + instance_variable(@rules_indexes)operator([)ident(rule)operator(]) operator(=) ident(i) + reserved(end) + reserved(end) + + reserved(def) method(create) + reserved(super) + ident(show)operator(()constant(PLACEMENT_SCREEN)operator(\)) + reserved(end) + + reserved(def) method(rule) ident(rule) + instance_variable(@productions)operator(.)ident(selectItem) instance_variable(@rules_indexes)operator([)ident(rule)operator(]) + ident(sleep) float(0.1) + reserved(end) + + reserved(def) method(iterate) ident(i) + ident(setTitle) ident(i)operator(.)ident(to_s) + ident(sleep) float(0.1) + reserved(end) + + reserved(def) method(missing) ident(what) + instance_variable(@debug)operator(.)ident(appendText) ident(what) operator(+) string + ident(sleep) float(0.1) + reserved(end) + + reserved(def) method(start) ident(sender)operator(,) ident(sel)operator(,) ident(pointer) + constant(Thread)operator(.)ident(new) reserved(do) + reserved(begin) + instance_variable(@grammar)operator(.)ident(first) + reserved(rescue) operator(=)operator(>) ident(boom) + instance_variable(@debug)operator(.)ident(appendText) operator([)ident(boom)operator(.)ident(to_s)operator(,) operator(*)ident(boom)operator(.)ident(backtrace)operator(])operator(.)ident(join)operator(()stringoperator(\)) + reserved(end) + reserved(end) + reserved(end) + +reserved(end) + +global_variable($:) operator(<<) string +ident(require) string + +ident(require) string + +ident(app) operator(=) constant(FXApp)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) + +comment(# fenster erzeugen) +ident(window) operator(=) constant(Window)operator(.)ident(new) ident(app) + +reserved(unless) pre_constant(ARGV)operator(.)ident(empty?) + ident(grammar) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator(.)ident(first)operator(\)) +reserved(else) + ident(grammar) operator(=) stringstring S +S --> Sb +S --> bAa +A --> aSc +A --> a +A --> aSb)delimiter( + EOG1)> +reserved(end) + +ident(window)operator(.)ident(load_grammar) ident(grammar) + +ident(app)operator(.)ident(create) +ident(app)operator(.)ident(run) + +ident(require) string +ident(require) string +ident(require) string +ident(require) string + +reserved(module) class(WhyTheLuckyStiff) + reserved(class) class(Book) + ident(attr_accessor) symbol(:author)operator(,) symbol(:title)operator(,) symbol(:terms)operator(,) symbol(:image)operator(,) symbol(:teaser)operator(,) + symbol(:chapters)operator(,) symbol(:expansion_paks)operator(,) symbol(:encoding)operator(,) symbol(:credits) + reserved(def) method([]) ident(x) + instance_variable(@lang)operator(.)ident(fetch)operator(()ident(x)operator(\)) reserved(do) + ident(warn) ident(warning) operator(=) stringcontent('!])delimiter(")> + ident(warning) + reserved(end) + reserved(end) + reserved(end) + + reserved(def) constant(Book)operator(::)ident(load)operator(() ident(file_name) operator(\)) + constant(YAML)operator(::)ident(load)operator(() constant(File)operator(.)ident(open)operator(() ident(file_name) operator(\)) operator(\)) + reserved(end) + + reserved(class) class(Section) + ident(attr_accessor) symbol(:index)operator(,) symbol(:header)operator(,) symbol(:content) + reserved(def) method(initialize)operator(() ident(i)operator(,) ident(h)operator(,) ident(c) operator(\)) + instance_variable(@index)operator(,) instance_variable(@header)operator(,) instance_variable(@content) operator(=) ident(i)operator(,) ident(h)operator(,) constant(RedCloth)operator(::)ident(new)operator(() ident(c)operator(.)ident(to_s) operator(\)) + reserved(end) + reserved(end) + + reserved(class) class(Sidebar) + ident(attr_accessor) symbol(:title)operator(,) symbol(:content) + reserved(end) + + constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) + constant(YAML)operator(::)ident(object_maker)operator(() constant(Sidebar)operator(,) string operator(=)operator(>) ident(val)operator(.)ident(keys)operator(.)ident(first)operator(,) string operator(=)operator(>) constant(RedCloth)operator(::)ident(new)operator(() ident(val)operator(.)ident(values)operator(.)ident(first) operator(\)) operator(\)) + reserved(end) + reserved(class) class(Chapter) + ident(attr_accessor) symbol(:index)operator(,) symbol(:title)operator(,) symbol(:sections) + reserved(def) method(initialize)operator(() ident(i)operator(,) ident(t)operator(,) ident(sects) operator(\)) + instance_variable(@index) operator(=) ident(i) + instance_variable(@title) operator(=) ident(t) + ident(i) operator(=) integer(0) + instance_variable(@sections) operator(=) ident(sects)operator(.)ident(collect) reserved(do) operator(|)ident(s)operator(|) + reserved(if) ident(s)operator(.)ident(respond_to?)operator(() symbol(:keys) operator(\)) + ident(i) operator(+=) integer(1) + constant(Section)operator(.)ident(new)operator(() ident(i)operator(,) ident(s)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(s)operator(.)ident(values)operator(.)ident(first) operator(\)) + reserved(else) + ident(s) + reserved(end) + reserved(end) + reserved(end) + reserved(end) + + constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) + operator([)stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(chaptype)operator(|) + ident(i) operator(=) integer(0) + ident(val)operator([)ident(chaptype)operator(])operator(.)ident(collect!) reserved(do) operator(|)ident(c)operator(|) + ident(i) operator(+=) integer(1) + constant(Chapter)operator(::)ident(new)operator(() ident(i)operator(,) ident(c)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(c)operator(.)ident(values)operator(.)ident(first) operator(\)) + reserved(end) + reserved(end) + ident(val)operator([)stringoperator(])operator(.)ident(collect!) reserved(do) operator(|)ident(t)operator(|) + constant(Section)operator(::)ident(new)operator(() integer(1)operator(,) ident(t)operator(.)ident(keys)operator(.)ident(first)operator(,) ident(t)operator(.)ident(values)operator(.)ident(first) operator(\)) + reserved(end) + ident(val)operator([)stringoperator(]) operator(=) constant(RedCloth)operator(::)ident(new)operator(() ident(val)operator([)stringoperator(]) operator(\)) + constant(YAML)operator(::)ident(object_maker)operator(() constant(Book)operator(,) ident(val) operator(\)) + reserved(end) + + reserved(class) class(Image) + ident(attr_accessor) symbol(:file_name) + reserved(end) + + constant(YAML)operator(::)ident(add_domain_type)operator(() stringoperator(,) string operator(\)) reserved(do) operator(|)ident(taguri)operator(,) ident(val)operator(|) + constant(YAML)operator(::)ident(object_maker)operator(() constant(Image)operator(,) string operator(=)operator(>) string operator(+) ident(val) operator(\)) + reserved(end) +reserved(end) + +comment(#) +comment(# Convert the book to HTML) +comment(#) +reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) + reserved(unless) pre_constant(ARGV)operator([)integer(0)operator(]) + ident(puts) stringcontent( [/path/to/save/html])delimiter(")> + ident(exit) + reserved(end) + + ident(site_path) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) + ident(book) operator(=) constant(WhyTheLuckyStiff)operator(::)constant(Book)operator(::)ident(load)operator(() string operator(\)) + ident(chapter) operator(=) pre_constant(nil) + + comment(# Write index page) + ident(index_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) + constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) + ident(out) operator(<<) ident(index_tpl)operator(.)ident(result) + reserved(end) + + ident(book)operator(.)ident(chapters) operator(=) ident(book)operator(.)ident(chapters)operator([)integer(0)operator(,)integer(3)operator(]) reserved(if) pre_constant(ARGV)operator(.)ident(include?) string + + comment(# Write chapter pages) + ident(chapter_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) + ident(book)operator(.)ident(chapters)operator(.)ident(each) reserved(do) operator(|)ident(chapter)operator(|) + constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) stringcontent(.html)delimiter(")> operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) + ident(out) operator(<<) ident(chapter_tpl)operator(.)ident(result) + reserved(end) + reserved(end) + ident(exit) reserved(if) pre_constant(ARGV)operator(.)ident(include?) string + + comment(# Write expansion pak pages) + ident(expak_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) + ident(book)operator(.)ident(expansion_paks)operator(.)ident(each) reserved(do) operator(|)ident(pak)operator(|) + constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) stringcontent(.html)delimiter(")> operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) + ident(out) operator(<<) ident(expak_tpl)operator(.)ident(result)operator(() ident(binding) operator(\)) + reserved(end) + reserved(end) + + comment(# Write printable version) + ident(print_tpl) operator(=) constant(ERB)operator(::)ident(new)operator(() constant(File)operator(.)ident(open)operator(() string operator(\))operator(.)ident(read) operator(\)) + constant(File)operator(.)ident(open)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\))operator(,) string operator(\)) reserved(do) operator(|)ident(out)operator(|) + ident(out) operator(<<) ident(print_tpl)operator(.)ident(result) + reserved(end) + + comment(# Copy css + images into site) + ident(copy_list) operator(=) operator([)stringoperator(]) operator(+) + constant(Dir)operator([)stringoperator(])operator(.)ident(find_all) operator({) operator(|)ident(image)operator(|) ident(image) operator(=)operator(~) regexp operator(}) + + constant(File)operator(.)ident(makedirs)operator(() constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) string operator(\)) operator(\)) + ident(copy_list)operator(.)ident(each) reserved(do) operator(|)ident(copy_file)operator(|) + constant(File)operator(.)ident(copy)operator(() ident(copy_file)operator(,) constant(File)operator(.)ident(join)operator(() ident(site_path)operator(,) ident(copy_file) operator(\)) operator(\)) + reserved(end) +reserved(end) + +comment(#!/usr/bin/env ruby) + +ident(require) string +reserved(begin) + ident(require) string +reserved(rescue) constant(LoadError) + ident(require) string + constant(MSG) operator(=) stringstring + ident(missingDependency)operator(()constant(MSG)operator(\)) +reserved(end) + + +ident(include) constant(Fox) +ident(include) constant(Math) + +constant(Deg2Rad) operator(=) constant(Math)operator(::)constant(PI) operator(/) integer(180) + +constant(D_MAX) operator(=) integer(6) +constant(SQUARE_SIZE) operator(=) float(2.0) operator(/) constant(D_MAX) +constant(SQUARE_DISTANCE) operator(=) float(4.0) operator(/) constant(D_MAX) +constant(AMPLITUDE) operator(=) constant(SQUARE_SIZE) +constant(LAMBDA) operator(=) constant(D_MAX)operator(.)ident(to_f) operator(/) integer(2) + +reserved(class) class(GLTestWindow) operator(<) constant(FXMainWindow) + + comment(# How often our timer will fire (in milliseconds\)) + constant(TIMER_INTERVAL) operator(=) integer(500) + + comment(# Rotate the boxes when a timer message is received) + reserved(def) method(onTimeout)operator(()ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(\)) + instance_variable(@angle) operator(+=) float(10.0) +comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) + ident(drawScene)operator(()operator(\)) + instance_variable(@timer) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addTimeout)operator(()constant(TIMER_INTERVAL)operator(,) ident(method)operator(()symbol(:onTimeout)operator(\))operator(\)) + reserved(end) + + comment(# Rotate the boxes when a chore message is received) + reserved(def) method(onChore)operator(()ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(\)) + instance_variable(@angle) operator(+=) float(10.0) +comment(# @angle %= 360.0) +comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) + ident(drawScene)operator(()operator(\)) + instance_variable(@chore) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addChore)operator(()ident(method)operator(()symbol(:onChore)operator(\))operator(\)) + reserved(end) + + comment(# Draw the GL scene) + reserved(def) method(drawScene) + ident(lightPosition) operator(=) operator([)float(15.0)operator(,) float(10.0)operator(,) float(5.0)operator(,) float(1.0)operator(]) + ident(lightAmbient) operator(=) operator([) float(0.1)operator(,) float(0.1)operator(,) float(0.1)operator(,) float(1.0)operator(]) + ident(lightDiffuse) operator(=) operator([) float(0.9)operator(,) float(0.9)operator(,) float(0.9)operator(,) float(1.0)operator(]) + ident(redMaterial) operator(=) operator([) float(0.0)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(1.0)operator(]) + ident(blueMaterial) operator(=) operator([) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(,) float(1.0)operator(]) + + ident(width) operator(=) instance_variable(@glcanvas)operator(.)ident(width)operator(.)ident(to_f) + ident(height) operator(=) instance_variable(@glcanvas)operator(.)ident(height)operator(.)ident(to_f) + ident(aspect) operator(=) ident(width)operator(/)ident(height) + + comment(# Make context current) + instance_variable(@glcanvas)operator(.)ident(makeCurrent)operator(()operator(\)) + + constant(GL)operator(.)ident(Viewport)operator(()integer(0)operator(,) integer(0)operator(,) instance_variable(@glcanvas)operator(.)ident(width)operator(,) instance_variable(@glcanvas)operator(.)ident(height)operator(\)) + + constant(GL)operator(.)ident(ClearColor)operator(()float(1.0)operator(/)integer(256)operator(,) float(0.0)operator(,) float(5.0)operator(/)integer(256)operator(,) float(1.0)operator(\)) + constant(GL)operator(.)ident(Clear)operator(()constant(GL)operator(::)constant(COLOR_BUFFER_BIT)operator(|)constant(GL)operator(::)constant(DEPTH_BUFFER_BIT)operator(\)) + constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(DEPTH_TEST)operator(\)) + + constant(GL)operator(.)ident(Disable)operator(()constant(GL)operator(::)constant(DITHER)operator(\)) + + constant(GL)operator(.)ident(MatrixMode)operator(()constant(GL)operator(::)constant(PROJECTION)operator(\)) + constant(GL)operator(.)ident(LoadIdentity)operator(()operator(\)) + constant(GLU)operator(.)ident(Perspective)operator(()float(30.0)operator(,) ident(aspect)operator(,) float(1.0)operator(,) float(100.0)operator(\)) + + constant(GL)operator(.)ident(MatrixMode)operator(()constant(GL)operator(::)constant(MODELVIEW)operator(\)) + constant(GL)operator(.)ident(LoadIdentity)operator(()operator(\)) + constant(GLU)operator(.)ident(LookAt)operator(()float(5.0)operator(,) float(10.0)operator(,) float(15.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(\)) + + constant(GL)operator(.)ident(ShadeModel)operator(()constant(GL)operator(::)constant(SMOOTH)operator(\)) + constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(POSITION)operator(,) ident(lightPosition)operator(\)) + constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(lightAmbient)operator(\)) + constant(GL)operator(.)ident(Light)operator(()constant(GL)operator(::)constant(LIGHT0)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(lightDiffuse)operator(\)) + constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(LIGHT0)operator(\)) + constant(GL)operator(.)ident(Enable)operator(()constant(GL)operator(::)constant(LIGHTING)operator(\)) + + constant(GL)operator(.)ident(Rotated)operator(()float(0.1)operator(*)instance_variable(@angle)operator(,) float(0.0)operator(,) float(1.0)operator(,) float(0.0)operator(\)) + reserved(for) ident(x) reserved(in) operator(-)constant(D_MAX)operator(..)constant(D_MAX) + reserved(for) ident(y) reserved(in) operator(-)constant(D_MAX)operator(..)constant(D_MAX) + ident(h1) operator(=) operator(()ident(x) operator(+) ident(y) operator(-) integer(2)operator(\))operator(.)ident(abs) + ident(h2) operator(=) operator(()ident(y) operator(-) ident(x) operator(+) integer(1)operator(\))operator(.)ident(abs) + constant(GL)operator(.)constant(PushMatrix) + ident(c) operator(=) operator([)integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(]) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) + + constant(GL)operator(.)ident(Translated)operator(() + ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) + constant(AMPLITUDE) operator(*) ident(h1)operator(,) + ident(x) operator(*) constant(SQUARE_DISTANCE) + operator(\)) + + constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) + constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)constant(End) + + constant(GL)operator(.)constant(PopMatrix) + + constant(GL)operator(.)constant(PushMatrix) + ident(c) operator(=) operator([)integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(1)operator(]) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) + + constant(GL)operator(.)ident(Translated)operator(() + ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) + constant(AMPLITUDE) operator(*) ident(h2)operator(,) + ident(x) operator(*) constant(SQUARE_DISTANCE) + operator(\)) + + constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) + constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)constant(End) + + constant(GL)operator(.)constant(PopMatrix) + + constant(GL)operator(.)constant(PushMatrix) + ident(c) operator(=) operator([)float(0.0) operator(+) operator(()ident(x)operator(/)float(10.0)operator(\))operator(,) float(0.0) operator(+) operator(()ident(y)operator(/)float(10.0)operator(\))operator(,) integer(0)operator(,) integer(1)operator(]) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) + constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) + + constant(GL)operator(.)ident(Translated)operator(() + ident(y) operator(*) constant(SQUARE_DISTANCE)operator(,) + integer(0)operator(,) + ident(x) operator(*) constant(SQUARE_DISTANCE) + operator(\)) + + constant(GL)operator(.)ident(Begin)operator(()constant(GL)operator(::)constant(TRIANGLE_STRIP)operator(\)) + constant(GL)operator(.)ident(Normal)operator(()float(1.0)operator(,) float(0.0)operator(,) float(0.0)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) + constant(GL)operator(.)constant(End) + + constant(GL)operator(.)constant(PopMatrix) + reserved(end) + reserved(end) + + comment(# Swap if it is double-buffered) + reserved(if) instance_variable(@glvisual)operator(.)ident(isDoubleBuffer) + instance_variable(@glcanvas)operator(.)ident(swapBuffers) + reserved(end) + + comment(# Make context non-current) + instance_variable(@glcanvas)operator(.)ident(makeNonCurrent) + reserved(end) + + reserved(def) method(initialize)operator(()ident(app)operator(\)) + comment(# Invoke the base class initializer) + reserved(super)operator(()ident(app)operator(,) stringoperator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) constant(DECOR_ALL)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1024)operator(,) integer(768)operator(\)) + + comment(# Construct the main window elements) + ident(frame) operator(=) constant(FXHorizontalFrame)operator(.)ident(new)operator(()pre_constant(self)operator(,) constant(LAYOUT_SIDE_TOP)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(\)) + ident(frame)operator(.)ident(padLeft)operator(,) ident(frame)operator(.)ident(padRight) operator(=) integer(0)operator(,) integer(0) + ident(frame)operator(.)ident(padTop)operator(,) ident(frame)operator(.)ident(padBottom) operator(=) integer(0)operator(,) integer(0) + + comment(# Left pane to contain the glcanvas) + ident(glcanvasFrame) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(frame)operator(,) + constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(glcanvasFrame)operator(.)ident(padLeft)operator(,) ident(glcanvasFrame)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(glcanvasFrame)operator(.)ident(padTop)operator(,) ident(glcanvasFrame)operator(.)ident(padBottom) operator(=) integer(10)operator(,) integer(10) + + comment(# Label above the glcanvas) + constant(FXLabel)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) + constant(JUSTIFY_CENTER_X)operator(|)constant(LAYOUT_FILL_X)operator(\)) + + comment(# Horizontal divider line) + constant(FXHorizontalSeparator)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) constant(SEPARATOR_GROOVE)operator(|)constant(LAYOUT_FILL_X)operator(\)) + + comment(# Drawing glcanvas) + ident(glpanel) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(glcanvasFrame)operator(,) operator(()constant(FRAME_SUNKEN)operator(|)constant(FRAME_THICK)operator(|) + constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\))operator(\)) + ident(glpanel)operator(.)ident(padLeft)operator(,) ident(glpanel)operator(.)ident(padRight) operator(=) integer(0)operator(,) integer(0) + ident(glpanel)operator(.)ident(padTop)operator(,) ident(glpanel)operator(.)ident(padBottom) operator(=) integer(0)operator(,) integer(0) + + comment(# A visual to draw OpenGL) + instance_variable(@glvisual) operator(=) constant(FXGLVisual)operator(.)ident(new)operator(()ident(getApp)operator(()operator(\))operator(,) constant(VISUAL_DOUBLEBUFFER)operator(\)) + + comment(# Drawing glcanvas) + instance_variable(@glcanvas) operator(=) constant(FXGLCanvas)operator(.)ident(new)operator(()ident(glpanel)operator(,) instance_variable(@glvisual)operator(,) pre_constant(nil)operator(,) integer(0)operator(,) + constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + instance_variable(@glcanvas)operator(.)ident(connect)operator(()constant(SEL_PAINT)operator(\)) operator({) + ident(drawScene) + operator(}) + instance_variable(@glcanvas)operator(.)ident(connect)operator(()constant(SEL_CONFIGURE)operator(\)) operator({) + reserved(if) instance_variable(@glcanvas)operator(.)ident(makeCurrent) + constant(GL)operator(.)ident(Viewport)operator(()integer(0)operator(,) integer(0)operator(,) instance_variable(@glcanvas)operator(.)ident(width)operator(,) instance_variable(@glcanvas)operator(.)ident(height)operator(\)) + instance_variable(@glcanvas)operator(.)ident(makeNonCurrent) + reserved(end) + operator(}) + + comment(# Right pane for the buttons) + ident(buttonFrame) operator(=) constant(FXVerticalFrame)operator(.)ident(new)operator(()ident(frame)operator(,) constant(LAYOUT_FILL_Y)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(buttonFrame)operator(.)ident(padLeft)operator(,) ident(buttonFrame)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(buttonFrame)operator(.)ident(padTop)operator(,) ident(buttonFrame)operator(.)ident(padBottom) operator(=) integer(10)operator(,) integer(10) + + comment(# Label above the buttons) + constant(FXLabel)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) + constant(JUSTIFY_CENTER_X)operator(|)constant(LAYOUT_FILL_X)operator(\)) + + comment(# Horizontal divider line) + constant(FXHorizontalSeparator)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) constant(SEPARATOR_RIDGE)operator(|)constant(LAYOUT_FILL_X)operator(\)) + + comment(# Spin according to timer) + ident(spinTimerBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) + stringoperator(,) pre_constant(nil)operator(,) + pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(spinTimerBtn)operator(.)ident(padLeft)operator(,) ident(spinTimerBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(spinTimerBtn)operator(.)ident(padTop)operator(,) ident(spinTimerBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) + ident(spinTimerBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) + instance_variable(@spinning) operator(=) pre_constant(true) + instance_variable(@timer) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addTimeout)operator(()constant(TIMER_INTERVAL)operator(,) ident(method)operator(()symbol(:onTimeout)operator(\))operator(\)) + operator(}) + ident(spinTimerBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) + instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(disable) operator(:) ident(sender)operator(.)ident(enable) + operator(}) + + comment(# Spin according to chore) + ident(spinChoreBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) + stringoperator(,) pre_constant(nil)operator(,) + pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(spinChoreBtn)operator(.)ident(padLeft)operator(,) ident(spinChoreBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(spinChoreBtn)operator(.)ident(padTop)operator(,) ident(spinChoreBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) + ident(spinChoreBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) + instance_variable(@spinning) operator(=) pre_constant(true) + instance_variable(@chore) operator(=) ident(getApp)operator(()operator(\))operator(.)ident(addChore)operator(()ident(method)operator(()symbol(:onChore)operator(\))operator(\)) + operator(}) + ident(spinChoreBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) + instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(disable) operator(:) ident(sender)operator(.)ident(enable) + operator(}) + + comment(# Stop spinning) + ident(stopBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) + stringoperator(,) pre_constant(nil)operator(,) + pre_constant(nil)operator(,) integer(0)operator(,) constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(stopBtn)operator(.)ident(padLeft)operator(,) ident(stopBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(stopBtn)operator(.)ident(padTop)operator(,) ident(stopBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) + ident(stopBtn)operator(.)ident(connect)operator(()constant(SEL_COMMAND)operator(\)) operator({) + instance_variable(@spinning) operator(=) pre_constant(false) + reserved(if) instance_variable(@timer) + ident(getApp)operator(()operator(\))operator(.)ident(removeTimeout)operator(()instance_variable(@timer)operator(\)) + instance_variable(@timer) operator(=) pre_constant(nil) + reserved(end) + reserved(if) instance_variable(@chore) + ident(getApp)operator(()operator(\))operator(.)ident(removeChore)operator(()instance_variable(@chore)operator(\)) + instance_variable(@chore) operator(=) pre_constant(nil) + reserved(end) + operator(}) + ident(stopBtn)operator(.)ident(connect)operator(()constant(SEL_UPDATE)operator(\)) operator({) operator(|)ident(sender)operator(,) ident(sel)operator(,) ident(ptr)operator(|) + instance_variable(@spinning) operator(?) ident(sender)operator(.)ident(enable) operator(:) ident(sender)operator(.)ident(disable) + operator(}) + + comment(# Exit button) + ident(exitBtn) operator(=) constant(FXButton)operator(.)ident(new)operator(()ident(buttonFrame)operator(,) stringoperator(,) pre_constant(nil)operator(,) + ident(getApp)operator(()operator(\))operator(,) constant(FXApp)operator(::)constant(ID_QUIT)operator(,) + constant(FRAME_THICK)operator(|)constant(FRAME_RAISED)operator(|)constant(LAYOUT_FILL_X)operator(|)constant(LAYOUT_TOP)operator(|)constant(LAYOUT_LEFT)operator(\)) + ident(exitBtn)operator(.)ident(padLeft)operator(,) ident(exitBtn)operator(.)ident(padRight) operator(=) integer(10)operator(,) integer(10) + ident(exitBtn)operator(.)ident(padTop)operator(,) ident(exitBtn)operator(.)ident(padBottom) operator(=) integer(5)operator(,) integer(5) + + comment(# Make a tooltip) + constant(FXTooltip)operator(.)ident(new)operator(()ident(getApp)operator(()operator(\))operator(\)) + + comment(# Initialize private variables) + instance_variable(@spinning) operator(=) pre_constant(false) + instance_variable(@chore) operator(=) pre_constant(nil) + instance_variable(@timer) operator(=) pre_constant(nil) + instance_variable(@angle) operator(=) float(0.0) + instance_variable(@size) operator(=) float(0.5) + reserved(end) + + comment(# Create and initialize) + reserved(def) method(create) + reserved(super) + ident(show)operator(()constant(PLACEMENT_SCREEN)operator(\)) + reserved(end) +reserved(end) + +reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) + comment(# Construct the application) + ident(application) operator(=) constant(FXApp)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) + + comment(# To ensure that the chores-based spin will run as fast as possible,) + comment(# we can disable the chore in FXRuby's event loop that tries to schedule) + comment(# other threads. This is OK for this program because there aren't any) + comment(# other Ruby threads running.) + + comment(#application.disableThreads) + + comment(# Construct the main window) + constant(GLTestWindow)operator(.)ident(new)operator(()ident(application)operator(\)) + + comment(# Create the app's windows) + ident(application)operator(.)ident(create) + + comment(# Run the application) + ident(application)operator(.)ident(run) +reserved(end) + +reserved(class) class(Facelet) + ident(attr_accessor) symbol(:color) + reserved(def) method(initialize)operator(()ident(color)operator(\)) + instance_variable(@color) operator(=) ident(color) + reserved(end) + + reserved(def) method(to_s) + instance_variable(@color) + reserved(end) +reserved(end) + +reserved(class) class(Edge) + ident(attr_accessor) symbol(:facelets)operator(,) symbol(:colors) + + reserved(def) method(initialize)operator(()ident(facelets)operator(\)) + instance_variable(@facelets) operator(=) ident(facelets) + instance_variable(@colors) operator(=) instance_variable(@facelets)operator(.)ident(map) operator({) operator(|)ident(fl)operator(|) ident(fl)operator(.)ident(color) operator(}) + reserved(end) + + reserved(def) method(apply)operator(()ident(edge)operator(\)) + instance_variable(@facelets)operator(.)ident(each_with_index) operator({) operator(|)ident(fl)operator(,) ident(i)operator(|) + ident(fl)operator(.)ident(color) operator(=) ident(edge)operator(.)ident(colors)operator([)ident(i)operator(]) + operator(}) + reserved(end) + + reserved(def) method(inspect) + string operator(%) ident(facelets) + reserved(end) +reserved(end) + +reserved(class) class(Side) + ident(attr_reader) symbol(:num)operator(,) symbol(:facelets) + ident(attr_accessor) symbol(:sides) + + reserved(def) method(initialize)operator(()ident(num)operator(\)) + instance_variable(@num) operator(=) ident(num) + instance_variable(@sides) operator(=) operator([)operator(]) + instance_variable(@facelets) operator(=) operator([)operator(]) + instance_variable(@fl_by_side) operator(=) operator({)operator(}) + reserved(end) + + comment(# facelets & sides) + comment(# 0) + comment(# 0 1 2) + comment(# 3 3 4 5 1) + comment(# 6 7 8) + comment(# 2) + + reserved(def) method(facelets=)operator(()ident(facelets)operator(\)) + instance_variable(@facelets) operator(=) ident(facelets)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(Facelet)operator(.)ident(new)operator(()ident(c)operator(\)) operator(}) + ident(init_facelet) integer(0)operator(,) integer(3)operator(,)integer(0) + ident(init_facelet) integer(1)operator(,) integer(0) + ident(init_facelet) integer(2)operator(,) integer(0)operator(,)integer(1) + ident(init_facelet) integer(3)operator(,) integer(3) + ident(init_facelet) integer(5)operator(,) integer(1) + ident(init_facelet) integer(6)operator(,) integer(2)operator(,)integer(3) + ident(init_facelet) integer(7)operator(,) integer(2) + ident(init_facelet) integer(8)operator(,) integer(1)operator(,)integer(2) + reserved(end) + + reserved(def) method(<=>)operator(()ident(side)operator(\)) + pre_constant(self)operator(.)ident(num) operator(<=>) ident(side)operator(.)ident(num) + reserved(end) + + reserved(def) method(init_facelet)operator(()ident(pos)operator(,) operator(*)ident(side_nums)operator(\)) + ident(sides) operator(=) ident(side_nums)operator(.)ident(map) operator({) operator(|)ident(num)operator(|) instance_variable(@sides)operator([)ident(num)operator(]) operator(})operator(.)ident(sort) + instance_variable(@fl_by_side)operator([)ident(sides)operator(]) operator(=) ident(pos) + reserved(end) + + reserved(def) method([]=)operator(()ident(color)operator(,) operator(*)ident(sides)operator(\)) + instance_variable(@facelets)operator([)instance_variable(@fl_by_side)operator([)ident(sides)operator(.)ident(sort)operator(])operator(])operator(.)ident(color) operator(=) ident(color) + reserved(end) + + reserved(def) method(values_at)operator(()operator(*)ident(sides)operator(\)) + ident(sides)operator(.)ident(map) operator({) operator(|)ident(sides)operator(|) instance_variable(@facelets)operator([)instance_variable(@fl_by_side)operator([)ident(sides)operator(.)ident(sort)operator(])operator(]) operator(}) + reserved(end) + + reserved(def) method(inspect)operator(()ident(range)operator(=)pre_constant(nil)operator(\)) + reserved(if) ident(range) + instance_variable(@facelets)operator(.)ident(values_at)operator(()operator(*)operator(()ident(range)operator(.)ident(to_a)operator(\))operator(\))operator(.)ident(join)operator(()stringoperator(\)) + reserved(else) + stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(num)operator(|) instance_variable(@facelets)operator([)ident(num)operator(.)ident(to_i)operator(]) operator(})operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(side)operator(|) instance_variable(@sides)operator([)ident(side)operator([)integer(0)operator(])operator(-)integer(?A)operator(])operator(.)ident(num)operator(.)ident(to_s) operator(})string + reserved(end) + reserved(end) + + reserved(def) method(get_edge)operator(()ident(side)operator(\)) + ident(trio) operator(=) operator(()integer(-1)operator(..)integer(1)operator(\))operator(.)ident(map) operator({) operator(|)ident(x)operator(|) operator(()ident(side) operator(+) ident(x)operator(\)) operator(%) integer(4) operator(}) + ident(prev_side)operator(,) ident(this_side)operator(,) ident(next_side) operator(=) instance_variable(@sides)operator(.)ident(values_at)operator(()operator(*)ident(trio)operator(\)) + ident(e) operator(=) constant(Edge)operator(.)ident(new)operator(() + pre_constant(self) operator(.)ident(values_at)operator(() operator([)ident(this_side)operator(])operator(,) operator([)ident(this_side)operator(,) ident(next_side)operator(]) operator(\)) operator(+) + ident(this_side)operator(.)ident(values_at)operator(() operator([)pre_constant(self)operator(,) ident(prev_side)operator(])operator(,) operator([)pre_constant(self) operator(])operator(,) operator([)pre_constant(self)operator(,) ident(next_side)operator(]) operator(\)) + operator(\)) + comment(#puts 'Edge created for side %d: ' % side + e.inspect) + ident(e) + reserved(end) + + reserved(def) method(turn)operator(()ident(dir)operator(\)) + comment(#p 'turn side %d in %d' % [num, dir]) + ident(edges) operator(=) operator(()integer(0)operator(..)integer(3)operator(\))operator(.)ident(map) operator({) operator(|)ident(n)operator(|) ident(get_edge) ident(n) operator(}) + reserved(for) ident(i) reserved(in) integer(0)operator(..)integer(3) + ident(edges)operator([)ident(i)operator(])operator(.)ident(apply) ident(edges)operator([)operator(()ident(i)operator(-)ident(dir)operator(\)) operator(%) integer(4)operator(]) + reserved(end) + reserved(end) +reserved(end) + +reserved(class) class(Cube) + reserved(def) method(initialize) + instance_variable(@sides) operator(=) operator([)operator(]) + stringoperator(.)ident(each_with_index) operator({) operator(|)ident(side)operator(,) ident(i)operator(|) + ident(eval)operator(()stringcontent(] = @)inlinecontent( = Side.new()inlinecontent(\))delimiter(")>operator(\)) + operator(}) + instance_variable(@left)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@front)operator(,) instance_variable(@bottom)operator(,) instance_variable(@back)operator(]) + instance_variable(@front)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@right)operator(,) instance_variable(@bottom)operator(,) instance_variable(@left)operator(]) + instance_variable(@right)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@back)operator(,) instance_variable(@bottom)operator(,) instance_variable(@front)operator(]) + instance_variable(@back)operator(.)ident(sides) operator(=) operator([)instance_variable(@top)operator(,) instance_variable(@left)operator(,) instance_variable(@bottom)operator(,) instance_variable(@right)operator(]) + instance_variable(@top)operator(.)ident(sides) operator(=) operator([)instance_variable(@back)operator(,) instance_variable(@right)operator(,) instance_variable(@front)operator(,) instance_variable(@left)operator(]) + instance_variable(@bottom)operator(.)ident(sides) operator(=) operator([)instance_variable(@front)operator(,) instance_variable(@right)operator(,) instance_variable(@back)operator(,) instance_variable(@left)operator(]) + reserved(end) + + reserved(def) method(read_facelets)operator(()ident(fs)operator(\)) + ident(pattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(\))string + ident(md) operator(=) ident(pattern)operator(.)ident(match)operator(()ident(fs)operator(\))operator(.)ident(to_a) + + instance_variable(@top)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(1)operator(,)integer(2)operator(,)integer(3)operator(\))operator(\)) + instance_variable(@left)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(4)operator(,)integer(8)operator(,)integer(12)operator(\))operator(\)) + instance_variable(@front)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(5)operator(,)integer(9)operator(,)integer(13)operator(\))operator(\)) + instance_variable(@right)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(6)operator(,)integer(10)operator(,)integer(14)operator(\))operator(\)) + instance_variable(@back)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(7)operator(,)integer(11)operator(,)integer(15)operator(\))operator(\)) + instance_variable(@bottom)operator(.)ident(facelets) operator(=) ident(parse_facelets)operator(()ident(md)operator(.)ident(values_at)operator(()integer(16)operator(,)integer(17)operator(,)integer(18)operator(\))operator(\)) + reserved(end) + + reserved(def) method(turn)operator(()ident(side)operator(,) ident(dir)operator(\)) + comment(#p 'turn %d in %d' % [side, dir]) + instance_variable(@sides)operator([)ident(side)operator(])operator(.)ident(turn)operator(()ident(dir)operator(\)) + comment(#puts inspect) + reserved(end) + + reserved(def) method(inspect) + stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) instance_variable(@sides)operator([)global_variable($1)operator(.)ident(to_i)operator(])operator(.)ident(inspect)operator(()constant(Range)operator(.)ident(new)operator(()global_variable($2)operator(.)ident(to_i)operator(,) global_variable($3)operator(.)ident(to_i)operator(\))operator(\)) operator(})string + reserved(end) + +ident(private) + reserved(def) method(parse_facelets)operator(()ident(rows)operator(\)) + ident(rows)operator(.)ident(join)operator(.)ident(delete)operator(()stringoperator(\))operator(.)ident(split)operator(()regexpoperator(\)) + reserved(end) +reserved(end) + +comment(#$stdin = DATA) + +ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) + ident(puts) stringcontent(:)delimiter(")> + ident(fs) operator(=) string + integer(9)operator(.)ident(times) operator({) ident(fs) operator(<<) ident(gets) operator(}) + ident(cube) operator(=) constant(Cube)operator(.)ident(new) + ident(cube)operator(.)ident(read_facelets) ident(fs) + ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(t)operator(|) + ident(side)operator(,) ident(dir) operator(=) ident(gets)operator(.)ident(split)operator(.)ident(map) operator({)operator(|)ident(s)operator(|) ident(s)operator(.)ident(to_i)operator(}) + ident(cube)operator(.)ident(turn)operator(()ident(side)operator(,) ident(dir)operator(\)) + reserved(end) + ident(puts) ident(cube)operator(.)ident(inspect) + ident(puts) +reserved(end) + +comment(# 2004 by murphy ) +comment(# GPL) +reserved(class) class(Scenario) + reserved(class) class(TimePoint) + ident(attr_reader) symbol(:data) + reserved(def) method(initialize) operator(*)ident(data) + instance_variable(@data) operator(=) ident(data) + reserved(end) + + reserved(def) method([]) ident(i) + instance_variable(@data)operator([)ident(i)operator(]) reserved(or) integer(0) + reserved(end) + + ident(include) constant(Comparable) + reserved(def) method(<=>) ident(tp) + ident(r) operator(=) integer(0) + operator([)instance_variable(@data)operator(.)ident(size)operator(,) ident(tp)operator(.)ident(data)operator(.)ident(size)operator(])operator(.)ident(max)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) + ident(r) operator(=) pre_constant(self)operator([)ident(i)operator(]) operator(<=>) ident(tp)operator([)ident(i)operator(]) + reserved(return) ident(r) reserved(if) ident(r)operator(.)ident(nonzero?) + reserved(end) + integer(0) + reserved(end) + + reserved(def) method(-) ident(tp) + ident(r) operator(=) operator([)operator(]) + operator([)instance_variable(@data)operator(.)ident(size)operator(,) ident(tp)operator(.)ident(data)operator(.)ident(size)operator(])operator(.)ident(max)operator(.)ident(times) reserved(do) operator(|)ident(i)operator(|) + ident(r) operator(<<) pre_constant(self)operator([)ident(i)operator(]) operator(-) ident(tp)operator([)ident(i)operator(]) + reserved(end) + ident(r) + reserved(end) + + reserved(def) method(inspect) + comment(# 01/01/1800 00:00:00) + string operator(%) instance_variable(@data)operator(.)ident(values_at)operator(()integer(1)operator(,) integer(2)operator(,) integer(0)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(\)) + reserved(end) + reserved(end) + + constant(ONE_HOUR) operator(=) constant(TimePoint)operator(.)ident(new) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(0)operator(,) integer(0) + + constant(APPOINTMENT_PATTERN) operator(=) regexp + + reserved(def) method(initialize) ident(io) + instance_variable(@team_size) operator(=) ident(io)operator(.)ident(gets)operator(.)ident(to_i) + instance_variable(@data) operator(=) operator([) operator([)constant(TimePoint)operator(.)ident(new)operator(()integer(1800)operator(,) integer(01)operator(,) integer(01)operator(,) integer(00)operator(,) integer(00)operator(,) integer(00)operator(\))operator(,) instance_variable(@team_size)operator(]) operator(]) + instance_variable(@team_size)operator(.)ident(times) reserved(do) comment(# each team member) + ident(io)operator(.)ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) comment(# each appointment) + ident(m) operator(=) constant(APPOINTMENT_PATTERN)operator(.)ident(match) ident(io)operator(.)ident(gets) + instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()operator(*)ident(m)operator(.)ident(captures)operator([)integer(0)operator(,)integer(6)operator(])operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(to_i) operator(})operator(\))operator(,) integer(-1)operator(]) + instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()operator(*)ident(m)operator(.)ident(captures)operator([)integer(6)operator(,)integer(6)operator(])operator(.)ident(map) operator({) operator(|)ident(x)operator(|) ident(x)operator(.)ident(to_i) operator(})operator(\))operator(,) integer(+1)operator(]) + reserved(end) + reserved(end) + instance_variable(@data) operator(<<) operator([)constant(TimePoint)operator(.)ident(new)operator(()integer(2200)operator(,) integer(01)operator(,) integer(01)operator(,) integer(00)operator(,) integer(00)operator(,) integer(00)operator(\))operator(,) operator(-)instance_variable(@team_size)operator(]) + reserved(end) + + reserved(def) method(print_time_plan) + ident(n) operator(=) integer(0) + ident(appointment) operator(=) pre_constant(nil) + ident(no_appointment) operator(=) pre_constant(true) + instance_variable(@data)operator(.)ident(sort_by) operator({) operator(|)ident(x)operator(|) ident(x)operator([)integer(0)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) + ident(tp)operator(,) ident(action) operator(=) operator(*)ident(x) + ident(n) operator(+=) ident(action) + comment(# at any time during the meeting, at least two team members need to be there) + comment(# and at most one team member is allowed to be absent) + reserved(if) ident(n) operator(>)operator(=) integer(2) reserved(and) operator(()instance_variable(@team_size) operator(-) ident(n)operator(\)) operator(<=) integer(1) + ident(appointment) operator(||=) ident(tp) + reserved(else) + reserved(if) ident(appointment) + comment(# the meeting should be at least one hour in length) + reserved(if) constant(TimePoint)operator(.)ident(new)operator(()operator(*)operator(()ident(tp) operator(-) ident(appointment)operator(\))operator(\)) operator(>)operator(=) constant(ONE_HOUR) + ident(puts) string operator(%) operator([)ident(appointment)operator(,) ident(tp)operator(]) + ident(no_appointment) operator(=) pre_constant(false) + reserved(end) + ident(appointment) operator(=) pre_constant(false) + reserved(end) + reserved(end) + reserved(end) + ident(puts) string reserved(if) ident(no_appointment) + reserved(end) +reserved(end) + +comment(# read the data) +pre_constant(DATA)operator(.)ident(gets)operator(.)ident(to_i)operator(.)ident(times) reserved(do) operator(|)ident(si)operator(|) comment(# each scenario) + ident(puts) string operator(%) operator(()ident(si) operator(+) integer(1)operator(\)) + ident(sc) operator(=) constant(Scenario)operator(.)ident(new) pre_constant(DATA) + ident(sc)operator(.)ident(print_time_plan) + ident(puts) +reserved(end) + +comment(#__END__) +integer(2) +integer(3) +integer(3) +integer(2002) integer(06) integer(28) integer(15) integer(00) integer(00) integer(2002) integer(06) integer(28) integer(18) integer(00) integer(00) constant(TUD) constant(Contest) constant(Practice) constant(Session) +integer(2002) integer(06) integer(29) integer(10) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(15) integer(00) integer(00) constant(TUD) constant(Contest) +integer(2002) integer(11) integer(15) integer(15) integer(00) integer(00) integer(2002) integer(11) integer(17) integer(23) integer(00) integer(00) constant(NWERC) constant(Delft) +integer(4) +integer(2002) integer(06) integer(25) integer(13) integer(30) integer(00) integer(2002) integer(06) integer(25) integer(15) integer(30) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Semifinal) constant(I) +integer(2002) integer(06) integer(26) integer(13) integer(30) integer(00) integer(2002) integer(06) integer(26) integer(15) integer(30) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Semifinal) constant(II) +integer(2002) integer(06) integer(29) integer(13) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(15) integer(00) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Third) constant(Place) +integer(2002) integer(06) integer(30) integer(13) integer(00) integer(00) integer(2002) integer(06) integer(30) integer(15) integer(00) integer(00) constant(FIFA) constant(World) constant(Cup) constant(Final) +integer(1) +integer(2002) integer(06) integer(01) integer(00) integer(00) integer(00) integer(2002) integer(06) integer(29) integer(18) integer(00) integer(00) constant(Preparation) ident(of) constant(Problem) constant(Set) +integer(2) +integer(1) +integer(1800) integer(01) integer(01) integer(00) integer(00) integer(00) integer(2200) integer(01) integer(01) integer(00) integer(00) integer(00) constant(Solving) constant(Problem) integer(8) +integer(0) + +ident(require) string +ident(require) string +ident(require) string +ident(require) string + +reserved(class) class(Fixnum) + comment(# Treat char as a digit and return it's value as Fixnum.) + comment(# Returns nonsense for non-digits.) + comment(# Examples:) + comment(# ) + comment(# RUBY_VERSION[0].digit == '1.8.2'[0].digit == 1) + comment(# ) + comment(#) + comment(# ) + comment(# ?6.digit == 6) + comment(# ) + comment(#) + comment(# ) + comment(# ?A.digit == 17) + comment(# ) + reserved(def) method(digit) + pre_constant(self) operator(-) integer(?0) + reserved(end) +reserved(end) + +comment(##) +comment(# Stellt einen einfachen Scanner für die lexikalische Analyse der Sprache Pas-0 dar.) +comment(#) +comment(# @author Andreas Kunert) +comment(# Ruby port by murphy) +reserved(class) class(Scanner) + + ident(include) constant(TokenConsts) + + ident(attr_reader) symbol(:line)operator(,) symbol(:pos) + + comment(# To allow Scanner.new without parameters.) + constant(DUMMY_INPUT) operator(=) string + reserved(def) constant(DUMMY_INPUT)operator(.)ident(getc) + pre_constant(nil) + reserved(end) + + comment(##) + comment(# Erzeugt einen Scanner, der als Eingabe das übergebene IO benutzt.) + reserved(def) method(initialize) ident(input) operator(=) constant(DUMMY_INPUT) + instance_variable(@line) operator(=) integer(1) + instance_variable(@pos) operator(=) integer(0) + + reserved(begin) + instance_variable(@input) operator(=) ident(input) + instance_variable(@next_char) operator(=) instance_variable(@input)operator(.)ident(getc) + reserved(rescue) constant(IOError) comment(# TODO show the reason!) + constant(Error)operator(.)ident(ioError) + ident(raise) + reserved(end) + reserved(end) + + comment(##) + comment(# Liest das nchste Zeichen von der Eingabe.) + reserved(def) method(read_next_char) + reserved(begin) + instance_variable(@pos) operator(+=) integer(1) + instance_variable(@current_char) operator(=) instance_variable(@next_char) + instance_variable(@next_char) operator(=) instance_variable(@input)operator(.)ident(getc) + reserved(rescue) constant(IOError) + constant(Error)operator(.)ident(ioError) + ident(raise) + reserved(end) + reserved(end) + + comment(##) + comment(# Sucht das nächste Symbol, identifiziert es, instantiiert ein entsprechendes) + comment(# PascalSymbol-Objekt und gibt es zurück.) + comment(# @see Symbol) + comment(# @return das gefundene Symbol als PascalSymbol-Objekt) + reserved(def) method(get_symbol) + ident(current_symbol) operator(=) pre_constant(nil) + reserved(until) ident(current_symbol) + ident(read_next_char) + + reserved(if) instance_variable(@current_char)operator(.)ident(alpha?) + ident(identifier) operator(=) instance_variable(@current_char)operator(.)ident(chr) + reserved(while) instance_variable(@next_char)operator(.)ident(alpha?) reserved(or) instance_variable(@next_char)operator(.)ident(digit?) + ident(identifier) operator(<<) instance_variable(@next_char) + ident(read_next_char) + reserved(end) + ident(current_symbol) operator(=) ident(handle_identifier)operator(()ident(identifier)operator(.)ident(upcase)operator(\)) + reserved(elsif) instance_variable(@current_char)operator(.)ident(digit?) + ident(current_symbol) operator(=) ident(number) + reserved(else) + reserved(case) instance_variable(@current_char) + reserved(when) integer(?\\s) + comment(# ignore) + reserved(when) integer(?\\n) + ident(new_line) + reserved(when) pre_constant(nil) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(EOP) + reserved(when) integer(?{) + ident(comment) + + reserved(when) integer(?:) + reserved(if) instance_variable(@next_char) operator(==) integer(?=) + ident(read_next_char) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(BECOMES) + reserved(else) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(COLON) + reserved(end) + + reserved(when) integer(?<) + reserved(if) operator(()instance_variable(@next_char) operator(==) integer(?=)operator(\)) + ident(read_next_char) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LEQSY) + reserved(elsif) operator(()instance_variable(@next_char) operator(==) integer(?>)operator(\)) + ident(read_next_char) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(NEQSY) + reserved(else) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LSSSY) + reserved(end) + + reserved(when) integer(?>) + reserved(if) operator(()instance_variable(@next_char) operator(==) integer(?=)operator(\)) + ident(read_next_char) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(GEQSY) + reserved(else) + ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(GRTSY) + reserved(end) + + reserved(when) integer(?.) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(PERIOD) + reserved(when) integer(?() reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(LPARENT) + reserved(when) integer(?,) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(COMMA) + reserved(when) integer(?*) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(TIMES) + reserved(when) integer(?/) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(SLASH) + reserved(when) integer(?+) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(PLUS) + reserved(when) integer(?-) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(MINUS) + reserved(when) integer(?=) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(EQLSY) + reserved(when) integer(?\)) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(RPARENT) + reserved(when) integer(?;) reserved(then) ident(current_symbol) operator(=) constant(PascalSymbol)operator(.)ident(new) constant(SEMICOLON) + reserved(else) + constant(Error)operator(.)ident(error)operator(()integer(100)operator(,) instance_variable(@line)operator(,) instance_variable(@pos)operator(\)) reserved(if) instance_variable(@current_char) operator(>) integer(?\\s) + reserved(end) + reserved(end) + reserved(end) + ident(current_symbol) + reserved(end) + +ident(private) + comment(##) + comment(# Versucht, in dem gegebenen String ein Schlüsselwort zu erkennen.) + comment(# Sollte dabei ein Keyword gefunden werden, so gibt er ein PascalSymbol-Objekt zurück, das) + comment(# das entsprechende Keyword repräsentiert. Ansonsten besteht die Rückgabe aus) + comment(# einem SymbolIdent-Objekt (abgeleitet von PascalSymbol\), das den String 1:1 enthält) + comment(# @see symbol) + comment(# @return falls Keyword gefunden, zugehöriges PascalSymbol, sonst SymbolIdent) + reserved(def) method(handle_identifier) ident(identifier) + reserved(if) ident(sym) operator(=) constant(KEYWORD_SYMBOLS)operator([)ident(identifier)operator(]) + constant(PascalSymbol)operator(.)ident(new) ident(sym) + reserved(else) + constant(SymbolIdent)operator(.)ident(new) ident(identifier) + reserved(end) + reserved(end) + + constant(MAXINT) operator(=) integer(2)operator(**)integer(31) operator(-) integer(1) + constant(MAXINT_DIV_10) operator(=) constant(MAXINT) operator(/) integer(10) + constant(MAXINT_MOD_10) operator(=) constant(MAXINT) operator(%) integer(10) + comment(##) + comment(# Versucht, aus dem gegebenen Zeichen und den folgenden eine Zahl zusammenzusetzen.) + comment(# Dabei wird der relativ intuitive Algorithmus benutzt, die endgültige Zahl bei) + comment(# jeder weiteren Ziffer mit 10 zu multiplizieren und diese dann mit der Ziffer zu) + comment(# addieren. Sonderfälle bestehen dann nur noch in der Behandlung von reellen Zahlen.) + comment(#
) + comment(# Treten dabei kein Punkt oder ein E auf, so gibt diese Methode ein SymbolIntCon-Objekt) + comment(# zurück, ansonsten (reelle Zahl\) ein SymbolRealCon-Objekt. Beide Symbole enthalten) + comment(# jeweils die Zahlwerte.) + comment(#
) + comment(# Anmerkung: Diese Funktion ist mit Hilfe der Java/Ruby-API deutlich leichter zu realisieren.) + comment(# Sie wurde dennoch so implementiert, um den Algorithmus zu demonstrieren) + comment(# @see symbol) + comment(# @return SymbolIntcon- oder SymbolRealcon-Objekt, das den Zahlwert enthält) + reserved(def) method(number) + ident(is_integer) operator(=) pre_constant(true) + ident(integer_too_long) operator(=) pre_constant(false) + ident(exponent) operator(=) integer(0) + ident(exp_counter) operator(=) integer(-1) + ident(exp_sign) operator(=) integer(1) + + ident(integer_mantisse) operator(=) instance_variable(@current_char)operator(.)ident(digit) + + reserved(while) operator(()instance_variable(@next_char)operator(.)ident(digit?) reserved(and) ident(integer_mantisse) operator(<) constant(MAXINT_DIV_10)operator(\)) reserved(or) + operator(()ident(integer_mantisse) operator(==) constant(MAXINT_DIV_10) reserved(and) instance_variable(@next_char)operator(.)ident(digit) operator(<=) constant(MAXINT_MOD_10)operator(\)) + ident(integer_mantisse) operator(*=) integer(10) + ident(integer_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) + ident(read_next_char) + reserved(end) + + ident(real_mantisse) operator(=) ident(integer_mantisse) + + reserved(while) instance_variable(@next_char)operator(.)ident(digit?) + ident(integer_too_long) operator(=) pre_constant(true) + ident(real_mantisse) operator(*=) integer(10) + ident(real_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) + ident(read_next_char) + reserved(end) + reserved(if) instance_variable(@next_char) operator(==) integer(?.) + ident(read_next_char) + ident(is_integer) operator(=) pre_constant(false) + reserved(unless) instance_variable(@next_char)operator(.)ident(digit?) + constant(Error)operator(.)ident(error) integer(101)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) + reserved(end) + reserved(while) instance_variable(@next_char)operator(.)ident(digit?) + ident(real_mantisse) operator(+=) instance_variable(@next_char)operator(.)ident(digit) operator(*) operator(()integer(10) operator(**) ident(exp_counter)operator(\)) + ident(read_next_char) + ident(exp_counter) operator(-=) integer(1) + reserved(end) + reserved(end) + reserved(if) instance_variable(@next_char) operator(==) integer(?E) + ident(is_integer) operator(=) pre_constant(false) + ident(read_next_char) + reserved(if) instance_variable(@next_char) operator(==) integer(?-) + ident(exp_sign) operator(=) integer(-1) + ident(read_next_char) + reserved(end) + reserved(unless) instance_variable(@next_char)operator(.)ident(digit?) + constant(Error)operator(.)ident(error) integer(101)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) + reserved(end) + reserved(while) instance_variable(@next_char)operator(.)ident(digit?) + ident(exponent) operator(*=) integer(10) + ident(exponent) operator(+=) instance_variable(@next_char)operator(.)ident(digit) + ident(read_next_char) + reserved(end) + reserved(end) + + reserved(if) ident(is_integer) + reserved(if) ident(integer_too_long) + constant(Error)operator(.)ident(error) integer(102)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) + reserved(end) + constant(SymbolIntcon)operator(.)ident(new) ident(integer_mantisse) + reserved(else) + constant(SymbolRealcon)operator(.)ident(new) ident(real_mantisse) operator(*) operator(()integer(10) operator(**) operator(()ident(exp_sign) operator(*) ident(exponent)operator(\))operator(\)) + reserved(end) + reserved(end) + + comment(##) + comment(# Sorgt für ein Überlesen von Kommentaren.) + comment(# Es werden einfach alle Zeichen bis zu einer schließenden Klammer eingelesen) + comment(# und verworfen.) + reserved(def) method(comment) + reserved(while) instance_variable(@current_char) operator(!=) integer(?}) + ident(forbid_eop) + ident(new_line) reserved(if) instance_variable(@current_char) operator(==) integer(?\\n) + ident(read_next_char) + reserved(end) + reserved(end) + + reserved(def) method(new_line) + instance_variable(@line) operator(+=) integer(1) + instance_variable(@pos) operator(=) integer(0) + reserved(end) + + reserved(def) method(forbid_eop) + reserved(if) ident(eop?) + constant(Error)operator(.)ident(error) integer(103)operator(,) instance_variable(@line)operator(,) instance_variable(@pos) + reserved(end) + ident(exit) + reserved(end) + + reserved(def) method(eop?) + instance_variable(@current_char)operator(.)ident(nil?) + reserved(end) +reserved(end) + +comment(##) +comment(# Läßt ein Testprogramm ablaufen.) +comment(# Dieses erzeugt sich ein Scanner-Objekt und ruft an diesem kontinuierlich bis zum Dateiende) +comment(# get_symbol auf.) +reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) + ident(scan) operator(=) constant(Scanner)operator(.)ident(new)operator(()constant(File)operator(.)ident(new)operator(()pre_constant(ARGV)operator([)integer(0)operator(]) operator(||) stringoperator(\))operator(\)) + ident(loop) reserved(do) + ident(c) operator(=) ident(scan)operator(.)ident(get_symbol) + ident(puts) ident(c) + reserved(break) reserved(if) ident(c)operator(.)ident(typ) operator(==) constant(TokenConsts)operator(::)constant(EOP) + reserved(end) +reserved(end) + diff --git a/test/ruby/jarh.out.raydebug b/test/ruby/jarh.out.raydebug index 0c3b36d..a1eb7fc 100644 --- a/test/ruby/jarh.out.raydebug +++ b/test/ruby/jarh.out.raydebug @@ -1,371 +1,371 @@ - -ident(print) stringoperator(.)ident(reverse) - -ident(print) stringoperator(.)ident(strip) - -ident(print) operator([)stringoperator(,) pre_constant(nil)operator(,) stringoperator(,) pre_constant(nil)operator(,) stringoperator(,) pre_constant(nil)operator(,) stringoperator(])operator(.)ident(compact) - -operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(reverse_each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x) reserved(end) - -regexpoperator(.)ident(source)operator(.)ident(display) - -ident(send) symbol(:print)operator(,) string - -ident(print) operator([)stringoperator(,) stringoperator(,) stringoperator(]) operator(|) operator([)stringoperator(,) stringoperator(,) stringoperator(]) - -ident(print) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) operator(-) operator([)stringoperator(]) - -ident(print) operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(.)ident(assoc)operator(()stringoperator(\)) - -ident(print) operator([)stringoperator(])operator(.)ident(pack)operator(()stringoperator(\)) - -ident(print) stringoperator(.)ident(unpack)operator(()stringoperator(\)) - -ident(print) operator([)operator([)stringoperator(])operator(.)ident(pop)operator(])operator(.)ident(sort)operator(.)ident(shift) - -ident(print) operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(.)ident(rassoc)operator(()stringoperator(\)) - -operator({)string operator(=)operator(>) stringoperator(})operator(.)ident(to_a)operator(.)ident(display) - -ident(print) stringoperator(.)ident(succ) - -ident(print) stringoperator(.)ident(swapcase) - -ident(print) operator([)stringoperator(])operator(.)ident(find) operator({)operator(|)ident(x)operator(|) ident(x)operator(}) - -ident(print) stringoperator(.)ident(find_all) operator({)operator(|)ident(x)operator(|) ident(x)operator(})operator(.)ident(join)operator(()stringoperator(\)) - -ident(print) stringoperator(.)ident(grep)operator(()regexpoperator(\))operator(.)ident(join)operator(()stringoperator(\)) - -constant(Ruby) operator(=) string reserved(and) ident(print) constant(Object)operator(.)ident(const_get)operator(()symbol(:Ruby)operator(\)) - -constant(Proc)operator(.)ident(new) operator({)ident(print) stringoperator(})operator([)operator(]) - -ident(print) stringoperator(.)ident(squeeze) - -ident(print) operator([)integer(1249211252)operator(,) integer(543256175)operator(,) integer(1952998770)operator(,) integer(542274914)operator(,) integer(2032167009)operator(,) integer(1667982706)operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(,) string - -global_variable($>) operator(<<) string operator(<<) string operator(<<) string operator(<<) string - -integer(5)operator(.)ident(times) reserved(do)operator(|)ident(i)operator(|)stringoperator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) ident(print) global_variable($&)operator([)ident(i)operator(,)integer(1)operator(]) reserved(end) reserved(end) - -ident(a)operator(=)stringoperator(.)ident(split)operator(()stringoperator(\))operator(;)ident(print) ident(a)operator(.)ident(pop) reserved(while) reserved(not) ident(a)operator(.)ident(empty?) - -ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(reverse) - -ident(print) regexpoperator(.)ident(match)operator(()stringoperator(\)) - -ident(print) global_variable($&) reserved(if) regexp operator(===) string - -reserved(case) string reserved(when) regexpoperator(;) ident(print) global_variable($~)operator([)integer(0)operator(]) reserved(end) - -ident(print) constant(Marshal)operator(.)ident(load)operator(()constant(Marshal)operator(.)ident(dump)operator(()stringoperator(\))operator(\)) - -stringoperator(.)ident(each_byte) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(chr) reserved(end) - -ident(print) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(sort)operator(.)ident(values_at)operator(()integer(1)operator(,)integer(3)operator(,)integer(2)operator(,)integer(4)operator(\)) - -ident(print) stringoperator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) - -comment(#$><<'RbyckJust another,'.split(''\).values_at(5..16,9,0,6,1,2,9,14,10,3,4,15..17\)) - -operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_a)operator(.)ident(join)operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) - -reserved(begin) ident(print) string reserved(ensure) ident(print) string reserved(end) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) - -stringoperator(.)ident(gsub)operator(()regexpoperator(,)stringoperator(\))operator(.)ident(display) - -ident(a)operator(=)stringoperator(;)integer(0)operator(.)ident(step)operator(()integer(24)operator(,)integer(2)operator(\))operator({)operator(|)ident(i)operator(|)ident(print) ident(a)operator([)ident(i)operator(,)integer(1)operator(])operator(})operator(;)integer(23)operator(.)ident(step)operator(()integer(1)operator(,)integer(-2)operator(\))operator({)operator(|)ident(i)operator(|)ident(print) ident(a)operator([)ident(i)operator(,)integer(1)operator(])operator(}) - -ident(a)operator(=)stringoperator(.)ident(split)operator(()stringoperator(\))operator(;)integer(12)operator(.)ident(times)operator({)ident(print) ident(a)operator(.)ident(shift)operator(,)ident(a)operator(.)ident(pop)operator(})operator(;)ident(print) ident(a) - -ident(a)operator(=)stringoperator(;)reserved(begin) ident(a)operator(.)ident(sub!)operator(()regexpoperator(\))operator({)ident(print) global_variable($1)operator(,)global_variable($3)operator(;)global_variable($2)operator(})reserved(end) reserved(while)global_variable($1)operator(;)ident(print) ident(a) - -ident(a)operator(=)stringoperator(;)integer(11)operator(.)ident(times)operator({)ident(a)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\))operator(})operator(;)ident(print) ident(a) - -ident(print) stringoperator(.)ident(tr_s)operator(()stringoperator(,) stringoperator(\)) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)operator([)ident(x)operator([)integer(1)operator(])operator(,)ident(x)operator([)integer(0)operator(])operator(])operator(})operator(.)ident(sort)operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(1)operator(])operator(})operator(.)ident(display) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(sort)operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(1)operator(,)integer(1)operator(])operator(})operator(.)ident(display) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator({)ident(print) global_variable($&)operator(.)ident(hex)operator(.)ident(chr)operator(}) - -ident(print) operator([)stringoperator(])operator(.)ident(fill)operator(()stringoperator(\)) - -global_variable($>)operator(<<)operator({)integer(1)operator(=)operator(>)stringoperator(,)integer(2)operator(=)operator(>)stringoperator(,)integer(3)operator(=)operator(>)stringoperator(,)integer(4)operator(=)operator(>)stringoperator(})operator(.)ident(sort)operator(.)ident(to_s)operator(.)ident(delete)operator(()stringoperator(\)) - -constant(Kernel)operator(.)ident(print) string)> - -reserved(class) class(Just_another_Ruby_hackerq)operator(;)reserved(end)operator(;)ident(print) constant(Just_another_Ruby_hackerq)operator(.)ident(to_s)operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\)) - -constant(Kust_another_Ruby_hacker)operator(=)integer(0)operator(;)ident(print) constant(Module)operator(.)ident(constants)operator(.)ident(grep)operator(()regexpoperator(\))operator([)integer(0)operator(])operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(,) string - -reserved(module) class(Lust_another_Ruby_hackerq)operator(;) ident(print) ident(name)operator(.)ident(tr)operator(()stringoperator(,) stringoperator(\)) reserved(end) - -reserved(class) class(Bar)operator(;) ident(print) string reserved(end) - -reserved(class) class(Baz)operator(;) reserved(def) method(initialize)operator(()operator(\)) ident(print) string reserved(end) reserved(end)operator(;) constant(Baz)operator(.)ident(new) - -ident(eval) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) - -ident(eval) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) - -global_variable($stdout)operator(.)ident(write) string - -stringoperator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(chomp) reserved(end) - -ident(print) global_variable($') reserved(if) regexp operator(===) string - -ident(raise) string reserved(rescue) ident(print) global_variable($!) - -ident(print) constant(File)operator(.)ident(basename)operator(()stringoperator(,)stringoperator(\)) - -ident(proc)operator({)operator(|)ident(x)operator(|)ident(x)operator([)stringoperator(])operator(})operator([)ident(proc)operator({)operator(|)ident(x)operator(|)ident(print) ident(x)operator(})operator(]) - -ident(method)operator(()symbol(:print)operator(\))operator([)stringoperator(]) - -stringoperator(.)ident(method)operator(()symbol(:display)operator(\))operator([)operator(]) - -ident(print) stringoperator(.)ident(replace)operator(()stringoperator(\)) - -ident(instance_eval) reserved(do) ident(print) string reserved(end) - -constant(Kernel)operator(.)ident(module_eval) reserved(do) ident(print) string reserved(end) - -ident(print) stringoperator(%)stringoperator(%)stringoperator(%)string - -ident(print) operator(!)integer(??)operator(?)integer(??)operator(:)integer(??)operator(?)stringoperator(:)integer(??) - -comment(#({}.default='Just another Ruby hacker,'\)[0].display) - -ident(print) constant(Hash)operator([)stringoperator(,) stringoperator(]) - -ident(print) string string string string - -ident(print) constant(File)operator(.)ident(dirname)operator(()stringoperator(\)) - -reserved(def) global_variable($_)operator(.)ident(singleton_method_added)operator(()operator(*)operator(\)) ident(print) string reserved(end) - -ident(print) operator([)stringoperator(])operator(.)ident(delete_at)operator(()integer(0)operator(\)) - -ident(print) string operator(%) string - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) - -operator(()integer(97)operator(..)integer(121)operator(\))operator(.)ident(to_a)operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) - -stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) - -ident(print) stringoperator(%)stringoperator(;)operator(;) - -ident(print)operator(()stringoperator(%) stringoperator(\)) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) - -ident(print) string operator(*) operator(()string operator(=)operator(~) regexpoperator(\)) - -ident(print) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator(.)ident(pack)operator(()stringoperator(\)) - -ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator({)operator(|)ident(x)operator(,)ident(y)operator(|) ident(print) ident(y)operator(+)ident(x)operator(}) - -ident(print) stringoperator([)stringoperator(]) - -ident(print) stringoperator([)regexpoperator(]) - -ident(print) operator([)operator(])operator(.)ident(push)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) - -ident(print) stringoperator([)integer(0)operator(..)integer(-1)operator(]) - -ident(print) stringoperator(.)ident(instance_eval)operator({)pre_constant(self)operator(}) - -reserved(class) class(String)operator(;) reserved(def) method(+@)operator(()operator(\)) ident(print) pre_constant(self) reserved(end)operator(;) operator(+)string reserved(end) - -ident(print) stringoperator(.)ident(delete)operator(()stringoperator(\)) - -stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(display) - -comment(#$><<{'Just another Ruby hacker,'=>''}.default=0) - -ident(print) ident(eval)operator(()stringoperator(.)ident(dump)operator(\)) - -ident(print) stringoperator(.)ident(concat)operator(()integer(?,)operator(\)) - -ident(print) stringoperator(.)ident(intern)operator(.)ident(to_s) - -ident(print) stringoperator(.)ident(dump)operator([)integer(1)operator(..)integer(-2)operator(]) - -stringoperator(.)ident(each_line) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x) reserved(end) - -operator([)stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(capitalize) reserved(end) - -ident(printf) stringoperator(,) string - -ident(print) stringoperator(.)ident(split)operator(()regexpoperator(\))operator([)integer(0)operator(]) - -ident(print) stringoperator(.)ident(split)operator(()regexpoperator(\)) - -ident(print) string - -ident(print) ident(String)operator(()operator([)stringoperator(])operator(\)) - -ident(print) ident(catch)operator(()symbol(:x)operator(\))operator({)ident(throw) symbol(:x)operator(,) stringoperator(}) - -ident(r)operator(,)ident(w) operator(=) constant(IO)operator(::)ident(pipe)operator(;)ident(w)operator(.)ident(print) stringoperator(;)ident(w)operator(.)ident(close)operator(;)ident(print) ident(r)operator(.)ident(gets) - -ident(print) ident(sprintf)operator(()stringoperator(,) ident(format)operator(()string operator(%) stringoperator(,) stringoperator(\))operator(\)) - -ident(print) ident(eval)operator(()stringoperator(.)ident(inspect)operator(\)) - -regexpdelimiter(})>delimiter(/)> - -ident(print) stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(collect)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(0)operator(])operator(})operator(.)ident(pack)operator(()stringoperator(\)) - -ident(print) stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(pack)operator(()stringoperator(*)integer(25)operator(\)) - -stringoperator(.)ident(send) stringoperator(.)ident(reverse)operator(.)ident(intern) - -ident(print) stringoperator(.)ident(uniq)operator(.)ident(join)operator(()stringoperator(\)) - -operator({)operator(})operator(.)ident(fetch)operator(()symbol(:x)operator(\))operator({)stringoperator(})operator(.)ident(display) - -operator({)operator(})operator(.)ident(delete)operator(()symbol(:x)operator(\))operator({)stringoperator(})operator(.)ident(display) - -ident(print) operator([)symbol(:x)operator(])operator(.)ident(map)operator({)stringoperator(}) - -operator({)stringoperator(=)operator(>)stringoperator(})operator(.)ident(each)operator({)operator(|*)ident(x)operator(|)ident(print) ident(x)operator(.)ident(reverse)operator(.)ident(join)operator(()stringoperator(\))operator(}) - -ident(print) operator([)operator(])operator(.)ident(unshift)operator(()stringoperator(\))operator(.)ident(unshift)operator(()stringoperator(\))operator(.)ident(join)operator(()stringoperator(\)) - -operator({)integer(3)operator(=)operator(>)stringoperator(,)integer(2)operator(=)operator(>)stringoperator(,)integer(4)operator(=)operator(>)stringoperator(,)integer(1)operator(=)operator(>)stringoperator(})operator(.)ident(values_at)operator(()integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(\))operator(.)ident(display) - -ident(print) operator([)operator([)integer(0)operator(,)stringoperator(])operator(,)integer(1)operator(])operator(.)ident(first)operator(.)ident(last) - -operator({)stringoperator(=)operator(>)stringoperator(})operator(.)ident(update)operator(()stringoperator(=)operator(>)stringoperator(\))operator(.)ident(display) - -operator({)symbol(:JARH) operator(=)operator(>) stringoperator(})operator(.)ident(values)operator(.)ident(display) - -operator({)stringoperator(=)operator(>)symbol(:JARH)operator(})operator(.)ident(invert)operator([)symbol(:JARH)operator(])operator(.)ident(display) - -ident(print) operator([)stringoperator(=)operator(>)symbol(:JARH)operator(])operator([)integer(0)operator(])operator(.)ident(keys) - -ident(print) operator([)operator({)operator(})operator(])operator(.)ident(slice)operator(()integer(0)operator(..)integer(0)operator(\))operator([)integer(0)operator(])operator(.)ident(store)operator(()stringoperator(,) stringoperator(\)) - -ident(print) stringoperator(.)ident(split)operator(.)ident(join)operator(()stringoperator(\)) - -reserved(begin) ident(print) string reserved(end) reserved(while) pre_constant(false) - -reserved(begin) reserved(rescue) reserved(then) reserved(else) ident(print) string reserved(end) - -ident(print) regexpoperator(.)ident(match)operator(()stringoperator(\))operator(.)ident(string) - -ident(callcc)operator({)ident(print) stringoperator(}) - -constant(Thread)operator(.)ident(start)operator({)ident(print)stringoperator(})operator(.)ident(join) - -operator(()stringoperator(..)stringoperator(\))operator(.)ident(end)operator(.)ident(display) - -operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_s)operator(.)ident(tr_s)operator(()stringoperator(,) stringoperator(\))operator(.)ident(display) - -reserved(unless) pre_constant(true) reserved(then) reserved(else) string reserved(end)operator(.)ident(display) - -ident(loop) reserved(do) ident(print) stringoperator(;) reserved(break) reserved(end) - -integer(1)operator(.)ident(times) reserved(do) ident(print) string reserved(end) - -integer(0)operator(.)ident(upto)operator(()integer(0)operator(\)) reserved(do) ident(print) string reserved(end) - -integer(0)operator(.)ident(downto)operator(()integer(0)operator(\)) reserved(do) ident(print) string reserved(end) - -ident(print) constant(Struct)operator(.)ident(new)operator(()stringoperator(\))operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(2)operator(])operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(,)string - -reserved(def) operator(()ident(x)operator(=)stringoperator(\))operator(.)ident(foo)operator(()operator(\)) ident(print) pre_constant(self) reserved(end)operator(;) ident(x)operator(.)ident(foo) - -reserved(begin) ident(print) string reserved(end) reserved(until) pre_constant(true) - -reserved(for) ident(i) reserved(in) string reserved(do) ident(print) ident(i) reserved(end) - -stringoperator(.)ident(each_byte) reserved(do) operator(|)ident(x)operator(|) ident(putc) ident(x) reserved(end) - -stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse_each) reserved(do) operator(|)ident(x)operator(|) ident(putc) ident(x) reserved(end) - -ident(print) constant(Regexp)operator(.)ident(quote)operator(()stringoperator(\))operator(.)ident(delete)operator(()stringoperator(\)) - -ident(print) pre_constant(true) operator(?) string symbol(:-)constant(P) - -ident(print) pre_constant(true) operator(?) string symbol(:-)constant(D) - -ident(print) operator(*)operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_a) - -ident(print) ident(eval)operator(()string)>operator(\)) - -ident(print) reserved(case) reserved(when) pre_constant(true) reserved(then) string reserved(end) - -ident(print) string operator(*) string - -reserved(begin) reserved(end) reserved(if) ident(print) string - -ident(print) reserved(begin) string reserved(end) - -ident(print) stringoperator(.)ident(center)operator(()integer(10000)operator(\))operator(.)ident(strip) - -ident(print) string reserved(or) ident(print) string reserved(or) ident(print) string reserved(or) ident(print) string - -ident(print) symbol - + +ident(print) stringoperator(.)ident(reverse) + +ident(print) stringoperator(.)ident(strip) + +ident(print) operator([)stringoperator(,) pre_constant(nil)operator(,) stringoperator(,) pre_constant(nil)operator(,) stringoperator(,) pre_constant(nil)operator(,) stringoperator(])operator(.)ident(compact) + +operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(reverse_each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x) reserved(end) + +regexpoperator(.)ident(source)operator(.)ident(display) + +ident(send) symbol(:print)operator(,) string + +ident(print) operator([)stringoperator(,) stringoperator(,) stringoperator(]) operator(|) operator([)stringoperator(,) stringoperator(,) stringoperator(]) + +ident(print) operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(]) operator(-) operator([)stringoperator(]) + +ident(print) operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(.)ident(assoc)operator(()stringoperator(\)) + +ident(print) operator([)stringoperator(])operator(.)ident(pack)operator(()stringoperator(\)) + +ident(print) stringoperator(.)ident(unpack)operator(()stringoperator(\)) + +ident(print) operator([)operator([)stringoperator(])operator(.)ident(pop)operator(])operator(.)ident(sort)operator(.)ident(shift) + +ident(print) operator([)operator([)stringoperator(,) stringoperator(])operator(])operator(.)ident(rassoc)operator(()stringoperator(\)) + +operator({)string operator(=)operator(>) stringoperator(})operator(.)ident(to_a)operator(.)ident(display) + +ident(print) stringoperator(.)ident(succ) + +ident(print) stringoperator(.)ident(swapcase) + +ident(print) operator([)stringoperator(])operator(.)ident(find) operator({)operator(|)ident(x)operator(|) ident(x)operator(}) + +ident(print) stringoperator(.)ident(find_all) operator({)operator(|)ident(x)operator(|) ident(x)operator(})operator(.)ident(join)operator(()stringoperator(\)) + +ident(print) stringoperator(.)ident(grep)operator(()regexpoperator(\))operator(.)ident(join)operator(()stringoperator(\)) + +constant(Ruby) operator(=) string reserved(and) ident(print) constant(Object)operator(.)ident(const_get)operator(()symbol(:Ruby)operator(\)) + +constant(Proc)operator(.)ident(new) operator({)ident(print) stringoperator(})operator([)operator(]) + +ident(print) stringoperator(.)ident(squeeze) + +ident(print) operator([)integer(1249211252)operator(,) integer(543256175)operator(,) integer(1952998770)operator(,) integer(542274914)operator(,) integer(2032167009)operator(,) integer(1667982706)operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(,) string + +global_variable($>) operator(<<) string operator(<<) string operator(<<) string operator(<<) string + +integer(5)operator(.)ident(times) reserved(do)operator(|)ident(i)operator(|)stringoperator(.)ident(scan)operator(()regexpoperator(\)) reserved(do) ident(print) global_variable($&)operator([)ident(i)operator(,)integer(1)operator(]) reserved(end) reserved(end) + +ident(a)operator(=)stringoperator(.)ident(split)operator(()stringoperator(\))operator(;)ident(print) ident(a)operator(.)ident(pop) reserved(while) reserved(not) ident(a)operator(.)ident(empty?) + +ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(reverse) + +ident(print) regexpoperator(.)ident(match)operator(()stringoperator(\)) + +ident(print) global_variable($&) reserved(if) regexp operator(===) string + +reserved(case) string reserved(when) regexpoperator(;) ident(print) global_variable($~)operator([)integer(0)operator(]) reserved(end) + +ident(print) constant(Marshal)operator(.)ident(load)operator(()constant(Marshal)operator(.)ident(dump)operator(()stringoperator(\))operator(\)) + +stringoperator(.)ident(each_byte) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(chr) reserved(end) + +ident(print) stringoperator(.)ident(split)operator(()stringoperator(\))operator(.)ident(sort)operator(.)ident(values_at)operator(()integer(1)operator(,)integer(3)operator(,)integer(2)operator(,)integer(4)operator(\)) + +ident(print) stringoperator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) + +comment(#$><<'RbyckJust another,'.split(''\).values_at(5..16,9,0,6,1,2,9,14,10,3,4,15..17\)) + +operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_a)operator(.)ident(join)operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) + +reserved(begin) ident(print) string reserved(ensure) ident(print) string reserved(end) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) + +stringoperator(.)ident(gsub)operator(()regexpoperator(,)stringoperator(\))operator(.)ident(display) + +ident(a)operator(=)stringoperator(;)integer(0)operator(.)ident(step)operator(()integer(24)operator(,)integer(2)operator(\))operator({)operator(|)ident(i)operator(|)ident(print) ident(a)operator([)ident(i)operator(,)integer(1)operator(])operator(})operator(;)integer(23)operator(.)ident(step)operator(()integer(1)operator(,)integer(-2)operator(\))operator({)operator(|)ident(i)operator(|)ident(print) ident(a)operator([)ident(i)operator(,)integer(1)operator(])operator(}) + +ident(a)operator(=)stringoperator(.)ident(split)operator(()stringoperator(\))operator(;)integer(12)operator(.)ident(times)operator({)ident(print) ident(a)operator(.)ident(shift)operator(,)ident(a)operator(.)ident(pop)operator(})operator(;)ident(print) ident(a) + +ident(a)operator(=)stringoperator(;)reserved(begin) ident(a)operator(.)ident(sub!)operator(()regexpoperator(\))operator({)ident(print) global_variable($1)operator(,)global_variable($3)operator(;)global_variable($2)operator(})reserved(end) reserved(while)global_variable($1)operator(;)ident(print) ident(a) + +ident(a)operator(=)stringoperator(;)integer(11)operator(.)ident(times)operator({)ident(a)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\))operator(})operator(;)ident(print) ident(a) + +ident(print) stringoperator(.)ident(tr_s)operator(()stringoperator(,) stringoperator(\)) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)operator([)ident(x)operator([)integer(1)operator(])operator(,)ident(x)operator([)integer(0)operator(])operator(])operator(})operator(.)ident(sort)operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(1)operator(])operator(})operator(.)ident(display) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(sort)operator(.)ident(collect!)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(1)operator(,)integer(1)operator(])operator(})operator(.)ident(display) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator({)ident(print) global_variable($&)operator(.)ident(hex)operator(.)ident(chr)operator(}) + +ident(print) operator([)stringoperator(])operator(.)ident(fill)operator(()stringoperator(\)) + +global_variable($>)operator(<<)operator({)integer(1)operator(=)operator(>)stringoperator(,)integer(2)operator(=)operator(>)stringoperator(,)integer(3)operator(=)operator(>)stringoperator(,)integer(4)operator(=)operator(>)stringoperator(})operator(.)ident(sort)operator(.)ident(to_s)operator(.)ident(delete)operator(()stringoperator(\)) + +constant(Kernel)operator(.)ident(print) string)> + +reserved(class) class(Just_another_Ruby_hackerq)operator(;)reserved(end)operator(;)ident(print) constant(Just_another_Ruby_hackerq)operator(.)ident(to_s)operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\)) + +constant(Kust_another_Ruby_hacker)operator(=)integer(0)operator(;)ident(print) constant(Module)operator(.)ident(constants)operator(.)ident(grep)operator(()regexpoperator(\))operator([)integer(0)operator(])operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(,) string + +reserved(module) class(Lust_another_Ruby_hackerq)operator(;) ident(print) ident(name)operator(.)ident(tr)operator(()stringoperator(,) stringoperator(\)) reserved(end) + +reserved(class) class(Bar)operator(;) ident(print) string reserved(end) + +reserved(class) class(Baz)operator(;) reserved(def) method(initialize)operator(()operator(\)) ident(print) string reserved(end) reserved(end)operator(;) constant(Baz)operator(.)ident(new) + +ident(eval) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) + +ident(eval) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) + +global_variable($stdout)operator(.)ident(write) string + +stringoperator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(chomp) reserved(end) + +ident(print) global_variable($') reserved(if) regexp operator(===) string + +ident(raise) string reserved(rescue) ident(print) global_variable($!) + +ident(print) constant(File)operator(.)ident(basename)operator(()stringoperator(,)stringoperator(\)) + +ident(proc)operator({)operator(|)ident(x)operator(|)ident(x)operator([)stringoperator(])operator(})operator([)ident(proc)operator({)operator(|)ident(x)operator(|)ident(print) ident(x)operator(})operator(]) + +ident(method)operator(()symbol(:print)operator(\))operator([)stringoperator(]) + +stringoperator(.)ident(method)operator(()symbol(:display)operator(\))operator([)operator(]) + +ident(print) stringoperator(.)ident(replace)operator(()stringoperator(\)) + +ident(instance_eval) reserved(do) ident(print) string reserved(end) + +constant(Kernel)operator(.)ident(module_eval) reserved(do) ident(print) string reserved(end) + +ident(print) stringoperator(%)stringoperator(%)stringoperator(%)string + +ident(print) operator(!)integer(??)operator(?)integer(??)operator(:)integer(??)operator(?)stringoperator(:)integer(??) + +comment(#({}.default='Just another Ruby hacker,'\)[0].display) + +ident(print) constant(Hash)operator([)stringoperator(,) stringoperator(]) + +ident(print) string string string string + +ident(print) constant(File)operator(.)ident(dirname)operator(()stringoperator(\)) + +reserved(def) global_variable($_)operator(.)ident(singleton_method_added)operator(()operator(*)operator(\)) ident(print) string reserved(end) + +ident(print) operator([)stringoperator(])operator(.)ident(delete_at)operator(()integer(0)operator(\)) + +ident(print) string operator(%) string + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) + +operator(()integer(97)operator(..)integer(121)operator(\))operator(.)ident(to_a)operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) + +stringoperator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(.)ident(display) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) + +ident(print) stringoperator(%)stringoperator(;)operator(;) + +ident(print)operator(()stringoperator(%) stringoperator(\)) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(display) + +ident(print) string operator(*) operator(()string operator(=)operator(~) regexpoperator(\)) + +ident(print) stringoperator(.)ident(unpack)operator(()stringoperator(\))operator(.)ident(pack)operator(()stringoperator(\)) + +ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator({)operator(|)ident(x)operator(,)ident(y)operator(|) ident(print) ident(y)operator(+)ident(x)operator(}) + +ident(print) stringoperator([)stringoperator(]) + +ident(print) stringoperator([)regexpoperator(]) + +ident(print) operator([)operator(])operator(.)ident(push)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) + +ident(print) stringoperator([)integer(0)operator(..)integer(-1)operator(]) + +ident(print) stringoperator(.)ident(instance_eval)operator({)pre_constant(self)operator(}) + +reserved(class) class(String)operator(;) reserved(def) method(+@)operator(()operator(\)) ident(print) pre_constant(self) reserved(end)operator(;) operator(+)string reserved(end) + +ident(print) stringoperator(.)ident(delete)operator(()stringoperator(\)) + +stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))operator(.)ident(display) + +comment(#$><<{'Just another Ruby hacker,'=>''}.default=0) + +ident(print) ident(eval)operator(()stringoperator(.)ident(dump)operator(\)) + +ident(print) stringoperator(.)ident(concat)operator(()integer(?,)operator(\)) + +ident(print) stringoperator(.)ident(intern)operator(.)ident(to_s) + +ident(print) stringoperator(.)ident(dump)operator([)integer(1)operator(..)integer(-2)operator(]) + +stringoperator(.)ident(each_line) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x) reserved(end) + +operator([)stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(x)operator(|) ident(print) ident(x)operator(.)ident(capitalize) reserved(end) + +ident(printf) stringoperator(,) string + +ident(print) stringoperator(.)ident(split)operator(()regexpoperator(\))operator([)integer(0)operator(]) + +ident(print) stringoperator(.)ident(split)operator(()regexpoperator(\)) + +ident(print) string + +ident(print) ident(String)operator(()operator([)stringoperator(])operator(\)) + +ident(print) ident(catch)operator(()symbol(:x)operator(\))operator({)ident(throw) symbol(:x)operator(,) stringoperator(}) + +ident(r)operator(,)ident(w) operator(=) constant(IO)operator(::)ident(pipe)operator(;)ident(w)operator(.)ident(print) stringoperator(;)ident(w)operator(.)ident(close)operator(;)ident(print) ident(r)operator(.)ident(gets) + +ident(print) ident(sprintf)operator(()stringoperator(,) ident(format)operator(()string operator(%) stringoperator(,) stringoperator(\))operator(\)) + +ident(print) ident(eval)operator(()stringoperator(.)ident(inspect)operator(\)) + +regexpdelimiter(})>delimiter(/)> + +ident(print) stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(collect)operator({)operator(|)ident(x)operator(|)ident(x)operator([)integer(0)operator(])operator(})operator(.)ident(pack)operator(()stringoperator(\)) + +ident(print) stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(pack)operator(()stringoperator(*)integer(25)operator(\)) + +stringoperator(.)ident(send) stringoperator(.)ident(reverse)operator(.)ident(intern) + +ident(print) stringoperator(.)ident(uniq)operator(.)ident(join)operator(()stringoperator(\)) + +operator({)operator(})operator(.)ident(fetch)operator(()symbol(:x)operator(\))operator({)stringoperator(})operator(.)ident(display) + +operator({)operator(})operator(.)ident(delete)operator(()symbol(:x)operator(\))operator({)stringoperator(})operator(.)ident(display) + +ident(print) operator([)symbol(:x)operator(])operator(.)ident(map)operator({)stringoperator(}) + +operator({)stringoperator(=)operator(>)stringoperator(})operator(.)ident(each)operator({)operator(|*)ident(x)operator(|)ident(print) ident(x)operator(.)ident(reverse)operator(.)ident(join)operator(()stringoperator(\))operator(}) + +ident(print) operator([)operator(])operator(.)ident(unshift)operator(()stringoperator(\))operator(.)ident(unshift)operator(()stringoperator(\))operator(.)ident(join)operator(()stringoperator(\)) + +operator({)integer(3)operator(=)operator(>)stringoperator(,)integer(2)operator(=)operator(>)stringoperator(,)integer(4)operator(=)operator(>)stringoperator(,)integer(1)operator(=)operator(>)stringoperator(})operator(.)ident(values_at)operator(()integer(1)operator(,)integer(2)operator(,)integer(3)operator(,)integer(4)operator(\))operator(.)ident(display) + +ident(print) operator([)operator([)integer(0)operator(,)stringoperator(])operator(,)integer(1)operator(])operator(.)ident(first)operator(.)ident(last) + +operator({)stringoperator(=)operator(>)stringoperator(})operator(.)ident(update)operator(()stringoperator(=)operator(>)stringoperator(\))operator(.)ident(display) + +operator({)symbol(:JARH) operator(=)operator(>) stringoperator(})operator(.)ident(values)operator(.)ident(display) + +operator({)stringoperator(=)operator(>)symbol(:JARH)operator(})operator(.)ident(invert)operator([)symbol(:JARH)operator(])operator(.)ident(display) + +ident(print) operator([)stringoperator(=)operator(>)symbol(:JARH)operator(])operator([)integer(0)operator(])operator(.)ident(keys) + +ident(print) operator([)operator({)operator(})operator(])operator(.)ident(slice)operator(()integer(0)operator(..)integer(0)operator(\))operator([)integer(0)operator(])operator(.)ident(store)operator(()stringoperator(,) stringoperator(\)) + +ident(print) stringoperator(.)ident(split)operator(.)ident(join)operator(()stringoperator(\)) + +reserved(begin) ident(print) string reserved(end) reserved(while) pre_constant(false) + +reserved(begin) reserved(rescue) reserved(then) reserved(else) ident(print) string reserved(end) + +ident(print) regexpoperator(.)ident(match)operator(()stringoperator(\))operator(.)ident(string) + +ident(callcc)operator({)ident(print) stringoperator(}) + +constant(Thread)operator(.)ident(start)operator({)ident(print)stringoperator(})operator(.)ident(join) + +operator(()stringoperator(..)stringoperator(\))operator(.)ident(end)operator(.)ident(display) + +operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_s)operator(.)ident(tr_s)operator(()stringoperator(,) stringoperator(\))operator(.)ident(display) + +reserved(unless) pre_constant(true) reserved(then) reserved(else) string reserved(end)operator(.)ident(display) + +ident(loop) reserved(do) ident(print) stringoperator(;) reserved(break) reserved(end) + +integer(1)operator(.)ident(times) reserved(do) ident(print) string reserved(end) + +integer(0)operator(.)ident(upto)operator(()integer(0)operator(\)) reserved(do) ident(print) string reserved(end) + +integer(0)operator(.)ident(downto)operator(()integer(0)operator(\)) reserved(do) ident(print) string reserved(end) + +ident(print) constant(Struct)operator(.)ident(new)operator(()stringoperator(\))operator(.)ident(to_s)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(2)operator(])operator(.)ident(tr)operator(()stringoperator(,)stringoperator(\))operator(,)string + +reserved(def) operator(()ident(x)operator(=)stringoperator(\))operator(.)ident(foo)operator(()operator(\)) ident(print) pre_constant(self) reserved(end)operator(;) ident(x)operator(.)ident(foo) + +reserved(begin) ident(print) string reserved(end) reserved(until) pre_constant(true) + +reserved(for) ident(i) reserved(in) string reserved(do) ident(print) ident(i) reserved(end) + +stringoperator(.)ident(each_byte) reserved(do) operator(|)ident(x)operator(|) ident(putc) ident(x) reserved(end) + +stringoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(reverse_each) reserved(do) operator(|)ident(x)operator(|) ident(putc) ident(x) reserved(end) + +ident(print) constant(Regexp)operator(.)ident(quote)operator(()stringoperator(\))operator(.)ident(delete)operator(()stringoperator(\)) + +ident(print) pre_constant(true) operator(?) string symbol(:-)constant(P) + +ident(print) pre_constant(true) operator(?) string symbol(:-)constant(D) + +ident(print) operator(*)operator(()stringoperator(..)stringoperator(\))operator(.)ident(to_a) + +ident(print) ident(eval)operator(()string)>operator(\)) + +ident(print) reserved(case) reserved(when) pre_constant(true) reserved(then) string reserved(end) + +ident(print) string operator(*) string + +reserved(begin) reserved(end) reserved(if) ident(print) string + +ident(print) reserved(begin) string reserved(end) + +ident(print) stringoperator(.)ident(center)operator(()integer(10000)operator(\))operator(.)ident(strip) + +ident(print) string reserved(or) ident(print) string reserved(or) ident(print) string reserved(or) ident(print) string + +ident(print) symbol + diff --git a/test/ruby/open-heredoc.out.raydebug b/test/ruby/open-heredoc.out.raydebug index 9251f43..72fae77 100644 --- a/test/ruby/open-heredoc.out.raydebug +++ b/test/ruby/open-heredoc.out.raydebug @@ -1,2 +1,2 @@ -stringstringstring \ No newline at end of file diff --git a/test/ruby/open-inline.in.rb b/test/ruby/open-inline.in.rb new file mode 100644 index 0000000..529907e --- /dev/null +++ b/test/ruby/open-inline.in.rb @@ -0,0 +1 @@ +"#{ diff --git a/test/ruby/open-inline.out.raydebug b/test/ruby/open-inline.out.raydebug new file mode 100644 index 0000000..03af29e --- /dev/null +++ b/test/ruby/open-inline.out.raydebug @@ -0,0 +1,2 @@ +string> \ No newline at end of file diff --git a/test/ruby/open-string.out.raydebug b/test/ruby/open-string.out.raydebug index f288618..e44c295 100644 --- a/test/ruby/open-string.out.raydebug +++ b/test/ruby/open-string.out.raydebug @@ -1,2 +1,2 @@ -string \ No newline at end of file diff --git a/test/ruby/pleac.out.raydebug b/test/ruby/pleac.out.raydebug index fbf465f..c6fcd8c 100644 --- a/test/ruby/pleac.out.raydebug +++ b/test/ruby/pleac.out.raydebug @@ -1,6368 +1,6368 @@ -comment(# -*- ruby -*-) - -comment(# Local variables:) -comment(# indent-tabs-mode: nil) -comment(# ruby-indent-level: 4) -comment(# End:) - -comment(# @@PLEAC@@_NAME) -comment(# @@SKIP@@ Ruby) - -comment(# @@PLEAC@@_WEB) -comment(# @@SKIP@@ http://www.ruby-lang.org) - - -comment(# @@PLEAC@@_1.0) -ident(string) operator(=) string comment(# two characters, \\ and an n) -ident(string) operator(=) string comment(# literal single quotes) - -ident(string) operator(=) string comment(# a "newline" character) -ident(string) operator(=) string comment(# literal double quotes) - -ident(string) operator(=) string comment(# literal single quotes) - -ident(string) operator(=) string comment(# literal single quotes) -ident(string) operator(=) string comment(# literal single quotes) -ident(string) operator(=) string comment(# literal single quotes) -ident(string) operator(=) string)> comment(# literal single quotes) - -ident(a) operator(=) stringstring - - -comment(# @@PLEAC@@_1.1) -ident(value) operator(=) ident(string)operator([)ident(offset)operator(,)ident(count)operator(]) -ident(value) operator(=) ident(string)operator([)ident(offset)operator(..)integer(-1)operator(]) - -ident(string)operator([)ident(offset)operator(,)ident(count)operator(]) operator(=) ident(newstring) -ident(string)operator([)ident(offset)operator(..)integer(-1)operator(]) operator(=) ident(newtail) - -comment(# in Ruby we can also specify intervals by their two offsets) -ident(value) operator(=) ident(string)operator([)ident(offset)operator(..)ident(offs2)operator(]) -ident(string)operator([)ident(offset)operator(..)ident(offs2)operator(]) operator(=) ident(newstring) - -ident(leading)operator(,) ident(s1)operator(,) ident(s2)operator(,) ident(trailing) operator(=) ident(data)operator(.)ident(unpack)operator(()stringoperator(\)) - -ident(fivers) operator(=) ident(string)operator(.)ident(unpack)operator(()string operator(*) operator(()ident(string)operator(.)ident(length)operator(/)integer(5)operator(\))operator(\)) - -ident(chars) operator(=) ident(string)operator(.)ident(unpack)operator(()string operator(*) ident(string)operator(.)ident(length)operator(\)) - -ident(string) operator(=) string -comment(# +012345678901234567890 Indexing forwards (left to right\)) -comment(# 109876543210987654321- Indexing backwards (right to left\)) -comment(# note that 0 means 10 or 20, etc. above) - -ident(first) operator(=) ident(string)operator([)integer(0)operator(,) integer(1)operator(]) comment(# "T") -ident(start) operator(=) ident(string)operator([)integer(5)operator(,) integer(2)operator(]) comment(# "is") -ident(rest) operator(=) ident(string)operator([)integer(13)operator(..)integer(-1)operator(]) comment(# "you have") -ident(last) operator(=) ident(string)operator([)integer(-1)operator(,) integer(1)operator(]) comment(# "e") -ident(end_) operator(=) ident(string)operator([)integer(-4)operator(..)integer(-1)operator(]) comment(# "have") -ident(piece) operator(=) ident(string)operator([)integer(-8)operator(,) integer(3)operator(]) comment(# "you") - -ident(string)operator([)integer(5)operator(,) integer(2)operator(]) operator(=) string comment(# change "is" to "wasn't") -ident(string)operator([)integer(-12)operator(..)integer(-1)operator(]) operator(=) string comment(# "This wasn't wondrous") -ident(string)operator([)integer(0)operator(,) integer(1)operator(]) operator(=) string comment(# delete first character) -ident(string)operator([)integer(-10)operator(..)integer(-1)operator(]) operator(=) string comment(# delete last 10 characters) - -reserved(if) ident(string)operator([)integer(-10)operator(..)integer(-1)operator(]) operator(=)operator(~) regexp - ident(puts) string -reserved(end) - -ident(string)operator([)integer(0)operator(,) integer(5)operator(])operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - -ident(a) operator(=) string -ident(a)operator([)integer(0)operator(,) integer(1)operator(])operator(,) ident(a)operator([)integer(-1)operator(,) integer(1)operator(]) operator(=) ident(a)operator([)integer(-1)operator(,) integer(1)operator(])operator(,) ident(a)operator([)integer(0)operator(,) integer(1)operator(]) - -ident(a) operator(=) string -ident(b) operator(=) ident(a)operator(.)ident(unpack)operator(()stringoperator(\)) - -ident(b)operator(,) ident(c) operator(=) ident(a)operator(.)ident(unpack)operator(()stringoperator(\)) -ident(puts) stringchar(\\n)inlinechar(\\n)delimiter(")> - -reserved(def) method(cut2fmt)operator(()operator(*)ident(args)operator(\)) - ident(template) operator(=) string - ident(lastpos) operator(=) integer(1) - reserved(for) ident(place) reserved(in) ident(args) - ident(template) operator(+=) string operator(+) operator(()ident(place) operator(-) ident(lastpos)operator(\))operator(.)ident(to_s) operator(+) string - ident(lastpos) operator(=) ident(place) - reserved(end) - ident(template) operator(+=) string - reserved(return) ident(template) -reserved(end) - -ident(fmt) operator(=) ident(cut2fmt)operator(()integer(8)operator(,) integer(14)operator(,) integer(20)operator(,) integer(26)operator(,) integer(30)operator(\)) - - -comment(# @@PLEAC@@_1.2) -comment(# careful! "b is true" doesn't mean "b != 0" (0 is true in Ruby\)) -comment(# thus no problem of "defined" later since only nil is false) -comment(# the following sets to `c' if `b' is nil or false) -ident(a) operator(=) ident(b) operator(||) ident(c) - -comment(# if you need Perl's behaviour (setting to `c' if `b' is 0\) the most) -comment(# effective way is to use Numeric#nonzero? (thanks to Dave Thomas!\)) -ident(a) operator(=) ident(b)operator(.)ident(nonzero?) operator(||) ident(c) - -comment(# you will still want to use defined? in order to test) -comment(# for scope existence of a given object) -ident(a) operator(=) reserved(defined?)operator(()ident(b)operator(\)) operator(?) ident(b) operator(:) ident(c) - -ident(dir) operator(=) pre_constant(ARGV)operator(.)ident(shift) operator(||) string - - -comment(# @@PLEAC@@_1.3) -ident(v1)operator(,) ident(v2) operator(=) ident(v2)operator(,) ident(v1) - -ident(alpha)operator(,) ident(beta)operator(,) ident(production) operator(=) string -ident(alpha)operator(,) ident(beta)operator(,) ident(production) operator(=) ident(beta)operator(,) ident(production)operator(,) ident(alpha) - - -comment(# @@PLEAC@@_1.4) -ident(num) operator(=) ident(char)operator([)integer(0)operator(]) -ident(char) operator(=) ident(num)operator(.)ident(chr) - -comment(# Ruby also supports having a char from character constant) -ident(num) operator(=) integer(?r) - -ident(char) operator(=) ident(sprintf)operator(()stringoperator(,) ident(num)operator(\)) -ident(printf)operator(()stringoperator(,) ident(num)operator(,) ident(num)operator(\)) - -ident(ascii) operator(=) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) -ident(string) operator(=) ident(ascii)operator(.)ident(pack)operator(()stringoperator(\)) - -ident(hal) operator(=) string -ident(ascii) operator(=) ident(hal)operator(.)ident(unpack)operator(()stringoperator(\)) -comment(# We can't use Array#each since we can't mutate a Fixnum) -ident(ascii)operator(.)ident(collect!) operator({) operator(|)ident(i)operator(|) - ident(i) operator(+) integer(1) comment(# add one to each ASCII value) -operator(}) -ident(ibm) operator(=) ident(ascii)operator(.)ident(pack)operator(()stringoperator(\)) -ident(puts) ident(ibm) - - -comment(# @@PLEAC@@_1.5) -ident(array) operator(=) ident(string)operator(.)ident(split)operator(()stringoperator(\)) - -ident(array) operator(=) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) - -ident(string)operator(.)ident(scan)operator(()regexpoperator(\)) operator({) operator(|)ident(b)operator(|) - comment(# do something with b) -operator(}) - -ident(string) operator(=) string -ident(print) stringoperator(,) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(uniq)operator(.)ident(sort)operator(,) string - -ident(sum) operator(=) integer(0) -reserved(for) ident(ascval) reserved(in) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) comment(# or use Array#each for a pure OO style :\)) - ident(sum) operator(+=) ident(ascval) -reserved(end) -ident(puts) stringdelimiter(")> comment(# since Ruby will go Bignum if necessary) - -comment(# @@INCLUDE@@ include/ruby/slowcat.rb) - - -comment(# @@PLEAC@@_1.6) -ident(revbytes) operator(=) ident(string)operator(.)ident(reverse) - -ident(revwords) operator(=) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(reverse)operator(.)ident(join)operator(()stringoperator(\)) - -ident(revwords) operator(=) ident(string)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(join) - -comment(# using the fact that IO is Enumerable, you can directly "select" it) -ident(long_palindromes) operator(=) constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.) - ident(select) operator({) operator(|)ident(w)operator(|) ident(w)operator(.)ident(chomp!)operator(;) ident(w)operator(.)ident(reverse) operator(==) ident(w) operator(&&) ident(w)operator(.)ident(length) operator(>) integer(5) operator(}) - - -comment(# @@PLEAC@@_1.7) -reserved(while) ident(string)operator(.)ident(sub!)operator(()stringoperator(\)) operator({) string operator(*) operator(()global_variable($&)operator(.)ident(length) operator(*) integer(8) operator(-) global_variable($`)operator(.)ident(length) operator(%) integer(8)operator(\)) operator(}) -reserved(end) - - -comment(# @@PLEAC@@_1.8) -stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) ident(eval)operator(()global_variable($1)operator(\)) operator(}) - -ident(rows)operator(,) ident(cols) operator(=) integer(24)operator(,) integer(80) -ident(text) operator(=) string -ident(text)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) ident(eval)operator(()stringdelimiter(")>operator(\)) operator(}) -ident(puts) ident(text) - -stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) integer(2) operator(*) global_variable($&)operator(.)ident(to_i) operator(}) - - -comment(# @@PLEAC@@_1.9) -ident(e) operator(=) stringoperator(.)ident(upcase) -ident(e)operator(.)ident(downcase!) -ident(e)operator(.)ident(capitalize!) - -stringoperator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) global_variable($&)operator(.)ident(capitalize) operator(}) - - -comment(# @@PLEAC@@_1.10) -stringcontent( guanacos.)delimiter(")> -ident(print) stringoperator(,) ident(n)integer(+1)operator(,) string - - -comment(# @@PLEAC@@_1.11) -ident(var) operator(=) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))string - - -comment(# @@PLEAC@@_1.12) -ident(string) operator(=) stringoperator(+) - stringoperator(+) - stringoperator(+) - string - -reserved(def) method(wrap)operator(()ident(str)operator(,) ident(max_size)operator(\)) - ident(all) operator(=) operator([)operator(]) - ident(line) operator(=) string - reserved(for) ident(l) reserved(in) ident(str)operator(.)ident(split) - reserved(if) operator(()ident(line)operator(+)ident(l)operator(\))operator(.)ident(length) operator(>)operator(=) ident(max_size) - ident(all)operator(.)ident(push)operator(()ident(line)operator(\)) - ident(line) operator(=) string - reserved(end) - ident(line) operator(+=) ident(line) operator(==) string operator(?) ident(l) operator(:) string operator(+) ident(l) - reserved(end) - ident(all)operator(.)ident(push)operator(()ident(line)operator(\))operator(.)ident(join)operator(()stringoperator(\)) -reserved(end) - -ident(print) ident(wrap)operator(()ident(string)operator(,) integer(20)operator(\)) -comment(#=> Folding and ) -comment(#=> splicing is the ) -comment(#=> work of an editor, ) -comment(#=> not a mere ) -comment(#=> collection of ) -comment(#=> silicon and mobile ) -comment(#=> electrons!) - - -comment(# @@PLEAC@@_1.13) -ident(string) operator(=) string -ident(string)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) -ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) -ident(string)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) -stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) comment(# no function like quotemeta?) - - -comment(# @@PLEAC@@_1.14) -ident(string)operator(.)ident(strip!) - - -comment(# @@PLEAC@@_1.15) -reserved(def) method(parse_csv)operator(()ident(text)operator(\)) - ident(new) operator(=) ident(text)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(new) operator(<<) pre_constant(nil) reserved(if) ident(text)operator([)integer(-1)operator(]) operator(==) integer(?,) - ident(new)operator(.)ident(flatten)operator(.)ident(compact) -reserved(end) - -ident(line) operator(=) string)> -ident(fields) operator(=) ident(parse_csv)operator(()ident(line)operator(\)) -ident(fields)operator(.)ident(each_with_index) operator({) operator(|)ident(v)operator(,)ident(i)operator(|) - ident(print) stringcontent( : )inlinechar(\\n)delimiter(")>operator(;) -operator(}) - - -comment(# @@PLEAC@@_1.16) -comment(# Use the soundex.rb Library from Michael Neumann.) -comment(# http://www.s-direktnet.de/homepages/neumann/rb_prgs/Soundex.rb) -ident(require) string - -ident(code) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(string)operator(\)) -ident(codes) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(array)operator(\)) - -comment(# substitution function for getpwent(\):) -comment(# returns an array of user entries,) -comment(# each entry contains the username and the full name) -reserved(def) method(login_names) - ident(result) operator(=) operator([)operator(]) - constant(File)operator(.)ident(open)operator(()stringoperator(\)) operator({) operator(|)ident(file)operator(|) - ident(file)operator(.)ident(each_line) operator({) operator(|)ident(line)operator(|) - reserved(next) reserved(if) ident(line)operator(.)ident(match)operator(()regexpoperator(\)) - ident(cols) operator(=) ident(line)operator(.)ident(split)operator(()stringoperator(\)) - ident(result)operator(.)ident(push)operator(()operator([)ident(cols)operator([)integer(0)operator(])operator(,) ident(cols)operator([)integer(4)operator(])operator(])operator(\)) - operator(}) - operator(}) - ident(result) -reserved(end) - -ident(puts) string -ident(user) operator(=) constant(STDIN)operator(.)ident(gets) -ident(user)operator(.)ident(chomp!) -ident(exit) reserved(unless) ident(user) -ident(name_code) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(user)operator(\)) - -ident(splitter) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) -reserved(for) ident(username)operator(,) ident(fullname) reserved(in) ident(login_names) reserved(do) - ident(firstname)operator(,) ident(lastname) operator(=) ident(splitter)operator(.)ident(match)operator(()ident(fullname)operator(\))operator([)integer(1)operator(,)integer(2)operator(]) - reserved(if) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(username)operator(\)) - operator(||) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(firstname)operator(\)) - operator(||) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(lastname)operator(\)) - reserved(then) - ident(puts) stringcontent(: )inlinecontent( )inlinedelimiter(")> - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_1.17) -comment(# @@INCLUDE@@ include/ruby/fixstyle.rb) - - -comment(# @@PLEAC@@_1.18) -comment(# @@INCLUDE@@ include/ruby/psgrep.rb) - - -comment(# @@PLEAC@@_2.1) -comment(# Matz tells that you can use Integer(\) for strict checked conversion.) -ident(Integer)operator(()stringoperator(\)) -comment(#=> `Integer': invalid value for Integer: "abc" (ArgumentError\)) -ident(Integer)operator(()stringoperator(\)) -comment(#=> 567) - -comment(# You may use Float(\) for floating point stuff) -ident(Integer)operator(()stringoperator(\)) -comment(#=> `Integer': invalid value for Integer: "56.7" (ArgumentError\)) -ident(Float)operator(()stringoperator(\)) -comment(#=> 56.7) - -comment(# You may also use a regexp for that) -reserved(if) ident(string) operator(=)operator(~) regexp - ident(p) string -reserved(else) - ident(p) string -reserved(end) - -reserved(if) ident(string) operator(=)operator(~) regexp - ident(p) string -reserved(else) - ident(p) string -reserved(end) - - -comment(# @@PLEAC@@_2.2) -comment(# equal(num1, num2, accuracy\) : returns true if num1 and num2 are) -comment(# equal to accuracy number of decimal places) -reserved(def) method(equal)operator(()ident(i)operator(,) ident(j)operator(,) ident(a)operator(\)) - ident(sprintf)operator(()stringcontent(g)delimiter(")>operator(,) ident(i)operator(\)) operator(==) ident(sprintf)operator(()stringcontent(g)delimiter(")>operator(,) ident(j)operator(\)) -reserved(end) - -ident(wage) operator(=) integer(536) comment(# $5.36/hour) -ident(week) operator(=) integer(40) operator(*) ident(wage) comment(# $214.40) -ident(printf)operator(()stringoperator(,) ident(week)operator(/)float(100.0)operator(\)) - - -comment(# @@PLEAC@@_2.3) -ident(num)operator(.)ident(round) comment(# rounds to integer) - -ident(a) operator(=) float(0.255) -ident(b) operator(=) ident(sprintf)operator(()stringoperator(,) ident(a)operator(\)) -ident(print) stringchar(\\n)content(Rounded: )inlinechar(\\n)delimiter(")> -ident(printf) stringchar(\\n)content(Rounded: %.2f)char(\\n)delimiter(")>operator(,) ident(a) - -ident(print) string -ident(a) operator(=) operator([) float(3.3) operator(,) float(3.5) operator(,) float(3.7)operator(,) float(-3.3) operator(]) -reserved(for) ident(n) reserved(in) ident(a) - ident(printf)operator(()stringoperator(,) comment(# at least I don't fake my output :\)) - ident(n)operator(,) ident(n)operator(.)ident(to_i)operator(,) ident(n)operator(.)ident(floor)operator(,) ident(n)operator(.)ident(ceil)operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_2.4) -reserved(def) method(dec2bin)operator(()ident(n)operator(\)) - operator([)ident(n)operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(])operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) -reserved(end) - -reserved(def) method(bin2dec)operator(()ident(n)operator(\)) - operator([)operator(()stringoperator(*)integer(32)operator(+)ident(n)operator(.)ident(to_s)operator(\))operator([)integer(-32)operator(..)integer(-1)operator(])operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) -reserved(end) - - -comment(# @@PLEAC@@_2.5) -reserved(for) ident(i) reserved(in) ident(x) operator(..) ident(y) - comment(# i is set to every integer from x to y, inclusive) -reserved(end) - -ident(x)operator(.)ident(step)operator(()ident(y)operator(,)integer(7)operator(\)) operator({) operator(|)ident(i)operator(|) - comment(# i is set to every integer from x to y, stepsize = 7) -operator(}) - -ident(print) string -operator(()integer(0)operator(..)integer(2)operator(\))operator(.)ident(each) operator({) operator(|)ident(i)operator(|) - ident(print) ident(i)operator(,) string -operator(}) -ident(print) string - - -comment(# @@PLEAC@@_2.6) -comment(# We can add conversion methods to the Integer class,) -comment(# this makes a roman number just a representation for normal numbers.) -reserved(class) class(Integer) - - class_variable(@@romanlist) operator(=) operator([)operator([)stringoperator(,) integer(1000)operator(])operator(,) - operator([)stringoperator(,) integer(900)operator(])operator(,) - operator([)stringoperator(,) integer(500)operator(])operator(,) - operator([)stringoperator(,) integer(400)operator(])operator(,) - operator([)stringoperator(,) integer(100)operator(])operator(,) - operator([)stringoperator(,) integer(90)operator(])operator(,) - operator([)stringoperator(,) integer(50)operator(])operator(,) - operator([)stringoperator(,) integer(40)operator(])operator(,) - operator([)stringoperator(,) integer(10)operator(])operator(,) - operator([)stringoperator(,) integer(9)operator(])operator(,) - operator([)stringoperator(,) integer(5)operator(])operator(,) - operator([)stringoperator(,) integer(4)operator(])operator(,) - operator([)stringoperator(,) integer(1)operator(])operator(]) - - reserved(def) method(to_roman) - ident(remains) operator(=) pre_constant(self) - ident(roman) operator(=) string - reserved(for) ident(sym)operator(,) ident(num) reserved(in) class_variable(@@romanlist) - reserved(while) ident(remains) operator(>)operator(=) ident(num) - ident(remains) operator(-=) ident(num) - ident(roman) operator(<<) ident(sym) - reserved(end) - reserved(end) - ident(roman) - reserved(end) - - reserved(def) constant(Integer)operator(.)ident(from_roman)operator(()ident(roman)operator(\)) - ident(ustr) operator(=) ident(roman)operator(.)ident(upcase) - ident(sum) operator(=) integer(0) - reserved(for) ident(entry) reserved(in) class_variable(@@romanlist) - ident(sym)operator(,) ident(num) operator(=) ident(entry)operator([)integer(0)operator(])operator(,) ident(entry)operator([)integer(1)operator(]) - reserved(while) ident(sym) operator(==) ident(ustr)operator([)integer(0)operator(,) ident(sym)operator(.)ident(length)operator(]) - ident(sum) operator(+=) ident(num) - ident(ustr)operator(.)ident(slice!)operator(()integer(0)operator(,) ident(sym)operator(.)ident(length)operator(\)) - reserved(end) - reserved(end) - ident(sum) - reserved(end) - -reserved(end) - - -ident(roman_fifteen) operator(=) integer(15)operator(.)ident(to_roman) -ident(puts) stringdelimiter(")> -ident(i) operator(=) constant(Integer)operator(.)ident(from_roman)operator(()ident(roman_fifteen)operator(\)) -ident(puts) stringcontent( is )inlinedelimiter(")> - -comment(# check) -reserved(for) ident(i) reserved(in) operator(()integer(1)operator(..)integer(3900)operator(\)) - ident(r) operator(=) ident(i)operator(.)ident(to_roman) - ident(j) operator(=) constant(Integer)operator(.)ident(from_roman)operator(()ident(r)operator(\)) - reserved(if) ident(i) operator(!=) ident(j) - ident(puts) stringcontent( : )inlinecontent( - )inlinedelimiter(")> - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_2.7) -ident(random) operator(=) ident(rand)operator(()ident(y)operator(-)ident(x)integer(+1)operator(\))operator(+)ident(x) - -ident(chars) operator(=) operator([)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(])operator(.)ident(collect) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(to_a) operator(})operator(.)ident(join) operator(+) string -ident(password) operator(=) operator(()integer(1)operator(..)integer(8)operator(\))operator(.)ident(collect) operator({) ident(chars)operator([)ident(rand)operator(()ident(chars)operator(.)ident(size)operator(\))operator(]) operator(})operator(.)ident(pack)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_2.8) -ident(srand) comment(# uses a combination of the time, the process id, and a sequence number) -ident(srand)operator(()ident(val)operator(\)) comment(# for repeatable behaviour) - - -comment(# @@PLEAC@@_2.9) -comment(# from the randomr lib: ) -comment(# http://raa.ruby-lang.org/project/randomr/) -operator(-)operator(-)operator(-)operator(-)operator(>) ident(http)symbol(:/)operator(/)ident(raa)operator(.)ident(ruby)operator(-)ident(lang)operator(.)ident(org)operator(/)ident(project)operator(/)ident(randomr)operator(/) - -ident(require) string -ident(mers) operator(=) constant(Random)operator(::)constant(MersenneTwister)operator(.)ident(new) integer(123456789) -ident(puts) ident(mers)operator(.)ident(rand)operator(()integer(0)operator(\)) comment(# 0.550321932544541) -ident(puts) ident(mers)operator(.)ident(rand)operator(()integer(10)operator(\)) comment(# 2) - -comment(# using online sources of random data via the realrand package:) -comment(# http://raa.ruby-lang.org/project/realrand/) -comment(# **Note**) -comment(# The following online services are used in this package:) -comment(# http://www.random.org - source: atmospheric noise ) -comment(# http://www.fourmilab.ch/hotbits - source: radioactive decay timings) -comment(# http://random.hd.org - source: entropy from local and network noise) -comment(# Please visit the sites and respect the rules of each service.) - -ident(require) string - -ident(generator1) operator(=) constant(Random)operator(::)constant(RandomOrg)operator(.)ident(new) -ident(puts) ident(generator1)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) -ident(puts) ident(generator1)operator(.)ident(randnum)operator(()integer(10)operator(,) integer(1)operator(,) integer(6)operator(\))operator(.)ident(join)operator(()stringoperator(\)) comment(# Roll dice 10 times.) - -ident(generator2) operator(=) constant(Random)operator(::)constant(FourmiLab)operator(.)ident(new) -ident(puts) ident(generator2)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) -comment(# randnum is not supported.) - -ident(generator3) operator(=) constant(Random)operator(::)constant(EntropyPool)operator(.)ident(new) -ident(puts) ident(generator3)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) -comment(# randnum is not supported.) - - -comment(# @@PLEAC@@_2.10) -reserved(def) method(gaussian_rand) - reserved(begin) - ident(u1) operator(=) integer(2) operator(*) ident(rand)operator(()operator(\)) operator(-) integer(1) - ident(u2) operator(=) integer(2) operator(*) ident(rand)operator(()operator(\)) operator(-) integer(1) - ident(w) operator(=) ident(u1)operator(*)ident(u1) operator(+) ident(u2)operator(*)ident(u2) - reserved(end) reserved(while) operator(()ident(w) operator(>)operator(=) integer(1)operator(\)) - ident(w) operator(=) constant(Math)operator(.)ident(sqrt)operator(()operator(()integer(-2)operator(*)constant(Math)operator(.)ident(log)operator(()ident(w)operator(\))operator(\))operator(/)ident(w)operator(\)) - operator([) ident(u2)operator(*)ident(w)operator(,) ident(u1)operator(*)ident(w) operator(]) -reserved(end) - -ident(mean) operator(=) integer(25) -ident(sdev) operator(=) integer(2) -ident(salary) operator(=) ident(gaussian_rand)operator([)integer(0)operator(]) operator(*) ident(sdev) operator(+) ident(mean) -ident(printf)operator(()stringoperator(,) ident(salary)operator(\)) - - -comment(# @@PLEAC@@_2.11) -reserved(def) method(deg2rad)operator(()ident(d)operator(\)) - operator(()ident(d)operator(/)float(180.0)operator(\))operator(*)constant(Math)operator(::)constant(PI) -reserved(end) - -reserved(def) method(rad2deg)operator(()ident(r)operator(\)) - operator(()ident(r)operator(/)constant(Math)operator(::)constant(PI)operator(\))operator(*)integer(180) -reserved(end) - - -comment(# @@PLEAC@@_2.12) -ident(sin_val) operator(=) constant(Math)operator(.)ident(sin)operator(()ident(angle)operator(\)) -ident(cos_val) operator(=) constant(Math)operator(.)ident(cos)operator(()ident(angle)operator(\)) -ident(tan_val) operator(=) constant(Math)operator(.)ident(tan)operator(()ident(angle)operator(\)) - -comment(# AFAIK Ruby's Math module doesn't provide acos/asin) -comment(# While we're at it, let's also define missing hyperbolic functions) -reserved(module) class(Math) - reserved(def) constant(Math)operator(.)ident(asin)operator(()ident(x)operator(\)) - ident(atan2)operator(()ident(x)operator(,) ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(\)) - reserved(end) - reserved(def) constant(Math)operator(.)ident(acos)operator(()ident(x)operator(\)) - ident(atan2)operator(()ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(,) ident(x)operator(\)) - reserved(end) - reserved(def) constant(Math)operator(.)ident(atan)operator(()ident(x)operator(\)) - ident(atan2)operator(()ident(x)operator(,) integer(1)operator(\)) - reserved(end) - reserved(def) constant(Math)operator(.)ident(sinh)operator(()ident(x)operator(\)) - operator(()ident(exp)operator(()ident(x)operator(\)) operator(-) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) - reserved(end) - reserved(def) constant(Math)operator(.)ident(cosh)operator(()ident(x)operator(\)) - operator(()ident(exp)operator(()ident(x)operator(\)) operator(+) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) - reserved(end) - reserved(def) constant(Math)operator(.)ident(tanh)operator(()ident(x)operator(\)) - ident(sinh)operator(()ident(x)operator(\)) operator(/) ident(cosh)operator(()ident(x)operator(\)) - reserved(end) -reserved(end) - -comment(# The support for Complex numbers is not built-in) -ident(y) operator(=) constant(Math)operator(.)ident(acos)operator(()float(3.7)operator(\)) -comment(#=> in `sqrt': square root for negative number (ArgumentError\)) - -comment(# There is an implementation of Complex numbers in 'complex.rb' in current) -comment(# Ruby distro, but it doesn't support atan2 with complex args, so it doesn't) -comment(# solve this problem.) - - -comment(# @@PLEAC@@_2.13) -ident(log_e) operator(=) constant(Math)operator(.)ident(log)operator(()ident(val)operator(\)) -ident(log_10) operator(=) constant(Math)operator(.)ident(log10)operator(()ident(val)operator(\)) - -reserved(def) method(log_base)operator(()ident(base)operator(,) ident(val)operator(\)) - constant(Math)operator(.)ident(log)operator(()ident(val)operator(\))operator(/)constant(Math)operator(.)ident(log)operator(()ident(base)operator(\)) -reserved(end) - -ident(answer) operator(=) ident(log_base)operator(()integer(10)operator(,) integer(10_000)operator(\)) -ident(puts) stringdelimiter(")> - - -comment(# @@PLEAC@@_2.14) -ident(require) string - -ident(a) operator(=) constant(Matrix)operator([)operator([)integer(3)operator(,) integer(2)operator(,) integer(3)operator(])operator(,) operator([)integer(5)operator(,) integer(9)operator(,) integer(8)operator(])operator(]) -ident(b) operator(=) constant(Matrix)operator([)operator([)integer(4)operator(,) integer(7)operator(])operator(,) operator([)integer(9)operator(,) integer(3)operator(])operator(,) operator([)integer(8)operator(,) integer(1)operator(])operator(]) -ident(c) operator(=) ident(a) operator(*) ident(b) - -ident(a)operator(.)ident(row_size) -ident(a)operator(.)ident(column_size) - -ident(c)operator(.)ident(det) -ident(a)operator(.)ident(transpose) - - -comment(# @@PLEAC@@_2.15) -ident(require) string -ident(require) string - -ident(a) operator(=) ident(Complex)operator(()integer(3)operator(,) integer(5)operator(\)) comment(# 3 + 5i) -ident(b) operator(=) ident(Complex)operator(()integer(2)operator(,) integer(-2)operator(\)) comment(# 2 - 2i) -ident(puts) stringdelimiter(")> - -ident(c) operator(=) ident(a) operator(*) ident(b) -ident(d) operator(=) integer(3) operator(+) integer(4)operator(*)constant(Complex)operator(::)constant(I) - -ident(printf) stringcontent(\) = %s)char(\\n)delimiter(")>operator(,) constant(Math)operator(.)ident(sqrt)operator(()ident(d)operator(\)) - - -comment(# @@PLEAC@@_2.16) -ident(number) operator(=) ident(hexadecimal)operator(.)ident(hex) -ident(number) operator(=) ident(octal)operator(.)ident(oct) - -ident(print) string -ident(num) operator(=) ident(gets)operator(.)ident(chomp) -ident(exit) reserved(unless) reserved(defined?)operator(()ident(num)operator(\)) -ident(num) operator(=) ident(num)operator(.)ident(oct) reserved(if) ident(num) operator(=)operator(~) regexp comment(# does both oct and hex ) -ident(printf) stringoperator(,) ident(num)operator(,) ident(num)operator(,) ident(num) - -ident(print) string -ident(permissions) operator(=) ident(gets)operator(.)ident(chomp) -ident(raise) string reserved(unless) reserved(defined?)operator(()ident(permissions)operator(\)) -ident(puts) stringdelimiter(")> - - -comment(# @@PLEAC@@_2.17) -reserved(def) method(commify)operator(()ident(n)operator(\)) - ident(n)operator(.)ident(to_s) operator(=)operator(~) regexp - ident(int)operator(,) ident(dec) operator(=) global_variable($1)operator(.)ident(reverse)operator(,) global_variable($2) operator(?) global_variable($2) operator(:) string - reserved(while) ident(int)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - ident(int)operator(.)ident(reverse) operator(+) ident(dec) -reserved(end) - - -comment(# @@PLEAC@@_2.18) -ident(printf) stringoperator(,) ident(time)operator(,) ident(time) operator(==) integer(1) operator(?) string operator(:) string - -comment(# dunno if an equivalent to Lingua::EN::Inflect exists...) - - -comment(# @@PLEAC@@_2.19) -comment(#-----------------------------) -comment(#!/usr/bin/ruby) -comment(# bigfact - calculating prime factors) -reserved(def) method(factorize)operator(()ident(orig)operator(\)) - ident(factors) operator(=) operator({)operator(}) - ident(factors)operator(.)ident(default) operator(=) integer(0) comment(# return 0 instead nil if key not found in hash) - ident(n) operator(=) ident(orig) - ident(i) operator(=) integer(2) - ident(sqi) operator(=) integer(4) comment(# square of i) - reserved(while) ident(sqi) operator(<=) ident(n) reserved(do) - reserved(while) ident(n)operator(.)ident(modulo)operator(()ident(i)operator(\)) operator(==) integer(0) reserved(do) - ident(n) regexpcontent(" - end - # we take advantage of the fact that (i +1\)**2 = i**2 + 2*i +1 - sqi += 2 * i + 1 - i += 1 - end - - if (n != 1\) && (n != orig\) - factors[n] += 1 - end - factors -end - -def printfactorhash(orig, factorcount\) - print format("%-10d ", orig\) - if factorcount.length == 0 - print "PRIME" - else - # sorts after number, because the hash keys are numbers - factorcount.sort.each { |factor,exponent| - print factor - if exponent > 1 - print "**", exponent - end - print " " - } - end - puts -end - -for arg in ARGV - n = arg.to_i - mfactors = factorize(n\) - printfactorhash(n, mfactors\) -end -#----------------------------- - - -# @@PLEAC@@_3.0 -puts Time.now - -print "Today is day ", Time.now.yday, " of the current year.)char(\\n)content(" -print "Today is day ", Time.now.day, " of the current month.)char(\\n)content(" - - -# @@PLEAC@@_3.1 -day, month, year = Time.now.day, Time.now.month, Time.now.year -# or -day, month, year = Time.now.to_a[3..5] - -tl = Time.now.localtime -printf("The current date is %04d %02d %02d)char(\\n)content(", tl.year, tl.month, tl.day\) - -Time.now.localtime.strftime("%Y-%m-%d"\) - - -# @@PLEAC@@_3.2 -Time.local(year, month, day, hour, minute, second\).tv_sec -Time.gm(year, month, day, hour, minute, second\).tv_sec - - -# @@PLEAC@@_3.3 -sec, min, hour, day, month, year, wday, yday, isdst, zone = Time.at(epoch_secs\).to_a - - -# @@PLEAC@@_3.4 -when_ = now + difference # now -> Time ; difference -> Numeric (delta in seconds\) -then_ = now - difference - - -# @@PLEAC@@_3.5 -bree = 361535725 -nat = 96201950 - -difference = bree - nat -puts "There were )inlinecontent( seconds between Nat and Bree" - -seconds = difference % 60 -difference = (difference - seconds\) )delimiter(/)> integer(60) -ident(minutes) operator(=) ident(difference) operator(%) integer(60) -ident(difference) operator(=) operator(()ident(difference) operator(-) ident(minutes)operator(\)) operator(/) integer(60) -ident(hours) operator(=) ident(difference) operator(%) integer(24) -ident(difference) operator(=) operator(()ident(difference) operator(-) ident(hours)operator(\)) operator(/) integer(24) -ident(days) operator(=) ident(difference) operator(%) integer(7) -ident(weeks) operator(=) operator(()ident(difference) operator(-) ident(days)operator(\)) operator(/) integer(7) - -ident(puts) stringcontent( weeks, )inlinecontent( days, )inlinecontent(:)inlinecontent(:)inlinecontent(\))delimiter(")> - - -comment(# @@PLEAC@@_3.6) -ident(monthday)operator(,) ident(weekday)operator(,) ident(yearday) operator(=) ident(date)operator(.)ident(mday)operator(,) ident(date)operator(.)ident(wday)operator(,) ident(date)operator(.)ident(yday) - -comment(# AFAIK the week number is not just a division since week boundaries are on sundays) -ident(weeknum) operator(=) ident(d)operator(.)ident(strftime)operator(()stringoperator(\))operator(.)ident(to_i) operator(+) integer(1) - -ident(year) operator(=) integer(1981) -ident(month) operator(=) string comment(# or `6' if you want to emulate a broken language) -ident(day) operator(=) integer(16) -ident(t) operator(=) constant(Time)operator(.)ident(mktime)operator(()ident(year)operator(,) ident(month)operator(,) ident(day)operator(\)) -ident(print) stringcontent(/)inlinecontent(/)inlinecontent( was a )delimiter(")>operator(,) ident(t)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) string - - -comment(# @@PLEAC@@_3.7) -ident(yyyy)operator(,) ident(mm)operator(,) ident(dd) operator(=) global_variable($1)operator(,) global_variable($2)operator(,) global_variable($3) reserved(if) string operator(=)operator(~) regexp - -ident(epoch_seconds) operator(=) constant(Time)operator(.)ident(mktime)operator(()ident(yyyy)operator(,) ident(mm)operator(,) ident(dd)operator(\))operator(.)ident(tv_sec) - -comment(# dunno an equivalent to Date::Manip#ParseDate) - - -comment(# @@PLEAC@@_3.8) -ident(string) operator(=) constant(Time)operator(.)ident(at)operator(()ident(epoch_secs)operator(\)) -constant(Time)operator(.)ident(at)operator(()integer(1234567890)operator(\))operator(.)ident(gmtime) comment(# gives: Fri Feb 13 23:31:30 UTC 2009) - -ident(time) operator(=) constant(Time)operator(.)ident(mktime)operator(()integer(1973)operator(,) stringoperator(,) integer(18)operator(,) integer(3)operator(,) integer(45)operator(,) integer(50)operator(\)) -ident(print) stringoperator(,) ident(time)operator(.)ident(localtime)operator(,) string - - -comment(# @@PLEAC@@_3.9) -comment(# Ruby provides micro-seconds in Time object) -constant(Time)operator(.)ident(now)operator(.)ident(usec) - -comment(# Ruby gives the seconds in floating format when substracting two Time objects) -ident(before) operator(=) constant(Time)operator(.)ident(now) -ident(line) operator(=) ident(gets) -ident(elapsed) operator(=) constant(Time)operator(.)ident(now) operator(-) ident(before) -ident(puts) stringcontent( seconds.)delimiter(")> - -comment(# On my Celeron-400 with Linux-2.2.19-14mdk, average for three execs are:) -comment(# This Ruby version: average 0.00321 sec) -comment(# Cookbook's Perl version: average 0.00981 sec) -ident(size) operator(=) integer(500) -ident(number_of_times) operator(=) integer(100) -ident(total_time) operator(=) integer(0) -ident(number_of_times)operator(.)ident(times) operator({) - comment(# populate array) - ident(array) operator(=) operator([)operator(]) - ident(size)operator(.)ident(times) operator({) ident(array) operator(<<) ident(rand) operator(}) - comment(# sort it) - ident(begin_) operator(=) constant(Time)operator(.)ident(now) - ident(array)operator(.)ident(sort!) - ident(time) operator(=) constant(Time)operator(.)ident(now) operator(-) ident(begin_) - ident(total_time) operator(+=) ident(time) -operator(}) -ident(printf) stringoperator(,) - ident(size)operator(,) operator(()ident(total_time)operator(/)ident(Float)operator(()ident(number_of_times)operator(\))operator(\)) - - -comment(# @@PLEAC@@_3.10) -ident(sleep)operator(()float(0.005)operator(\)) comment(# Ruby is definitely not as broken as Perl :\)) -comment(# (may be interrupted by sending the process a SIGALRM\)) - - -comment(# @@PLEAC@@_3.11) -comment(#!/usr/bin/ruby -w) -comment(# hopdelta - feed mail header, produce lines) -comment(# showing delay at each hop.) -ident(require) string -reserved(class) class(MailHopDelta) - - reserved(def) method(initialize)operator(()ident(mail)operator(\)) - instance_variable(@head) operator(=) ident(mail)operator(.)ident(gsub)operator(()regexpoperator(,)stringoperator(\)) - instance_variable(@topline) operator(=) string - instance_variable(@start_from) operator(=) ident(mail)operator(.)ident(match)operator(()regexp]*\))delimiter(/)>operator(\))operator([)integer(1)operator(]) - instance_variable(@date) operator(=) constant(Time)operator(.)ident(parse)operator(()ident(mail)operator(.)ident(match)operator(()regexpoperator(\))operator([)integer(1)operator(])operator(\)) - reserved(end) - - reserved(def) method(out)operator(()ident(line)operator(\)) - string operator(%) ident(line) - reserved(end) - - reserved(def) method(hop_date)operator(()ident(day)operator(\)) - ident(day)operator(.)ident(strftime)operator(()stringoperator(\)) - reserved(end) - - reserved(def) method(puts_hops) - ident(puts) ident(out)operator(()instance_variable(@topline)operator(\)) - ident(puts) ident(out)operator(()operator([)stringoperator(,) instance_variable(@start_from)operator(,) ident(hop_date)operator(()instance_variable(@date)operator(\))operator(,)stringoperator(])operator(\)) - instance_variable(@head)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(grep)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(hop)operator(|) - ident(hop)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) - ident(whence) operator(=) ident(hop)operator(.)ident(match)operator(()regexpoperator(\))operator([)integer(1)operator(]) - reserved(unless) ident(whence) - ident(warn) stringdelimiter(")> - reserved(next) - reserved(end) - ident(from) operator(=) global_variable($+) reserved(if) ident(hop) operator(=)operator(~) regexp - ident(by) operator(=) global_variable($1) reserved(if) ident(hop) operator(=)operator(~) regexp - reserved(next) reserved(unless) ident(now) operator(=) constant(Time)operator(.)ident(parse)operator(()ident(whence)operator(\))operator(.)ident(localtime) - ident(delta) operator(=) ident(now) operator(-) instance_variable(@date) - ident(puts) ident(out)operator(()operator([)ident(from)operator(,) ident(by)operator(,) ident(hop_date)operator(()ident(now)operator(\))operator(,) ident(hop_time)operator(()ident(delta)operator(\))operator(])operator(\)) - instance_variable(@date) operator(=) ident(now) - reserved(end) - reserved(end) - - reserved(def) method(hop_time)operator(()ident(secs)operator(\)) - ident(sign) operator(=) ident(secs) operator(<) integer(0) operator(?) integer(-1) operator(:) integer(1) - ident(days)operator(,) ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60) operator(*) integer(60) operator(*) integer(24)operator(\)) - ident(hours)operator(,)ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60) operator(*) integer(60)operator(\)) - ident(mins)operator(,) ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60)operator(\)) - ident(rtn) operator(=) string operator(%) operator([)ident(secs) operator(*) ident(sign)operator(]) - ident(rtn) operator(<<) string operator(%) operator([)ident(mins) operator(*) ident(sign)operator(]) reserved(if) ident(mins) operator(!=) integer(0) - ident(rtn) operator(<<) string operator(%) operator([)ident(hours) operator(*) ident(sign)operator(]) reserved(if) ident(hours) operator(!=) integer(0) - ident(rtn) operator(<<) string operator(%) operator([)ident(days) operator(*) ident(sign)operator(]) reserved(if) ident(days) operator(!=) integer(0) - ident(rtn) - reserved(end) -reserved(end) - -global_variable($/) operator(=) string -ident(mail) operator(=) constant(MailHopDelta)operator(.)ident(new)operator(()pre_constant(ARGF)operator(.)ident(gets)operator(\))operator(.)ident(puts_hops) - - -comment(# @@PLEAC@@_4.0) -ident(single_level) operator(=) operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(]) - -comment(# Ruby directly supports nested arrays) -ident(double_level) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(]) -ident(still_single_level) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(])operator(.)ident(flatten) - - -comment(# @@PLEAC@@_4.1) -ident(a) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) -ident(a) operator(=) string - -ident(lines) operator(=) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))string - -ident(bigarray) operator(=) constant(IO)operator(.)ident(readlines)operator(()stringoperator(\))operator(.)ident(collect) operator({) operator(|)ident(l)operator(|) ident(l)operator(.)ident(chomp) operator(}) - -ident(name) operator(=) string -ident(banner) operator(=) stringcontent(, and welcome!)delimiter(\))> - -ident(host_info) operator(=) shelldelimiter(`)> - -shelldelimiter(\))> - -ident(banner) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\)) - -ident(rax) operator(=) string { } [ ] )delimiter(!)> - - -comment(# @@PLEAC@@_4.2) -reserved(def) method(commify_series)operator(()ident(arr)operator(\)) - reserved(return) string reserved(if) reserved(not) ident(arr) - reserved(case) ident(arr)operator(.)ident(size) - reserved(when) integer(0) reserved(then) string - reserved(when) integer(1) reserved(then) ident(arr)operator([)integer(0)operator(]) - reserved(when) integer(2) reserved(then) ident(arr)operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) ident(arr)operator([)integer(0)operator(..)integer(-2)operator(])operator(.)ident(join)operator(()stringoperator(\)) operator(+) string operator(+) ident(arr)operator([)integer(-1)operator(]) - reserved(end) -reserved(end) - -ident(array) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) - -ident(print) stringoperator(,) ident(array)operator(,) string -comment(# -> I have redyellowgreen marbles) - -comment(# But unlike Perl:) -ident(print) stringcontent( marbles)char(\\n)delimiter(")> -comment(# -> I have redyellowgreen marbles) -comment(# So, needs:) -ident(print) stringoperator(\))delimiter(})>content( marbles)char(\\n)delimiter(")> -comment(# -> I have red yellow green marbles) - -comment(#!/usr/bin/ruby) -comment(# communify_series - show proper comma insertion in list output) - -reserved(def) method(commify_series)operator(()ident(arr)operator(\)) - reserved(return) string reserved(if) reserved(not) ident(arr) - ident(sepchar) operator(=) ident(arr)operator(.)ident(find) operator({) operator(|)ident(p)operator(|) ident(p) operator(=)operator(~) regexp operator(}) operator(?) string operator(:) string - reserved(case) ident(arr)operator(.)ident(size) - reserved(when) integer(0) reserved(then) string - reserved(when) integer(1) reserved(then) ident(arr)operator([)integer(0)operator(]) - reserved(when) integer(2) reserved(then) ident(arr)operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) ident(arr)operator([)integer(0)operator(..)integer(-2)operator(])operator(.)ident(join)operator(()ident(sepchar)operator(\)) operator(+) ident(sepchar) operator(+) string operator(+) ident(arr)operator([)integer(-1)operator(]) - reserved(end) -reserved(end) - -ident(lists) operator(=) operator([) - operator([) string operator(])operator(,) - stringoperator(,) - stringoperator(,) - operator([) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) string operator(])operator(,) - operator([) stringoperator(,) - stringoperator(,) - string operator(])operator(,) -operator(]) - -reserved(for) ident(list) reserved(in) ident(lists) reserved(do) - ident(puts) stringcontent(.)delimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_4.3) -comment(# (note: AFAIK Ruby doesn't allow gory change of Array length\)) -comment(# grow the array by assigning nil to past the end of array) -ident(ary)operator([)ident(new_size)integer(-1)operator(]) operator(=) pre_constant(nil) -comment(# shrink the array by slicing it down) -ident(ary)operator(.)ident(slice!)operator(()ident(new_size)operator(..)integer(-1)operator(\)) -comment(# init the array with given size) -constant(Array)operator(.)ident(new)operator(()ident(number_of_elems)operator(\)) -comment(# assign to an element past the original end enlarges the array) -ident(ary)operator([)ident(index_new_last_elem)operator(]) operator(=) ident(value) - -reserved(def) method(what_about_that_array)operator(()ident(a)operator(\)) - ident(print) stringoperator(,) ident(a)operator(.)ident(size)operator(,) string - comment(# Index of last element is not really interesting in Ruby) - ident(print) stringcontent('.)char(\\n)delimiter(")> -reserved(end) -ident(people) operator(=) string -ident(what_about_that_array)operator(()ident(people)operator(\)) - - -comment(# @@PLEAC@@_4.4) -comment(# OO style) -ident(bad_users)operator(.)ident(each) operator({) operator(|)ident(user)operator(|) - ident(complain)operator(()ident(user)operator(\)) -operator(}) -comment(# or, functional style) -reserved(for) ident(user) reserved(in) ident(bad_users) - ident(complain)operator(()ident(user)operator(\)) -reserved(end) - -reserved(for) ident(var) reserved(in) constant(ENV)operator(.)ident(keys)operator(.)ident(sort) - ident(puts) stringcontent(=)inlinedelimiter(")> -reserved(end) - -reserved(for) ident(user) reserved(in) ident(all_users) - ident(disk_space) operator(=) ident(get_usage)operator(()ident(user)operator(\)) - reserved(if) operator(()ident(disk_space) operator(>) constant(MAX_QUOTA)operator(\)) - ident(complain)operator(()ident(user)operator(\)) - reserved(end) -reserved(end) - -reserved(for) ident(l) reserved(in) constant(IO)operator(.)ident(popen)operator(()stringoperator(\))operator(.)ident(readlines) - ident(print) ident(l) reserved(if) ident(l) operator(=)operator(~) regexp -reserved(end) - -comment(# we can mimic the obfuscated Perl way) -reserved(while) ident(fh)operator(.)ident(gets) comment(# $_ is set to the line just read) - ident(chomp) comment(# $_ has a trailing \\n removed, if it had one) - ident(split)operator(.)ident(each) operator({) operator(|)ident(w)operator(|) comment(# $_ is split on whitespace) - comment(# but $_ is not set to each chunk as in Perl) - ident(print) ident(w)operator(.)ident(reverse) - operator(}) -reserved(end) -comment(# ...or use a cleaner way) -reserved(for) ident(l) reserved(in) ident(fh)operator(.)ident(readlines) - ident(l)operator(.)ident(chomp)operator(.)ident(split)operator(.)ident(each) operator({) operator(|)ident(w)operator(|) ident(print) ident(w)operator(.)ident(reverse) operator(}) -reserved(end) - -comment(# same drawback as in problem 1.4, we can't mutate a Numeric...) -ident(array)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(-) integer(1) operator(}) - -ident(a) operator(=) operator([) operator(.)integer(5)operator(,) integer(3) operator(])operator(;) ident(b) operator(=) operator([) integer(0)operator(,) integer(1) operator(]) -reserved(for) ident(ary) reserved(in) operator([) ident(a)operator(,) ident(b) operator(]) - ident(ary)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(*) integer(7) operator(}) -reserved(end) -ident(puts) stringoperator(\))delimiter(})>content( )inlineoperator(\))delimiter(})>delimiter(")> - -comment(# we can mutate Strings, cool; we need a trick for the scalar) -reserved(for) ident(ary) reserved(in) operator([) operator([) ident(scalar) operator(])operator(,) ident(array)operator(,) ident(hash)operator(.)ident(values) operator(]) - ident(ary)operator(.)ident(each) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(strip!) operator(}) comment(# String#strip rules :\)) -reserved(end) - - -comment(# @@PLEAC@@_4.5) -comment(# not relevant in Ruby since we have always references) -reserved(for) ident(item) reserved(in) ident(array) - comment(# do somethingh with item) -reserved(end) - - -comment(# @@PLEAC@@_4.6) -ident(unique) operator(=) ident(list)operator(.)ident(uniq) - -comment(# generate a list of users logged in, removing duplicates) -ident(users) operator(=) shelloperator(.)ident(collect) operator({) operator(|)ident(l)operator(|) ident(l) operator(=)operator(~) regexpoperator(;) global_variable($1) operator(})operator(.)ident(sort)operator(.)ident(uniq) -ident(puts)operator(()stringdelimiter(")>operator(\)) comment(# see 4.2 for commify_series) - - -comment(# @@PLEAC@@_4.7) -ident(a) operator(-) ident(b) -comment(# [ 1, 1, 2, 2, 3, 3, 3, 4, 5 ] - [ 1, 2, 4 ] -> [3, 5]) - - -comment(# @@PLEAC@@_4.8) -ident(union) operator(=) ident(a) operator(|) ident(b) -ident(intersection) operator(=) ident(a) operator(&) ident(b) -ident(difference) operator(=) ident(a) operator(-) ident(b) - - -comment(# @@PLEAC@@_4.9) -ident(array1)operator(.)ident(concat)operator(()ident(array2)operator(\)) -comment(# if you will assign to another object, better use:) -ident(new_ary) operator(=) ident(array1) operator(+) ident(array2) - -ident(members) operator(=) operator([) stringoperator(,) string operator(]) -ident(initiates) operator(=) operator([) stringoperator(,) string operator(]) -ident(members) operator(+=) ident(initiates) - -ident(members) operator(=) operator([) stringoperator(,) string operator(]) -ident(initiates) operator(=) operator([) stringoperator(,) string operator(]) -ident(members)operator([)integer(2)operator(,)integer(0)operator(]) operator(=) operator([) stringoperator(,) ident(initiates) operator(])operator(.)ident(flatten) - -ident(members)operator([)integer(0)operator(]) operator(=) string -ident(members)operator([)integer(3)operator(,)integer(2)operator(]) operator(=) stringoperator(,) string - - -comment(# @@PLEAC@@_4.10) -ident(reversed) operator(=) ident(ary)operator(.)ident(reverse) - -ident(ary)operator(.)ident(reverse_each) operator({) operator(|)ident(e)operator(|) - comment(# do something with e) -operator(}) - -ident(descending) operator(=) ident(ary)operator(.)ident(sort)operator(.)ident(reverse) -ident(descending) operator(=) ident(ary)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b) operator(<=>) ident(a) operator(}) - - -comment(# @@PLEAC@@_4.11) -comment(# remove n elements from front of ary (shift n\)) -ident(front) operator(=) ident(ary)operator(.)ident(slice!)operator(()integer(0)operator(,) ident(n)operator(\)) - -comment(# remove n elements from the end of ary (pop n\)) -ident(end_) operator(=) ident(ary)operator(.)ident(slice!)operator(()operator(-)ident(n) operator(..) integer(-1)operator(\)) - -comment(# let's extend the Array class, to make that useful) -reserved(class) class(Array) - reserved(def) method(shift2)operator(()operator(\)) - ident(slice!)operator(()integer(0) operator(..) integer(1)operator(\)) comment(# more symetric with pop2...) - reserved(end) - reserved(def) method(pop2)operator(()operator(\)) - ident(slice!)operator(()integer(-2) operator(..) integer(-1)operator(\)) - reserved(end) -reserved(end) - -ident(friends) operator(=) string -ident(this)operator(,) ident(that) operator(=) ident(friends)operator(.)ident(shift2) - -ident(beverages) operator(=) string -ident(pair) operator(=) ident(beverages)operator(.)ident(pop2) - - -comment(# @@PLEAC@@_4.12) -comment(# use Enumerable#detect (or the synonym Enumerable#find\)) -ident(highest_eng) operator(=) ident(employees)operator(.)ident(detect) operator({) operator(|)ident(emp)operator(|) ident(emp)operator(.)ident(category) operator(==) string operator(}) - - -comment(# @@PLEAC@@_4.13) -comment(# use Enumerable#select (or the synonym Enumerable#find_all\)) -ident(bigs) operator(=) ident(nums)operator(.)ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(>) integer(1_000_000) operator(}) -ident(pigs) operator(=) ident(users)operator(.)ident(keys)operator(.)ident(select) operator({) operator(|)ident(k)operator(|) ident(users)operator([)ident(k)operator(]) operator(>) float(1e7) operator(}) - -ident(matching) operator(=) shelloperator(.)ident(select) operator({) operator(|)ident(u)operator(|) ident(u) operator(=)operator(~) regexp operator(}) - -ident(engineers) operator(=) ident(employees)operator(.)ident(select) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(position) operator(==) string operator(}) - -ident(secondary_assistance) operator(=) ident(applicants)operator(.)ident(select) operator({) operator(|)ident(a)operator(|) - ident(a)operator(.)ident(income) operator(>)operator(=) integer(26_000) operator(&&) ident(a)operator(.)ident(income) operator(<) integer(30_000) -operator(}) - - -comment(# @@PLEAC@@_4.14) -comment(# normally you would have an array of Numeric (Float or) -comment(# Fixnum or Bignum\), so you would use:) -ident(sorted) operator(=) ident(unsorted)operator(.)ident(sort) -comment(# if you have strings representing Integers or Floats) -comment(# you may specify another sort method:) -ident(sorted) operator(=) ident(unsorted)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(to_f) operator(<=>) ident(b)operator(.)ident(to_f) operator(}) - -comment(# let's use the list of my own PID's) -shelloperator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(..)integer(-1)operator(])operator(.) - ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(=)operator(~) regexpoperator(])delimiter(})>delimiter(/)> operator(})operator(.) - ident(collect) operator({) operator(|)ident(i)operator(|) ident(i)operator(.)ident(split)operator([)integer(1)operator(]) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(to_i) operator(<=>) ident(b)operator(.)ident(to_i) operator(})operator(.)ident(each) operator({) operator(|)ident(i)operator(|) ident(puts) ident(i) operator(}) -ident(puts) string -ident(pid) operator(=) ident(gets)operator(.)ident(chomp) -ident(raise) string reserved(unless) ident(pid) operator(&&) ident(pid) operator(=)operator(~) regexp -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid)operator(.)ident(to_i)operator(\)) -ident(sleep) integer(2) -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid)operator(.)ident(to_i)operator(\)) - -ident(descending) operator(=) ident(unsorted)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator(.)ident(to_f) operator(<=>) ident(a)operator(.)ident(to_f) operator(}) - - -comment(# @@PLEAC@@_4.15) -ident(ordered) operator(=) ident(unordered)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(compare)operator(()ident(a)operator(,)ident(b)operator(\)) operator(}) - -ident(precomputed) operator(=) ident(unordered)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(compute)operator(,) ident(e)operator(]) operator(}) -ident(ordered_precomputed) operator(=) ident(precomputed)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(}) -ident(ordered) operator(=) ident(ordered_precomputed)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) - -ident(ordered) operator(=) ident(unordered)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(compute)operator(,) ident(e)operator(]) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) - ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) - -reserved(for) ident(employee) reserved(in) ident(employees)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(name) operator(<=>) ident(b)operator(.)ident(name) operator(}) - ident(print) ident(employee)operator(.)ident(name)operator(,) stringoperator(,) ident(employee)operator(.)ident(salary)operator(,) string -reserved(end) - -comment(# Beware! `0' is true in Ruby.) -comment(# For chaining comparisons, you may use Numeric#nonzero?, which) -comment(# returns num if num is not zero, nil otherwise) -ident(sorted) operator(=) ident(employees)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) operator(()ident(a)operator(.)ident(name) operator(<=>) ident(b)operator(.)ident(name)operator(\))operator(.)ident(nonzero?) operator(||) ident(b)operator(.)ident(age) operator(<=>) ident(a)operator(.)ident(age) operator(}) - -ident(users) operator(=) operator([)operator(]) -comment(# getpwent is not wrapped in Ruby... let's fallback) -constant(IO)operator(.)ident(readlines)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(u)operator(|) ident(users) operator(<<) ident(u)operator(.)ident(split)operator(()stringoperator(\)) operator(}) -ident(users)operator(.)ident(sort!) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(}) -reserved(for) ident(user) reserved(in) ident(users) - ident(puts) ident(user)operator([)integer(0)operator(]) -reserved(end) - -ident(sorted) operator(=) ident(names)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(,) integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(,) integer(1)operator(]) operator(}) -ident(sorted) operator(=) ident(strings)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(length) operator(<=>) ident(b)operator(.)ident(length) operator(}) - -comment(# let's show only the compact version) -ident(ordered) operator(=) ident(strings)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(e)operator(.)ident(length)operator(,) ident(e)operator(]) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) - ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) - -ident(ordered) operator(=) ident(strings)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)regexpoperator(.)ident(match)operator(()ident(e)operator(\))operator([)integer(0)operator(])operator(.)ident(to_i)operator(,) ident(e)operator(]) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) - ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) - -ident(print) shelloperator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(e)operator(,) ident(e)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(indexes)operator(()integer(3)operator(,)integer(2)operator(,)integer(0)operator(\))operator(])operator(.)ident(flatten) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) operator(()ident(a)operator([)integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(])operator(\))operator(.)ident(nonzero?) operator(||) operator(()ident(a)operator([)integer(2)operator(]) operator(<=>) ident(b)operator([)integer(2)operator(])operator(\))operator(.)ident(nonzero?) operator(||) ident(a)operator([)integer(3)operator(]) operator(<=>) ident(b)operator([)integer(3)operator(]) operator(})operator(.) - ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(0)operator(]) operator(}) - - -comment(# @@PLEAC@@_4.16) -ident(circular)operator(.)ident(unshift)operator(()ident(circular)operator(.)ident(pop)operator(\)) comment(# the last shall be first) -ident(circular)operator(.)ident(push)operator(()ident(circular)operator(.)ident(shift)operator(\)) comment(# and vice versa) - -reserved(def) method(grab_and_rotate)operator(()ident(l)operator(\)) - ident(l)operator(.)ident(push)operator(()ident(ret) operator(=) ident(l)operator(.)ident(shift)operator(\)) - ident(ret) -reserved(end) - -ident(processes) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) -reserved(while) operator(()integer(1)operator(\)) - ident(process) operator(=) ident(grab_and_rotate)operator(()ident(processes)operator(\)) - ident(puts) stringdelimiter(")> - ident(sleep) integer(1) -reserved(end) - - -comment(# @@PLEAC@@_4.17) -reserved(def) method(fisher_yates_shuffle)operator(()ident(a)operator(\)) - operator(()ident(a)operator(.)ident(size)integer(-1)operator(\))operator(.)ident(downto)operator(()integer(1)operator(\)) operator({) operator(|)ident(i)operator(|) - ident(j) operator(=) ident(rand)operator(()ident(i)integer(+1)operator(\)) - ident(a)operator([)ident(i)operator(])operator(,) ident(a)operator([)ident(j)operator(]) operator(=) ident(a)operator([)ident(j)operator(])operator(,) ident(a)operator([)ident(i)operator(]) reserved(if) ident(i) operator(!=) ident(j) - operator(}) -reserved(end) - -reserved(def) method(naive_shuffle)operator(()ident(a)operator(\)) - reserved(for) ident(i) reserved(in) integer(0)operator(...)ident(a)operator(.)ident(size) - ident(j) operator(=) ident(rand)operator(()ident(a)operator(.)ident(size)operator(\)) - ident(a)operator([)ident(i)operator(])operator(,) ident(a)operator([)ident(j)operator(]) operator(=) ident(a)operator([)ident(j)operator(])operator(,) ident(a)operator([)ident(i)operator(]) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_4.18) -comment(#!/usr/bin/env ruby) -comment(# example 4-2 words) -comment(# words - gather lines, present in colums) - -comment(# class to encapsulate the word formatting from the input) -reserved(class) class(WordFormatter) - reserved(def) method(initialize)operator(()ident(cols)operator(\)) - instance_variable(@cols) operator(=) ident(cols) - reserved(end) - - comment(# helper to return the length of the longest word in the wordlist) - reserved(def) method(maxlen)operator(()ident(wordlist)operator(\)) - ident(max) operator(=) integer(1) - reserved(for) ident(word) reserved(in) ident(wordlist) - reserved(if) ident(word)operator(.)ident(length) operator(>) ident(max) - ident(max) operator(=) ident(word)operator(.)ident(length) - reserved(end) - reserved(end) - ident(max) - reserved(end) - - comment(# process the wordlist and print it formmated into columns) - reserved(def) method(output)operator(()ident(wordlist)operator(\)) - ident(collen) operator(=) ident(maxlen)operator(()ident(wordlist)operator(\)) operator(+) integer(1) - ident(columns) operator(=) instance_variable(@cols) operator(/) ident(collen) - ident(columns) operator(=) integer(1) reserved(if) ident(columns) operator(==) integer(0) - ident(rows) operator(=) operator(()ident(wordlist)operator(.)ident(length) operator(+) ident(columns) operator(-) integer(1)operator(\)) operator(/) ident(columns) - comment(# now process each item, picking out proper piece for this position) - integer(0)operator(.)ident(upto)operator(()ident(rows) operator(*) ident(columns) operator(-) integer(1)operator(\)) operator({) operator(|)ident(item)operator(|) - ident(target) operator(=) operator(()ident(item) operator(%) ident(columns)operator(\)) operator(*) ident(rows) operator(+) operator(()ident(item) operator(/) ident(columns)operator(\)) - ident(eol) operator(=) operator(()operator(()ident(item)integer(+1)operator(\)) operator(%) ident(columns) operator(==) integer(0)operator(\)) - ident(piece) operator(=) ident(wordlist)operator([)ident(target)operator(]) operator(||) string - ident(piece) operator(=) ident(piece)operator(.)ident(ljust)operator(()ident(collen)operator(\)) reserved(unless) ident(eol) - ident(print) ident(piece) - ident(puts) reserved(if) ident(eol) - operator(}) - comment(# no need to finish it up, because eol is always true for the last element) - reserved(end) -reserved(end) - -comment(# get nr of chars that fit in window or console, see PLEAC 15.4) -comment(# not portable -- linux only (?\)) -reserved(def) method(getWinCharWidth)operator(()operator(\)) - ident(buf) operator(=) string operator(*) integer(8) - global_variable($stdout)operator(.)ident(ioctl)operator(()integer(0x5413)operator(,) ident(buf)operator(\)) - ident(ws_row)operator(,) ident(ws_col)operator(,) ident(ws_xpixel)operator(,) ident(ws_ypixel) operator(=) ident(buf)operator(.)ident(unpack)operator(()stringoperator(\)) - ident(ws_col) operator(||) integer(80) -reserved(rescue) - integer(80) -reserved(end) - -comment(# main program) -ident(cols) operator(=) ident(getWinCharWidth)operator(()operator(\)) -ident(formatter) operator(=) constant(WordFormatter)operator(.)ident(new)operator(()ident(cols)operator(\)) -ident(words) operator(=) ident(readlines)operator(()operator(\)) -ident(words)operator(.)ident(collect!) operator({) operator(|)ident(line)operator(|) - ident(line)operator(.)ident(chomp) -operator(}) -ident(formatter)operator(.)ident(output)operator(()ident(words)operator(\)) - - -comment(# @@PLEAC@@_4.19) -comment(# In ruby, Fixnum's are automatically converted to Bignum's when) -comment(# needed, so there is no need for an extra module) -reserved(def) method(factorial)operator(()ident(n)operator(\)) - ident(s) operator(=) integer(1) - reserved(while) ident(n) operator(>) integer(0) - ident(s) operator(*=) ident(n) - ident(n) operator(-=) integer(1) - reserved(end) - ident(s) -reserved(end) - -ident(puts) ident(factorial)operator(()integer(500)operator(\)) - -comment(#---------------------------------------------------------) -comment(# Example 4-3. tsc-permute) -comment(# tsc_permute: permute each word of input) -reserved(def) method(permute)operator(()ident(items)operator(,) ident(perms)operator(\)) - reserved(unless) ident(items)operator(.)ident(length) operator(>) integer(0) - ident(puts) ident(perms)operator(.)ident(join)operator(()stringoperator(\)) - reserved(else) - reserved(for) ident(i) reserved(in) ident(items) - ident(newitems) operator(=) ident(items)operator(.)ident(dup) - ident(newperms) operator(=) ident(perms)operator(.)ident(dup) - ident(newperms)operator(.)ident(unshift)operator(()ident(newitems)operator(.)ident(delete)operator(()ident(i)operator(\))operator(\)) - ident(permute)operator(()ident(newitems)operator(,) ident(newperms)operator(\)) - reserved(end) - reserved(end) -reserved(end) -comment(# In ruby the main program must be after all definitions it is using) -ident(permute)operator(()pre_constant(ARGV)operator(,) operator([)operator(])operator(\)) - -comment(#---------------------------------------------------------) -comment(# mjd_permute: permute each word of input) - -reserved(def) method(factorial)operator(()ident(n)operator(\)) - ident(s) operator(=) integer(1) - reserved(while) ident(n) operator(>) integer(0) - ident(s) operator(*=) ident(n) - ident(n) operator(-=) integer(1) - reserved(end) - ident(s) -reserved(end) - -comment(# we use a class with a class variable store the private cache) -comment(# for the results of the factorial function.) -reserved(class) class(Factorial) - class_variable(@@fact) operator(=) operator([) integer(1) operator(]) - reserved(def) constant(Factorial)operator(.)ident(compute)operator(()ident(n)operator(\)) - reserved(if) class_variable(@@fact)operator([)ident(n)operator(]) - class_variable(@@fact)operator([)ident(n)operator(]) - reserved(else) - class_variable(@@fact)operator([)ident(n)operator(]) operator(=) ident(n) operator(*) constant(Factorial)operator(.)ident(compute)operator(()ident(n) operator(-) integer(1)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -comment(#---------------------------------------------------------) -comment(# Example 4-4- mjd-permute) -comment(# n2pat(n, len\): produce the N-th pattern of length len) - -comment(# We must use a lower case letter as parameter N, otherwise it is) -comment(# handled as constant Length is the length of the resulting) -comment(# array, not the index of the last element (length -1\) like in) -comment(# the perl example.) -reserved(def) method(n2pat)operator(()ident(n)operator(,) ident(length)operator(\)) - ident(pat) operator(=) operator([)operator(]) - ident(i) operator(=) integer(1) - reserved(while) ident(i) operator(<=) ident(length) - ident(pat)operator(.)ident(push)operator(()ident(n) operator(%) ident(i)operator(\)) - ident(n) regexp 0 - perm -end - -def n2perm(n, len\) - pat2perm(n2pat(n,len\)\) -end - -# In ruby the main program must be after all definitions -while gets - data = split - # the perl solution has used $#data, which is length-1 - num_permutations = Factorial.compute(data.length(\)\) - 0.upto(num_permutations - 1\) do |i| - # in ruby we can not use an array as selector for an array - # but by exchanging the two arrays, we can use the collect method - # which returns an array with the result of all block invocations - permutation = n2perm(i, data.length\).collect { - |j| data[j] - } - puts permutation.join(" "\) - end -end - - -# @@PLEAC@@_5.0 -age = { "Nat", 24, - "Jules", 25, - "Josh", 17 } - -age["Nat"] = 24 -age["Jules"] = 25 -age["Josh"] = 17 - -food_color = { - "Apple" => "red", - "Banana" => "yellow", - "Lemon" => "yellow", - "Carrot" => "orange" - } - -# In Ruby, you cannot avoid the double or simple quoting -# while manipulatin hashes - - -# @@PLEAC@@_5.1 -hash[key] = value - -food_color["Raspberry"] = "pink" -puts "Known foods:", food_color.keys - - -# @@PLEAC@@_5.2 -# does hash have a value for key ? -if (hash.has_key?(key\)\) - # it exists -else - # it doesn't -end - -[ "Banana", "Martini" ].each { |name| - print name, " is a ", food_color.has_key?(name\) ? "food" : "drink", ")char(\\n)content(" -} - -age = {} -age['Toddler'] = 3 -age['Unborn'] = 0 -age['Phantasm'] = nil - -for thing in ['Toddler', 'Unborn', 'Phantasm', 'Relic'] - print ")inlinecontent(: " - print "Has-key " if age.has_key?(thing\) - print "True " if age[thing] - print "Nonzero " if age[thing] && age[thing].nonzero? - print ")char(\\n)content(" -end - -#=> -# Toddler: Has-key True Nonzero -# Unborn: Has-key True -# Phantasm: Has-key -# Relic: - -# You use Hash#has_key? when you use Perl's exists -> it checks -# for existence of a key in a hash. -# All Numeric are "True" in ruby, so the test doesn't have the -# same semantics as in Perl; you would use Numeric#nonzero? to -# achieve the same semantics (false if 0, true otherwise\). - - -# @@PLEAC@@_5.3 -food_color.delete("Banana"\) - - -# @@PLEAC@@_5.4 -hash.each { |key, value| - # do something with key and value -} - -hash.each_key { |key| - # do something with key -} - -food_color.each { |food, color| - puts ")inlinecontent( is )inlinecontent(" -} - -food_color.each_key { |food| - puts ")inlinecontent( is )inlinecontent(" -} - -# IMO this demonstrates that OO style is by far more readable -food_color.keys.sort.each { |food| - puts ")inlinecontent( is )inlinecontent(." -} - -#----------------------------- -#!)delimiter(/)modifier(us)>ident(r)operator(/)ident(bin)operator(/)ident(ruby) -comment(# countfrom - count number of messages from each sender) - -comment(# Default value is 0) -ident(from) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(while) ident(gets) - regexp reserved(and) ident(from)operator([)global_variable($1)operator(]) operator(+=) integer(1) -reserved(end) - -comment(# More useful to sort by number of received mail by person) -ident(from)operator(.)ident(sort) operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(])operator(<=>)ident(a)operator([)integer(1)operator(])operator(})operator(.)ident(each) operator({) operator(|)ident(v)operator(|) - ident(puts) stringcontent(: )inlinedelimiter(")> -operator(}) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_5.5) -comment(# You may use the built-in 'inspect' method this way:) -ident(p) ident(hash) - -comment(# Or do it the Cookbook way:) -ident(hash)operator(.)ident(each) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) - -comment(# Sorted by keys) -ident(hash)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) -comment(# Sorted by values) -ident(hash)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(])operator(<=>)ident(b)operator([)integer(1)operator(])operator(})operator(.)ident(each) operator({) operator(|)ident(e)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) - - -comment(# @@PLEAC@@_5.7) -ident(ttys) operator(=) constant(Hash)operator(.)ident(new) -reserved(for) ident(i) reserved(in) shell - ident(user)operator(,) ident(tty) operator(=) ident(i)operator(.)ident(split) - operator(()ident(ttys)operator([)ident(user)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(tty) comment(# see problems_ruby for more infos) -reserved(end) -ident(ttys)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(k)operator(|) - ident(puts) stringcontent(: )inlinedelimiter(")> comment(# from 4.2) -operator(}) - - -comment(# @@PLEAC@@_5.8) -ident(surname) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) -ident(puts) ident(surname)operator(.)ident(index)operator(()stringoperator(\)) - -comment(# If you really needed to 'invert' the whole hash, use Hash#invert) - -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# foodfind - find match for food or color) - -ident(given) operator(=) pre_constant(ARGV)operator(.)ident(shift) reserved(or) ident(raise) string - -ident(color) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) -operator(}) - -reserved(if) operator(()ident(color)operator(.)ident(has_key?)operator(()ident(given)operator(\))operator(\)) - ident(puts) stringcontent( is a food with color )inlinecontent(.)delimiter(")> -reserved(end) -reserved(if) operator(()ident(color)operator(.)ident(has_value?)operator(()ident(given)operator(\))operator(\)) - ident(puts) stringcontent( is a food with color )inlinecontent(.)delimiter(")> -reserved(end) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_5.9) -comment(# Sorted by keys (Hash#sort gives an Array of pairs made of each key,value\)) -ident(food_color)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(f)operator(|) - ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> -operator(}) - -comment(# Sorted by values) -ident(food_color)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(]) operator(})operator(.)ident(each) operator({) operator(|)ident(f)operator(|) - ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> -operator(}) - -comment(# Sorted by length of values) -ident(food_color)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(])operator(.)ident(length) operator(<=>) ident(b)operator([)integer(1)operator(])operator(.)ident(length) operator(})operator(.)ident(each) operator({) operator(|)ident(f)operator(|) - ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> -operator(}) - - -comment(# @@PLEAC@@_5.10) -ident(merged) operator(=) ident(a)operator(.)ident(clone)operator(.)ident(update)operator(()ident(b)operator(\)) comment(# because Hash#update changes object in place) - -ident(drink_color) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) -ident(ingested_color) operator(=) ident(drink_color)operator(.)ident(clone)operator(.)ident(update)operator(()ident(food_color)operator(\)) - -ident(substance_color) operator(=) operator({)operator(}) -reserved(for) ident(i) reserved(in) operator([) ident(food_color)operator(,) ident(drink_color) operator(]) - ident(i)operator(.)ident(each_key) operator({) operator(|)ident(k)operator(|) - reserved(if) ident(substance_color)operator(.)ident(has_key?)operator(()ident(k)operator(\)) - ident(puts) stringcontent( seen twice. Using the first definition.)delimiter(")> - reserved(next) - reserved(end) - ident(substance_color)operator([)ident(k)operator(]) operator(=) integer(1) - operator(}) -reserved(end) - - -comment(# @@PLEAC@@_5.11) -ident(common) operator(=) ident(hash1)operator(.)ident(keys) operator(&) ident(hash2)operator(.)ident(keys) - -ident(this_not_that) operator(=) ident(hash1)operator(.)ident(keys) operator(-) ident(hash2)operator(.)ident(keys) - - -comment(# @@PLEAC@@_5.12) -comment(# no problem here, Ruby handles any kind of object for key-ing) -comment(# (it takes Object#hash, which defaults to Object#id\)) - - -comment(# @@PLEAC@@_5.13) -comment(# AFAIK, not possible in Ruby) - - -comment(# @@PLEAC@@_5.14) -comment(# Be careful, the following is possible only because Fixnum objects are) -comment(# special (documentation says: there is effectively only one Fixnum object) -comment(# instance for any given integer value\).) -ident(count) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -ident(array)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) - ident(count)operator([)ident(e)operator(]) operator(+=) integer(1) -operator(}) - - -comment(# @@PLEAC@@_5.15) -ident(father) operator(=) operator({) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) - string operator(,) stringoperator(,) -operator(}) - -reserved(while) ident(gets) - ident(chomp) - reserved(begin) - ident(print) global_variable($_)operator(,) string - reserved(end) reserved(while) global_variable($_) operator(=) ident(father)operator([)global_variable($_)operator(]) - ident(puts) -reserved(end) - -ident(children) operator(=) operator({)operator(}) -ident(father)operator(.)ident(each) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) - operator(()ident(children)operator([)ident(v)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(k) -operator(}) -reserved(while) ident(gets) - ident(chomp) - ident(puts) stringcontent( begat )inlineoperator(])operator(\))operator(.)ident(join)operator(()stringoperator(\))delimiter(})>content(.)char(\\n)delimiter(")> -reserved(end) - -ident(includes) operator(=) operator({)operator(}) -ident(files)operator(.)ident(each) operator({) operator(|)ident(f)operator(|) - reserved(begin) - reserved(for) ident(l) reserved(in) constant(IO)operator(.)ident(readlines)operator(()ident(f)operator(\)) - reserved(next) reserved(unless) ident(l) operator(=)operator(~) regexp]+\)>)delimiter(/)> - operator(()ident(includes)operator([)global_variable($1)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(f) - reserved(end) - reserved(rescue) constant(SystemCallError) - global_variable($stderr)operator(.)ident(puts) string - reserved(end) -operator(}) - -ident(include_free) operator(=) ident(includes)operator(.)ident(values)operator(.)ident(flatten)operator(.)ident(uniq) operator(-) ident(includes)operator(.)ident(keys) - - -comment(# @@PLEAC@@_5.16) -comment(# dutree - print sorted intented rendition of du output) -comment(#% dutree) -comment(#% dutree /usr) -comment(#% dutree -a) -comment(#% dutree -a /bin) - -comment(# The DuNode class collects all information about a directory,) -comment(# and provides some convenience methods) -reserved(class) class(DuNode) - - ident(attr_reader) symbol(:name) - ident(attr_accessor) symbol(:size) - ident(attr_accessor) symbol(:kids) - - reserved(def) method(initialize)operator(()ident(name)operator(\)) - instance_variable(@name) operator(=) ident(name) - instance_variable(@kids) operator(=) operator([)operator(]) - instance_variable(@size) operator(=) integer(0) - reserved(end) - - comment(# support for sorting nodes with side) - reserved(def) method(size_compare)operator(()ident(node2)operator(\)) - instance_variable(@size) operator(<=>) ident(node2)operator(.)ident(size) - reserved(end) - - reserved(def) method(basename) - instance_variable(@name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - - comment(#returns substring before last "/", nil if not there) - reserved(def) method(parent) - ident(p) operator(=) instance_variable(@name)operator(.)ident(sub)operator(()regexpoperator(,)stringoperator(\)) - reserved(if) ident(p) operator(==) instance_variable(@name) - pre_constant(nil) - reserved(else) - ident(p) - reserved(end) - reserved(end) - -reserved(end) - -comment(# The DuTree does the acdtual work of) -comment(# getting the input, parsing it, builging up a tree) -comment(# and format it for output) -reserved(class) class(Dutree) - - ident(attr_reader) symbol(:topdir) - - reserved(def) method(initialize) - instance_variable(@nodes) operator(=) constant(Hash)operator(.)ident(new) - instance_variable(@dirsizes) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) - instance_variable(@kids) operator(=) constant(Hash)operator(.)ident(new)operator(()operator([)operator(])operator(\)) - reserved(end) - - comment(# get a node by name, create it if it does not exist yet) - reserved(def) method(get_create_node)operator(()ident(name)operator(\)) - reserved(if) instance_variable(@nodes)operator(.)ident(has_key?)operator(()ident(name)operator(\)) - instance_variable(@nodes)operator([)ident(name)operator(]) - reserved(else) - ident(node) operator(=) constant(DuNode)operator(.)ident(new)operator(()ident(name)operator(\)) - instance_variable(@nodes)operator([)ident(name)operator(]) operator(=) ident(node) - ident(node) - reserved(end) - reserved(end) - - comment(# run du, read in input, save sizes and kids) - comment(# stores last directory read in instance variable topdir) - reserved(def) method(input)operator(()ident(arguments)operator(\)) - ident(name) operator(=) string - ident(cmd) operator(=) string operator(+) ident(arguments)operator(.)ident(join)operator(()stringoperator(\)) - constant(IO)operator(.)ident(popen)operator(()ident(cmd)operator(\)) operator({) operator(|)ident(pipe)operator(|) - ident(pipe)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(size)operator(,) ident(name) operator(=) ident(line)operator(.)ident(chomp)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) - ident(node) operator(=) ident(get_create_node)operator(()ident(name)operator(\)) - ident(node)operator(.)ident(size) operator(=) ident(size)operator(.)ident(to_i) - instance_variable(@nodes)operator([)ident(name)operator(]) operator(=) ident(node) - ident(parent) operator(=) ident(node)operator(.)ident(parent) - reserved(if) ident(parent) - ident(get_create_node)operator(()ident(parent)operator(\))operator(.)ident(kids)operator(.)ident(push)operator(()ident(node)operator(\)) - reserved(end) - operator(}) - operator(}) - instance_variable(@topdir) operator(=) instance_variable(@nodes)operator([)ident(name)operator(]) - reserved(end) - - comment(# figure out how much is taken in each directory) - comment(# that isn't stored in the subdirectories. Add a new) - comment(# fake kid called "." containing that much.) - reserved(def) method(get_dots)operator(()ident(node)operator(\)) - ident(cursize) operator(=) ident(node)operator(.)ident(size) - reserved(for) ident(kid) reserved(in) ident(node)operator(.)ident(kids) - ident(cursize) operator(-=) ident(kid)operator(.)ident(size) - ident(get_dots)operator(()ident(kid)operator(\)) - reserved(end) - reserved(if) ident(node)operator(.)ident(size) operator(!=) ident(cursize) - ident(newnode) operator(=) ident(get_create_node)operator(()ident(node)operator(.)ident(name) operator(+) stringoperator(\)) - ident(newnode)operator(.)ident(size) operator(=) ident(cursize) - ident(node)operator(.)ident(kids)operator(.)ident(push)operator(()ident(newnode)operator(\)) - reserved(end) - reserved(end) - - comment(# recursively output everything) - comment(# passing padding and number width as well) - comment(# on recursive calls) - reserved(def) method(output)operator(()ident(node)operator(,) ident(prefix)operator(=)stringoperator(,) ident(width)operator(=)integer(0)operator(\)) - ident(line) operator(=) ident(sprintf)operator(()stringcontent(d %s)delimiter(")>operator(,) ident(node)operator(.)ident(size)operator(,) ident(node)operator(.)ident(basename)operator(\)) - ident(puts)operator(()ident(prefix) operator(+) ident(line)operator(\)) - ident(prefix) operator(+=) ident(line)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) - ident(prefix)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(if) ident(node)operator(.)ident(kids)operator(.)ident(length) operator(>) integer(0) comment(# not a bachelor node) - ident(kids) operator(=) ident(node)operator(.)ident(kids) - ident(kids)operator(.)ident(sort!) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) - ident(b)operator(.)ident(size_compare)operator(()ident(a)operator(\)) - operator(}) - ident(width) operator(=) ident(kids)operator([)integer(0)operator(])operator(.)ident(size)operator(.)ident(to_s)operator(.)ident(length) - reserved(for) ident(kid) reserved(in) ident(kids) - ident(output)operator(()ident(kid)operator(,) ident(prefix)operator(,) ident(width)operator(\)) - reserved(end) - reserved(end) - reserved(end) - -reserved(end) - -ident(tree) operator(=) constant(Dutree)operator(.)ident(new) -ident(tree)operator(.)ident(input)operator(()pre_constant(ARGV)operator(\)) -ident(tree)operator(.)ident(get_dots)operator(()ident(tree)operator(.)ident(topdir)operator(\)) -ident(tree)operator(.)ident(output)operator(()ident(tree)operator(.)ident(topdir)operator(\)) - - -comment(# @@PLEAC@@_6.0) -comment(# The verbose version are match, sub, gsub, sub! and gsub!;) -comment(# pattern needs to be a Regexp object; it yields a MatchData) -comment(# object.) -ident(pattern)operator(.)ident(match)operator(()ident(string)operator(\)) -ident(string)operator(.)ident(sub)operator(()ident(pattern)operator(,) ident(replacement)operator(\)) -ident(string)operator(.)ident(gsub)operator(()ident(pattern)operator(,) ident(replacement)operator(\)) -comment(# As usual in Ruby, sub! does the same as sub but also modifies) -comment(# the object, the same for gsub!/gsub.) - -comment(# Sugared syntax yields the position of the match (or nil if no) -comment(# match\). Note that the object at the right of the operator needs) -comment(# not to be a Regexp object (it can be a String\). The "dont) -comment(# match" operator yields true or false.) -ident(meadow) operator(=)operator(~) regexp comment(# position of the match, nil if no match) -ident(meadow) operator(!)operator(~) regexp comment(# true if doesn't match, false if it does) -comment(# There is no sugared version for the substitution) - -ident(meadow) operator(=)operator(~) regexp reserved(and) ident(print) string - -ident(string) operator(=) string -ident(string)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - -comment(# % echo ababacaca | ruby -ne 'puts $& if /(a|ba|b\)+(a|ac\)+/') -comment(# ababa) - -comment(# The "global" (or "multiple"\) match is handled by String#scan) -ident(scan) operator(()regexpoperator(\)) operator({) - ident(puts) stringdelimiter(")> -operator(}) - -comment(# String#scan yields an Array if not used with a block) -ident(numbers) operator(=) ident(scan)operator(()regexpoperator(\)) - -ident(digits) operator(=) string -ident(nonlap) operator(=) ident(digits)operator(.)ident(scan)operator(()regexpoperator(\)) -ident(yeslap) operator(=) ident(digits)operator(.)ident(scan)operator(()regexpoperator(\)) -ident(puts) stringoperator(\))delimiter(})>delimiter(")> -ident(puts) stringoperator(\))delimiter(})>delimiter(")>operator(;) -comment(# Non-overlapping: 123 456 789) -comment(# Overlapping: 123 234 345 456 567 678 789) - -ident(string) operator(=) string -ident(string) operator(=)operator(~) regexp -ident(puts) string -comment(# (And \) (little lambs\) ( eat ivy\)) - - -comment(# @@PLEAC@@_6.1) -comment(# Ruby doesn't have the same problem:) -ident(dst) operator(=) ident(src)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) - -ident(progname) operator(=) global_variable($0)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) - -ident(bindirs) operator(=) string -ident(libdirs) operator(=) ident(bindirs)operator(.)ident(map) operator({) operator(|)ident(l)operator(|) ident(l)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) operator(}) - - -comment(# @@PLEAC@@_6.3) -regexp comment(# as many non-whitespace bytes as possible) -regexp comment(# as many letters, apostrophes, and hyphens) - -regexp comment(# usually best) -regexp comment(# fails at ends or w/ punctuation) - - -comment(# @@PLEAC@@_6.4) -ident(require) string -ident(str) operator(=) string -ident(re) operator(=) regexp comment(# /x for nice formatting) - -ident(str)operator(.)ident(gsub!) ident(re) reserved(do) comment(# pass a block to execute replacement) - ident(host) operator(=) constant(TCPsocket)operator(.)ident(gethostbyname)operator(()global_variable($1)operator(\)) - stringcontent( [)inlinecontent(])delimiter(")> -reserved(end) - -ident(puts) ident(str) -comment(#-----------------------------) -comment(# to match whitespace or #-characters in an extended re you need to escape) -comment(# them.) - -ident(foo) operator(=) integer(42) -ident(str) operator(=) string -ident(str)operator(.)ident(gsub!) regexp reserved(do) - ident(eval) global_variable($1) comment(# with the value of a local variable) - reserved(end) -ident(puts) ident(str) comment(# => blah 42 blah) - - -comment(# @@PLEAC@@_6.5) -comment(# The 'g' modifier doesn't exist in Ruby, a regexp can't be used) -comment(# directly in a while loop; instead, use String#scan { |match| .. } ) -ident(fish) operator(=) string -constant(WANT) operator(=) integer(3) -ident(count) operator(=) integer(0) -ident(fish)operator(.)ident(scan)operator(()regexpoperator(\)) operator({) - reserved(if) operator(()ident(count) operator(+=) integer(1)operator(\)) operator(==) constant(WANT) - ident(puts) stringcontent( one.)delimiter(")> - reserved(end) -operator(}) - -reserved(if) ident(fish) operator(=)operator(~) regexp - ident(puts) stringcontent( one.)delimiter(")> -reserved(end) - -ident(pond) operator(=) string -comment(# String#scan without a block gives an array of matches, each match) -comment(# being an array of all the specified groups) -ident(colors) operator(=) ident(pond)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten) comment(# get all matches) -ident(color) operator(=) ident(colors)operator([)integer(2)operator(]) comment(# then the one we want) -comment(# or without a temporary array) -ident(color) operator(=) ident(pond)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten)operator([)integer(2)operator(]) comment(# just grab element 3) -ident(puts) stringcontent(.)delimiter(")> - -ident(count) operator(=) integer(0) -ident(fishes) operator(=) string -ident(evens) operator(=) ident(fishes)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(select) operator({) operator(()ident(count)operator(+=)integer(1)operator(\)) operator(%) integer(2) operator(==) integer(0) operator(}) -ident(print) stringoperator(\))delimiter(})>content(.)delimiter(")> - -ident(count) operator(=) integer(0) -ident(fishes)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) - reserved(if) operator(()ident(count) operator(+=) integer(1)operator(\)) operator(==) integer(4) - string operator(+) global_variable($2) - reserved(else) - global_variable($1) operator(+) global_variable($2) - reserved(end) -operator(}) - -ident(pond) operator(=) string -ident(puts) stringoperator(\))operator(.)ident(flatten)operator([)integer(-1)operator(])delimiter(})>delimiter(")> - -regexp - -comment(# The "s" perl modifier is "m" in Ruby (not very nice since there is) -comment(# also an "m" in perl..\)) -ident(pond) operator(=) string -reserved(if) operator(()ident(pond) operator(=)operator(~) regexpoperator(\)) - ident(puts) stringcontent(.)delimiter(")> -reserved(else) - ident(puts) string -reserved(end) - - -comment(# @@PLEAC@@_6.6) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# killtags - very bad html killer) -global_variable($/) operator(=) pre_constant(nil)operator(;) comment(# each read is whole file) -reserved(while) ident(file) operator(=) ident(gets)operator(()operator(\)) reserved(do) - ident(file)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\))operator(;) comment(# strip tags (terribly\)) - ident(puts) ident(file) comment(# print file to STDOUT) -reserved(end) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(#headerfy - change certain chapter headers to html) -global_variable($/) operator(=) string -reserved(while) ident(file) operator(=) ident(gets)operator(()operator(\)) reserved(do) - ident(pattern) operator(=) regexp - ident(puts) ident(file)operator(.)ident(gsub)operator(()ident(pattern)operator(,)string)content(\\1)content()delimiter(')>operator(\)) -reserved(end) -comment(#-----------------------------) -comment(#% ruby -00pe "gsub!(/\\A(Chapter\\s+\\d+\\s*:.*\)/,'

\\1

'\)" datafile) - -comment(#!/usr/bin/ruby -w) -comment(#-----------------------------) -reserved(for) ident(file) reserved(in) pre_constant(ARGV) - ident(file) operator(=) constant(File)operator(.)ident(open)operator(()pre_constant(ARGV)operator(.)ident(shift)operator(\)) - reserved(while) ident(file)operator(.)ident(gets)operator(()stringoperator(\)) reserved(do) comment(# each read is a paragraph) - ident(print) stringcontent( in $ARGV has <<)inlinecontent(>>)char(\\n)delimiter(")> reserved(while) regexp - reserved(end) comment(# /m activates the multiline mode) -reserved(end) -comment(#-----------------------------) - -comment(# @@PLEAC@@_6.7) -comment(#-----------------------------) -global_variable($/) operator(=) pre_constant(nil)operator(;) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()stringoperator(\)) -ident(chunks) operator(=) ident(file)operator(.)ident(gets)operator(.)ident(split)operator(()regexpoperator(\)) -comment(#-----------------------------) -comment(# .Ch, .Se and .Ss divide chunks of STDIN) -ident(chunks) operator(=) ident(gets)operator(()pre_constant(nil)operator(\))operator(.)ident(split)operator(()regexpoperator(\)) -ident(print) stringcontent( chunks.)char(\\n)delimiter(")> -comment(#-----------------------------) - - -comment(# @@PLEAC@@_6.8) -reserved(while) ident(gets) - reserved(if) operator(~)regexp operator(..) operator(~)regexp - comment(# line falls between BEGIN and END inclusive) - reserved(end) -reserved(end) - -reserved(while) ident(gets) - reserved(if) operator(()global_variable($.) operator(==) ident(firstnum)operator(\)) operator(..) operator(()global_variable($.) operator(==) ident(lastnum)operator(\)) - comment(# operate between firstnum and lastnum line number) - reserved(end) -reserved(end) - -comment(# in ruby versions prior to 1.8, the above two conditional) -comment(# expressions could be shortened to:) -comment(# if /BEGIN/ .. /END/) -comment(# and) -comment(# if firstnum .. lastnum) -comment(# but these now only work this way from the command line ) - -comment(#-----------------------------) - -reserved(while) ident(gets) - reserved(if) operator(~)regexp operator(...) operator(~)regexp - comment(# line falls between BEGIN and END on different lines) - reserved(end) -reserved(end) - -reserved(while) ident(gets) - reserved(if) operator(()global_variable($.) operator(==) ident(first)operator(\)) operator(...) operator(()global_variable($.) operator(==) ident(last)operator(\)) - comment(# operate between first and last line number on different lines) - reserved(end) -reserved(end) - -comment(#-----------------------------) -comment(# command-line to print lines 15 through 17 inclusive (see below\)) -ident(ruby) operator(-)ident(ne) string ident(datafile) - -comment(# print out all .. displays from HTML doc) -reserved(while) ident(gets) - ident(print) reserved(if) operator(~)regexp)delimiter(#)modifier(i)> operator(..) operator(~)regexp)delimiter(#)modifier(i)>operator(;) -reserved(end) - -comment(# same, but as shell command) -comment(# ruby -ne 'print if %r##i .. %r##i' document.html) -comment(#-----------------------------) -comment(# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \\) -comment(# print if $top .. $bottom' /etc/passwd # FAILS) -comment(# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \\) -comment(# print if $. == $top .. $. == $bottom' /etc/passwd # works) -comment(# ruby -ne 'print if 3 .. 5' /etc/passwd # also works) -comment(#-----------------------------) -ident(print) reserved(if) operator(~)regexp operator(..) operator(~)regexpoperator(;) -ident(print) reserved(if) operator(~)regexp operator(...) operator(~)regexpoperator(;) -comment(#-----------------------------) -reserved(while) ident(gets) - global_variable($in_header) operator(=) global_variable($.) operator(==) integer(1) operator(..) operator(~)regexp operator(?) pre_constant(true) operator(:) pre_constant(false) - global_variable($in_body) operator(=) operator(~)regexp operator(..) pre_constant(ARGF)operator(.)ident(eof) operator(?) pre_constant(true) operator(:) pre_constant(false) -reserved(end) -comment(#-----------------------------) -ident(seen) operator(=) operator({)operator(}) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - reserved(next) reserved(unless) ident(line) operator(=)operator(~) regexp operator(..) ident(line) operator(=)operator(~) regexpoperator(;) - ident(line)operator(.)ident(scan)operator(()regexp(\),;)char(\\s)content(]+)char(\\@)content([^<>(\),;)char(\\s)content(]+\))delimiter(/)>operator(\))operator(.)ident(each) reserved(do) operator(|)ident(addr)operator(|) - ident(puts) ident(addr) reserved(unless) ident(seen)operator([)ident(addr)operator(]) - ident(seen)operator([)ident(addr)operator(]) operator(||=) integer(1) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_6.9) -reserved(def) method(glob2pat)operator(()ident(globstr)operator(\)) - ident(patmap) operator(=) operator({) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - operator(}) - ident(globstr)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(c)operator(|) ident(patmap)operator([)ident(c)operator(]) operator(||) constant(Regexp)operator(::)ident(escape)operator(()ident(c)operator(\)) operator(}) - string operator(+) ident(globstr) operator(+) string -reserved(end) - - -comment(# @@PLEAC@@_6.10) -comment(# avoid interpolating patterns like this if the pattern) -comment(# isn't going to change:) -ident(pattern) operator(=) pre_constant(ARGV)operator(.)ident(shift) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)> -reserved(end) - -comment(# the above creates a new regex each iteration. Instead,) -comment(# use the /o modifier so the regex is compiled only once) - -ident(pattern) operator(=) pre_constant(ARGV)operator(.)ident(shift) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)modifier(o)> -reserved(end) - -comment(#-----------------------------) - -comment(#!/usr/bin/ruby) -comment(# popgrep1 - grep for abbreviations of places that say "pop") -comment(# version 1: slow but obvious way) -ident(popstates) operator(=) string -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) - reserved(if) ident(line) operator(=)operator(~) regexpchar(\\b)delimiter(/)> - ident(print) ident(line) - ident(last) - reserved(end) - reserved(end) -reserved(end) - -comment(#-----------------------------) -comment(#!/usr/bin/ruby) -comment(# popgrep2 - grep for abbreviations of places that say "pop") -comment(# version 2: eval strings; fast but hard to quote) -ident(popstates) operator(=) string -ident(code) operator(=) string -ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) - ident(code) operator(+=) stringchar(\\\\)content(b/; print(line\); next; end)char(\\n)delimiter(")> -reserved(end) -ident(code) operator(+=) string -ident(print) stringchar(\\n)content(---)char(\\n)delimiter(")> reserved(if) pre_constant(false) comment(# turn on for debugging) -ident(eval) ident(code) - -comment(# CODE IS) -comment(# ---) -comment(# ARGF.each do |line|) -comment(# if line =~ /\\bCO\\b/; print(line\); next; end) -comment(# if line =~ /\\bON\\b/; print(line\); next; end) -comment(# if line =~ /\\bMI\\b/; print(line\); next; end) -comment(# if line =~ /\\bWI\\b/; print(line\); next; end) -comment(# if line =~ /\\bMN\\b/; print(line\); next; end) -comment(# end) -comment(# ) -comment(# ---) - -comment(## alternatively, the same idea as above but compiling ) -comment(## to a case statement: (not in perlcookbook\)) -comment(#!/usr/bin/ruby -w) -comment(# popgrep2.5 - grep for abbreviations of places that say "pop") -comment(# version 2.5: eval strings; fast but hard to quote) -ident(popstates) operator(=) string -ident(code) operator(=) string -ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) - ident(code) operator(+=) stringchar(\\\\)content(b/ : print line)char(\\n)delimiter(")> -reserved(end) -ident(code) operator(+=) string -ident(print) stringchar(\\n)content(---)char(\\n)delimiter(")> reserved(if) pre_constant(false) comment(# turn on for debugging) -ident(eval) ident(code) - -comment(# CODE IS) -comment(# ---) -comment(# ARGF.each do |line|) -comment(# case line) -comment(# when /\\bCO\\b/ : print line) -comment(# when /\\bON\\b/ : print line) -comment(# when /\\bMI\\b/ : print line) -comment(# when /\\bWI\\b/ : print line) -comment(# when /\\bMN\\b/ : print line) -comment(# end) -comment(# end) -comment(# ) -comment(# ---) - -comment(# Note: (above\) Ruby 1.8+ allows the 'when EXP : EXPR' on one line) -comment(# with the colon separator.) - -comment(#-----------------------------) -comment(#!/usr/bin/ruby) -comment(# popgrep3 - grep for abbreviations of places that say "pop") -comment(# version3: build a match_any function) -ident(popstates) operator(=) string -ident(expr) operator(=) ident(popstates)operator(.)ident(map)operator({)operator(|)ident(e)operator(|)stringchar(\\\\)content(b/)delimiter(")>operator(})operator(.)ident(join)operator(()stringoperator(\)) -ident(eval) stringcontent(;end)delimiter(")> -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(match_any)operator(()ident(line)operator(\)) -reserved(end) -comment(#-----------------------------) - -comment(## building a match_all function is a trivial) -comment(## substitution of && for ||) -comment(## here is a generalized example:) -comment(#!/usr/bin/ruby -w) -comment(## grepauth - print lines that mention both foo and bar) -reserved(class) class(MultiMatch) - reserved(def) method(initialize)operator(()operator(*)ident(patterns)operator(\)) - ident(_any) operator(=) ident(build_match)operator(()stringoperator(,)ident(patterns)operator(\)) - ident(_all) operator(=) ident(build_match)operator(()stringoperator(,)ident(patterns)operator(\)) - ident(eval) stringcontent(;end)char(\\n)delimiter(")> - ident(eval) stringcontent(;end)char(\\n)delimiter(")> - reserved(end) - reserved(def) method(build_match)operator(()ident(sym)operator(,)ident(args)operator(\)) - ident(args)operator(.)ident(map)operator({)operator(|)ident(e)operator(|)stringcontent(/)delimiter(")>operator(})operator(.)ident(join)operator(()ident(sym)operator(\)) - reserved(end) -reserved(end) - -ident(mm) operator(=) constant(MultiMatch)operator(.)ident(new)operator(()stringoperator(,)stringoperator(\)) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(mm)operator(.)ident(match_all)operator(()ident(line)operator(\)) -reserved(end) -comment(#-----------------------------) - -comment(#!/usr/bin/ruby) -comment(# popgrep4 - grep for abbreviations of places that say "pop") -comment(# version4: pretty fast, but simple: compile all re's first:) -ident(popstates) operator(=) string -ident(popstates) operator(=) ident(popstates)operator(.)ident(map)operator({)operator(|)ident(re)operator(|) regexpchar(\\b)delimiter(/)>operator(}) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state_re)operator(|) - reserved(if) ident(line) operator(=)operator(~) ident(state_re) - ident(print) ident(line) - reserved(break) - reserved(end) - reserved(end) -reserved(end) - -comment(## speeds trials on the jargon file(412\): 26006 lines, 1.3MB) -comment(## popgrep1 => 7.040s) -comment(## popgrep2 => 0.656s) -comment(## popgrep2.5 => 0.633s) -comment(## popgrep3 => 0.675s) -comment(## popgrep4 => 1.027s) - -comment(# unless speed is criticial, the technique in popgrep4 is a) -comment(# reasonable balance between speed and logical simplicity.) - - -comment(# @@PLEAC@@_6.11) -reserved(begin) - ident(print) string - ident(pat) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) - constant(Regexp)operator(.)ident(new)operator(()ident(pat)operator(\)) -reserved(rescue) - ident(warn) string - reserved(retry) -reserved(end) - - -comment(# @@PLEAC@@_6.13) -comment(# uses the 'amatch' extension found on:) -comment(# http://raa.ruby-lang.org/project/amatch/) -ident(require) string -ident(matcher) operator(=) constant(Amatch)operator(.)ident(new)operator(()stringoperator(\)) -comment(#$relative, $distance = 0, 1) -constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each_line) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(matcher)operator(.)ident(search)operator(()ident(line)operator(\)) operator(<=) integer(1) -reserved(end) -comment(__END__ -)comment(#CODE) -ident(ballast) -ident(ballasts) -ident(balustrade) -ident(balustrades) -ident(blast) -ident(blasted) -ident(blaster) -ident(blasters) -ident(blasting) -ident(blasts) - - -comment(# @@PLEAC@@_6.14) -ident(str)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(token)operator(|) - ident(puts) stringdelimiter(")> -reserved(end) -comment(#-----------------------------) -ident(n) operator(=) string -ident(n)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -ident(puts) ident(n) -comment(#-----------------------------) -ident(str) operator(=) string -ident(str)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(num)operator(|) - ident(puts) stringdelimiter(")> -reserved(end) -comment(#-----------------------------) -comment(# Ruby doesn't have the String.pos or a /c re modifier like Perl ) -comment(# But it does have StringScanner in the standard library (strscn\)) -comment(# which allows similar functionality:) - -ident(require) string -ident(text) operator(=) string -ident(sc) operator(=) constant(StringScanner)operator(.)ident(new)operator(()ident(text)operator(\)) -reserved(while) ident(sc)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(print) stringchar(\\n)delimiter(")> -reserved(end) -reserved(if) ident(sc)operator(.)ident(scan)operator(()regexpoperator(\)) - ident(puts) stringcontent( after last number)delimiter(")> -reserved(end) -comment(#-----------------------------) -comment(# assuming continuing from above:) -ident(puts) stringdelimiter(")> -ident(sc)operator(.)ident(pos) operator(=) integer(30) -ident(puts) stringdelimiter(")> - - -comment(# @@PLEAC@@_6.15) -comment(#-----------------------------) -comment(# greedy pattern) -ident(str)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\)) comment(# not good) - -comment(# non-greedy (minimal\) pattern) -ident(str)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\)) comment(# not great) - - -comment(#-----------------------------) -comment(#this and that are important Oh, me too!) -comment(#-----------------------------) -regexp(.*?\) )delimiter(})modifier(mx)> -comment(#-----------------------------) -regexp -comment(#-----------------------------) -regexp( (?: (?!|\). \)* \) )delimiter(})modifier(mx)> -comment(#-----------------------------) -regexp( (?: (?!\). \)* \) )delimiter(})modifier(mx)> -comment(#-----------------------------) -regexp - [^<]* # stuff not possibly bad, and not possibly the end. - (?: - # at this point, we can have '<' if not part of something bad - (?! \) # what we can't have - < # okay, so match the '<' - [^<]* # and continue with more safe stuff - \) * - - )delimiter(})modifier(mx)> - - -comment(# @@PLEAC@@_6.16) -comment(#-----------------------------) -global_variable($/) operator(=) string -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) - ident(para)operator(.)ident(scan) regexp reserved(do) - ident(puts) stringcontent(' at paragraph )inlinedelimiter(")> - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(astr) operator(=) string -ident(bstr) operator(=) string -reserved(if) stringcontent( )inlinedelimiter(")> operator(=)operator(~) regexp - ident(print) stringcontent( overlaps in )inlinecontent(-)inlinecontent(-)inlinedelimiter(")> -reserved(end) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# prime_pattern -- find prime factors of argument using patterns) -pre_constant(ARGV) operator(<<) integer(180) -ident(cap) operator(=) string operator(*) pre_constant(ARGV)operator(.)ident(shift) -reserved(while) ident(cap) operator(=)operator(~) regexp - ident(print) global_variable($1)operator(.)ident(size)operator(,) string - ident(cap)operator(.)ident(gsub!)operator(()regexpdelimiter(/)>operator(,)stringoperator(\)) -reserved(end) -ident(puts) ident(cap)operator(.)ident(size) -comment(#-----------------------------) -comment(#diophantine) -comment(# solve for 12x + 15y + 16z = 281, maximizing x) -reserved(if) operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) - ident(x)operator(,) ident(y)operator(,) ident(z) operator(=) global_variable($1)operator(.)ident(size)operator(,) global_variable($2)operator(.)ident(size)operator(,) global_variable($3)operator(.)ident(size) - ident(puts) stringcontent(; y=)inlinecontent(; z=)inlinedelimiter(")> -reserved(else) - ident(puts) string -reserved(end) -comment(# => One solution is: x=17; y=3; z=2) - -comment(#-----------------------------) -comment(# using different quantifiers:) -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=17; y=3; z=2) - -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=0; y=7; z=11) - -operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) -comment(# => One solution is: x=1; y=3; z=14) - - -comment(# @@PLEAC@@_6.17) -comment(# alpha OR beta) -regexp - -comment(# alpha AND beta) -regexp - -comment(# alpha AND beta, no overlap) -regexp - -comment(# NOT beta) -regexp - -comment(# NOT bad BUT good) -regexp -comment(#-----------------------------) - -reserved(if) operator(!)operator(()ident(string) operator(=)operator(~) regexpoperator(\)) comment(# ugly) - ident(something)operator(()operator(\)) -reserved(end) - -reserved(if) ident(string) operator(!)operator(~) regexp comment(# preferred) - ident(something)operator(()operator(\)) -reserved(end) - - -comment(#-----------------------------) -reserved(if) ident(string) operator(=)operator(~) regexp operator(&&) ident(string) operator(=)operator(~) regexp - ident(something)operator(()operator(\)) -reserved(end) -comment(#-----------------------------) -reserved(if) ident(string) operator(=)operator(~) regexp operator(||) ident(string) operator(=)operator(~) regexp - ident(something)operator(()operator(\)) -reserved(end) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# minigrep - trivial grep) -ident(pat) operator(=) pre_constant(ARGV)operator(.)ident(shift) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)modifier(o)> -reserved(end) -comment(#-----------------------------) - string operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($string) operator(=)operator(~) regexp operator(&&) global_variable($string) operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($murray_hill) operator(=) string -reserved(if) global_variable($murray_hill) operator(=)operator(~) regexp comment(# /m means . can match newline) - - ident(print) stringoperator(;) -reserved(end) -comment(#-----------------------------) -string operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($brand) operator(=) stringoperator(;) -reserved(if) global_variable($brand) operator(=)operator(~) regexp comment(# /m means . can match newline) - ident(print) stringoperator(;) -reserved(end) -comment(#-----------------------------) -global_variable($map) operator(=)operator(~) regexp -comment(#-----------------------------) -global_variable($map) operator(=) string -reserved(if) global_variable($map) operator(=)operator(~) regexp comment(# /m means . can match newline) - ident(print) stringoperator(;) -reserved(end) -comment(=begin - 7:15am up 206 days, 13:30, 4 users, load average: 1.04, 1.07, 1.04 - -USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT - -tchrist tty1 5:16pm 36days 24:43 0.03s xinit - -tchrist tty2 5:19pm 6days 0.43s 0.43s -tcsh - -tchrist ttyp0 chthon 7:58am 3days 23.44s 0.44s -tcsh - -gnat ttyS4 coprolith 2:01pm 13:36m 0.30s 0.30s -tcsh -=end) -comment(#% w | minigrep '^(?!.*ttyp\).*tchrist') -comment(#-----------------------------) -regexp -comment(#-----------------------------) -comment(#% w | grep tchrist | grep -v ttyp) -comment(#-----------------------------) -comment(#% grep -i 'pattern' files) -comment(#% minigrep '(?i\)pattern' files) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_6.20) -ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) -ident(re) operator(=) regexpdelimiter(/)> -reserved(case) - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string - reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string -reserved(end) -comment(#-----------------------------) -ident(require) string -ident(table) operator(=) constant(Abbrev)operator(.)ident(abbrev) string -ident(loop) reserved(do) - ident(print) string - ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) - ident(puts) stringcontent( is )inlinedelimiter(")> -reserved(end) - - -comment(#-----------------------------) -comment(# dummy values are defined for 'file', 'PAGER', and) -comment(# the 'invoke_editor' and 'deliver_message' methods) -comment(# do not do anything interesting in this example.) -comment(#!/usr/bin/ruby -w) -ident(require) string - -ident(file) operator(=) string -constant(PAGER) operator(=) string - -reserved(def) method(invoke_editor) - ident(puts) string -reserved(end) - -reserved(def) method(deliver_message) - ident(puts) string -reserved(end) - -ident(actions) operator(=) operator({) - string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:invoke_editor)operator(\))operator(,) - string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:deliver_message)operator(\))operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(system)operator(()constant(PAGER)operator(,) ident(file)operator(\))operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(;) ident(exit)operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(}) -operator(}) - -ident(dtable) operator(=) constant(Abbrev)operator(.)ident(abbrev)operator(()ident(actions)operator(.)ident(keys)operator(\)) -ident(loop) reserved(do) - ident(print) string - ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp)operator(.)ident(delete)operator(()stringoperator(\)) - ident(actions)operator([) ident(dtable)operator([)ident(ans)operator(.)ident(downcase)operator(]) operator(||) string operator(])operator(.)ident(call) -reserved(end) - - -comment(# @@PLEAC@@_6.19) -comment(#-----------------------------) -comment(# basically, the Perl Cookbook categorizes this as an) -comment(# unsolvable problem ...) -comment(#-----------------------------) -integer(1) reserved(while) ident(addr)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -constant(Dear) ident(someuser)instance_variable(@host)operator(.)ident(com)operator(,) - -constant(Please) ident(confirm) ident(the) ident(mail) ident(address) ident(you) ident(gave) ident(us) constant(Wed) constant(May) integer(6) integer(09)operator(:)integer(38)operator(:)integer(41) -constant(MDT) integer(1998) ident(by) ident(replying) ident(to) ident(this) ident(message)operator(.) constant(Include) ident(the) ident(string) -string reserved(in) ident(that) ident(reply)operator(,) ident(but) ident(spelled) reserved(in) ident(reverse)operator(;) ident(that) ident(is)operator(,) -ident(start) ident(with) stringoperator(.) constant(Once) ident(this) ident(is) ident(done)operator(,) ident(your) ident(confirmed) ident(address) ident(will) -ident(be) ident(entered) ident(into) ident(our) ident(records)operator(.) - - -comment(# @@PLEAC@@_6.21) -comment(#-----------------------------) -comment(#% gunzip -c ~/mail/archive.gz | urlify > archive.urlified) -comment(#-----------------------------) -comment(#% urlify ~/mail/*.inbox > ~/allmail.urlified) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# urlify - wrap HTML links around URL-like constructs) - -ident(urls) operator(=) stringoperator(;) -ident(ltrs) operator(=) stringoperator(;) -ident(gunk) operator(=) stringoperator(;) -ident(punc) operator(=) stringoperator(;) -ident(any) operator(=) stringinlineinlinedelimiter(")>operator(;) - -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(line)operator(.)ident(gsub!) regexpcontent( : # need resource and a colon - [)inlinecontent(] +? # followed by on or more - # of any valid character, but - # be conservative and take only - # what you need to.... - \) # end $1 } - (?= # look-ahead non-consumptive assertion - [)inlinecontent(]* # either 0 or more punctuation - [^)inlinecontent(] # followed by a non-url char - | # or else - $ # then end of the string - \) - )delimiter(/)modifier(iox)> reserved(do) - string)inlinecontent()delimiter(|)> - reserved(end) - ident(print) ident(line) -reserved(end) - - -comment(# @@PLEAC@@_6.23) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -regexp comment(# keyword is $1, value is $2) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(\))operator({) global_variable($1)operator(.)ident(hex)operator(.)ident(chr) operator(}) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - -comment(# but really, in Ruby we'd just do:) -ident(str)operator(.)ident(strip!) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(cols) operator(=) operator(() operator(()constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(\)) operator(=)operator(~) regexp operator(\)) operator(?) global_variable($1) operator(:) integer(80)operator(;) -comment(#-----------------------------) -ident(name) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(require) string -ident(include) constant(Config) -ident(raise) string reserved(unless) constant(CONFIG)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(;) -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) -ident(nums) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(capwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(lowords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(icwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) -comment(#-----------------------------) -ident(links) operator(=) ident(str)operator(.)ident(scan)operator(()regexp]+?HREF)char(\\s)content(*=)char(\\s)content(*["']?([^'" >]+?\)[ '"]?>)delimiter(/)modifier(mi)>operator(\)) -comment(#-----------------------------) -ident(initial) operator(=) ident(str) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) string -comment(#-----------------------------) -ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) -comment(#-----------------------------) - -global_variable($/) operator(=) string -ident(sentences) operator(=) operator([)operator(]) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) - ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) - ident(sentences) operator(<<) ident(para)operator(.)ident(scan)operator(()regexpoperator(\)) -reserved(end) - -comment(#-----------------------------) -regexp comment(# YYYY in $1, MM in $2, DD in $3) -comment(#-----------------------------) -regexp -comment(#-----------------------------) -regexp -comment(#-----------------------------) -ident(lines) operator(=) operator([)operator(]) -ident(lines) operator(<<) global_variable($1) reserved(while) ident(input)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) - - -comment(# @@PLEAC@@_7.0) -comment(# An IO object being Enumerable, we can use 'each' directly on it) -constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp -operator(}) - -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -ident(mysub)operator(()global_variable($stdin)operator(,) ident(logfile)operator(\)) - -comment(# The method IO#readline is similar to IO#gets) -comment(# but throws an exception when it reaches EOF) -ident(f) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(\)) -reserved(begin) - reserved(while) operator(()ident(line) operator(=) ident(f)operator(.)ident(readline)operator(\)) - ident(line)operator(.)ident(chomp) - global_variable($stdout)operator(.)ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp - reserved(end) -reserved(rescue) constant(EOFError) - ident(f)operator(.)ident(close) -reserved(end) - -reserved(while) global_variable($stdin)operator(.)ident(gets) comment(# reads from STDIN) - reserved(unless) operator(()regexpoperator(\)) - global_variable($stderr)operator(.)ident(puts) string comment(# writes to STDERR) - reserved(end) - ident(puts) stringdelimiter(")> comment(# writes to STDOUT) -reserved(end) - -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - -ident(logfile)operator(.)ident(close) - -comment(# $defout (or its synonym '$>'\) is the destination of output) -comment(# for Kernel#print, Kernel#puts, and family functions) -ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -ident(old) operator(=) global_variable($defout) -global_variable($defout) operator(=) ident(logfile) comment(# switch to logfile for output) -ident(puts) string -global_variable($defout) operator(=) ident(old) comment(# return to original output) -ident(puts) string - - -comment(# @@PLEAC@@_7.1) -ident(source) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for reading only) -ident(sink) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for writing only) - -ident(source) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) comment(# open file "path" for reading only) -ident(sink) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(\)) comment(# open file "path" for writing only) - -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) comment(# open "path" for reading and writing) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) ident(flags)operator(\)) comment(# open "path" with the flags "flags" (see examples below for flags\)) - -comment(# open file "path" read only) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) - -comment(# open file "path" write only, create it if it does not exist) -comment(# truncate it to zero length if it exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) comment(# with permission 0666) - -comment(# open file "path" write only, fails if file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) - -comment(# open file "path" for appending) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) - -comment(# open file "path" for appending only when file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(\)) - -comment(# open file "path" for reading and writing) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(\)) - -comment(# open file for reading and writing, create a new file if it does not exist) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) - -comment(# open file "path" reading and writing, fails if file exists) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) -ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) - - -comment(# @@PLEAC@@_7.2) -comment(# No problem with Ruby since the filename doesn't contain characters with) -comment(# special meaning; like Perl's sysopen) -constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) - - -comment(# @@PLEAC@@_7.3) -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/root/tmp") -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/var/lib/nfs") - -comment(# To expand ~/.. it explicitely needs the environment variable HOME) -constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) -comment(#=> "/home/gc/tmp") - - -comment(# @@PLEAC@@_7.4) -comment(# The exception raised in Ruby reports the filename) -constant(File)operator(.)ident(open)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_7.5) -comment(# Standard Ruby distribution provides the following useful extension) -ident(require) string -comment(# With the Tempfile class, the file is automatically deleted on garbage) -comment(# collection, so you won't need to remove it, later on.) -ident(tf) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) comment(# a name is required to create the filename) - -comment(# If you need to pass the filename to an external program you can use) -comment(# File#path, but don't forget to File#flush in order to flush anything) -comment(# living in some buffer somewhere.) -ident(tf)operator(.)ident(flush) -ident(system)operator(()stringdelimiter(")>operator(\)) - -ident(fh) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) -ident(fh)operator(.)ident(sync) operator(=) pre_constant(true) comment(# autoflushes) -integer(10)operator(.)ident(times) operator({) operator(|)ident(i)operator(|) ident(fh)operator(.)ident(puts) ident(i) operator(}) -ident(fh)operator(.)ident(rewind) -ident(puts) stringoperator(,) ident(fh)operator(.)ident(readlines) - - -comment(# @@PLEAC@@_7.6) -reserved(while) operator(()pre_constant(DATA)operator(.)ident(gets)operator(\)) reserved(do) - comment(# process the line ) -reserved(end) -comment(__END__ -# your data goes here -# __DATA__ doesn't exist in Ruby - -)comment(#CODE) -comment(# get info about the script (size, date of last modification\)) -ident(kilosize) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(size) operator(/) integer(1024) -ident(last_modif) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(mtime) -ident(puts) stringScript size is )inlinedelimiter(")> -ident(puts) stringLast script update: )inlinedelimiter(")> -comment(__END__ -# DO NOT REMOVE THE PRECEEDING LINE. -# Everything else in this file will be ignored. -)comment(#CODE) - - -comment(# @@PLEAC@@_7.7) -reserved(while) ident(line) operator(=) ident(gets) reserved(do) - comment(# do something with line.) -reserved(end) - -comment(# or ) -reserved(while) ident(gets) reserved(do) - comment(# do something with $_) -reserved(end) - -comment(# or more rubyish) -global_variable($stdin)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - comment(# do stuff with line) -reserved(end) - - -comment(# ARGF may makes this more easy) -comment(# this is skipped if ARGV.size==0) -pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - comment(# closing and exception handling are done by the block) - ident(open)operator(()ident(filename)operator(\)) reserved(do) operator(|)ident(fd)operator(|) - ident(fd)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - comment(# do stuff with line) - reserved(end) - reserved(end) reserved(rescue) ident(abort)operator(()string operator(%) ident(filename)operator(\)) -reserved(end) - -comment(# globbing is done in the Dir module) -pre_constant(ARGV) operator(=) constant(Dir)operator([)stringoperator(]) reserved(if) pre_constant(ARGV)operator(.)ident(empty?) - -comment(# note: optparse is the preferred way to handle this) -reserved(if) operator(()pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) stringoperator(\)) - ident(chop_first) operator(+=) integer(1) - pre_constant(ARGV)operator(.)ident(shift) -reserved(end) - - -comment(# processing numerical options) -reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(=)operator(~) regexp - ident(columns) operator(=) global_variable($1) - pre_constant(ARGV)operator(.)ident(shift) -reserved(end) - -comment(# again, better to use optparse:) -ident(require) string -ident(nostdout) operator(=) integer(0) -ident(append) operator(=) integer(0) -ident(unbuffer) operator(=) integer(0) -ident(ignore_ints) operator(=) integer(0) -pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opt)operator(|) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(nostdout) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(append) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(unbuffer) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(ignore_ints) operator(+=)integer(1) operator(}) - ident(opt)operator(.)ident(parse!) -reserved(end) reserved(or) ident(abort)operator(()string operator(+) pre_constant(__FILE__) operator(+) stringoperator(\)) - -comment(# no need to do undef $/, we have File.read) -ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) - -comment(# again we have File.read) -ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) - -comment(# not sure what this should do:) -comment(# I believe open the file, print filename, lineno and line:) -pre_constant(ARGF)operator(.)ident(each_with_index) reserved(do) operator(|)ident(line)operator(,) ident(idx)operator(|) - ident(print) pre_constant(ARGF)operator(.)ident(filename)operator(,) stringoperator(,) ident(idx)operator(,) stringoperator(,) ident(line) -reserved(end) - -comment(# print all the lines in every file passed via command line that contains login) -pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp -reserved(end) -comment(#) -comment(# even this would fit) -comment(#%ruby -ne "print if /f/" 2.log) -comment(#) - -pre_constant(ARGF)operator(.)ident(each) operator({) operator(|)ident(l)operator(|) ident(puts) ident(l)operator(.)ident(downcase!) operator(}) - -comment(#------------------) -comment(#!/usr/bin/ruby -p) -comment(# just like perl's -p) -global_variable($_)operator(.)ident(downcase!) -comment(#) - -comment(# I don't know who should I trust. ) -comment(# perl's version splits on \\w+ while python's on \\w.) - -ident(chunks) operator(=) integer(0) - -constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\))operator(.)ident(split)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - reserved(next) reserved(if) ident(word) operator(=)operator(~) regexp - reserved(break) reserved(if) operator([)stringoperator(,) stringoperator(])operator(.)ident(member?) ident(word) - ident(chunks) operator(+=) integer(1) -reserved(end) - -ident(print) stringoperator(,) ident(chunks)operator(,) string - - -comment(# @@PLEAC@@_7.8) -ident(old) operator(=) constant(File)operator(.)ident(open)operator(()ident(old_file)operator(\)) -ident(new) operator(=) constant(File)operator(.)ident(open)operator(()ident(new_file)operator(,) stringoperator(\)) -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - comment(# change $_, then...) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) -ident(old)operator(.)ident(close) -ident(new)operator(.)ident(close) -constant(File)operator(.)ident(rename)operator(()ident(old_file)operator(,) stringoperator(\)) -constant(File)operator(.)ident(rename)operator(()ident(new_file)operator(,) ident(old_file)operator(\)) - -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - reserved(if) global_variable($.) operator(==) integer(20) reserved(then) comment(# we are at the 20th line) - ident(new)operator(.)ident(puts) string - ident(new)operator(.)ident(puts) string - reserved(end) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) - -reserved(while) ident(old)operator(.)ident(gets) reserved(do) - reserved(next) reserved(if) integer(20)operator(..)integer(30) comment(# skip the 20th line to the 30th) - comment(# Ruby (and Perl\) permit to write if 20..30 ) - comment(# instead of if (20 <= $.\) and ($. <= 30\)) - ident(new)operator(.)ident(print) global_variable($_) -reserved(end) - - -comment(# @@PLEAC@@_7.9) -comment(#% ruby -i.orig -pe 'FILTER COMMAND' file1 file2 file3 ...) -comment(#) -comment(#-----------------------------) -comment(##!/usr/bin/ruby -i.orig -p) -comment(# filter commands go here) -comment(#-----------------------------) - -comment(#% ruby -pi.orig -e 'gsub!(/DATE/\){Time.now\)') - -comment(# effectively becomes:) -pre_constant(ARGV) operator(<<) string -ident(oldfile) operator(=) string -reserved(while) ident(gets) - reserved(if) pre_constant(ARGF)operator(.)ident(filename) operator(!=) ident(oldfile) - ident(newfile) operator(=) pre_constant(ARGF)operator(.)ident(filename) - constant(File)operator(.)ident(rename)operator(()ident(newfile)operator(,) ident(newfile) operator(+) stringoperator(\)) - global_variable($stdout) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,)stringoperator(\)) - ident(oldfile) operator(=) ident(newfile) - reserved(end) - ident(gsub!)operator(()regexpoperator(\))operator({)constant(Time)operator(.)ident(now)operator(}) - ident(print) -reserved(end) -global_variable($stdout) operator(=) constant(STDOUT) -comment(#-----------------------------) -comment(#% ruby -i.old -pe 'gsub!(%r{\\bhisvar\\b}, 'hervar'\)' *.[Cchy]) - -comment(#-----------------------------) -comment(# set up to iterate over the *.c files in the current directory,) -comment(# editing in place and saving the old file with a .orig extension) -global_variable($-i) operator(=) string comment(# set up -i mode) -pre_constant(ARGV)operator(.)ident(replace)operator(()constant(Dir)operator([)stringoperator(])operator(\)) -reserved(while) ident(gets) - reserved(if) global_variable($.) operator(==) integer(1) - ident(print) string - reserved(end) - ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) comment(# Correct typos, preserving case) - ident(print) - pre_constant(ARGF)operator(.)ident(close) reserved(if) pre_constant(ARGF)operator(.)ident(eof) -reserved(end) - - -comment(# @@PLEAC@@_7.10) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) comment(# open file for update) - ident(lines) operator(=) ident(f)operator(.)ident(readlines) comment(# read into array of lines) - ident(lines)operator(.)ident(each) reserved(do) operator(|)ident(it)operator(|) comment(# modify lines) - ident(it)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - ident(f)operator(.)ident(pos) operator(=) integer(0) comment(# back to start) - ident(f)operator(.)ident(print) ident(lines) comment(# write out modified lines) - ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) comment(# truncate to new length) -reserved(end) comment(# file is automatically closed) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(out) operator(=) string - ident(f)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(out) operator(<<) ident(line)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)constant(Time)operator(.)ident(now)operator(}) - reserved(end) - ident(f)operator(.)ident(pos) operator(=) integer(0) - ident(f)operator(.)ident(print) ident(out) - ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) -reserved(end) - -comment(# @@PLEAC@@_7.11) -constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) - comment(# update file) -reserved(end) -comment(#-----------------------------) -constant(File)operator(::)constant(LOCK_SH) comment(# shared lock (for reading\)) -constant(File)operator(::)constant(LOCK_EX) comment(# exclusive lock (for writing\)) -constant(File)operator(::)constant(LOCK_NB) comment(# non-blocking request) -constant(File)operator(::)constant(LOCK_UN) comment(# free lock) -comment(#-----------------------------) -reserved(unless) ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) operator(|) constant(File)operator(::)constant(LOCK_NB) - ident(warn) string - ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) -reserved(end) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) reserved(do) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(flock)operator(()constant(File)operator(::)constant(LOCK_EX)operator(\)) - ident(num) operator(=) ident(f)operator(.)ident(gets)operator(.)ident(to_i) operator(||) integer(0) - ident(f)operator(.)ident(pos) operator(=) integer(0) - ident(f)operator(.)ident(truncate) integer(0) - ident(f)operator(.)ident(puts) ident(num) operator(+) integer(1)ident(q) -reserved(end) - - -comment(# @@PLEAC@@_7.12) -ident(output_handle)operator(.)ident(sync) operator(=) pre_constant(true) -comment(# Please note that like in Perl, $stderr is already unbuffered) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# seeme - demo stdio output buffering) -global_variable($stdout)operator(.)ident(sync) operator(=) pre_constant(ARGV)operator(.)ident(size) operator(>) integer(0) -ident(print) string -ident(sleep) integer(2) -ident(puts) string -comment(#-----------------------------) -global_variable($stderr)operator(.)ident(sync) operator(=) pre_constant(true) -ident(afile)operator(.)ident(sync) operator(=) pre_constant(false) -comment(#-----------------------------) -comment(# assume 'remote_con' is an interactive socket handle,) -comment(# but 'disk_file' is a handle to a regular file.) -ident(remote_con)operator(.)ident(sync) operator(=) pre_constant(true) comment(# unbuffer for clarity) -ident(disk_file)operator(.)ident(sync) operator(=) pre_constant(false) comment(# buffered for speed) -comment(#-----------------------------) -ident(require) string -ident(sock) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) integer(80)operator(\)) -ident(sock)operator(.)ident(sync) operator(=) pre_constant(true) -ident(sock)operator(.)ident(puts) string -ident(resp) operator(=) ident(sock)operator(.)ident(read) -ident(print) stringchar(\\n)delimiter(")> - - -comment(# @@PLEAC@@_7.13) -comment(#-----------------------------) -comment(# assumes fh1, fh2, fh2 are oen IO objects) -ident(nfound) operator(=) ident(select)operator(()operator([)global_variable($stdin)operator(,) ident(fh1)operator(,) ident(fh2)operator(,) ident(fh3)operator(])operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) -ident(nfound)operator([)integer(0)operator(])operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(case) ident(file) - reserved(when) ident(fh1) - comment(# do something with fh1) - reserved(when) ident(fh2) - comment(# do something with fh2) - reserved(when) ident(fh3) - comment(# do something with fh3) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(input_files) operator(=) operator([)operator(]) -comment(# repeat next line for all in-files to poll) -ident(input_files) operator(<<) ident(fh1) -reserved(if) ident(nfound) operator(=) ident(select)operator(()ident(input_files)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) - comment(# input ready on files in nfound[0]) -reserved(end) - - -comment(# @@PLEAC@@_8.0) -comment(#-----------------------------) -comment(# datafile is a file or IO object) -ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(line)operator(.)ident(chomp!) - ident(size) operator(=) ident(line)operator(.)ident(length) - ident(puts) ident(size) -operator(}) -comment(#-----------------------------) -ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(puts) ident(line)operator(.)ident(chomp!)operator(.)ident(length) -operator(}) -comment(#-----------------------------) -ident(lines) operator(=) ident(datafile)operator(.)ident(readlines) -comment(#-----------------------------) -ident(whole_file) operator(=) ident(file)operator(.)ident(read) -comment(#-----------------------------) -comment(# ruby -040 -e 'word = gets; puts "First word is #{word}"') -comment(#-----------------------------) -comment(# ruby -ne 'BEGIN { $/="%%\\n" }; $_.chomp; puts $_ if( $_=~/Unix/i\)' fortune.dat) -comment(#-----------------------------) -ident(handle)operator(.)ident(print) stringoperator(,) stringoperator(,) string comment(# "onetwothree") -ident(puts) string comment(# sent to $stdout) -comment(#-----------------------------) -ident(buffer) operator(=) ident(handle)operator(.)ident(read)operator(()integer(4096)operator(\)) -ident(rv) operator(=) ident(buffer)operator(.)ident(length) -comment(#-----------------------------) -ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) -ident(open)operator(()stringcontent(.pid)delimiter(")>operator(,) stringoperator(\)) operator({) operator(|)ident(handle)operator(|) ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) operator(}) -comment(#-----------------------------) -ident(pos) operator(=) ident(datafile)operator(.)ident(pos) comment(# tell is an alias of pos) -ident(puts) stringcontent( bytes from the start of datafile)delimiter(")> -comment(#-----------------------------) -ident(logfile)operator(.)ident(seek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_END)operator(\)) -ident(datafile)operator(.)ident(seek)operator(()ident(pos)operator(\)) comment(# IO::SEEK_SET is the default) -ident(out)operator(.)ident(seek)operator(()integer(-20)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) -comment(#-----------------------------) -ident(written) operator(=) ident(datafile)operator(.)ident(syswrite)operator(()ident(mystring)operator(\)) -ident(raise) constant(RunTimeError) reserved(unless) ident(written) operator(==) ident(mystring)operator(.)ident(length) -ident(block) operator(=) ident(infile)operator(.)ident(sysread)operator(()integer(256)operator(\)) comment(# no equivalent to perl offset parameter in sysread) -ident(puts) stringcontent( bytes)delimiter(")> reserved(if) integer(256) operator(!=) ident(block)operator(.)ident(length) -comment(#-----------------------------) -ident(pos) operator(=) ident(handle)operator(.)ident(sysseek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) comment(# don't change position) - - -comment(# @@PLEAC@@_8.1) -reserved(while) operator(()ident(line) operator(=) ident(fh)operator(.)ident(gets)operator(\)) - ident(line)operator(.)ident(chomp!) - ident(nextline) operator(=) pre_constant(nil) - ident(line)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(match)operator(|) ident(nextline) operator(=) ident(fh)operator(.)ident(gets)operator(;) string operator(}) - reserved(if) operator(()ident(nextline) operator(!=) pre_constant(nil)operator(\)) - ident(line) operator(+=) ident(nextline) - reserved(redo) - reserved(end) - comment(# process full record in line here) -reserved(end) -comment(#-----------------------------) -comment(# DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) -comment(# $(TEXINFOS\) $(INFOS\) $(MANS\) $(DATA\)) -comment(# DEP_DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) -comment(# $(TEXINFOS\) $(INFO_DEPS\) $(MANS\) $(DATA\) \\) -comment(# $(EXTRA_DIST\)) -comment(#-----------------------------) -ident(line)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) operator({) - comment(# as before) -operator(}) - - -comment(# @@PLEAC@@_8.2) -comment(#-----------------------------) -ident(count) operator(=) shelldelimiter(`)> -ident(fail) stringdelimiter(")> reserved(if) global_variable($?) operator(!=) integer(0) -ident(count)operator(.)ident(chomp!) -comment(#-----------------------------) -ident(count) operator(=) integer(0) -constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) -operator(}) -comment(# count now holds the number of lines read) -comment(#-----------------------------) -ident(count) operator(=) integer(0) -reserved(while) operator(()ident(chunk) operator(=) ident(file)operator(.)ident(sysread)operator(()integer(2)operator(**)integer(16)operator(\))operator(\)) - ident(count) operator(+=) ident(chunk)operator(.)ident(count)operator(()stringoperator(\)) -reserved(end) reserved(rescue) constant(EOFError) -comment(#-----------------------------) -constant(File)operator(.)ident(open)operator(()ident(filename)operator(,)stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) -operator(}) -comment(# count now holds the number of lines read) -comment(#-----------------------------) -comment(# As ruby doesn't quite have an equivalent to using a for) -comment(# statement as in perl, I threw this in) -ident(count) operator(=) constant(File)operator(.)ident(readlines)operator(()ident(filename)operator(\))operator(.)ident(size) -comment(#-----------------------------) -integer(1) reserved(while) ident(file)operator(.)ident(gets) -ident(count) operator(=) global_variable($.) -comment(#-----------------------------) -global_variable($/) operator(=) string -ident(open)operator(()ident(filename)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) - integer(1) reserved(while) ident(fh)operator(.)ident(gets) - ident(para_count) operator(=) global_variable($.) -operator(}) reserved(rescue) ident(fail)operator(()stringcontent(: $!)delimiter(")>operator(\)) -comment(#-----------------------------) - - -comment(# ^^PLEAC^^_8.3) -comment(#-----------------------------) -reserved(while) operator(()ident(gets)operator(\)) - ident(split)operator(.)ident(each) operator({) operator(|)ident(chunk)operator(|) - comment(# do something with chunk) - operator(}) -reserved(end) -comment(#-----------------------------) -reserved(while) operator(()ident(gets)operator(\)) - ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) - comment(# do something with word) - operator(}) -reserved(end) -comment(#-----------------------------) -comment(# Make a word frequency count) -comment(# normally hashes can be created using {} or just Hash.new) -comment(# but we want the default value of an entry to be 0 instead ) -comment(# of nil. (nil can't be incremented\)) -ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(while) operator(()ident(gets)operator(\)) - ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) - ident(seen)operator([)ident(word)operator(.)ident(downcase)operator(]) operator(+=) integer(1) - operator(}) -reserved(end) -comment(# output hash in a descending numeric sort of its values) -ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) -reserved(end) - -comment(#-----------------------------) -comment(# Line frequency count) -ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(while) operator(()ident(gets)operator(\)) - ident(seen)operator([)global_variable($_)operator(.)ident(downcase)operator(]) operator(+=) integer(1) -reserved(end) -ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) - ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) -reserved(end) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_8.4) -comment(#-----------------------------) -comment(# instead of file handle FILE, we can just) -comment(# use a string containing the filename) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - comment(# do something with line) -operator(}) -comment(#-----------------------------) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(reverse_each) operator({) operator(|)ident(line)operator(|) - comment(# do something with line) -operator(}) -comment(#-----------------------------) -comment(# the variable lines might have been created) -comment(# this way) -comment(# lines = File.readlines(file\)) -comment(#) -comment(# normally one would use the reverse_each, but) -comment(# if you insist on using a numerical index to) -comment(# iterate over the lines array...) -operator(()ident(lines)operator(.)ident(size) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\)) operator({) operator(|)ident(i)operator(|) - ident(line) operator(=) ident(lines)operator([)ident(i)operator(]) -operator(}) -comment(#-----------------------------) -comment(# the second readlines argument is a the ) -comment(# record separator $/, just like perl, a blank) -comment(# separator splits the records into paragraphs) -constant(File)operator(.)ident(readlines)operator(()ident(file)operator(,) stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(paragraph)operator(|) - comment(# do something with paragraph) - ident(puts) stringParagraph )inlinedelimiter(")> -operator(}) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_8.6) - -global_variable($/) operator(=) stringoperator(;) -ident(srand)operator(;) - -constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) - ident(adage) operator(=) ident(line) reserved(if) ident(rand)operator(()global_variable($.)operator(\)) operator(<) integer(1) -reserved(end) - -ident(puts) ident(adage)operator(;) - - -comment(# @@PLEAC@@_8.10) -reserved(begin) - ident(fh) operator(=) constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) - ident(addr) operator(=) ident(fh)operator(.)ident(tell) reserved(unless) ident(fh)operator(.)ident(eof) reserved(while) ident(fh)operator(.)ident(gets) - ident(fh)operator(.)ident(truncate)operator(()ident(addr)operator(\)) -reserved(rescue) constant(SystemCallError) - global_variable($stderr)operator(.)ident(puts) string -reserved(end) - - -comment(# @@PLEAC@@_9.0) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()constant(INFILE)operator(\)) - -ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(ctime) operator(=) ident(entry)operator(.)ident(ctime) -ident(size) operator(=) ident(entry)operator(.)ident(size) - -ident(f) operator(=) constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) - -comment(## There is no -T equivalent in Ruby, but we can still test emptiness) -reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) - ident(puts) stringcontent( doesn't have text in it.)delimiter(")> - ident(exit) -reserved(end) - -constant(Dir)operator(.)ident(new)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_9.1) -ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(readtime)operator(,) ident(writetime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) -ident(file)operator(.)ident(utime)operator(()ident(readtime)operator(,) ident(writetime)operator(\)) - -constant(SECONDS_PER_DAY) operator(=) integer(60) operator(*) integer(60) operator(*) integer(24) -ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) -ident(atime)operator(,) ident(mtime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) - -ident(atime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) -ident(mtime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) - -constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) -constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) constant(File)operator(.)ident(stat)operator(()stringoperator(\))operator(.)ident(mtime)operator(,) ident(file)operator(\)) - -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(## uvi - vi a file without changing it's access times) - -reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(!=) integer(1) - ident(puts) string - ident(exit) -reserved(end) -ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(atime)operator(,) ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(atime)operator(,) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) -ident(system)operator(()constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(,) ident(file)operator(\)) -constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_9.2) -constant(File)operator(.)ident(unlink)operator(()constant(FILENAME)operator(\)) - -ident(err_flg) operator(=) pre_constant(false) -ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(begin) - constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - reserved(rescue) - ident(err_flg) operator(=) global_variable($!) - reserved(end) -reserved(end) -ident(err_flg) reserved(and) ident(raise) stringoperator(\))delimiter(})>content(: )inlinedelimiter(")> - -constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - -ident(count) operator(=) ident(filenames)operator(.)ident(length) -ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(begin) - constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) - reserved(rescue) - ident(count) operator(-=) integer(1) - reserved(end) -reserved(end) -reserved(if) ident(count) operator(!=) ident(filenames)operator(.)ident(length) - constant(STDERR)operator(.)ident(puts) stringcontent( of )inlinecontent( files)delimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_9.3) -ident(require) string -constant(File)operator(.)ident(copy)operator(()ident(oldfile)operator(,) ident(newfile)operator(\)) - -ident(infile) operator(=) constant(File)operator(.)ident(open)operator(()ident(oldfile)operator(,) stringoperator(\)) -ident(outfile) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,) stringoperator(\)) - -ident(blksize) operator(=) ident(infile)operator(.)ident(stat)operator(.)ident(blksize) -comment(# This doesn't handle partial writes or ^Z) -comment(# like the Perl version does.) -reserved(while) operator(()ident(line) operator(=) ident(infile)operator(.)ident(read)operator(()ident(blksize)operator(\))operator(\)) - ident(outfile)operator(.)ident(write)operator(()ident(line)operator(\)) -reserved(end) - -ident(infile)operator(.)ident(close) -ident(outfile)operator(.)ident(close) - -ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# unix) -ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# dos, vms) - -ident(require) string -constant(File)operator(.)ident(copy)operator(()stringoperator(,) stringoperator(\)) -constant(File)operator(.)ident(move)operator(()stringoperator(,) stringoperator(\)) - - -comment(# @@PLEAC@@_9.4) -global_variable($seen) operator(=) operator({)operator(}) comment(# must use global var to be seen inside of method below) - -reserved(def) method(do_my_thing)operator(()ident(filename)operator(\)) - ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) - reserved(unless) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) - comment(# do something with $filename because we haven't) - comment(# seen it before) - reserved(end) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) -reserved(end) - -ident(files)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) - ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) - reserved(if) operator(!)global_variable($seen)operator(.)ident(has_key?)operator(()operator([)ident(dev)operator(,) ident(ino)operator(])operator(\)) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) operator([)operator(]) - reserved(end) - global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(push)operator(()ident(filename)operator(\)) -reserved(end) - -global_variable($seen)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(each) reserved(do) operator(|)ident(devino)operator(|) - ident(ino)operator(,) ident(dev) operator(=) ident(devino) - reserved(if) global_variable($seen)operator([)ident(devino)operator(])operator(.)ident(length) operator(>) integer(1) - comment(# $seen[devino] is a list of filenames for the same file) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_9.5) -constant(Dir)operator(.)ident(open)operator(()ident(dirname)operator(\)) reserved(do) operator(|)ident(dir)operator(|) - ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - comment(# do something with dirname/file) - ident(puts) ident(file) - reserved(end) -reserved(end) -comment(# Dir.close is automatic) - -comment(# No -T equivalent in Ruby) - -ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - reserved(next) reserved(if) ident(file) operator(=)operator(~) regexp - comment(# ...) -reserved(end) - -reserved(def) method(plainfiles)operator(()ident(dir)operator(\)) - ident(dh) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) - ident(dh)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) - ident(map) operator({)operator(|)ident(file)operator(|) stringcontent(/)inlinedelimiter(")>operator(})operator(.) - ident(find_all) operator({)operator(|)ident(file)operator(|) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\))operator(})operator(.) - ident(sort) -reserved(end) - - -comment(# @@PLEAC@@_9.6) -ident(list) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) - -ident(dir) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\)) -ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) -ident(dir)operator(.)ident(close) - -ident(files) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) -ident(files) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\))operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) - -ident(dir) operator(=) constant(Dir)operator(.)ident(new)operator(()ident(path)operator(\)) -ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) - -reserved(begin) - ident(d) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) -reserved(rescue) constant(Errno)operator(::)constant(ENOENT) - ident(raise) stringcontent( for reading: )inlinedelimiter(")> -reserved(end) - -ident(files) operator(=) operator([)operator(]) -ident(d)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(puts) ident(file) - reserved(next) reserved(unless) ident(file) operator(=)operator(~) regexp - - ident(filename) operator(=) stringcontent(/)inlinedelimiter(")> - comment(# There is no -T equivalent in Ruby, but we can still test emptiness) - ident(files)operator(.)ident(push)operator(()ident(filename)operator(\)) reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) -reserved(end) - -ident(dirs)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) - ident(map) operator({) operator(|)ident(file)operator(|) operator([)ident(file)operator(,) stringcontent(/)inlinedelimiter(")>operator(])operator(}) operator(.) - ident(select) operator({) operator(|)ident(file)operator(|) ident(test)operator(()integer(?d)operator(,) ident(file)operator([)integer(1)operator(])operator(\)) operator(})operator(.) - ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) - ident(map) operator({) operator(|)ident(file)operator(|) ident(file)operator([)integer(1)operator(]) operator(}) - - -comment(# @@PLEAC@@_9.7) -ident(require) string -constant(Find)operator(.)ident(find)operator(()ident(dirlist)operator(\)) reserved(do) operator(|)ident(file)operator(|) - comment(# do whatever) -reserved(end) - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(print) ident(file)operator(,) operator(()ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(?) string operator(:) stringoperator(\)) -reserved(end) - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(sum) operator(=) integer(0) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) - ident(sum) operator(+=) ident(size) -reserved(end) -ident(puts) stringoperator(\))delimiter(})>content( contains )inlinecontent( bytes)delimiter(")> - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(saved_size)operator(,) ident(saved_name) operator(=) integer(-1)operator(,) string -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) - reserved(next) reserved(unless) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\)) operator(&&) ident(size) operator(>) ident(saved_size) - ident(saved_size) operator(=) ident(size) - ident(saved_name) operator(=) ident(file) -reserved(end) -ident(puts) stringcontent( in )inlineoperator(\))delimiter(})>content( is )inlinedelimiter(")> - -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -ident(age)operator(,) ident(name) operator(=) pre_constant(nil) -constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) - ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) - reserved(next) reserved(if) ident(age) operator(&&) ident(age) operator(>) ident(mtime) - ident(age) operator(=) ident(mtime) - ident(name) operator(=) ident(file) -reserved(end) -ident(puts) stringcontent( )inlinedelimiter(")> - -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# fdirs - find all directories) -ident(require) string -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) -constant(File)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) operator({) operator(|)ident(file)operator(|) ident(puts) ident(file) reserved(if) ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(}) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_9.8) -ident(require) string - -ident(puts) stringcontent( dir ...)delimiter(")> reserved(if) pre_constant(ARGV)operator(.)ident(empty?) -pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) - constant(FileUtils)operator(.)ident(rmtree)operator(()ident(dir)operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_9.9) -ident(require) string -ident(names)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(newname) operator(=) ident(file) - reserved(begin) - constant(File)operator(.)ident(move)operator(()ident(file)operator(,) ident(newname)operator(\)) - reserved(rescue) constant(Errno)operator(::)constant(EPERM) - global_variable($stderr)operator(.)ident(puts) stringcontent( to )inlinecontent(: )inlinedelimiter(")> - reserved(end) -reserved(end) - -ident(require) string -ident(op) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) operator(()ident(raise) stringoperator(\)) operator(:) pre_constant(ARGV)operator(.)ident(shift) -ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(chomp) operator(}) operator(:) pre_constant(ARGV) -ident(argv)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) - ident(was) operator(=) ident(file) - ident(file) operator(=) ident(eval)operator(()stringdelimiter(")>operator(\)) - constant(File)operator(.)ident(move)operator(()ident(was)operator(,) ident(file)operator(\)) reserved(unless) ident(was) operator(==) ident(file) -reserved(end) - - -comment(# @@PLEAC@@_9.10) -ident(base) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) -ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) -comment(# ruby has no fileparse equivalent) -ident(dir)operator(,) ident(base) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) -ident(ext) operator(=) ident(base)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) - -ident(path) operator(=) string -ident(file) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) -ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) - -ident(puts) stringcontent(, file is )inlinedelimiter(")> -comment(# dir is /usr/lib, file is libc.a) - -ident(path) operator(=) string -ident(dir)operator(,) ident(filename) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) -ident(name)operator(,) ident(ext) operator(=) ident(filename)operator(.)ident(split)operator(()regexpoperator(\)) -ident(puts) stringcontent(, name is )inlinecontent(, ext is )inlinedelimiter(")> -comment(# NOTE: The Ruby code prints) -comment(# dir is /usr/lib, name is libc, extension is .a) -comment(# while the Perl code prints a '/' after the directory name) -comment(# dir is /usr/lib/, name is libc, extension is .a) - -comment(# No fileparse_set_fstype(\) equivalent in ruby) - -reserved(def) method(extension)operator(()ident(path)operator(\)) - ident(ext) operator(=) ident(path)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) - ident(ext)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) -reserved(end) - - -comment(# @@PLEAC@@_9.11) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# symirror - build spectral forest of symlinks) - -ident(require) string -ident(require) string - -ident(raise) stringcontent( realdir mirrordir)delimiter(")> reserved(unless) pre_constant(ARGV)operator(.)ident(size) operator(==) integer(2) - -ident(srcdir)operator(,)ident(dstdir) operator(=) pre_constant(ARGV) -ident(srcmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcdir)operator(\))operator(.)ident(mode) -constant(Dir)operator(.)ident(mkdir)operator(()ident(dstdir)operator(,) ident(srcmode) operator(&) integer(07777)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dstdir)operator(\)) - -comment(# fix relative paths) -constant(Dir)operator(.)ident(chdir)operator(()ident(srcdir)operator(\)) operator({)ident(srcdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) -constant(Dir)operator(.)ident(chdir)operator(()ident(dstdir)operator(\)) operator({)ident(dstdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) - -constant(Find)operator(.)ident(find)operator(()ident(srcdir)operator(\)) reserved(do) operator(|)ident(srcfile)operator(|) - reserved(if) ident(test)operator(()integer(?d)operator(,) ident(srcfile)operator(\)) - ident(dest) operator(=) ident(srcfile)operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) ident(dstdir)operator(\)) - ident(dmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcfile)operator(\))operator(.)ident(mode) operator(&) integer(07777) - constant(Dir)operator(.)ident(mkdir)operator(()ident(dest)operator(,) ident(dmode)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dest)operator(\)) - ident(a) operator(=) constant(Dir)operator([)stringcontent(/*)delimiter(")>operator(])operator(.)ident(reject)operator({)operator(|)ident(f)operator(|) ident(test)operator(()integer(?d)operator(,) ident(f)operator(\))operator(}) - constant(FileUtils)operator(.)ident(ln_s)operator(()ident(a)operator(,) ident(dest)operator(\)) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_9.12) -comment(# we use the Getopt/Declare library here for convenience:) -comment(# http://raa.ruby-lang.org/project/getoptdeclare/) -comment(#-----------------------------) -comment(#!/usr/bin/ruby -w) -comment(# lst - list sorted directory contents (depth first\)) - -ident(require) string -ident(require) string -ident(require) string - -comment(# Note: in the option-spec below there must by at least one hard) -comment(# tab in between each -option and its description. For example) -comment(# -i read from stdin) - -ident(opts) operator(=) constant(Getopt)operator(::)constant(Declare)operator(.)ident(new)operator(()stringoperator(\))string - -global_variable($sort_criteria) operator(||=) symbol(:mtime) -ident(files) operator(=) operator({)operator(}) -constant(DIRS) operator(=) ident(opts)operator([)stringoperator(]) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map)operator({)operator(|)ident(f)operator(|)ident(f)operator(.)ident(chomp!)operator(}) operator(:) pre_constant(ARGV) -constant(DIRS)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) - constant(Find)operator(.)ident(find)operator(()ident(dir)operator(\)) reserved(do) operator(|)ident(ent)operator(|) - ident(files)operator([)ident(ent)operator(]) operator(=) constant(File)operator(::)ident(stat)operator(()ident(ent)operator(\)) - reserved(end) -reserved(end) -ident(entries) operator(=) ident(files)operator(.)ident(keys)operator(.)ident(sort_by)operator({)operator(|)ident(f)operator(|) ident(files)operator([)ident(f)operator(])operator(.)ident(send)operator(()global_variable($sort_criteria)operator(\))operator(}) -ident(entries) operator(=) ident(entries)operator(.)ident(reverse) reserved(unless) ident(opts)operator([)stringoperator(]) - -ident(entries)operator(.)ident(each) reserved(do) operator(|)ident(ent)operator(|) - reserved(unless) ident(opts)operator([)stringoperator(]) - ident(puts) ident(ent) - reserved(next) - reserved(end) - ident(stats) operator(=) ident(files)operator([)ident(ent)operator(]) - ident(ftime) operator(=) ident(stats)operator(.)ident(send)operator(()global_variable($sort_criteria) operator(==) symbol(:size) operator(?) symbol(:mtime) operator(:) global_variable($sort_criteria)operator(\)) - ident(printf) stringoperator(,) - ident(stats)operator(.)ident(ino)operator(,) - ident(stats)operator(.)ident(mode) operator(&) integer(07777)operator(,) - ident(stats)operator(.)ident(nlink)operator(,) - constant(ETC)operator(::)constant(PASSWD)operator([)ident(stats)operator(.)ident(uid)operator(])operator(.)ident(name)operator(,) - constant(ETC)operator(::)constant(GROUP)operator([)ident(stats)operator(.)ident(gid)operator(])operator(.)ident(name)operator(,) - ident(stats)operator(.)ident(size)operator(,) - ident(ftime)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) - ident(ent) -reserved(end) - - -comment(# @@PLEAC@@_10.0) -reserved(def) method(hello) - global_variable($greeted) operator(+=) integer(1) comment(# in Ruby, a variable beginning with $ is global (can be any type of course\)) - ident(puts) string -reserved(end) - -comment(# We need to initialize $greeted before it can be used, because "+=" is waiting a Numeric object) -global_variable($greeted) operator(=) integer(0) -ident(hello) comment(# note that appending (\) is optional to function calls with no parameters) - - -comment(# @@PLEAC@@_10.1) -comment(# In Ruby, parameters are named anyway) -reserved(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\)) - constant(Math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\)) comment(# the sqrt function comes from the Math module) -reserved(end) -ident(diag) operator(=) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) - -ident(puts) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) - -ident(a) operator(=) operator([)integer(3)operator(,) integer(4)operator(]) -ident(print) ident(hypotenuse)operator(()operator(*)ident(a)operator(\)) comment(# the star operator will magically convert an Array into a "tuple") - -ident(both) operator(=) ident(men) operator(+) ident(women) - -comment(# In Ruby, all objects are references, so the same problem arises; we then return a new object) -ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -reserved(def) method(int_all)operator(()ident(n)operator(\)) - ident(n)operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) -reserved(end) -ident(ints) operator(=) ident(int_all)operator(()ident(nums)operator(\)) - -ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) -reserved(def) method(trunc_em)operator(()ident(n)operator(\)) - ident(n)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) comment(# the bang-version of collect modifies the object) -reserved(end) -ident(trunc_em)operator(()ident(nums)operator(\)) - -comment(# Ruby has two chomp version:) -comment(# ``chomp'' chomps the record separator and returns what's expected) -comment(# ``chomp!'' does the same but also modifies the parameter object) - - -comment(# @@PLEAC@@_10.2) -reserved(def) method(somefunc) - ident(variable) operator(=) ident(something) comment(# variable is local by default) -reserved(end) - -ident(name)operator(,) ident(age) operator(=) pre_constant(ARGV) -ident(start) operator(=) ident(fetch_time) - -ident(a)operator(,) ident(b) operator(=) ident(pair) comment(# will succeed if pair is an Array object (like ARGV is\)) -ident(c) operator(=) ident(fetch_time) - -comment(# In ruby, run_check can't access a, b, or c until they are) -comment(# explicitely defined global (using leading $\), even if they are) -comment(# both defined in the same scope) - -reserved(def) method(check_x)operator(()ident(x)operator(\)) - ident(y) operator(=) string - ident(run_check) - reserved(if) global_variable($condition) - ident(puts) string - reserved(end) -reserved(end) - -comment(# The following will keep a reference to the array, though the) -comment(# results will be slightly different from perl: the last element) -comment(# of $global_array will be itself an array) -reserved(def) method(save_array)operator(()ident(ary)operator(\)) - global_variable($global_array) operator(<<) ident(ary) -reserved(end) - -comment(# The following gives the same results as in Perl for $global_array,) -comment(# though it doesn't illustrate anymore the way to keep a reference) -comment(# to an object: $global_array is extended with the elements of ary) -reserved(def) method(save_array)operator(()ident(ary)operator(\)) - global_variable($global_array) operator(+=) ident(ary) -reserved(end) - - -comment(# @@PLEAC@@_10.3) -comment(# In Ruby, AFAIK a method cannot access "local variables" defined) -comment(# upper scope; mostly because everything is an object, so you'll) -comment(# do the same by defining an attribute or a static attribute) - -comment(# In Ruby the BEGIN also exists:) -reserved(BEGIN) operator({) ident(puts) string operator(}) -ident(puts) string -reserved(BEGIN) operator({) ident(puts) string operator(}) -comment(# gives:) -comment(# hello from BEGIN) -comment(# hello from 2nd BEGIN) -comment(# hello from main) - -comment(# In Ruby, it can be written as a static method and a static) -comment(# variable) -reserved(class) class(Counter) - class_variable(@@counter) operator(=) integer(0) - reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) -reserved(end) - -comment(# There is no need of BEGIN since the variable will get) -comment(# initialized when parsing) -reserved(class) class(Counter) - class_variable(@@counter) operator(=) integer(42) - reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) - reserved(def) constant(Counter)operator(.)ident(prev_counter)operator(;) class_variable(@@counter) operator(-=) integer(1)operator(;) reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_10.4) -comment(# You can either get the whole trace as an array of strings, each) -comment(# string telling which file, line and method is calling:) -ident(caller) - -comment(# ...or only the last caller) -ident(caller)operator([)integer(0)operator(]) - -comment(# We need to extract just the method name of the backtrace:) -reserved(def) method(whoami)operator(;) ident(caller)operator(()operator(\))operator([)integer(0)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) -reserved(def) method(whowasi)operator(;) ident(caller)operator(()operator(\))operator([)integer(1)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) - - -comment(# @@PLEAC@@_10.5) -comment(# In Ruby, every value is a reference on an object, thus there is) -comment(# no such problem) -ident(array_diff)operator(()ident(array1)operator(,) ident(array2)operator(\)) - -reserved(def) method(add_vecpair)operator(()ident(a1)operator(,) ident(a2)operator(\)) - ident(results) operator(=) operator([)operator(]) - ident(a1)operator(.)ident(each_index) operator({) operator(|)ident(i)operator(|) ident(results) operator(<<) operator(()ident(a1)operator([)ident(i)operator(]) operator(+) ident(a2)operator([)ident(i)operator(])operator(\)) operator(}) - ident(results) -reserved(end) -ident(a) operator(=) operator([)integer(1)operator(,) integer(2)operator(]) -ident(b) operator(=) operator([)integer(5)operator(,) integer(8)operator(]) -ident(c) operator(=) ident(add_vecpair)operator(()ident(a)operator(,) ident(b)operator(\)) -ident(p) ident(c) - -comment(# Add this to the beginning of the function to check if we were) -comment(# given two arrays) -ident(a1)operator(.)ident(type) operator(==) constant(Array) operator(&&) ident(a2)operator(.)ident(type) operator(==) constant(Array) reserved(or) - ident(raise) stringcontent( )inlinecontent(\))delimiter(")> - - -comment(# @@PLEAC@@_10.6) -comment(# There is no return context in Ruby) - - -comment(# @@PLEAC@@_10.7) -comment(# Like in Perl, we need to fake with a hash, but it's dirty :-() -reserved(def) method(thefunc)operator(()ident(param_args)operator(\)) - ident(args) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(0) operator(}) - ident(args)operator(.)ident(update)operator(()ident(param_args)operator(\)) - reserved(if) operator(()ident(args)operator([)stringoperator(]) operator(=)operator(~) regexp operator(\)) - comment(# .....) - reserved(end) -reserved(end) - -ident(thefunc)operator(()operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(})operator(\)) -ident(thefunc)operator(()operator({)operator(})operator(\)) - - -comment(# @@PLEAC@@_10.8) -comment(# there is no "undef" direct equivalent but there is the slice equiv:) -ident(a)operator(,) ident(c) operator(=) ident(func)operator(.)ident(indexes)operator(()integer(0)operator(,) integer(2)operator(\)) - - -comment(# @@PLEAC@@_10.9) -comment(# Ruby has no such limitation:) -reserved(def) method(somefunc) - ident(ary) operator(=) operator([)operator(]) - ident(hash) operator(=) operator({)operator(}) - comment(# ...) - reserved(return) ident(ary)operator(,) ident(hash) -reserved(end) -ident(arr)operator(,) ident(dict) operator(=) ident(somefunc) - -ident(array_of_hashes) operator(=) ident(fn) -ident(h1)operator(,) ident(h2)operator(,) ident(h3) operator(=) ident(fn) - - -comment(# @@PLEAC@@_10.10) -reserved(return) -comment(# or (equivalent\)) -reserved(return) pre_constant(nil) - - -comment(# @@PLEAC@@_10.11) -comment(# You can't prototype in Ruby regarding types :-() -comment(# Though, you can force the number of arguments:) -reserved(def) method(func_with_no_arg)operator(;) reserved(end) -reserved(def) method(func_with_no_arg)operator(()operator(\))operator(;) reserved(end) -reserved(def) method(func_with_one_arg)operator(()ident(a1)operator(\))operator(;) reserved(end) -reserved(def) method(func_with_two_args)operator(()ident(a1)operator(,) ident(a2)operator(\))operator(;) reserved(end) -reserved(def) method(func_with_any_number_of_args)operator(()operator(*)ident(args)operator(\))operator(;) reserved(end) - - -comment(# @@PLEAC@@_10.12) -ident(raise) string comment(# raise exception) - -reserved(begin) - ident(val) operator(=) ident(func) -reserved(rescue) constant(Exception) operator(=)operator(>) ident(msg) - global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> -reserved(end) - -comment(# In Ruby the rescue statement uses an exception class, every) -comment(# exception which is not matched is still continuing) -reserved(begin) - ident(val) operator(=) ident(func) -reserved(rescue) constant(FullMoonError) - operator(...) -reserved(end) - - -comment(# @@PLEAC@@_10.13) -comment(# Saving Global Values) -comment(# Of course we can just save the value and restore it later:) -reserved(def) method(print_age) - ident(puts) stringdelimiter(")> -reserved(end) - -global_variable($age) operator(=) integer(18) comment(# global variable) -ident(print_age)operator(()operator(\)) -reserved(if) ident(condition) - ident(safeage) operator(=) global_variable($age) - global_variable($age) operator(=) integer(23) - ident(print_age)operator(()operator(\)) - global_variable($age) operator(=) ident(safeage) -reserved(end) - -comment(# We can also use a method that saves the global variable and) -comment(# restores it automatically when the block is left:) - -reserved(def) method(local)operator(()ident(var)operator(\)) - ident(eval)operator(()stringdelimiter(")>operator(\)) - reserved(begin) - ident(result) operator(=) reserved(yield) - reserved(ensure) - comment(# we want to call this even if we got an exception) - ident(eval)operator(()stringcontent( = save)delimiter(")>operator(\)) - reserved(end) - ident(result) -reserved(end) - -ident(condition) operator(=) pre_constant(true) -global_variable($age) operator(=) integer(18) -ident(print_age)operator(()operator(\)) -reserved(if) ident(condition) - ident(local)operator(()symbol(:$age)operator(\)) operator({) - global_variable($age) operator(=) integer(23) - ident(print_age)operator(()operator(\)) - operator(}) -reserved(end) -ident(print_age)operator(()operator(\)) - -comment(# There is no need to use local(\) for filehandles or directory) -comment(# handles in ruby because filehandles are normal objects.) - - -comment(# @@PLEAC@@_10.14) -comment(# In Ruby you may redefine a method [but not overload it :-(]) -comment(# just by defining again with the same name.) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -ident(foo) -comment(#=> bar) - -comment(# You can also take a reference to an existing method before) -comment(# redefining a new one, using the `alias' keyword) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -reserved(alias) ident(foo_orig) ident(foo) -reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) -ident(foo_orig) -ident(foo) -comment(#=> foo) -comment(#=> bar) - -comment(# AFAIK, there is no direct way to create a new method whose name) -comment(# comes from a variable, so use "eval") -ident(colors) operator(=) string -ident(colors)operator(.)ident(each) operator({) operator(|)ident(c)operator(|) - ident(eval) stringstringcontent((*a\) - "" + a.to_s + "" - end)delimiter( - EOS)> -operator(}) - - -comment(# @@PLEAC@@_10.15) -reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) - string)delimiter(")> operator(+) ident(args)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string)delimiter(")> -reserved(end) -ident(puts) ident(chartreuse)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_10.16) -reserved(def) method(outer)operator(()ident(arg)operator(\)) - ident(x) operator(=) ident(arg) operator(+) integer(35) - ident(inner) operator(=) ident(proc) operator({) ident(x) operator(*) integer(19) operator(}) - ident(x) operator(+) ident(inner)operator(.)ident(call)operator(()operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_10.17) -comment(#!/usr/bin/ruby -w) -comment(# mailsort - sort mbox by different criteria) -ident(require) string -ident(require) string - -comment(# Objects of class Mail represent a single mail.) -reserved(class) class(Mail) - ident(attr_accessor) symbol(:no) - ident(attr_accessor) symbol(:subject) - ident(attr_accessor) symbol(:fulltext) - ident(attr_accessor) symbol(:date) - - reserved(def) method(initialize) - instance_variable(@fulltext) operator(=) string - instance_variable(@subject) operator(=) string - reserved(end) - - reserved(def) method(append)operator(()ident(para)operator(\)) - instance_variable(@fulltext) operator(<<) ident(para) - reserved(end) - - comment(# this is called if you call puts(mail\)) - reserved(def) method(to_s) - instance_variable(@fulltext) - reserved(end) -reserved(end) - -comment(# represents a list of mails.) -reserved(class) class(Mailbox) operator(<) constant(Array) - - constant(Subjectpattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - constant(Datepattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - - comment(# reads mails from open file and stores them) - reserved(def) method(read)operator(()ident(file)operator(\)) - global_variable($INPUT_RECORD_SEPARATOR) operator(=) string comment(# paragraph reads) - ident(msgno) operator(=) integer(-1) - ident(file)operator(.)ident(each) operator({) operator(|)ident(para)operator(|) - reserved(if) ident(para) operator(=)operator(~) regexp - ident(mail) operator(=) constant(Mail)operator(.)ident(new) - ident(mail)operator(.)ident(no) operator(=) operator(()ident(msgno) operator(+=) integer(1)operator(\)) - ident(md) operator(=) constant(Subjectpattern)operator(.)ident(match)operator(()ident(para)operator(\)) - reserved(if) ident(md) - ident(mail)operator(.)ident(subject) operator(=) ident(md)operator([)integer(1)operator(]) - reserved(end) - ident(md) operator(=) constant(Datepattern)operator(.)ident(match)operator(()ident(para)operator(\)) - reserved(if) ident(md) - ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(parse)operator(()ident(md)operator([)integer(1)operator(])operator(\)) - reserved(else) - ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(now) - reserved(end) - pre_constant(self)operator(.)ident(push)operator(()ident(mail)operator(\)) - reserved(end) - ident(mail)operator(.)ident(append)operator(()ident(para)operator(\)) reserved(if) ident(mail) - operator(}) - reserved(end) - - reserved(def) method(sort_by_subject_and_no) - pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(m)operator(|) - operator([)ident(m)operator(.)ident(subject)operator(,) ident(m)operator(.)ident(no)operator(]) - operator(}) - reserved(end) - - comment(# sorts by a list of attributs of mail, given as symbols) - reserved(def) method(sort_by_attributs)operator(()operator(*)ident(attrs)operator(\)) - comment(# you can sort an Enumerable by an array of) - comment(# values, they would be compared) - comment(# from ary[0] to ary[n]t, say:) - comment(# ['b',1] > ['a',10] > ['a',9]) - pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(elem)operator(|) - ident(attrs)operator(.)ident(map) operator({) operator(|)ident(attr)operator(|) - ident(elem)operator(.)ident(send)operator(()ident(attr)operator(\)) - operator(}) - operator(}) - reserved(end) - -reserved(end) - -ident(mailbox) operator(=) constant(Mailbox)operator(.)ident(new) -ident(mailbox)operator(.)ident(read)operator(()pre_constant(ARGF)operator(\)) - -comment(# print only subjects sorted by subject and number) -reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_subject_and_no) - ident(puts)operator(()ident(m)operator(.)ident(subject)operator(\)) -reserved(end) - -comment(# print complete mails sorted by date, then subject, then number) -reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_attributs)operator(()symbol(:date)operator(,) symbol(:subject)operator(\)) - ident(puts)operator(()ident(m)operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_11.7) -reserved(def) method(mkcounter)operator(()ident(count)operator(\)) - ident(start) operator(=) ident(count) - ident(bundle) operator(=) operator({) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(+=) integer(1) operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(-=) integer(1) operator(})operator(,) - string operator(=)operator(>) ident(proc) operator({) ident(count) operator(=) ident(start) operator(}) - operator(}) - ident(bundle)operator([)stringoperator(]) operator(=) ident(bundle)operator([)stringoperator(]) - reserved(return) ident(bundle) -reserved(end) - -ident(c1) operator(=) ident(mkcounter)operator(()integer(20)operator(\)) -ident(c2) operator(=) ident(mkcounter)operator(()integer(77)operator(\)) - -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 21 ) -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 78 ) -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 22 ) -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 21 ) -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 20 ) -ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 77 ) - - -comment(# @@PLEAC@@_11.15) -reserved(class) class(Binary_tree) - reserved(def) method(initialize)operator(()ident(val)operator(\)) - instance_variable(@value) operator(=) ident(val) - instance_variable(@left) operator(=) pre_constant(nil) - instance_variable(@right) operator(=) pre_constant(nil) - reserved(end) - - comment(# insert given value into proper point of) - comment(# provided tree. If no tree provided, ) - comment(# use implicit pass by reference aspect of @_) - comment(# to fill one in for our caller.) - reserved(def) method(insert)operator(()ident(val)operator(\)) - reserved(if) ident(val) operator(<) instance_variable(@value) reserved(then) - reserved(if) instance_variable(@left) reserved(then) - instance_variable(@left)operator(.)ident(insert)operator(()ident(val)operator(\)) - reserved(else) - instance_variable(@left) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) - reserved(end) - reserved(elsif) ident(val) operator(>) instance_variable(@value) reserved(then) - reserved(if) instance_variable(@right) reserved(then) - instance_variable(@right)operator(.)ident(insert)operator(()ident(val)operator(\)) - reserved(else) - instance_variable(@right) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) - reserved(end) - reserved(else) - ident(puts) string - comment(# do nothing, no double values) - reserved(end) - reserved(end) - - comment(# recurse on left child, ) - comment(# then show current value, ) - comment(# then recurse on right child. ) - reserved(def) method(in_order) - instance_variable(@left)operator(.)ident(in_order) reserved(if) instance_variable(@left) - ident(print) instance_variable(@value)operator(,) string - instance_variable(@right)operator(.)ident(in_order) reserved(if) instance_variable(@right) - reserved(end) - - comment(# show current value, ) - comment(# then recurse on left child, ) - comment(# then recurse on right child.) - reserved(def) method(pre_order) - ident(print) instance_variable(@value)operator(,) string - instance_variable(@left)operator(.)ident(pre_order) reserved(if) instance_variable(@left) - instance_variable(@right)operator(.)ident(pre_order) reserved(if) instance_variable(@right) - reserved(end) - - comment(# recurse on left child, ) - comment(# then recurse on right child,) - comment(# then show current value.) - reserved(def) method(post_order) - instance_variable(@left)operator(.)ident(post_order) reserved(if) instance_variable(@left) - instance_variable(@right)operator(.)ident(post_order) reserved(if) instance_variable(@right) - ident(print) instance_variable(@value)operator(,) string - reserved(end) - - comment(# find out whether provided value is in the tree.) - comment(# if so, return the node at which the value was found.) - comment(# cut down search time by only looking in the correct) - comment(# branch, based on current value.) - reserved(def) method(search)operator(()ident(val)operator(\)) - reserved(if) ident(val) operator(==) instance_variable(@value) reserved(then) - reserved(return) pre_constant(self) - reserved(elsif) ident(val) operator(<) instance_variable(@value) reserved(then) - reserved(return) instance_variable(@left)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@left) - reserved(return) pre_constant(nil) - reserved(else) - reserved(return) instance_variable(@right)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@right) - reserved(return) pre_constant(nil) - reserved(end) - reserved(end) -reserved(end) - -comment(# first generate 20 random inserts) -ident(test) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()integer(0)operator(\)) -reserved(for) ident(a) reserved(in) integer(0)operator(..)integer(20) - ident(test)operator(.)ident(insert)operator(()ident(rand)operator(()integer(1000)operator(\))operator(\)) -reserved(end) - -comment(# now dump out the tree all three ways) -ident(print) stringoperator(;) ident(test)operator(.)ident(pre_order)operator(;) ident(puts) string -ident(print) stringoperator(;) ident(test)operator(.)ident(in_order)operator(;) ident(puts) string -ident(print) stringoperator(;) ident(test)operator(.)ident(post_order)operator(;) ident(puts) string - -ident(print) string -reserved(while) ident(gets) - ident(print) ident(test)operator(.)ident(search)operator(()global_variable($_)operator(.)ident(to_i)operator(\)) - ident(print) string -reserved(end) - - -comment(# @@PLEAC@@_12.0) -comment(# class and module names need to have the first letter capitalized) -reserved(module) class(Alpha) - constant(NAME) operator(=) string -reserved(end) -reserved(module) class(Omega) - constant(NAME) operator(=) string -reserved(end) -ident(puts) stringcontent(, Omega is )inlinedelimiter(")> - -comment(# ruby doesn't differentiate beteen compile-time and run-time) -ident(require) string -ident(require) string comment(# assumes the .rb) -ident(require) string -ident(require) string comment(# assumes the .rb) -ident(load) string comment(# require only loads the file once) - -reserved(module) class(Cards) - reserved(module) class(Poker) - instance_variable(@card_deck) operator(=) constant(Array)operator(.)ident(new) comment(# or @card_deck = []) - reserved(def) method(shuffle) - reserved(end) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_12.1) -comment(# a module exports all of its functions) -reserved(module) class(Your_Module) - reserved(def) pre_constant(self)operator(.)ident(function) - comment(# this would be called as Your_Module.function) - reserved(end) - - reserved(def) constant(Your_Module)operator(.)ident(another) - comment(# this is the same as above, but more specific) - reserved(end) -reserved(end) - -comment(# @@PLEAC@@_12.2) -reserved(begin) - ident(require) string -reserved(rescue) constant(LoadError) - ident(puts) stringdelimiter(")> comment(# $! contains the last error string) -reserved(end) - -comment(# @@PLEAC@@_12.4) -comment(# module variables are private unless access functions are defined) -reserved(module) class(Alpha) - instance_variable(@aa) operator(=) integer(10) - instance_variable(@bb) operator(=) integer(11) - - reserved(def) pre_constant(self)operator(.)ident(put_aa) - ident(puts) instance_variable(@aa) - reserved(end) - - reserved(def) pre_constant(self)operator(.)ident(bb)operator(=)operator(()ident(val)operator(\)) - instance_variable(@bb) operator(=) ident(val) - reserved(end) -reserved(end) - -constant(Alpha)operator(.)ident(bb) operator(=) integer(12) -comment(# Alpha.aa = 10 # error, no aa=method) - - -comment(# @@PLEAC@@_12.5) -comment(# caller provides a backtrace of the call stack) -reserved(module) class(MyModule) - reserved(def) method(find_caller) - ident(caller) - reserved(end) - - reserved(def) method(find_caller2)operator(()ident(i)operator(\)) - ident(caller)operator(()ident(i)operator(\)) comment(# an argument limits the size of the stack returned) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_12.6) -reserved(BEGIN) operator({) - global_variable($logfile) operator(=) string reserved(unless) reserved(defined?) global_variable($logfile) - global_variable($LF) operator(=) constant(File)operator(.)ident(open)operator(()global_variable($logfile)operator(,) stringoperator(\)) -operator(}) - -reserved(module) class(Logger) - reserved(def) pre_constant(self)operator(.)ident(logmsg)operator(()ident(msg)operator(\)) - global_variable($LF)operator(.)ident(puts) ident(msg) - reserved(end) - - ident(logmsg)operator(()stringoperator(\)) -reserved(end) - -reserved(END) operator({) - constant(Logger)operator(::)ident(logmsg)operator(()stringoperator(\)) - global_variable($LF)operator(.)ident(close) -operator(}) - - -comment(# @@PLEAC@@_12.7) -comment(#-----------------------------) -comment(# results may be different on your system) -comment(# % ruby -e "$LOAD_PATH.each_index { |i| printf("%d %s\\n", i, $LOAD_PATH[i] }) -comment(#0 /usr/local/lib/site_ruby/1.6) -comment(#1 /usr/local/lib/site_ruby/1.6/i386-linux) -comment(#2 /usr/local/lib/site_ruby/) -comment(#3 /usr/lib/ruby/1.6) -comment(#4 /usr/lib/ruby/1.6/i136-linux) -comment(#5 .) -comment(#-----------------------------) -comment(# syntax for sh, bash, ksh, or zsh) -comment(#$ export RUBYLIB=$HOME/rubylib) - -comment(# syntax for csh or tcsh) -comment(# % setenv RUBYLIB ~/rubylib) -comment(#-----------------------------) -global_variable($LOAD_PATH)operator(.)ident(unshift) stringoperator(;) - - -comment(# @@PLEAC@@_12.8) -comment(# equivalents in ruby are mkmf, SWIG, or Ruby/DL depending on usage) - - -comment(# @@PLEAC@@_12.9) -comment(# no equivalent in ruby) - - -comment(# @@PLEAC@@_12.10) -comment(# no equivalent in ruby) - - -comment(# @@PLEAC@@_12.11) -reserved(module) class(FineTime) - reserved(def) pre_constant(self)operator(.)ident(time) - comment(# to be defined later) - reserved(end) -reserved(end) - - -reserved(module) class(FineTime) - reserved(def) pre_constant(self)operator(.)ident(time) - string - reserved(end) -reserved(end) - -ident(puts) constant(FineTime)operator(.)ident(time) comment(#=> "its a fine time") - - -comment(# @@PLEAC@@_12.12) -reserved(def) method(even_only)operator(()ident(n)operator(\)) - ident(raise) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) comment(# one way to test) - comment(# ...) -reserved(end) -reserved(def) method(even_only)operator(()ident(n)operator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) - comment(# ...) -reserved(end) - - -comment(# @@PLEAC@@_12.17) -comment(# The library archive for ruby is called Ruby Application archive,) -comment(# or shorter RAA, and can be found at http://raa.ruby-lang.org.) -comment(# A typical library is installed like this:) -comment(# % gunzip some-module-4.54.tar.gz) -comment(# % tar xf some-module-4.54.tar) -comment(# % cd some-module-4.54.tar) -comment(# % ruby install.rb config) -comment(# % ruby install.rb setup) -comment(# get superuser previleges here if needed for next step) -comment(# % ruby install.rb install) - -comment(# Some modules use a different process,) -comment(# you should find details in the documentation) -comment(# Here is an example of such a different process) -comment(# % ruby extconf.rb) -comment(# % make) -comment(# % make install) - -comment(# If you want the module installed in your own directory:) -comment(# For ruby version specific libraries) -comment(# % ruby install.rb config --site-ruby=~/lib) -comment(# For version independent libraries) -comment(# % ruby install.rb config --site-ruby-common=~/lib) - -comment(# Information about possible options for config) -comment(# % ruby install.rb --help) - -comment(# If you have your own complete distribution) -comment(# % ruby install.rb --prefix=path=~/ruby-private) - - -comment(# @@PLEAC@@_13.0) -comment(# Classes and objects in Ruby are rather straigthforward) -reserved(class) class(Person) - comment(# Class variables (also called static attributes\) are prefixed by @@) - class_variable(@@person_counter)operator(=)integer(0) - - comment(# object constructor) - reserved(def) method(initialize)operator(()ident(age)operator(,) ident(name)operator(,) ident(alive) operator(=) pre_constant(true)operator(\)) comment(# Default arg like in C++) - instance_variable(@age)operator(,) instance_variable(@name)operator(,) instance_variable(@alive) operator(=) ident(age)operator(,) ident(name)operator(,) ident(alive) comment(# Object attributes are prefixed by '@') - class_variable(@@person_counter) operator(+=) integer(1) - comment(# There is no '++' operator in Ruby. The '++'/'--' operators are in fact ) - comment(# hidden assignments which affect variables, not objects. You cannot accomplish) - comment(# assignment via method. Since everything in Ruby is object, '++' and '--' ) - comment(# contradict Ruby OO ideology. Instead '-=' and '+=' are used.) - reserved(end) - - ident(attr_accessor) symbol(:name)operator(,) symbol(:age) comment(# This creates setter and getter methods for @name) - comment(# and @age. See 13.3 for detailes.) - - comment(# methods modifying the receiver object usually have the '!' suffix) - reserved(def) method(die!) - instance_variable(@alive) operator(=) pre_constant(false) - ident(puts) stringcontent( has died at the age of )inlinecontent(.)delimiter(")> - instance_variable(@alive) - reserved(end) - - reserved(def) method(kill)operator(()ident(anotherPerson)operator(\)) - ident(print) instance_variable(@name)operator(,) stringoperator(,) ident(anotherPerson)operator(.)ident(name)operator(,) string - ident(anotherPerson)operator(.)ident(die!) - reserved(end) - - comment(# methods used as queries) - comment(# usually have the '?' suffix ) - reserved(def) method(alive?) - instance_variable(@alive) operator(&&) pre_constant(true) - reserved(end) - - reserved(def) method(year_of_birth) - constant(Time)operator(.)ident(now)operator(.)ident(year) operator(-) instance_variable(@age) - reserved(end) - - comment(# Class method (also called static method\)) - reserved(def) constant(Person)operator(.)ident(number_of_people) - class_variable(@@person_counter) - reserved(end) -reserved(end) - -comment(# Using the class:) -comment(# Create objects of class Person) -ident(lecter) operator(=) constant(Person)operator(.)ident(new)operator(()integer(47)operator(,) stringoperator(\)) -ident(starling) operator(=) constant(Person)operator(.)ident(new)operator(()integer(29)operator(,) stringoperator(,) pre_constant(true)operator(\)) -ident(pazzi) operator(=) constant(Person)operator(.)ident(new)operator(()integer(40)operator(,) stringoperator(,) pre_constant(true)operator(\)) - -comment(# Calling a class method) -ident(print) stringoperator(,) constant(Person)operator(.)ident(number_of_people)operator(,) string - -ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string -ident(lecter)operator(.)ident(kill)operator(()ident(pazzi)operator(\)) -ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string - -ident(print) ident(starling)operator(.)ident(name) operator(,) stringoperator(,) ident(starling)operator(.)ident(year_of_birth)operator(,) string - - -comment(# @@PLEAC@@_13.1) -comment(# If you don't need any initialisation in the constructor,) -comment(# you don't need to write a constructor.) -reserved(class) class(MyClass) -reserved(end) - -reserved(class) class(MyClass) - reserved(def) method(initialize) - instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) - instance_variable(@age) operator(=) integer(0) - reserved(end) -reserved(end) - -reserved(class) class(MyClass) - reserved(def) method(initialize)operator(()ident(inithash)operator(\)) - instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) - instance_variable(@age) operator(=) integer(0) - reserved(for) ident(key)operator(,) ident(value) reserved(in) ident(inithash) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(value)operator(\)) - reserved(end) - reserved(end) -reserved(end) - -comment(# @@PLEAC@@_13.2) -comment(# Objects are destroyed by the garbage collector.) -comment(# The time of destroying is not predictable.) -comment(# The ruby garbage collector can handle circular references,) -comment(# so there is no need to write destructor for that.) - -comment(# There is no direct support for destructor.) -comment(# You can call a custom function, or more specific a proc object, when the) -comment(# garbage collector is about to destruct the object, but it is unpredictable) -comment(# when this occurs.) -comment(# Also if such a finalizer object has a reference to the orignal object,) -comment(# this may prevent the original object to get garbage collected.) -comment(# Because of this problem the finalize method below is) -comment(# a class method and not a instance method.) -comment(# So if you need to free resources for an object, like) -comment(# closing a socket or kill a spawned subprocess,) -comment(# you should do it explicitly.) - -reserved(class) class(MyClass) - reserved(def) method(initialize) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - reserved(def) constant(MyClass)operator(.)ident(finalize)operator(()ident(id)operator(\)) - ident(puts) stringcontent( dying at )inlinedelimiter(")> - reserved(end) -reserved(end) - -comment(# test code) -integer(3)operator(.)ident(times) operator({) - constant(MyClass)operator(.)ident(new) -operator(}) -constant(ObjectSpace)operator(.)ident(garbage_collect) - - -comment(# @@PLEAC@@_13.3) -comment(# You can write getter and setter methods in a natural way:) -reserved(class) class(Person) - reserved(def) method(name) - instance_variable(@name) - reserved(end) - reserved(def) method(name=)operator(()ident(name)operator(\)) - instance_variable(@name) operator(=) ident(name) - reserved(end) -reserved(end) - -comment(# But there is a better and shorter way) -reserved(class) class(Person) - ident(attr_reader) symbol(:age) - ident(attr_writer) symbol(:name) - comment(# attr_reader and attr_writer are actually methods in class Class) - comment(# which set getter and setter methods for you.) -reserved(end) - -comment(# There is also attr_accessor to create both setters and getters) -reserved(class) class(Person) - ident(attr_accessor) symbol(:age)operator(,) symbol(:name) -reserved(end) - - -comment(# @@PLEAC@@_13.4) -reserved(class) class(Person) - comment(# Class variables (also called static attributes\) are prefixed by @@) - class_variable(@@person_counter) operator(=) integer(0) - - reserved(def) constant(Person)operator(.)ident(population) - class_variable(@@person_counter) - reserved(end) - reserved(def) method(initialize) - class_variable(@@person_counter) operator(+=) integer(1) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - reserved(def) constant(Person)operator(.)ident(finalize)operator(()ident(id)operator(\)) - class_variable(@@person_counter) operator(-=) integer(1) - reserved(end) -reserved(end) -ident(people) operator(=) operator([)operator(]) -integer(10)operator(.)ident(times) operator({) - ident(people)operator(.)ident(push)operator(()constant(Person)operator(.)ident(new)operator(\)) -operator(}) -ident(printf)operator(()stringoperator(,) constant(Person)operator(.)ident(population)operator(\)) - - -constant(FixedArray)operator(.)ident(class_max_bounds) operator(=) integer(100) -ident(alpha) operator(=) constant(FixedArray)operator(.)ident(new) -ident(puts) stringdelimiter(")> - -ident(beta) operator(=) constant(FixedArray)operator(.)ident(new) -ident(beta)operator(.)ident(max_bounds) operator(=) integer(50) comment(# calls the instance method) -ident(beta)operator(.)ident(class)operator(.)ident(class_max_bounds) operator(=) integer(50) comment(# alternative, calls the class method) -ident(puts) stringdelimiter(")> - -reserved(class) class(FixedArray) - class_variable(@@bounds) operator(=) integer(7) - - reserved(def) method(max_bounds) - class_variable(@@max_bounds) - reserved(end) - comment(# instance method, which sets the class variable) - reserved(def) method(max_bounds=)operator(()ident(value)operator(\)) - class_variable(@@max_bounds) operator(=) ident(value) - reserved(end) - comment(# class method. This can only be called on a class,) - comment(# but not on the instances) - reserved(def) constant(FixedArray)operator(.)ident(class_max_bounds)operator(=)operator(()ident(value)operator(\)) - class_variable(@@max_bounds) operator(=) ident(value) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.5) -constant(PersonStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(,) symbol(:age)operator(,) symbol(:peers)operator(\)) -comment(# creates a class "Person::Struct", which is accessiable with the) -comment(# constant "PersonStruct") -ident(p) operator(=) constant(PersonStruct)operator(.)ident(new) -ident(p) operator(=) constant(Struct)operator(::)constant(Person)operator(.)ident(new) comment(# alternative using the classname) -ident(p)operator(.)ident(name) operator(=) string -ident(p)operator(.)ident(age) operator(=) integer(13) -ident(p)operator(.)ident(peers) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) -ident(p)operator([)symbol(:peers)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using symbol) -ident(p)operator([)stringoperator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using name of field) -ident(p)operator([)integer(2)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using index of field) -ident(puts) stringcontent(, )inlinecontent('s first friend is )inlinedelimiter(")> - -comment(# The fields of a struct have no special type, like other ruby variables) -comment(# you can put any objects in. Therefore the discussions how to specify) -comment(# the types of the fields do not apply to ruby.) - -constant(FamilyStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:head)operator(,) symbol(:address)operator(,) symbol(:members)operator(\)) -ident(folks) operator(=) constant(FamilyStruct)operator(.)ident(new) -ident(folks)operator(.)ident(head) operator(=) constant(PersonStruct)operator(.)ident(new) -ident(dad) operator(=) ident(folks)operator(.)ident(head) -ident(dad)operator(.)ident(name) operator(=) string -ident(dad)operator(.)ident(age) operator(=) integer(34) - -comment(# supply of own accessor method for the struct for error checking) -reserved(class) class(PersonStruct) - reserved(def) method(age=)operator(()ident(value)operator(\)) - reserved(if) operator(!)ident(value)operator(.)ident(kind_of?)operator(()constant(Integer)operator(\)) - ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( isn't an Integer)delimiter(")>operator(\)) - reserved(elsif) ident(value) operator(>) integer(150) - ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( is unreasonable)delimiter(")>operator(\)) - reserved(end) - instance_variable(@age) operator(=) ident(value) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.6) -comment(# The ruby Object class defines a dup and a clone method.) -comment(# The dup method is recommended for prototype object creation.) -comment(# The default implementation makes a shallow copy,) -comment(# but each class can override it, for example to make a deep copy.) - -comment(# If you want to call 'new' directly on the instances,) -comment(# you can create a instance method "new", which returns a new duplicate.) -comment(# This method is distinct from the class method new.) -comment(#) -reserved(class) class(A) - reserved(def) method(new) - ident(dup) - reserved(end) -reserved(end) - -ident(ob1) operator(=) constant(A)operator(.)ident(new) -comment(# later on) -ident(ob2) operator(=) ident(ob1)operator(.)ident(new) - - -comment(# @@PLEAC@@_13.7) -ident(methname) operator(=) string -ident(obj)operator(.)ident(send)operator(()ident(methname)operator(,) integer(10)operator(\)) comment(# calls obj.flicker(10\)) - -comment(# call three methods on the object, by name) -operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(method_string)operator(|) - ident(obj)operator(.)ident(send)operator(()ident(method_string)operator(\)) -reserved(end) - -comment(# Another way is to create a Method object) -ident(method_obj) operator(=) ident(obj)operator(.)ident(method)operator(()stringoperator(\)) -comment(# And then call it) -ident(method_obj)operator(.)ident(call)operator(()integer(10)operator(\)) - - -comment(# @@PLEAC@@_13.8) -comment(# All classes in Ruby inherit from class Object) -comment(# and thus all objects share methods defined in this class) - -comment(# the class of the object) -ident(puts) ident(any_object)operator(.)ident(type) - -comment(# Ruby classes are actually objects of class Class and they) -comment(# respond to methods defined in Object class as well) - -comment(# the superclass of this class) -ident(puts) ident(any_object)operator(.)ident(class)operator(.)ident(superclass) - -comment(# ask an object whether it is an instance of particular class) -ident(n) operator(=) float(4.7) -ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Float)operator(\)) comment(# true) -ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Numeric)operator(\)) comment(# false) - -comment(# ask an object whether it is an instance of class, one of the) -comment(# superclasses of the object, or modules included in it) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Float)operator(\)) comment(# true (the class\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Numeric)operator(\)) comment(# true (an ancestor class\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Comparable)operator(\)) comment(# true (a mixin module\)) -ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) comment(# false) - -comment(# ask an object whether it can respond to a particular method) -ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# true) -ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# false) - -comment(# all methods an object can respond to) -stringoperator(.)ident(methods)operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(puts) ident(m) operator(}) - - -comment(# @@PLEAC@@_13.9) -comment(# Actually any class in Ruby is inheritable) -reserved(class) class(Person) - ident(attr_accessor) symbol(:age)operator(,) symbol(:name) - reserved(def) method(initialize) - instance_variable(@name) - instance_variable(@age) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(dude) operator(=) constant(Person)operator(.)ident(new) -ident(dude)operator(.)ident(name) operator(=) string -ident(dude)operator(.)ident(age) operator(=) integer(23) -ident(printf) stringoperator(,) ident(dude)operator(.)ident(name)operator(,) ident(dude)operator(.)ident(age) -comment(#-----------------------------) -comment(# Inheriting from Person) -reserved(class) class(Employee) operator(<) constant(Person) - ident(attr_accessor) symbol(:salary) -reserved(end) -comment(#-----------------------------) -ident(empl) operator(=) constant(Employee)operator(.)ident(new) -ident(empl)operator(.)ident(name) operator(=) string -ident(empl)operator(.)ident(age) operator(=) integer(23) -ident(empl)operator(.)ident(salary) operator(=) integer(200) -ident(printf) stringoperator(,) ident(empl)operator(.)ident(name)operator(,) ident(empl)operator(.)ident(age)operator(,) ident(empl)operator(.)ident(salary) -comment(#-----------------------------) -comment(# Any built-in class can be inherited the same way) -reserved(class) class(WeirdString) operator(<) constant(String) - reserved(def) method(initialize)operator(()ident(obj)operator(\)) - reserved(super) ident(obj) - reserved(end) - reserved(def) method(+)operator(()ident(anotherObj)operator(\)) comment(# + method in this class is overridden) - comment(# to return the sum of string lengths) - pre_constant(self)operator(.)ident(length) operator(+) ident(anotherObj)operator(.)ident(length) comment(# 'self' can be omitted) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(a) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) -ident(b) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) - -ident(puts) ident(a) operator(+) ident(b) comment(# the overridden +) -comment(#=> 8) -ident(puts) ident(a)operator(.)ident(length) comment(# method from the superclass, String) -comment(#=> 5) - - -comment(# @@PLEAC@@_13.11) -comment(# In ruby you can override the method_missing method) -comment(# to have a solution similar to perls AUTOLOAD.) -reserved(class) class(Person) - - reserved(def) method(initialize) - instance_variable(@ok_fields) operator(=) string - reserved(end) - - reserved(def) method(valid_attribute?)operator(()ident(name)operator(\)) - instance_variable(@ok_fields)operator(.)ident(include?)operator(()ident(name)operator(\)) - reserved(end) - - reserved(def) method(method_missing)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) - ident(name) operator(=) ident(namesymbol)operator(.)ident(to_s) - reserved(return) reserved(if) ident(name) operator(=)operator(~) regexp - reserved(if) ident(name)operator(.)ident(to_s)operator([)integer(-1)operator(]) operator(==) operator(()stringoperator([)integer(0)operator(])operator(\)) comment(# we have a setter) - ident(isSetter) operator(=) pre_constant(true) - ident(name)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) - reserved(end) - reserved(if) ident(valid_attribute?)operator(()ident(name)operator(\)) - reserved(if) ident(isSetter) - ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) - reserved(else) - ident(instance_variable_get)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) - reserved(end) - reserved(else) - comment(# if no annestor is responsible,) - comment(# the Object class will throw a NoMethodError exception) - reserved(super)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) - reserved(end) - reserved(end) - - reserved(def) method(new) - ident(kid) operator(=) constant(Person)operator(.)ident(new) - ident(kid)operator(.)ident(parent) operator(=) pre_constant(self) - ident(kid) - reserved(end) - -reserved(end) - -ident(dad) operator(=) constant(Person)operator(.)ident(new) -ident(dad)operator(.)ident(name) operator(=) string -ident(dad)operator(.)ident(age) operator(=) integer(23) -ident(kid) operator(=) ident(dad)operator(.)ident(new) -ident(kid)operator(.)ident(name) operator(=) string -ident(kid)operator(.)ident(age) operator(=) integer(2) -ident(puts) stringdelimiter(")> -ident(puts) ident(dad) -ident(puts) ident(kid) - -reserved(class) class(Employee) operator(<) constant(Person) - reserved(def) method(initialize) - reserved(super) - instance_variable(@ok_fields)operator(.)ident(push)operator(()stringoperator(,) stringoperator(\)) - reserved(end) - reserved(def) method(ok_fields) - instance_variable(@ok_fields) - reserved(end) -reserved(end) - - -comment(# @@PLEAC@@_13.13) -comment(# The ruby garbage collector pretends to cope with circular structures.) -comment(# You can test it with this code:) -reserved(class) class(RingNode) - ident(attr_accessor) symbol(:next) - ident(attr_accessor) symbol(:prev) - ident(attr_reader) symbol(:name) - - reserved(def) method(initialize)operator(()ident(aName)operator(\)) - instance_variable(@name) operator(=) ident(aName) - constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) - pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) - reserved(end) - - reserved(def) constant(RingNode)operator(.)ident(finalize)operator(()ident(id)operator(\)) - ident(puts) stringcontent( dying)delimiter(")> - reserved(end) - - reserved(def) constant(RingNode)operator(.)ident(show_all_objects) - constant(ObjectSpace)operator(.)ident(each_object) operator({)operator(|)ident(id)operator(|) - ident(puts) ident(id)operator(.)ident(name) reserved(if) ident(id)operator(.)ident(class) operator(==) constant(RingNode) - operator(}) - reserved(end) -reserved(end) - -reserved(def) method(create_test) - ident(a) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(b) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(c) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) - ident(a)operator(.)ident(next) operator(=) ident(b) - ident(b)operator(.)ident(next) operator(=) ident(c) - ident(c)operator(.)ident(next) operator(=) ident(a) - ident(a)operator(.)ident(prev) operator(=) ident(c) - ident(c)operator(.)ident(prev) operator(=) ident(b) - ident(b)operator(.)ident(prev) operator(=) ident(a) - - ident(a) operator(=) pre_constant(nil) - ident(b) operator(=) pre_constant(nil) - ident(c) operator(=) pre_constant(nil) -reserved(end) - -ident(create_test) -constant(RingNode)operator(.)ident(show_all_objects) -constant(ObjectSpace)operator(.)ident(garbage_collect) -ident(puts) string -constant(RingNode)operator(.)ident(show_all_objects) - - -comment(# @@PLEAC@@_13.14) -reserved(class) class(String) - reserved(def) method(<=>)operator(()ident(other)operator(\)) - pre_constant(self)operator(.)ident(casecmp) ident(other) - reserved(end) -reserved(end) - -comment(# There is no way to directly overload the '""' (stringify\) ) -comment(# operator in Ruby. However, by convention, classes which ) -comment(# can reasonably be converted to a String will define a ) -comment(# 'to_s' method as in the TimeNumber class defined below.) -comment(# The 'puts' method will automatcally call an object's) -comment(# 'to_s' method as is demonstrated below.) -comment(# Furthermore, if a class defines a to_str method, an object of that) -comment(# class can be used most any place where the interpreter is looking ) -comment(# for a String value.) - -comment(#---------------------------------------) -comment(# NOTE: Ruby has a builtin Time class which would usually be used ) -comment(# to manipulate time objects, the following is supplied for) -comment(# educational purposes to demonstrate operator overloading.) -comment(#) -reserved(class) class(TimeNumber) - ident(attr_accessor) symbol(:hours)operator(,)symbol(:minutes)operator(,)symbol(:seconds) - reserved(def) method(initialize)operator(() ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) - instance_variable(@hours) operator(=) ident(hours) - instance_variable(@minutes) operator(=) ident(minutes) - instance_variable(@seconds) operator(=) ident(seconds) - reserved(end) - - reserved(def) method(to_s) - reserved(return) ident(sprintf)operator(() stringoperator(,) instance_variable(@hours)operator(,) instance_variable(@minutes)operator(,) instance_variable(@seconds)operator(\)) - reserved(end) - - reserved(def) method(to_str) - ident(to_s) - reserved(end) - - reserved(def) method(+)operator(() ident(other)operator(\)) - ident(seconds) operator(=) instance_variable(@seconds) operator(+) ident(other)operator(.)ident(seconds) - ident(minutes) operator(=) instance_variable(@minutes) operator(+) ident(other)operator(.)ident(minutes) - ident(hours) operator(=) instance_variable(@hours) operator(+) ident(other)operator(.)ident(hours) - reserved(if) ident(seconds) operator(>)operator(=) integer(60) - ident(seconds) operator(%=) integer(60) - ident(minutes) operator(+=) integer(1) - reserved(end) - reserved(if) ident(minutes) operator(>)operator(=) integer(60) - ident(minutes) operator(%=) integer(60) - ident(hours) operator(+=) integer(1) - reserved(end) - reserved(return) constant(TimeNumber)operator(.)ident(new)operator(()ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) - reserved(end) - - reserved(def) method(-)operator(()ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(*)operator(()ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) - - reserved(def) method(/)operator(() ident(other)operator(\)) - ident(raise) constant(NotImplementedError) - reserved(end) -reserved(end) - -ident(t1) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(58)operator(,) integer(59)operator(\)) -ident(sec) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(0)operator(,) integer(1)operator(\)) -ident(min) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) -ident(puts) ident(t1) operator(+) ident(sec) operator(+) ident(min) operator(+) ident(min) - -comment(#-----------------------------) -comment(# StrNum class example: Ruby's builtin String class already has the ) -comment(# capabilities outlined in StrNum Perl example, however the '*' operator) -comment(# on Ruby's String class acts differently: It creates a string which) -comment(# is the original string repeated N times.) -comment(#) -comment(# Using Ruby's String class as is in this example:) -ident(x) operator(=) stringoperator(;) ident(y) operator(=) string -ident(z) operator(=) ident(x)operator(+)ident(y) -ident(r) operator(=) ident(z)operator(*)integer(3) comment(# r is "RedBlackRedBlackRedBlack") -ident(puts) stringcontent(, )inlinecontent(, )inlinecontent(, and )inlinedelimiter(")> -ident(print) stringcontent( is )delimiter(")>operator(,) ident(x) operator(<) ident(y) operator(?) string operator(:) stringoperator(,) stringchar(\\n)delimiter(")> -comment(# prints:) -comment(# values are Red, Black, RedBlack, and RedBlackRedBlackRedBlack) -comment(# Red is GE Black) - -comment(#-----------------------------) -reserved(class) class(FixNum) - constant(REGEX) operator(=) regexp - constant(DEFAULT_PLACES) operator(=) integer(0) - ident(attr_accessor) symbol(:value)operator(,) symbol(:places) - reserved(def) method(initialize)operator(()ident(value)operator(,) ident(places) operator(=) pre_constant(nil)operator(\)) - instance_variable(@value) operator(=) ident(value) - reserved(if) ident(places) - instance_variable(@places) operator(=) ident(places) - reserved(else) - ident(m) operator(=) constant(REGEX)operator(.)ident(match)operator(()ident(value)operator(.)ident(to_s)operator(\)) - reserved(if) ident(m) - instance_variable(@places) operator(=) ident(m)operator([)integer(0)operator(])operator(.)ident(length) operator(-) integer(1) - reserved(else) - instance_variable(@places) operator(=) constant(DEFAULT_PLACES) - reserved(end) - reserved(end) - reserved(end) - - reserved(def) method(+)operator(()ident(other)operator(\)) - constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(+) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - reserved(end) - - reserved(def) method(*)operator(()ident(other)operator(\)) - constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(*) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) - reserved(end) - - reserved(def) method(/)operator(()ident(other)operator(\)) - ident(puts) stringdelimiter(")> - ident(result) operator(=) constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value)operator(.)ident(to_f)operator(/)ident(other)operator(.)ident(value)operator(.)ident(to_f)operator(\)) - ident(result)operator(.)ident(places) operator(=) ident(max)operator(()ident(result)operator(.)ident(places)operator(,)ident(other)operator(.)ident(places)operator(\)) - ident(result) - reserved(end) - - reserved(def) method(to_s) - ident(sprintf)operator(()stringoperator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(to_s) operator(,) instance_variable(@places)operator(,) instance_variable(@value)operator(\)) comment(#.) - reserved(end) - - reserved(def) method(to_str) - ident(to_s) - reserved(end) - - reserved(def) method(to_i) comment(#convert to int) - instance_variable(@value)operator(.)ident(to_i) - reserved(end) - - reserved(def) method(to_f) comment(#convert to float`) - instance_variable(@value)operator(.)ident(to_f) - reserved(end) - - ident(private) - reserved(def) method(max)operator(()ident(a)operator(,)ident(b)operator(\)) - ident(a) operator(>) ident(b) operator(?) ident(a) operator(:) ident(b) - reserved(end) -reserved(end) - -reserved(def) method(demo)operator(()operator(\)) - ident(x) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(40)operator(\)) - ident(y) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(12)operator(,) integer(0)operator(\)) - - ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> - ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> - - ident(z) operator(=) ident(x)operator(/)ident(y) - ident(puts) stringcontent( has )inlinecontent( places)delimiter(")> - reserved(unless) ident(z)operator(.)ident(places) - ident(z)operator(.)ident(places) operator(=) integer(2) - reserved(end) - - ident(puts) stringcontent( by )inlinecontent( is )inlinedelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - -reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) - ident(demo)operator(()operator(\)) -reserved(end) - - -comment(# @@PLEAC@@_14.1) -comment(# There are dbm, sdbm, gdbm modules) -comment(# and the bdb module for accessing the berkeley db) -comment(# sdbm seem to be available on the most systems,) -comment(# so we use it here) -comment(#) -ident(require) string -constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) - comment(# raises exception if open error) - - comment(# the returned sdbm-dbobj has most of the methods of a hash) - ident(v) operator(=) ident(dbobj)operator([)stringoperator(]) - ident(dbobj)operator([)stringoperator(]) operator(=) string - reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()stringoperator(\)) - comment(# ...) - reserved(end) - ident(dbobj)operator(.)ident(delete)operator(()stringoperator(\)) -operator(}) -comment(# database is open only inside the block.) - -comment(# It is also possible to use a open .. close pair:) -ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -comment(#.. do something with dbobj) -ident(dbobj)operator(.)ident(close) - -comment(#!/usr/bin/ruby -w) -comment(# userstats - generate statistics on who is logged in) -comment(# call with usernames as argument to display the totals) -comment(# for the given usernames, call with "ALL" to display all users) - -ident(require) string -ident(filename) operator(=) string -constant(SDBM)operator(.)ident(open)operator(()ident(filename)operator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) - reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(>) integer(0) - reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) string - comment(# ARGV is constant, so we need the variable userlist) - ident(userlist) operator(=) ident(dbobj)operator(.)ident(keys)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) - reserved(else) - ident(userlist) operator(=) pre_constant(ARGV) - reserved(end) - ident(userlist)operator(.)ident(each) operator({) operator(|)ident(user)operator(|) - ident(print) stringchar(\\t)inlinechar(\\n)delimiter(")> - operator(}) - reserved(else) - ident(who) operator(=) shell - ident(who)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) - ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) - ident(raise) stringdelimiter(")> reserved(unless) ident(md) - comment(# sdbm stores only strings, so "+=" doesn't work,) - comment(# we need to convert them expicitly back to integer.) - reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()ident(md)operator([)integer(0)operator(])operator(\)) - ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) - reserved(else) - ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) string - reserved(end) - operator(}) - reserved(end) -operator(}) - - -comment(# @@PLEAC@@_14.2) -comment(# using open and clear) -ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -ident(dbobj)operator(.)ident(clear)operator(()operator(\)) -ident(dbobj)operator(.)ident(close)operator(()operator(\)) -comment(# deleting file and recreating it) -comment(# the filenames depend on the flavor of dbm you use,) -comment(# for example sdbm has two files named filename.pag and filename.dir,) -comment(# so you need to delete both files) -reserved(begin) - constant(File)operator(.)ident(delete)operator(()stringoperator(\)) - comment(# raises Exception if not exist) - ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) -reserved(rescue) - comment(# add error handling here) -reserved(end) - - -comment(# @@PLEAC@@_14.3) -comment(# sdbm2gdbm: converts sdbm database to a gdbm database) -ident(require) string -ident(require) string - -reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(2) - ident(fail) string -reserved(end) -ident(infile) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(1)operator(]) - -ident(sdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile)operator(\)) -ident(gdb) operator(=) constant(GDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) -ident(sdb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) - ident(gdb)operator([)ident(key)operator(]) operator(=) ident(val) -operator(}) -ident(gdb)operator(.)ident(close) -ident(sdb)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.4) -comment(#!/usr/bin/ruby -w) -comment(# dbmmerge: merges two dbm databases) -ident(require) string - -reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(3) - ident(fail) string -reserved(end) -ident(infile1) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(infile2) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(2)operator(]) - -ident(in1) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile1)operator(,) pre_constant(nil)operator(\)) -ident(in2) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile2)operator(,) pre_constant(nil)operator(\)) -ident(outdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) - -operator([)ident(in1)operator(,) ident(in2)operator(])operator(.)ident(each) operator({) operator(|)ident(indb)operator(|) - ident(indb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) - reserved(if) ident(outdb)operator(.)ident(has_key?)operator(()ident(key)operator(\)) - comment(# decide which value to set.) - comment(# set outdb[key] if necessary) - reserved(else) - ident(outdb)operator([)ident(key)operator(]) operator(=) ident(val) - reserved(end) - operator(}) -operator(}) -ident(in1)operator(.)ident(close) -ident(in2)operator(.)ident(close) -ident(outdb)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.7) -comment(# we write a tie method that extends the Array class.) -comment(# It reads the file into the memory, executes the code block) -comment(# in which you can manipulate the array as needed, and writes) -comment(# the array back to the file after the end of the block execution) -reserved(class) class(Array) - reserved(def) method(tie)operator(()ident(filename)operator(,) ident(flags)operator(\)) - constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) ident(flags)operator(\)) operator({) operator(|)ident(f)operator(|) - ident(f)operator(.)ident(each_line) operator({) operator(|)ident(line)operator(|) - pre_constant(self)operator(.)ident(push)operator(()ident(line)operator(.)ident(chomp)operator(\)) - operator(}) - reserved(yield) - ident(f)operator(.)ident(rewind) - ident(each) operator({) operator(|)ident(line)operator(|) - reserved(if) ident(line) - ident(f)operator(.)ident(puts)operator(()ident(line)operator(\)) - reserved(else) - ident(f)operator(.)ident(puts) string - reserved(end) - operator(}) - operator(}) - reserved(end) -reserved(end) - -ident(array) operator(=) constant(Array)operator(.)ident(new) -ident(array)operator(.)ident(tie)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) operator({) - ident(array)operator([)integer(4)operator(]) operator(=) string -operator(}) - -comment(# The tied array can be manipulated like a normal array,) -comment(# so there is no need for a special API, and the recno_demo program) -comment(# to demonstrate is API is useless) - - -comment(# tied array demo: show how to use array with a tied file) -ident(filename) operator(=) string -ident(lines) operator(=) constant(Array)operator(.)ident(new) -constant(File)operator(.)ident(unlink)operator(()ident(filename)operator(\)) reserved(if) constant(File)operator(.)ident(exists?)operator(()ident(filename)operator(\)) -ident(lines)operator(.)ident(tie)operator(()ident(filename)operator(,) constant(File)operator(::)constant(RDWR) operator(|) constant(File)operator(::)constant(CREAT)operator(\)) operator({) - comment(# first create a textfile to play with) - ident(lines)operator([)integer(0)operator(]) operator(=) string - ident(lines)operator([)integer(1)operator(]) operator(=) string - ident(lines)operator([)integer(2)operator(]) operator(=) string - ident(lines)operator([)integer(3)operator(]) operator(=) string - ident(lines)operator([)integer(4)operator(]) operator(=) string - - comment(# print the records in order.) - comment(# Opposed to perl, the tied array behaves exactly as a normal array) - ident(puts) string - reserved(for) ident(i) reserved(in) integer(0)operator(..)operator(()ident(lines)operator(.)ident(length)integer(-1)operator(\)) - ident(puts) stringcontent(: )inlinedelimiter(")> - reserved(end) - - comment(#use push and pop) - ident(a) operator(=) ident(lines)operator(.)ident(pop) - ident(lines)operator(.)ident(push)operator(()stringoperator(\)) - ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) - - comment(#use shift and unshift) - ident(a) operator(=) ident(lines)operator(.)ident(shift) - ident(lines)operator(.)ident(unshift)operator(()stringoperator(\)) - ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) - - comment(# add record after record 2) - ident(i) operator(=) integer(2) - ident(lines)operator(.)ident(insert)operator(()ident(i) operator(+) integer(1)operator(,) stringoperator(\)) - - comment(# add record before record one) - ident(i) operator(=) integer(1) - ident(lines)operator(.)ident(insert)operator(()ident(i)operator(,) stringoperator(\)) - - comment(# delete record 3) - ident(lines)operator(.)ident(delete_at)operator(()integer(3)operator(\)) - - comment(#now print the records in reverse order) - ident(puts) string - operator(()ident(lines)operator(.)ident(length) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\))operator({) operator(|)ident(i)operator(|) - ident(puts) stringcontent(: )inlinedelimiter(")> - operator(}) - -operator(}) - - -comment(# @@PLEAC@@_14.8) -comment(# example to store complex data in a database) -comment(# uses marshall from the standard library) -ident(require) string -ident(db) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) - -comment(# convert the Objects into strings and back by using the Marshal module.) -comment(# Most normal objects can be converted out of the box,) -comment(# but not special things like procedure objects,) -comment(# IO instance variables, singleton objects) - -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) -stringoperator(])operator(\)) - -ident(name1) operator(=) string -ident(name2) operator(=) string - -ident(tom1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name1)operator(])operator(\)) -ident(tom2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name2)operator(])operator(\)) - -ident(puts) stringcontent( )inlinedelimiter(")> - -reserved(if) ident(tom1)operator([)integer(0)operator(]) operator(==) ident(tom2)operator([)integer(0)operator(]) operator(&&) ident(tom1)operator([)integer(1)operator(]) operator(==) ident(tom2)operator([)integer(1)operator(]) - ident(puts) string -reserved(else) - ident(puts) string -reserved(end) - -comment(# To change parts of an entry, get the whole entry, change the parts,) -comment(# and save the whole entry back) -ident(entry) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)stringoperator(])operator(\)) -ident(entry)operator([)integer(0)operator(]) operator(=) string -ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()ident(entry)operator(\)) -ident(db)operator(.)ident(close) - - -comment(# @@PLEAC@@_14.9) -comment(# example to make data persistent) -comment(# uses Marshal from the standard lib) -comment(# Stores the data in a simple file,) -comment(# see 14.8 on how to store it in a dbm file) - -comment(# The BEGIN block is executed before the rest of the script) -comment(# we use global variables here because local variables) -comment(# will go out of scope and are not accessible from the main script) - -reserved(BEGIN) operator({) - global_variable($persistent_store) operator(=) string - reserved(begin) - constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(\)) reserved(do) operator(|)ident(f)operator(|) - global_variable($stringvariable1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) - global_variable($arrayvariable2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) - reserved(end) - reserved(rescue) - ident(puts) stringdelimiter(")> - comment(# Initialisation if this script runs the first time) - global_variable($stringvariable1) operator(=) string - global_variable($arrayvariable2) operator(=) operator([)operator(]) - reserved(end) -operator(}) - -reserved(END) operator({) - constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) - constant(Marshal)operator(.)ident(dump)operator(()global_variable($stringvariable1)operator(,) ident(f)operator(\)) - constant(Marshal)operator(.)ident(dump)operator(()global_variable($arrayvariable2)operator(,) ident(f)operator(\)) - reserved(end) -operator(}) - -comment(# simple test program) -ident(puts) global_variable($stringvariable1) -ident(puts) global_variable($arrayvariable2) -global_variable($stringvariable1) operator(=) string -global_variable($arrayvariable2)operator(.)ident(push)operator(()integer(5)operator(\)) -ident(puts) global_variable($stringvariable1) -ident(puts) global_variable($arrayvariable2) - - -comment(# @@PLEAC@@_14.10) -comment(#!/usr/bin/ruby -w) -comment(# Ruby has a dbi module with an architecture similar) -comment(# to the Perl dbi module: the dbi module provides an unified) -comment(# interface and uses specialized drivers for each dbms vendor) -comment(#) -reserved(begin) - constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - operator(|)ident(dbh)operator(|) - - ident(dbh)operator(.)ident(do)operator(()constant(SQL1)operator(\)) - - ident(dbh)operator(.)ident(prepare)operator(()constant(SQL2)operator(\))operator({) operator(|)ident(sth)operator(|) - ident(sth)operator(.)ident(execute) - ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) - comment(# ...) - operator(}) - operator(}) comment(# end of block finishes the statement handle) - operator(}) comment(# end of block closes the database connection) -reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) - ident(puts) string - ident(puts) stringdelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - -comment(#!/usr/bin/ruby -w) -comment(# dbusers - example for mysql which creates a table,) -comment(# fills it with values, retrieves the values back,) -comment(# and finally destroys the table.) - -ident(require) string - -comment(# replacement for the User::pwnt module) -reserved(def) method(getpwent) - ident(result) operator(=) operator([)operator(]) - constant(File)operator(.)ident(open)operator(()stringoperator(\)) operator({)operator(|)ident(file)operator(|) - ident(file)operator(.)ident(each_line) operator({)operator(|)ident(line)operator(|) - reserved(next) reserved(if) ident(line)operator(.)ident(match)operator(()regexpoperator(\)) - ident(cols) operator(=) ident(line)operator(.)ident(split)operator(()stringoperator(\)) - ident(result)operator(.)ident(push)operator(()operator([)ident(cols)operator([)integer(2)operator(])operator(,) ident(cols)operator([)integer(0)operator(])operator(])operator(\)) - operator(}) - operator(}) - ident(result) -reserved(end) - -reserved(begin) - constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - operator(|)ident(conn)operator(|) - - ident(conn)operator(.)ident(do)operator(()stringoperator(\)) - - ident(users) operator(=) ident(getpwent) - - ident(conn)operator(.)ident(prepare)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) - ident(users)operator(.)ident(each) operator({)operator(|)ident(entry)operator(|) - ident(sth)operator(.)ident(execute)operator(()ident(entry)operator([)integer(0)operator(])operator(,) ident(entry)operator([)integer(1)operator(])operator(\)) - operator(}) - operator(}) - - ident(conn)operator(.)ident(execute)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) - ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) - ident(puts) ident(row)operator(.)ident(collect) operator({)operator(|)ident(col)operator(|) - reserved(if) ident(col)operator(.)ident(nil?) - string - reserved(else) - ident(col) - reserved(end) - operator(})operator(.)ident(join)operator(()stringoperator(\)) - operator(}) - operator(}) - - ident(conn)operator(.)ident(do)operator(()stringoperator(\)) - operator(}) -reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) - ident(puts) string - ident(puts) stringdelimiter(")> - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_15.1) -comment(# This test program demonstrates parsing program arguments.) -comment(# It uses the optparse library, which is included with ruby 1.8) -comment(# It handles classic unix style and gnu style options) -ident(require) string - -instance_variable(@debugmode) operator(=) pre_constant(false) -instance_variable(@verbose) operator(=) pre_constant(false) - -pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opts)operator(|) - ident(opts)operator(.)ident(banner) operator(=) stringcontent( [OPTIONS] INPUTFILES)delimiter(")> - - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) - ident(puts) ident(opts) - ident(exit) - operator(}) - comment(# The OptionParser#on method is called with a specification of short) - comment(# options, of long options, a data type spezification and user help) - comment(# messages for this option.) - comment(# The method analyses the given parameter and decides what it is,) - comment(# so you can leave out the long option if you don't need it) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) stringoperator(\)) operator({) - operator(|)instance_variable(@verbose)operator(|) comment(# sets @verbose to true or false) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) string operator(\))operator({) - operator(|)instance_variable(@debugmode)operator(|) comment(# sets @debugmode to true) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(Integer)operator(,) string operator(\))operator({) - operator(|)instance_variable(@count)operator(|) comment(# sets @count to given integer) - operator(}) - ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(String)operator(,) stringoperator(\))operator({) - operator(|)instance_variable(@outputfile)operator(|) comment(# sets @outputfile to given string) - operator(}) - ident(opts)operator(.)ident(parse!) -reserved(end) - -comment(# example to use the options in the main program) -ident(puts) string reserved(if) instance_variable(@verbose) -ident(puts) string reserved(if) instance_variable(@debugmode) -ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@outputfile) -ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@count) -pre_constant(ARGV)operator(.)ident(each) operator({) operator(|)ident(param)operator(|) - ident(puts) stringdelimiter(")> -operator(}) - - -comment(# @@PLEAC@@_15.4) -ident(buf) operator(=) string operator(*) integer(8) -global_variable($stdout)operator(.)ident(ioctl)operator(()integer(0x5413)operator(,) ident(buf)operator(\)) -ident(ws_row)operator(,) ident(ws_col)operator(,) ident(ws_xpixel)operator(,) ident(ws_ypixel) operator(=) ident(buf)operator(.)ident(unpack)operator(()stringoperator(\)) - -ident(raise) string reserved(unless) ident(ws_col) operator(>)operator(=) integer(20) -ident(max) operator(=) integer(0) -ident(values) operator(=) operator(()integer(1)operator(..)integer(5)operator(\))operator(.)ident(collect) operator({) ident(rand)operator(()integer(20)operator(\)) operator(}) comment(# generate an array[5] of rand values) -reserved(for) ident(i) reserved(in) ident(values) - ident(max) operator(=) ident(i) reserved(if) ident(max) operator(<) ident(i) -reserved(end) -ident(ratio) operator(=) ident(Float)operator(()ident(ws_col)integer(-12)operator(\))operator(/)ident(max) comment(# chars per unit) -reserved(for) ident(i) reserved(in) ident(values) - ident(printf) stringoperator(,) ident(i)operator(,) string operator(*) operator(()ident(ratio)operator(*)ident(i)operator(\)) -reserved(end) - -comment(# gives, for example:) -comment(# 15.0 *******************************) -comment(# 10.0 *********************) -comment(# 5.0 **********) -comment(# 14.0 *****************************) -comment(# 18.0 **************************************) - - -comment(# @@PLEAC@@_16.1) -ident(output) operator(=) shell comment(# collect output into one multiline string) -ident(output) operator(=) shelloperator(.)ident(split) comment(# collect output into array, one line per) -ident(element) - -ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) -ident(output) operator(=) string -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - ident(output) operator(+=) global_variable($_) -reserved(end) -ident(readme)operator(.)ident(close) - -shell comment(# BAD AND SCARY in Perl because it's managed by the shell) - comment(# I donna in Ruby ...) - -comment(# so the "clean and secure" version) -ident(readme)operator(,) ident(writeme) operator(=) constant(IO)operator(.)ident(pipe) -ident(pid) operator(=) ident(fork) operator({) - comment(# child) - global_variable($stdout) operator(=) ident(writeme) - ident(readme)operator(.)ident(close) - ident(exec)operator(()stringoperator(,) stringoperator(\)) -operator(}) -comment(# parent) -constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) -ident(writeme)operator(.)ident(close) -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# do something with $_) -reserved(end) - - -comment(# @@PLEAC@@_16.2) -ident(status) operator(=) ident(system)operator(()stringdelimiter(")>operator(\)) - -ident(status) operator(=) ident(system)operator(()stringoperator(,) ident(myfile)operator(\)) - -ident(system)operator(()stringoutfile)delimiter(")>operator(\)) -ident(system)operator(()stringoutfile 2>errfile)delimiter(")>operator(\)) - -comment(# stop if the command fails) -ident(raise) stringdelimiter(")> reserved(unless) ident(system)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) - -comment(# get the value of the signal sent to the child) -comment(# even if it is a SIGINT or SIGQUIT) -ident(system)operator(()ident(arglist)operator(\)) -ident(raise) stringdelimiter(")> reserved(if) operator(()global_variable($?) operator(&) integer(127)operator(\)) operator(!=) integer(0) - -ident(pid) operator(=) ident(fork) operator({) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(exec)operator(()stringoperator(,) stringoperator(\)) -operator(}) -ident(trap) operator(()stringoperator(\)) operator({) - ident(puts) string -operator(}) -constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) - -comment(# Ruby doesn't permit to lie to the program called by a 'system'.) -comment(# (ie specify what return argv[0] in C, $0 in Perl/Ruby ...\)) -comment(# A (dirty\) way is to create a link (under Unix\), run this link and) -comment(# erase it. Somebody has a best idea ?) - - -comment(# @@PLEAC@@_16.3) -ident(exec)operator(()stringoperator(\)) - -ident(exec)operator(()stringoperator(,) stringoperator(\)) - -ident(exec)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_16.4) -comment(# read the output of a program) -constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) operator({)operator(|)ident(readme)operator(|) - reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# ...) - reserved(end) -operator(}) -comment(# or) -ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) -reserved(while) ident(readme)operator(.)ident(gets) reserved(do) - comment(# ...) -reserved(end) -ident(readme)operator(.)ident(close) - -comment(# "write" in a program) -constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) operator({)operator(|)ident(pipe)operator(|) - ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) - ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) -operator(}) - -comment(# close wait for the end of the process) -ident(read) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) comment(# child goes to sleep) -ident(read)operator(.)ident(close) comment(# and the parent goes to lala land) - -ident(writeme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,) stringoperator(\)) -ident(writeme)operator(.)ident(puts) string comment(# program will get hello\\n on STDIN) -ident(writeme)operator(.)ident(close) comment(# program will get EOF on STDIN) - -comment(# send in a pager (eg less\) all output) -global_variable($stdout) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) -ident(print) string operator(*) integer(10000) - - -comment(# @@PLEAC@@_16.5) -comment(#-----------------------------) -reserved(def) method(head)operator(()ident(lines) operator(=) integer(20)operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(pid)operator(.)ident(print) - ident(lines) operator(-=) integer(1) - reserved(break) reserved(if) ident(lines) operator(==) integer(0) - reserved(end) - reserved(end) - ident(exit) -reserved(end) - -ident(head)operator(()integer(100)operator(\)) -reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(print) -reserved(end) -comment(#-----------------------------) -integer(1)operator(:) operator(>) constant(Welcome) ident(to) constant(Linux)operator(,) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) - -integer(2)operator(:) operator(>) - -integer(3)operator(:) operator(>) string so I installed Linux.)delimiter(")> -comment(#-----------------------------) -operator(>) integer(1)operator(:) constant(Welcome) ident(to) constant(Linux)operator(,) constant(Kernel) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) - -operator(>) integer(2)operator(:) - -operator(>) integer(3)operator(:) string 4: so I installed Linux.)delimiter(")> -comment(#-----------------------------) -comment(#!/usr/bin/ruby) -comment(# qnumcat - demo additive output filters) - -reserved(def) method(number)operator(()operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(printf)operator(()stringoperator(,) global_variable($.)operator(,) global_variable($_)operator(\))operator(;) reserved(end) - reserved(end) - ident(exit) -reserved(end) - -reserved(def) method(quote)operator(()operator(\)) - ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) - reserved(if) ident(pid) operator(==) pre_constant(nil) - reserved(return) - reserved(else) - reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(print) string )inlinedelimiter(")> reserved(end) - reserved(end) - ident(exit) -reserved(end) - -ident(number)operator(()operator(\)) -ident(quote)operator(()operator(\)) - -reserved(while) ident(gets)operator(()operator(\)) reserved(do) - ident(print) -reserved(end) -global_variable($stdout)operator(.)ident(close) -ident(exit) - - -comment(# @@PLEAC@@_16.6) -pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) - ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) -operator(}) -reserved(for) ident(file) reserved(in) pre_constant(ARGV) - ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) - reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) - comment(# .......) - reserved(end) -reserved(end) -comment(#-----------------------------) -pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) - ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) comment(#) -operator(}) -reserved(for) ident(file) reserved(in) pre_constant(ARGV) - ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) - reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) - comment(# .......) - reserved(end) -reserved(end) -comment(#-----------------------------) -ident(pwdinfo) operator(=) operator(()shell operator(=)operator(~) regexpoperator(\)) operator(?) string operator(:) stringoperator(;) -ident(pwd) operator(=) ident(open)operator(()ident(pwdinfo)operator(\))operator(;) -comment(#-----------------------------) -ident(puts) stringoperator(;) -ident(file) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\))operator(;) -ident(fh) operator(=) ident(open)operator(()ident(file)operator(\))operator(;) - - -comment(# @@PLEAC@@_16.7) -ident(output) operator(=) shell&1)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell/dev/null)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>/dev/null)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1 1>/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> comment(# with backticks) -comment(# or) -ident(ph) operator(=) ident(open)operator(()string&1 1>&2 2>&3 3>&-)delimiter(")>operator(\)) comment(# with an open pipe) -reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) -comment(#-----------------------------) -ident(system)operator(()string/tmp/program.stdout 2>/tmp/program.stderr)delimiter(")>operator(\)) -comment(#-----------------------------) -ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> -comment(#-----------------------------) -ident(fd3) operator(=) ident(fd1) -ident(fd1) operator(=) ident(fd2) -ident(fd2) operator(=) ident(fd3) -ident(fd3) operator(=) pre_constant(nil) -comment(#-----------------------------) -ident(system)operator(()stringtmpfile 2>&1)delimiter(")>operator(\)) -ident(system)operator(()string&1 1>tmpfile)delimiter(")>operator(\)) -comment(#-----------------------------) -comment(# system ("prog args 1>tmpfile 2>&1"\) ) -ident(fd1) operator(=) string comment(# change stdout destination first) -ident(fd2) operator(=) ident(fd1) comment(# now point stderr there, too) -comment(#-----------------------------) -comment(# system("prog args 2>&1 1>tmpfile"\) ) -ident(fd2) operator(=) ident(fd1) comment(# stderr same destination as stdout) -ident(fd1) operator(=) string comment(# but change stdout destination ) -comment(#-----------------------------) -comment(# It is often better not to rely on the shell, ) -comment(# because of portability, possible security problems ) -comment(# and bigger resource usage. So, it is often better to use the open3 library. ) -comment(# See below for an example.) -comment(# opening stdin, stdout, stderr) -ident(require) string -ident(stdin)operator(,) ident(stdout)operator(,) ident(stderr) operator(=) constant(Open3)operator(.)ident(popen)operator(()stringoperator(\)) - - -comment(# @@PLEAC@@_16.8) -comment(#-----------------------------) -comment(# Contrary to perl, we don't need to use a module in Ruby) -ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program)operator(,) stringoperator(\)) -ident(fh)operator(.)ident(puts) string -ident(output) operator(=) ident(fh)operator(.)ident(gets)operator(()operator(\)) -ident(fh)operator(.)ident(close)operator(()operator(\)) -comment(#-----------------------------) -constant(Kernel)operator(.)ident(open)operator(()stringoperator(\))operator(,)stringoperator(\)) comment(# RIGHT !) -comment(#-----------------------------) -comment(# Ruby has already object methods for I/O handles) -comment(#-----------------------------) -reserved(begin) - ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program_and_options)operator(,) stringoperator(\)) -reserved(rescue) - reserved(if) operator(()global_variable($@) operator(~=) regexpoperator(\)) - global_variable($stderr)operator(.)ident(puts) stringcontent( )char(\\n)content( )inlinecontent( )char(\\n)delimiter(")> - reserved(break) - reserved(end) - ident(raise) comment(# reraise unforseen exception) -reserved(end) - - -comment(# @@PLEAC@@_16.13) -comment(#% kill -l) -comment(#HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE) -comment(#ALRM TERM CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM) -comment(#PROF WINCH POLL PWR) -comment(#-----------------------------) -comment(#% ruby -e 'puts Signal.list.keys.join(" "\)') -comment(#PWR USR1 BUS USR2 TERM SEGV KILL POLL STOP SYS TRAP IOT HUP INT #) -comment(#WINCH XCPU TTIN CLD TSTP FPE IO TTOU PROF CHLD CONT PIPE ABRT) -comment(#VTALRM QUIT ILL XFSZ URG ALRM) -comment(#-----------------------------) -comment(# After that, the perl script create an hash equivalent to Signal.list, ) -comment(# and an array. The array can be obtained by :) -ident(signame) operator(=) operator([)operator(]) -constant(Signal)operator(.)ident(list)operator(.)ident(each) operator({) operator(|)ident(name)operator(,) ident(i)operator(|) ident(signame)operator([)ident(i)operator(]) operator(=) ident(name) operator(}) - - -comment(# @@PLEAC@@_16.14) -constant(Process)operator(.)ident(kill)operator(()integer(9)operator(,) ident(pid)operator(\)) comment(# send $pid a signal 9) -constant(Process)operator(.)ident(kill)operator(()integer(-1)operator(,) constant(Process)operator(.)ident(getpgrp)operator(()operator(\))operator(\)) comment(# send whole job a signal 1) -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) global_variable($$)operator(\)) comment(# send myself a SIGUSR1) -constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid1)operator(,) ident(pid2)operator(,) ident(pid3)operator(\)) comment(# send a SIGHUP to processes in @pids) -comment(#-----------------------------) -reserved(begin) - constant(Process)operator(.)ident(kill)operator(()integer(0)operator(,) ident(minion)operator(\)) - ident(puts) stringcontent( is alive!)delimiter(")> -reserved(rescue) constant(Errno)operator(::)constant(EPERM) comment(# changed uid) - ident(puts) stringcontent( has escaped my control!)delimiter(")>operator(;) -reserved(rescue) constant(Errno)operator(::)constant(ESRCH) - ident(puts) stringcontent( is deceased.)delimiter(")>operator(;) comment(# or zombied) -reserved(rescue) - ident(puts) stringcontent( : )inlinedelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_16.15) -constant(Kernel)operator(.)ident(trap)operator(()stringoperator(,) ident(got_sig_quit)operator(\)) comment(# got_sig_quit = Proc.new { puts "Quit\\n" }) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# def got_sig_pipe ...) -ident(trap)operator(()stringoperator(\)) operator({) ident(ouch)operator(+)operator(+) operator(}) comment(# increment ouch for every SIGINT) -comment(#-----------------------------) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# ignore the signal INT) -comment(#-----------------------------) -ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# restore default STOP signal handling) - - -comment(# @@PLEAC@@_16.16) -comment(# the signal handler) -reserved(def) method(ding) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(puts) string -reserved(end) - -comment(# prompt for name, overriding SIGINT) -reserved(def) method(get_name) - ident(save) operator(=) ident(trap)operator(()stringoperator(,) stringoperator(\)) - - ident(puts) string - ident(name) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\)) - ident(trap)operator(()stringoperator(,) ident(save)operator(\)) - ident(name) -reserved(end) - - -comment(# @@PLEAC@@_16.21) -comment(# implemented thanks to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/1760) -ident(require) string - -comment(# we'll do something vastly more useful than cookbook to demonstrate timeouts) -reserved(begin) - ident(timeout)operator(()integer(5)operator(\)) operator({) - ident(waitsec) operator(=) ident(rand)operator(()integer(10)operator(\)) - ident(puts) stringcontent( seconds is longer than 5 seconds...)delimiter(")> - ident(system)operator(()stringdelimiter(")>operator(\)) - operator(}) - ident(puts) string -reserved(rescue) constant(Timeout)operator(::)constant(Error) - ident(puts) string -reserved(end) - - -comment(# @@PLEAC@@_17.1) -comment(# A basic TCP client connection) -ident(require) string -reserved(begin) - ident(t) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(else) - comment(# ... do something with the socket) - ident(t)operator(.)ident(print) string - ident(answer) operator(=) ident(t)operator(.)ident(gets)operator(()pre_constant(nil)operator(\)) - comment(# and terminate the connection when we're done) - ident(t)operator(.)ident(close) -reserved(end) - -comment(# Using the evil low level socket API) -ident(require) string -comment(# create a socket) -ident(s) operator(=) constant(Socket)operator(.)ident(new)operator(()constant(Socket)operator(::)constant(AF_INET)operator(,) constant(Socket)operator(::)constant(SOCK_STREAM)operator(,) integer(0)operator(\)) -comment(# build the address of the remote machine) -ident(sockaddr_server) operator(=) operator([)constant(Socket)operator(::)constant(AF_INET)operator(,) integer(80)operator(,) - constant(Socket)operator(.)ident(gethostbyname)operator(()stringoperator(\))operator([)integer(3)operator(])operator(,) - integer(0)operator(,) integer(0)operator(])operator(.)ident(pack)operator(()stringoperator(\)) -comment(# connect) -reserved(begin) - ident(s)operator(.)ident(connect)operator(()ident(sockaddr_server)operator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(else) - comment(# ... do something with the socket) - ident(s)operator(.)ident(print) string - comment(# and terminate the connection when we're done) - ident(s)operator(.)ident(close) -reserved(end) - -comment(# TCP connection with management of error (DNS\)) -ident(require) string -reserved(begin) - ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(end) - -comment(# TCP connection with a time out) -ident(require) string -ident(require) string -reserved(begin) - ident(timeout)operator(()integer(1)operator(\)) reserved(do) comment(#the server has one second to answer) - ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) - reserved(end) -reserved(rescue) - ident(puts) stringdelimiter(")> -reserved(end) - - -comment(# @@PLEAC@@_17.12) -ident(require) string - -reserved(class) class(Preforker) - ident(attr_reader) operator(()symbol(:child_count)operator(\)) - - reserved(def) method(initialize)operator(()ident(prefork)operator(,) ident(max_clients_per_child)operator(,) ident(port)operator(,) ident(client_handler)operator(\)) - instance_variable(@prefork) operator(=) ident(prefork) - instance_variable(@max_clients_per_child) operator(=) ident(max_clients_per_child) - instance_variable(@port) operator(=) ident(port) - instance_variable(@child_count) operator(=) integer(0) - - instance_variable(@reaper) operator(=) ident(proc) operator({) - ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) - ident(pid) operator(=) constant(Process)operator(.)ident(wait) - instance_variable(@child_count) operator(-=) integer(1) - operator(}) - - instance_variable(@huntsman) operator(=) ident(proc) operator({) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - constant(Process)operator(.)ident(kill)operator(()stringoperator(,) integer(0)operator(\)) - ident(exit) - operator(}) - - instance_variable(@client_handler)operator(=)ident(client_handler) - reserved(end) - - reserved(def) method(child_handler) - ident(trap)operator(()stringoperator(,) stringoperator(\)) - instance_variable(@client_handler)operator(.)ident(setUp) - comment(# wish: sigprocmask UNblock SIGINT) - instance_variable(@max_clients_per_child)operator(.)ident(times) operator({) - ident(client) operator(=) instance_variable(@server)operator(.)ident(accept) reserved(or) reserved(break) - instance_variable(@client_handler)operator(.)ident(handle_request)operator(()ident(client)operator(\)) - ident(client)operator(.)ident(close) - operator(}) - instance_variable(@client_handler)operator(.)ident(tearDown) - reserved(end) - - reserved(def) method(make_new_child) - comment(# wish: sigprocmask block SIGINT) - instance_variable(@child_count) operator(+=) integer(1) - ident(pid) operator(=) ident(fork) reserved(do) - ident(child_handler) - reserved(end) - comment(# wish: sigprocmask UNblock SIGINT) - reserved(end) - - reserved(def) method(run) - instance_variable(@server) operator(=) constant(TCPserver)operator(.)ident(open)operator(()instance_variable(@port)operator(\)) - ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) - ident(trap)operator(()stringoperator(,) instance_variable(@huntsman)operator(\)) - ident(loop) operator({) - operator(()instance_variable(@prefork) operator(-) instance_variable(@child_count)operator(\))operator(.)ident(times) operator({) operator(|)ident(i)operator(|) - ident(make_new_child) - operator(}) - ident(sleep) operator(.)integer(1) - operator(}) - reserved(end) -reserved(end) - -comment(#-----------------------------) -comment(#!/usr/bin/ruby) - -ident(require) string - -reserved(class) class(ClientHandler) - reserved(def) method(setUp) - reserved(end) - - reserved(def) method(tearDown) - reserved(end) - - reserved(def) method(handle_request)operator(()ident(client)operator(\)) - comment(# do stuff) - reserved(end) -reserved(end) - -ident(server) operator(=) constant(Preforker)operator(.)ident(new)operator(()integer(1)operator(,) integer(100)operator(,) integer(3102)operator(,) constant(ClientHandler)operator(.)ident(new)operator(\)) -ident(server)operator(.)ident(run) - - -comment(# @@PLEAC@@_18.2) -ident(require) string - -reserved(begin) - ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) - ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) - ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) - ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string operator(+) global_variable($!) -reserved(ensure) - ident(ftp)operator(.)ident(close)operator(()operator(\)) reserved(if) ident(ftp) -reserved(end) - -comment(# A better solution for a local use could be :) -constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) reserved(do) operator(|)ident(ftp)operator(|) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) - ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) - ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) - ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) -reserved(end) - -comment(# If you have only one file to get, there is a simple solution :) -ident(require) string -ident(open)operator(()stringoperator(\)) reserved(do) operator(|)ident(fh)operator(|) - comment(# read from filehandle fh) -reserved(end) -comment(#--------------------------------------------) -comment(# to wait a defined time for the connection, ) -comment(# use the timeout module) -ident(require) string -reserved(begin) - ident(timeout)operator(()integer(30)operator(\))operator({) - ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) - ident(ftp)operator(.)ident(debug_mode) operator(=) pre_constant(true) - operator(}) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(puts) string -reserved(rescue) constant(Timeout)operator(::)constant(Error) - global_variable($stderr)operator(.)ident(puts) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) - -reserved(begin) - ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(,) ident(account)operator(\)) -reserved(rescue) constant(Net)operator(::)constant(FTPError) - global_variable($stderr)operator(.)ident(print) string -reserved(end) -comment(#-----------------------------) -ident(ftp)operator(.)ident(put)operator(()ident(localfile)operator(,) ident(remotefile)operator(\)) -comment(#-----------------------------) -comment(# Sending data from STDIN is not directly supported ) -comment(# by the ftp library module. A possible way to do it is to use the ) -comment(# storlines method directly to send raw commands to the ftp server.) -comment(#-----------------------------) -ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(,) ident(localfile)operator(\)) -comment(#-----------------------------) -ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(\)) operator({) operator(|)ident(data)operator(|) ident(puts) ident(data) operator(}) -comment(#-----------------------------) -ident(ftp)operator(.)ident(chdir)operator(()stringoperator(\)) -ident(print) stringoperator(,) ident(ftp)operator(.)ident(pwd)operator(()operator(\))operator(,) string -comment(#-----------------------------) -ident(ftp)operator(.)ident(mkdir)operator(()stringoperator(\)) -comment(#-----------------------------) -ident(lines) operator(=) ident(ftp)operator(.)ident(ls)operator(()stringoperator(\)) -comment(# => ["drwxr-xr-x 2 matz users 4096 July 17 1998 1.0", ... ]) - -ident(latest) operator(=) ident(ftp)operator(.)ident(dir)operator(()stringoperator(\))operator(.)ident(sort)operator(.)ident(last) - -ident(ftp)operator(.)ident(nlst)operator(()stringoperator(\)) -comment(# => ["/pub/ruby/1.0", ... ]) -comment(#-----------------------------) -ident(ftp)operator(.)ident(quit)operator(()operator(\)) - - -comment(# @@PLEAC@@_18.6) -ident(require) string -ident(t) operator(=) constant(Net)operator(::)constant(Telnet)operator(::)ident(new)operator(() string operator(=)operator(>) integer(10)operator(,) - string operator(=)operator(>) regexpoperator(,) - string operator(=)operator(>) ident(host) operator(\)) -ident(t)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -ident(files) operator(=) ident(t)operator(.)ident(cmd)operator(()stringoperator(\)) -ident(t)operator(.)ident(print)operator(()stringoperator(\)) -ident(process_string) operator(=) ident(t)operator(.)ident(waitfor)operator(()regexpoperator(\)) -ident(t)operator(.)ident(close) -comment(#-----------------------------) -regexp] )char(\\z)delimiter(/)modifier(n)> -comment(#-----------------------------) -comment(# In case of an error, the telnet module throws an exception.) -comment(# For control of the behavior in case of an error,) -comment(# you just need to catch the exceptions and do your custom) -comment(# error handling.) -comment(#-----------------------------) -reserved(begin) - ident(telnet)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) -reserved(rescue) constant(TimeoutError) - ident(fail) string -reserved(end) -comment(#-----------------------------) -ident(telnet)operator(.)ident(waitfor)operator(()stringoperator(\)) -comment(#-----------------------------) -ident(telnet)operator(.)ident(waitfor)operator(()constant(String) operator(=)operator(>) stringoperator(,) constant(Timeout) operator(=)operator(>) integer(30)operator(\)) - - -comment(# @@PLEAC@@_18.7) -ident(require) string - -ident(puts) stringcontent( is alive.)char(\\n)delimiter(")> reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()ident(host)operator(\))operator(;) -comment(#-----------------------------) -comment(# the ping module only use TCP ping, not ICMP even if we are root) -reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()stringoperator(\)) - ident(puts) stringoperator(;) -reserved(else) - ident(puts) stringoperator(;) -reserved(end) - - -comment(# @@PLEAC@@_19.0) -comment(#-----------------------------) -comment(# http://www.perl.com/CPAN/) -comment(# http://www.perl.com:8001/bad/mojo.html) -comment(# ftp://gatekeeper.dec.com/pub/misc/netlib.tar.Z) -comment(# ftp://anonymous@myplace:gatekeeper.dec.com/pub/misc/netlib.tar.Z) -comment(# file:///etc/motd) -comment(#-----------------------------) -comment(# http://mox.perl.com/cgi-bin/program?name=Johann&born=1685) -comment(#-----------------------------) -comment(# http://mox.perl.com/cgi-bin/program) -comment(#-----------------------------) - - -comment(# @@PLEAC@@_19.1) -comment(#!/usr/local/bin/ruby -w) -comment(# hiweb - load CGI class to decode information given by web server) - -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) - -comment(# get a parameter from a form) -ident(value) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) - -comment(# output a document) -ident(cgi)operator(.)ident(out) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) ident(cgi)operator(.)ident(p) operator({) string operator(+) ident(cgi)operator(.)ident(tt) operator({) - constant(CGI)operator(.)ident(escapeHTML)operator(()ident(value)operator(\)) operator(}) operator(}) operator(}) - operator(}) -operator(}) - -ident(require) string -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(who) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) comment(# first param in list) -ident(phone) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) -ident(picks) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(]) comment(# complete list) - -ident(print) ident(cgi)operator(.)ident(header)operator(() string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\)) operator(\)) - - -comment(# @@PLEAC@@_19.3) -comment(#!/usr/local/bin/ruby -w) -comment(# webwhoami - show web user's id) -ident(require) string -ident(print) string -ident(print) string operator(+) constant(Etc)operator(.)ident(getpwuid)operator(.)ident(name) operator(+) string - -comment(# % ruby -wc cgi-script # just check syntax) - -comment(# % ruby -w cgi-script # params from stdin) -comment(# (offline mode: enter name=value pairs on standard input\)) -comment(# name=joe) -comment(# number=10) -comment(# ^D) - -comment(# % ruby -w cgi-script name=joe number=10 # run with mock form input) -comment(# % ruby -d cgi-script name=joe number=10 # ditto, under the debugger) - -comment(# POST method script in csh) -comment(# % (setenv HTTP_METHOD POST; ruby -w cgi-script name=joe number=10\)) -comment(# POST method script in sh) -comment(# % HTTP_METHOD=POST perl -w cgi-script name=joe number=10) - - -comment(# @@PLEAC@@_19.4) -comment(# ruby has several security levels, the level "1" is similar to perls taint mode.) -comment(# It can be switched on by providing the -T command line parameter) -comment(# or by setting $SAFE to 1. Setting $SAFE to 2,3 or 4 restricts possible) -comment(# harmful operations further.) - -comment(#!/usr/bin/ruby -T) -global_variable($SAFE) operator(=) integer(1) -constant(File)operator(.)ident(open)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(,) stringoperator(\)) -comment(# ruby warns with:) -comment(# taint1.rb:2:in `initialize': Insecure operation - initialize (SecurityError\)) - -global_variable($SAFE) operator(=) integer(1) -ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) -reserved(unless) regexpoperator(.)ident(match)operator(()ident(file)operator(\)) - ident(raise) stringcontent( has invalid characters)delimiter(")> -reserved(end) -ident(file) operator(=) global_variable($1) -comment(# In ruby, even the back reference from a regular expression stays tainted.) -comment(# you need to explicitly untaint the variable:) -ident(file)operator(.)ident(untaint) -constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) - -comment(# Race condition exists like in perl:) -reserved(unless) constant(File)operator(.)ident(exists)operator(()ident(filename)operator(\)) comment(# Wrong because of race condition) - constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) -reserved(end) - - -comment(# @@PLEAC@@_19.8) -ident(url) operator(=) string -ident(print) stringchar(\\r)char(\\n)char(\\r)char(\\n)delimiter(")> -ident(exit) - -comment(#!/usr/bin/ruby) -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(oreo) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(30) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\))operator(,) - string operator(=)operator(>) stringoperator(\)) - -ident(whither) operator(=) string - -ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) ident(oreo)operator(,) - string operator(=)operator(>) ident(whither)operator(\))operator({)stringoperator(}) - -comment(#!/usr/bin/ruby) -comment(# os_snipe - redirect to a Jargon File entry about current OS) -ident(dir) operator(=) string - -ident(agent) operator(=) constant(ENV)operator([)stringoperator(]) - -ident(page) operator(=) reserved(case) - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string - reserved(else) string -reserved(end) - -ident(print) stringcontent(/)inlinechar(\\n)char(\\n)delimiter(")> - -ident(require) string -ident(cgi) operator(=) constant(CGI)operator(.)ident(new) -ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) stringoperator(\))operator({)stringoperator(}) -comment(# this produces:) -comment(# Status: 204 No response) -comment(# Content-Type: text/html) -comment(# Content-Length: 0) -comment(# ) - - -comment(# @@PLEAC@@_19.10) -ident(preference_value) operator(=) ident(cgi)operator(.)ident(cookies)operator([)stringoperator(])operator([)integer(0)operator(]) - -ident(packed_cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) stringoperator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) - constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) - -ident(cgi)operator(.)ident(header)operator(()string operator(=)operator(>) operator([)ident(packed_cookie)operator(])operator(\)) - -comment(#!/usr/local/bin/ruby -w) -comment(# ic_cookies - sample CGI script that uses a cookie) -ident(require) string - -ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) - -ident(cookname) operator(=) string -ident(favorite) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) -ident(tasty) operator(=) ident(cgi)operator(.)ident(cookies)operator([)ident(cookname)operator(])operator([)integer(0)operator(]) operator(||) string - -reserved(unless) ident(favorite) - ident(cgi)operator(.)ident(out) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) - ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) - ident(cgi)operator(.)ident(hr) operator(+) - ident(cgi)operator(.)ident(form) operator({) - ident(cgi)operator(.)ident(p) operator({) string operator(+) - ident(cgi)operator(.)ident(text_field)operator(()stringoperator(,) ident(tasty) operator(\)) operator(}) - operator(}) operator(+) - ident(cgi)operator(.)ident(hr) - operator(}) - operator(}) - operator(}) -reserved(else) - ident(cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(() string operator(=)operator(>) ident(cookname)operator(,) - string operator(=)operator(>) ident(favorite)operator(,) - string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) -constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) - ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) operator([)ident(cookie)operator(])operator(\)) operator({) - ident(cgi)operator(.)ident(html) operator({) - ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) - ident(cgi)operator(.)ident(body) operator({) - ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) - ident(cgi)operator(.)ident(p) operator({) stringcontent('.)delimiter(")> operator(}) - operator(}) - operator(}) - operator(}) -reserved(end) - - -comment(# @@PLEAC@@_20.9) -reserved(def) method(templatefile)operator(()ident(filename)operator(,) ident(fillings)operator(\)) - ident(aFile) operator(=) constant(File)operator(.)ident(new)operator(()ident(filename)operator(,) stringoperator(\)) - ident(text) operator(=) ident(aFile)operator(.)ident(read)operator(()operator(\)) - ident(aFile)operator(.)ident(close)operator(()operator(\)) - ident(pattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) - ident(text)operator(.)ident(gsub!)operator(()ident(pattern)operator(\)) operator({) - ident(fillings)operator([)global_variable($1)operator(]) operator(||) string - operator(}) - ident(text) -reserved(end) - -ident(fields) operator(=) operator({) - string operator(=)operator(>) ident(whats_his_name)operator(,) - string operator(=)operator(>) ident(login_count)operator(,) - string operator(=)operator(>) ident(minutes_used) -operator(}) -ident(puts) ident(templatefile)operator(()stringoperator(,) ident(fields)operator(\)) - -comment(# @@INCOMPLETE@@) -comment(# An example using databases is missing) - - +comment(# -*- ruby -*-) + +comment(# Local variables:) +comment(# indent-tabs-mode: nil) +comment(# ruby-indent-level: 4) +comment(# End:) + +comment(# @@PLEAC@@_NAME) +comment(# @@SKIP@@ Ruby) + +comment(# @@PLEAC@@_WEB) +comment(# @@SKIP@@ http://www.ruby-lang.org) + + +comment(# @@PLEAC@@_1.0) +ident(string) operator(=) string comment(# two characters, \\ and an n) +ident(string) operator(=) string comment(# literal single quotes) + +ident(string) operator(=) string comment(# a "newline" character) +ident(string) operator(=) string comment(# literal double quotes) + +ident(string) operator(=) string comment(# literal single quotes) + +ident(string) operator(=) string comment(# literal single quotes) +ident(string) operator(=) string comment(# literal single quotes) +ident(string) operator(=) string comment(# literal single quotes) +ident(string) operator(=) string)> comment(# literal single quotes) + +ident(a) operator(=) stringstring + + +comment(# @@PLEAC@@_1.1) +ident(value) operator(=) ident(string)operator([)ident(offset)operator(,)ident(count)operator(]) +ident(value) operator(=) ident(string)operator([)ident(offset)operator(..)integer(-1)operator(]) + +ident(string)operator([)ident(offset)operator(,)ident(count)operator(]) operator(=) ident(newstring) +ident(string)operator([)ident(offset)operator(..)integer(-1)operator(]) operator(=) ident(newtail) + +comment(# in Ruby we can also specify intervals by their two offsets) +ident(value) operator(=) ident(string)operator([)ident(offset)operator(..)ident(offs2)operator(]) +ident(string)operator([)ident(offset)operator(..)ident(offs2)operator(]) operator(=) ident(newstring) + +ident(leading)operator(,) ident(s1)operator(,) ident(s2)operator(,) ident(trailing) operator(=) ident(data)operator(.)ident(unpack)operator(()stringoperator(\)) + +ident(fivers) operator(=) ident(string)operator(.)ident(unpack)operator(()string operator(*) operator(()ident(string)operator(.)ident(length)operator(/)integer(5)operator(\))operator(\)) + +ident(chars) operator(=) ident(string)operator(.)ident(unpack)operator(()string operator(*) ident(string)operator(.)ident(length)operator(\)) + +ident(string) operator(=) string +comment(# +012345678901234567890 Indexing forwards (left to right\)) +comment(# 109876543210987654321- Indexing backwards (right to left\)) +comment(# note that 0 means 10 or 20, etc. above) + +ident(first) operator(=) ident(string)operator([)integer(0)operator(,) integer(1)operator(]) comment(# "T") +ident(start) operator(=) ident(string)operator([)integer(5)operator(,) integer(2)operator(]) comment(# "is") +ident(rest) operator(=) ident(string)operator([)integer(13)operator(..)integer(-1)operator(]) comment(# "you have") +ident(last) operator(=) ident(string)operator([)integer(-1)operator(,) integer(1)operator(]) comment(# "e") +ident(end_) operator(=) ident(string)operator([)integer(-4)operator(..)integer(-1)operator(]) comment(# "have") +ident(piece) operator(=) ident(string)operator([)integer(-8)operator(,) integer(3)operator(]) comment(# "you") + +ident(string)operator([)integer(5)operator(,) integer(2)operator(]) operator(=) string comment(# change "is" to "wasn't") +ident(string)operator([)integer(-12)operator(..)integer(-1)operator(]) operator(=) string comment(# "This wasn't wondrous") +ident(string)operator([)integer(0)operator(,) integer(1)operator(]) operator(=) string comment(# delete first character) +ident(string)operator([)integer(-10)operator(..)integer(-1)operator(]) operator(=) string comment(# delete last 10 characters) + +reserved(if) ident(string)operator([)integer(-10)operator(..)integer(-1)operator(]) operator(=)operator(~) regexp + ident(puts) string +reserved(end) + +ident(string)operator([)integer(0)operator(,) integer(5)operator(])operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + +ident(a) operator(=) string +ident(a)operator([)integer(0)operator(,) integer(1)operator(])operator(,) ident(a)operator([)integer(-1)operator(,) integer(1)operator(]) operator(=) ident(a)operator([)integer(-1)operator(,) integer(1)operator(])operator(,) ident(a)operator([)integer(0)operator(,) integer(1)operator(]) + +ident(a) operator(=) string +ident(b) operator(=) ident(a)operator(.)ident(unpack)operator(()stringoperator(\)) + +ident(b)operator(,) ident(c) operator(=) ident(a)operator(.)ident(unpack)operator(()stringoperator(\)) +ident(puts) stringchar(\\n)inlinechar(\\n)delimiter(")> + +reserved(def) method(cut2fmt)operator(()operator(*)ident(args)operator(\)) + ident(template) operator(=) string + ident(lastpos) operator(=) integer(1) + reserved(for) ident(place) reserved(in) ident(args) + ident(template) operator(+=) string operator(+) operator(()ident(place) operator(-) ident(lastpos)operator(\))operator(.)ident(to_s) operator(+) string + ident(lastpos) operator(=) ident(place) + reserved(end) + ident(template) operator(+=) string + reserved(return) ident(template) +reserved(end) + +ident(fmt) operator(=) ident(cut2fmt)operator(()integer(8)operator(,) integer(14)operator(,) integer(20)operator(,) integer(26)operator(,) integer(30)operator(\)) + + +comment(# @@PLEAC@@_1.2) +comment(# careful! "b is true" doesn't mean "b != 0" (0 is true in Ruby\)) +comment(# thus no problem of "defined" later since only nil is false) +comment(# the following sets to `c' if `b' is nil or false) +ident(a) operator(=) ident(b) operator(||) ident(c) + +comment(# if you need Perl's behaviour (setting to `c' if `b' is 0\) the most) +comment(# effective way is to use Numeric#nonzero? (thanks to Dave Thomas!\)) +ident(a) operator(=) ident(b)operator(.)ident(nonzero?) operator(||) ident(c) + +comment(# you will still want to use defined? in order to test) +comment(# for scope existence of a given object) +ident(a) operator(=) reserved(defined?)operator(()ident(b)operator(\)) operator(?) ident(b) operator(:) ident(c) + +ident(dir) operator(=) pre_constant(ARGV)operator(.)ident(shift) operator(||) string + + +comment(# @@PLEAC@@_1.3) +ident(v1)operator(,) ident(v2) operator(=) ident(v2)operator(,) ident(v1) + +ident(alpha)operator(,) ident(beta)operator(,) ident(production) operator(=) string +ident(alpha)operator(,) ident(beta)operator(,) ident(production) operator(=) ident(beta)operator(,) ident(production)operator(,) ident(alpha) + + +comment(# @@PLEAC@@_1.4) +ident(num) operator(=) ident(char)operator([)integer(0)operator(]) +ident(char) operator(=) ident(num)operator(.)ident(chr) + +comment(# Ruby also supports having a char from character constant) +ident(num) operator(=) integer(?r) + +ident(char) operator(=) ident(sprintf)operator(()stringoperator(,) ident(num)operator(\)) +ident(printf)operator(()stringoperator(,) ident(num)operator(,) ident(num)operator(\)) + +ident(ascii) operator(=) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) +ident(string) operator(=) ident(ascii)operator(.)ident(pack)operator(()stringoperator(\)) + +ident(hal) operator(=) string +ident(ascii) operator(=) ident(hal)operator(.)ident(unpack)operator(()stringoperator(\)) +comment(# We can't use Array#each since we can't mutate a Fixnum) +ident(ascii)operator(.)ident(collect!) operator({) operator(|)ident(i)operator(|) + ident(i) operator(+) integer(1) comment(# add one to each ASCII value) +operator(}) +ident(ibm) operator(=) ident(ascii)operator(.)ident(pack)operator(()stringoperator(\)) +ident(puts) ident(ibm) + + +comment(# @@PLEAC@@_1.5) +ident(array) operator(=) ident(string)operator(.)ident(split)operator(()stringoperator(\)) + +ident(array) operator(=) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) + +ident(string)operator(.)ident(scan)operator(()regexpoperator(\)) operator({) operator(|)ident(b)operator(|) + comment(# do something with b) +operator(}) + +ident(string) operator(=) string +ident(print) stringoperator(,) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(uniq)operator(.)ident(sort)operator(,) string + +ident(sum) operator(=) integer(0) +reserved(for) ident(ascval) reserved(in) ident(string)operator(.)ident(unpack)operator(()stringoperator(\)) comment(# or use Array#each for a pure OO style :\)) + ident(sum) operator(+=) ident(ascval) +reserved(end) +ident(puts) stringdelimiter(")> comment(# since Ruby will go Bignum if necessary) + +comment(# @@INCLUDE@@ include/ruby/slowcat.rb) + + +comment(# @@PLEAC@@_1.6) +ident(revbytes) operator(=) ident(string)operator(.)ident(reverse) + +ident(revwords) operator(=) ident(string)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(reverse)operator(.)ident(join)operator(()stringoperator(\)) + +ident(revwords) operator(=) ident(string)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(join) + +comment(# using the fact that IO is Enumerable, you can directly "select" it) +ident(long_palindromes) operator(=) constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.) + ident(select) operator({) operator(|)ident(w)operator(|) ident(w)operator(.)ident(chomp!)operator(;) ident(w)operator(.)ident(reverse) operator(==) ident(w) operator(&&) ident(w)operator(.)ident(length) operator(>) integer(5) operator(}) + + +comment(# @@PLEAC@@_1.7) +reserved(while) ident(string)operator(.)ident(sub!)operator(()stringoperator(\)) operator({) string operator(*) operator(()global_variable($&)operator(.)ident(length) operator(*) integer(8) operator(-) global_variable($`)operator(.)ident(length) operator(%) integer(8)operator(\)) operator(}) +reserved(end) + + +comment(# @@PLEAC@@_1.8) +stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) ident(eval)operator(()global_variable($1)operator(\)) operator(}) + +ident(rows)operator(,) ident(cols) operator(=) integer(24)operator(,) integer(80) +ident(text) operator(=) string +ident(text)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) ident(eval)operator(()stringdelimiter(")>operator(\)) operator(}) +ident(puts) ident(text) + +stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) integer(2) operator(*) global_variable($&)operator(.)ident(to_i) operator(}) + + +comment(# @@PLEAC@@_1.9) +ident(e) operator(=) stringoperator(.)ident(upcase) +ident(e)operator(.)ident(downcase!) +ident(e)operator(.)ident(capitalize!) + +stringoperator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) global_variable($&)operator(.)ident(capitalize) operator(}) + + +comment(# @@PLEAC@@_1.10) +stringcontent( guanacos.)delimiter(")> +ident(print) stringoperator(,) ident(n)integer(+1)operator(,) string + + +comment(# @@PLEAC@@_1.11) +ident(var) operator(=) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))string + + +comment(# @@PLEAC@@_1.12) +ident(string) operator(=) stringoperator(+) + stringoperator(+) + stringoperator(+) + string + +reserved(def) method(wrap)operator(()ident(str)operator(,) ident(max_size)operator(\)) + ident(all) operator(=) operator([)operator(]) + ident(line) operator(=) string + reserved(for) ident(l) reserved(in) ident(str)operator(.)ident(split) + reserved(if) operator(()ident(line)operator(+)ident(l)operator(\))operator(.)ident(length) operator(>)operator(=) ident(max_size) + ident(all)operator(.)ident(push)operator(()ident(line)operator(\)) + ident(line) operator(=) string + reserved(end) + ident(line) operator(+=) ident(line) operator(==) string operator(?) ident(l) operator(:) string operator(+) ident(l) + reserved(end) + ident(all)operator(.)ident(push)operator(()ident(line)operator(\))operator(.)ident(join)operator(()stringoperator(\)) +reserved(end) + +ident(print) ident(wrap)operator(()ident(string)operator(,) integer(20)operator(\)) +comment(#=> Folding and ) +comment(#=> splicing is the ) +comment(#=> work of an editor, ) +comment(#=> not a mere ) +comment(#=> collection of ) +comment(#=> silicon and mobile ) +comment(#=> electrons!) + + +comment(# @@PLEAC@@_1.13) +ident(string) operator(=) string +ident(string)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) +ident(string)operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) +ident(string)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) +stringoperator(.)ident(gsub)operator(()regexpoperator(\)) operator({) stringoperator(+)global_variable($&) operator(}) comment(# no function like quotemeta?) + + +comment(# @@PLEAC@@_1.14) +ident(string)operator(.)ident(strip!) + + +comment(# @@PLEAC@@_1.15) +reserved(def) method(parse_csv)operator(()ident(text)operator(\)) + ident(new) operator(=) ident(text)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(new) operator(<<) pre_constant(nil) reserved(if) ident(text)operator([)integer(-1)operator(]) operator(==) integer(?,) + ident(new)operator(.)ident(flatten)operator(.)ident(compact) +reserved(end) + +ident(line) operator(=) string)> +ident(fields) operator(=) ident(parse_csv)operator(()ident(line)operator(\)) +ident(fields)operator(.)ident(each_with_index) operator({) operator(|)ident(v)operator(,)ident(i)operator(|) + ident(print) stringcontent( : )inlinechar(\\n)delimiter(")>operator(;) +operator(}) + + +comment(# @@PLEAC@@_1.16) +comment(# Use the soundex.rb Library from Michael Neumann.) +comment(# http://www.s-direktnet.de/homepages/neumann/rb_prgs/Soundex.rb) +ident(require) string + +ident(code) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(string)operator(\)) +ident(codes) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(array)operator(\)) + +comment(# substitution function for getpwent(\):) +comment(# returns an array of user entries,) +comment(# each entry contains the username and the full name) +reserved(def) method(login_names) + ident(result) operator(=) operator([)operator(]) + constant(File)operator(.)ident(open)operator(()stringoperator(\)) operator({) operator(|)ident(file)operator(|) + ident(file)operator(.)ident(each_line) operator({) operator(|)ident(line)operator(|) + reserved(next) reserved(if) ident(line)operator(.)ident(match)operator(()regexpoperator(\)) + ident(cols) operator(=) ident(line)operator(.)ident(split)operator(()stringoperator(\)) + ident(result)operator(.)ident(push)operator(()operator([)ident(cols)operator([)integer(0)operator(])operator(,) ident(cols)operator([)integer(4)operator(])operator(])operator(\)) + operator(}) + operator(}) + ident(result) +reserved(end) + +ident(puts) string +ident(user) operator(=) constant(STDIN)operator(.)ident(gets) +ident(user)operator(.)ident(chomp!) +ident(exit) reserved(unless) ident(user) +ident(name_code) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(user)operator(\)) + +ident(splitter) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) +reserved(for) ident(username)operator(,) ident(fullname) reserved(in) ident(login_names) reserved(do) + ident(firstname)operator(,) ident(lastname) operator(=) ident(splitter)operator(.)ident(match)operator(()ident(fullname)operator(\))operator([)integer(1)operator(,)integer(2)operator(]) + reserved(if) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(username)operator(\)) + operator(||) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(firstname)operator(\)) + operator(||) ident(name_code) operator(==) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(lastname)operator(\)) + reserved(then) + ident(puts) stringcontent(: )inlinecontent( )inlinedelimiter(")> + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_1.17) +comment(# @@INCLUDE@@ include/ruby/fixstyle.rb) + + +comment(# @@PLEAC@@_1.18) +comment(# @@INCLUDE@@ include/ruby/psgrep.rb) + + +comment(# @@PLEAC@@_2.1) +comment(# Matz tells that you can use Integer(\) for strict checked conversion.) +ident(Integer)operator(()stringoperator(\)) +comment(#=> `Integer': invalid value for Integer: "abc" (ArgumentError\)) +ident(Integer)operator(()stringoperator(\)) +comment(#=> 567) + +comment(# You may use Float(\) for floating point stuff) +ident(Integer)operator(()stringoperator(\)) +comment(#=> `Integer': invalid value for Integer: "56.7" (ArgumentError\)) +ident(Float)operator(()stringoperator(\)) +comment(#=> 56.7) + +comment(# You may also use a regexp for that) +reserved(if) ident(string) operator(=)operator(~) regexp + ident(p) string +reserved(else) + ident(p) string +reserved(end) + +reserved(if) ident(string) operator(=)operator(~) regexp + ident(p) string +reserved(else) + ident(p) string +reserved(end) + + +comment(# @@PLEAC@@_2.2) +comment(# equal(num1, num2, accuracy\) : returns true if num1 and num2 are) +comment(# equal to accuracy number of decimal places) +reserved(def) method(equal)operator(()ident(i)operator(,) ident(j)operator(,) ident(a)operator(\)) + ident(sprintf)operator(()stringcontent(g)delimiter(")>operator(,) ident(i)operator(\)) operator(==) ident(sprintf)operator(()stringcontent(g)delimiter(")>operator(,) ident(j)operator(\)) +reserved(end) + +ident(wage) operator(=) integer(536) comment(# $5.36/hour) +ident(week) operator(=) integer(40) operator(*) ident(wage) comment(# $214.40) +ident(printf)operator(()stringoperator(,) ident(week)operator(/)float(100.0)operator(\)) + + +comment(# @@PLEAC@@_2.3) +ident(num)operator(.)ident(round) comment(# rounds to integer) + +ident(a) operator(=) float(0.255) +ident(b) operator(=) ident(sprintf)operator(()stringoperator(,) ident(a)operator(\)) +ident(print) stringchar(\\n)content(Rounded: )inlinechar(\\n)delimiter(")> +ident(printf) stringchar(\\n)content(Rounded: %.2f)char(\\n)delimiter(")>operator(,) ident(a) + +ident(print) string +ident(a) operator(=) operator([) float(3.3) operator(,) float(3.5) operator(,) float(3.7)operator(,) float(-3.3) operator(]) +reserved(for) ident(n) reserved(in) ident(a) + ident(printf)operator(()stringoperator(,) comment(# at least I don't fake my output :\)) + ident(n)operator(,) ident(n)operator(.)ident(to_i)operator(,) ident(n)operator(.)ident(floor)operator(,) ident(n)operator(.)ident(ceil)operator(\)) +reserved(end) + + +comment(# @@PLEAC@@_2.4) +reserved(def) method(dec2bin)operator(()ident(n)operator(\)) + operator([)ident(n)operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(])operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) +reserved(end) + +reserved(def) method(bin2dec)operator(()ident(n)operator(\)) + operator([)operator(()stringoperator(*)integer(32)operator(+)ident(n)operator(.)ident(to_s)operator(\))operator([)integer(-32)operator(..)integer(-1)operator(])operator(])operator(.)ident(pack)operator(()stringoperator(\))operator(.)ident(unpack)operator(()stringoperator(\))operator([)integer(0)operator(]) +reserved(end) + + +comment(# @@PLEAC@@_2.5) +reserved(for) ident(i) reserved(in) ident(x) operator(..) ident(y) + comment(# i is set to every integer from x to y, inclusive) +reserved(end) + +ident(x)operator(.)ident(step)operator(()ident(y)operator(,)integer(7)operator(\)) operator({) operator(|)ident(i)operator(|) + comment(# i is set to every integer from x to y, stepsize = 7) +operator(}) + +ident(print) string +operator(()integer(0)operator(..)integer(2)operator(\))operator(.)ident(each) operator({) operator(|)ident(i)operator(|) + ident(print) ident(i)operator(,) string +operator(}) +ident(print) string + + +comment(# @@PLEAC@@_2.6) +comment(# We can add conversion methods to the Integer class,) +comment(# this makes a roman number just a representation for normal numbers.) +reserved(class) class(Integer) + + class_variable(@@romanlist) operator(=) operator([)operator([)stringoperator(,) integer(1000)operator(])operator(,) + operator([)stringoperator(,) integer(900)operator(])operator(,) + operator([)stringoperator(,) integer(500)operator(])operator(,) + operator([)stringoperator(,) integer(400)operator(])operator(,) + operator([)stringoperator(,) integer(100)operator(])operator(,) + operator([)stringoperator(,) integer(90)operator(])operator(,) + operator([)stringoperator(,) integer(50)operator(])operator(,) + operator([)stringoperator(,) integer(40)operator(])operator(,) + operator([)stringoperator(,) integer(10)operator(])operator(,) + operator([)stringoperator(,) integer(9)operator(])operator(,) + operator([)stringoperator(,) integer(5)operator(])operator(,) + operator([)stringoperator(,) integer(4)operator(])operator(,) + operator([)stringoperator(,) integer(1)operator(])operator(]) + + reserved(def) method(to_roman) + ident(remains) operator(=) pre_constant(self) + ident(roman) operator(=) string + reserved(for) ident(sym)operator(,) ident(num) reserved(in) class_variable(@@romanlist) + reserved(while) ident(remains) operator(>)operator(=) ident(num) + ident(remains) operator(-=) ident(num) + ident(roman) operator(<<) ident(sym) + reserved(end) + reserved(end) + ident(roman) + reserved(end) + + reserved(def) constant(Integer)operator(.)ident(from_roman)operator(()ident(roman)operator(\)) + ident(ustr) operator(=) ident(roman)operator(.)ident(upcase) + ident(sum) operator(=) integer(0) + reserved(for) ident(entry) reserved(in) class_variable(@@romanlist) + ident(sym)operator(,) ident(num) operator(=) ident(entry)operator([)integer(0)operator(])operator(,) ident(entry)operator([)integer(1)operator(]) + reserved(while) ident(sym) operator(==) ident(ustr)operator([)integer(0)operator(,) ident(sym)operator(.)ident(length)operator(]) + ident(sum) operator(+=) ident(num) + ident(ustr)operator(.)ident(slice!)operator(()integer(0)operator(,) ident(sym)operator(.)ident(length)operator(\)) + reserved(end) + reserved(end) + ident(sum) + reserved(end) + +reserved(end) + + +ident(roman_fifteen) operator(=) integer(15)operator(.)ident(to_roman) +ident(puts) stringdelimiter(")> +ident(i) operator(=) constant(Integer)operator(.)ident(from_roman)operator(()ident(roman_fifteen)operator(\)) +ident(puts) stringcontent( is )inlinedelimiter(")> + +comment(# check) +reserved(for) ident(i) reserved(in) operator(()integer(1)operator(..)integer(3900)operator(\)) + ident(r) operator(=) ident(i)operator(.)ident(to_roman) + ident(j) operator(=) constant(Integer)operator(.)ident(from_roman)operator(()ident(r)operator(\)) + reserved(if) ident(i) operator(!=) ident(j) + ident(puts) stringcontent( : )inlinecontent( - )inlinedelimiter(")> + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_2.7) +ident(random) operator(=) ident(rand)operator(()ident(y)operator(-)ident(x)integer(+1)operator(\))operator(+)ident(x) + +ident(chars) operator(=) operator([)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(,)stringoperator(..)stringoperator(])operator(.)ident(collect) operator({) operator(|)ident(r)operator(|) ident(r)operator(.)ident(to_a) operator(})operator(.)ident(join) operator(+) string +ident(password) operator(=) operator(()integer(1)operator(..)integer(8)operator(\))operator(.)ident(collect) operator({) ident(chars)operator([)ident(rand)operator(()ident(chars)operator(.)ident(size)operator(\))operator(]) operator(})operator(.)ident(pack)operator(()stringoperator(\)) + + +comment(# @@PLEAC@@_2.8) +ident(srand) comment(# uses a combination of the time, the process id, and a sequence number) +ident(srand)operator(()ident(val)operator(\)) comment(# for repeatable behaviour) + + +comment(# @@PLEAC@@_2.9) +comment(# from the randomr lib: ) +comment(# http://raa.ruby-lang.org/project/randomr/) +operator(-)operator(-)operator(-)operator(-)operator(>) ident(http)symbol(:/)operator(/)ident(raa)operator(.)ident(ruby)operator(-)ident(lang)operator(.)ident(org)operator(/)ident(project)operator(/)ident(randomr)operator(/) + +ident(require) string +ident(mers) operator(=) constant(Random)operator(::)constant(MersenneTwister)operator(.)ident(new) integer(123456789) +ident(puts) ident(mers)operator(.)ident(rand)operator(()integer(0)operator(\)) comment(# 0.550321932544541) +ident(puts) ident(mers)operator(.)ident(rand)operator(()integer(10)operator(\)) comment(# 2) + +comment(# using online sources of random data via the realrand package:) +comment(# http://raa.ruby-lang.org/project/realrand/) +comment(# **Note**) +comment(# The following online services are used in this package:) +comment(# http://www.random.org - source: atmospheric noise ) +comment(# http://www.fourmilab.ch/hotbits - source: radioactive decay timings) +comment(# http://random.hd.org - source: entropy from local and network noise) +comment(# Please visit the sites and respect the rules of each service.) + +ident(require) string + +ident(generator1) operator(=) constant(Random)operator(::)constant(RandomOrg)operator(.)ident(new) +ident(puts) ident(generator1)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) +ident(puts) ident(generator1)operator(.)ident(randnum)operator(()integer(10)operator(,) integer(1)operator(,) integer(6)operator(\))operator(.)ident(join)operator(()stringoperator(\)) comment(# Roll dice 10 times.) + +ident(generator2) operator(=) constant(Random)operator(::)constant(FourmiLab)operator(.)ident(new) +ident(puts) ident(generator2)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) +comment(# randnum is not supported.) + +ident(generator3) operator(=) constant(Random)operator(::)constant(EntropyPool)operator(.)ident(new) +ident(puts) ident(generator3)operator(.)ident(randbyte)operator(()integer(5)operator(\))operator(.)ident(join)operator(()stringoperator(\)) +comment(# randnum is not supported.) + + +comment(# @@PLEAC@@_2.10) +reserved(def) method(gaussian_rand) + reserved(begin) + ident(u1) operator(=) integer(2) operator(*) ident(rand)operator(()operator(\)) operator(-) integer(1) + ident(u2) operator(=) integer(2) operator(*) ident(rand)operator(()operator(\)) operator(-) integer(1) + ident(w) operator(=) ident(u1)operator(*)ident(u1) operator(+) ident(u2)operator(*)ident(u2) + reserved(end) reserved(while) operator(()ident(w) operator(>)operator(=) integer(1)operator(\)) + ident(w) operator(=) constant(Math)operator(.)ident(sqrt)operator(()operator(()integer(-2)operator(*)constant(Math)operator(.)ident(log)operator(()ident(w)operator(\))operator(\))operator(/)ident(w)operator(\)) + operator([) ident(u2)operator(*)ident(w)operator(,) ident(u1)operator(*)ident(w) operator(]) +reserved(end) + +ident(mean) operator(=) integer(25) +ident(sdev) operator(=) integer(2) +ident(salary) operator(=) ident(gaussian_rand)operator([)integer(0)operator(]) operator(*) ident(sdev) operator(+) ident(mean) +ident(printf)operator(()stringoperator(,) ident(salary)operator(\)) + + +comment(# @@PLEAC@@_2.11) +reserved(def) method(deg2rad)operator(()ident(d)operator(\)) + operator(()ident(d)operator(/)float(180.0)operator(\))operator(*)constant(Math)operator(::)constant(PI) +reserved(end) + +reserved(def) method(rad2deg)operator(()ident(r)operator(\)) + operator(()ident(r)operator(/)constant(Math)operator(::)constant(PI)operator(\))operator(*)integer(180) +reserved(end) + + +comment(# @@PLEAC@@_2.12) +ident(sin_val) operator(=) constant(Math)operator(.)ident(sin)operator(()ident(angle)operator(\)) +ident(cos_val) operator(=) constant(Math)operator(.)ident(cos)operator(()ident(angle)operator(\)) +ident(tan_val) operator(=) constant(Math)operator(.)ident(tan)operator(()ident(angle)operator(\)) + +comment(# AFAIK Ruby's Math module doesn't provide acos/asin) +comment(# While we're at it, let's also define missing hyperbolic functions) +reserved(module) class(Math) + reserved(def) constant(Math)operator(.)ident(asin)operator(()ident(x)operator(\)) + ident(atan2)operator(()ident(x)operator(,) ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(\)) + reserved(end) + reserved(def) constant(Math)operator(.)ident(acos)operator(()ident(x)operator(\)) + ident(atan2)operator(()ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(,) ident(x)operator(\)) + reserved(end) + reserved(def) constant(Math)operator(.)ident(atan)operator(()ident(x)operator(\)) + ident(atan2)operator(()ident(x)operator(,) integer(1)operator(\)) + reserved(end) + reserved(def) constant(Math)operator(.)ident(sinh)operator(()ident(x)operator(\)) + operator(()ident(exp)operator(()ident(x)operator(\)) operator(-) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) + reserved(end) + reserved(def) constant(Math)operator(.)ident(cosh)operator(()ident(x)operator(\)) + operator(()ident(exp)operator(()ident(x)operator(\)) operator(+) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) + reserved(end) + reserved(def) constant(Math)operator(.)ident(tanh)operator(()ident(x)operator(\)) + ident(sinh)operator(()ident(x)operator(\)) operator(/) ident(cosh)operator(()ident(x)operator(\)) + reserved(end) +reserved(end) + +comment(# The support for Complex numbers is not built-in) +ident(y) operator(=) constant(Math)operator(.)ident(acos)operator(()float(3.7)operator(\)) +comment(#=> in `sqrt': square root for negative number (ArgumentError\)) + +comment(# There is an implementation of Complex numbers in 'complex.rb' in current) +comment(# Ruby distro, but it doesn't support atan2 with complex args, so it doesn't) +comment(# solve this problem.) + + +comment(# @@PLEAC@@_2.13) +ident(log_e) operator(=) constant(Math)operator(.)ident(log)operator(()ident(val)operator(\)) +ident(log_10) operator(=) constant(Math)operator(.)ident(log10)operator(()ident(val)operator(\)) + +reserved(def) method(log_base)operator(()ident(base)operator(,) ident(val)operator(\)) + constant(Math)operator(.)ident(log)operator(()ident(val)operator(\))operator(/)constant(Math)operator(.)ident(log)operator(()ident(base)operator(\)) +reserved(end) + +ident(answer) operator(=) ident(log_base)operator(()integer(10)operator(,) integer(10_000)operator(\)) +ident(puts) stringdelimiter(")> + + +comment(# @@PLEAC@@_2.14) +ident(require) string + +ident(a) operator(=) constant(Matrix)operator([)operator([)integer(3)operator(,) integer(2)operator(,) integer(3)operator(])operator(,) operator([)integer(5)operator(,) integer(9)operator(,) integer(8)operator(])operator(]) +ident(b) operator(=) constant(Matrix)operator([)operator([)integer(4)operator(,) integer(7)operator(])operator(,) operator([)integer(9)operator(,) integer(3)operator(])operator(,) operator([)integer(8)operator(,) integer(1)operator(])operator(]) +ident(c) operator(=) ident(a) operator(*) ident(b) + +ident(a)operator(.)ident(row_size) +ident(a)operator(.)ident(column_size) + +ident(c)operator(.)ident(det) +ident(a)operator(.)ident(transpose) + + +comment(# @@PLEAC@@_2.15) +ident(require) string +ident(require) string + +ident(a) operator(=) ident(Complex)operator(()integer(3)operator(,) integer(5)operator(\)) comment(# 3 + 5i) +ident(b) operator(=) ident(Complex)operator(()integer(2)operator(,) integer(-2)operator(\)) comment(# 2 - 2i) +ident(puts) stringdelimiter(")> + +ident(c) operator(=) ident(a) operator(*) ident(b) +ident(d) operator(=) integer(3) operator(+) integer(4)operator(*)constant(Complex)operator(::)constant(I) + +ident(printf) stringcontent(\) = %s)char(\\n)delimiter(")>operator(,) constant(Math)operator(.)ident(sqrt)operator(()ident(d)operator(\)) + + +comment(# @@PLEAC@@_2.16) +ident(number) operator(=) ident(hexadecimal)operator(.)ident(hex) +ident(number) operator(=) ident(octal)operator(.)ident(oct) + +ident(print) string +ident(num) operator(=) ident(gets)operator(.)ident(chomp) +ident(exit) reserved(unless) reserved(defined?)operator(()ident(num)operator(\)) +ident(num) operator(=) ident(num)operator(.)ident(oct) reserved(if) ident(num) operator(=)operator(~) regexp comment(# does both oct and hex ) +ident(printf) stringoperator(,) ident(num)operator(,) ident(num)operator(,) ident(num) + +ident(print) string +ident(permissions) operator(=) ident(gets)operator(.)ident(chomp) +ident(raise) string reserved(unless) reserved(defined?)operator(()ident(permissions)operator(\)) +ident(puts) stringdelimiter(")> + + +comment(# @@PLEAC@@_2.17) +reserved(def) method(commify)operator(()ident(n)operator(\)) + ident(n)operator(.)ident(to_s) operator(=)operator(~) regexp + ident(int)operator(,) ident(dec) operator(=) global_variable($1)operator(.)ident(reverse)operator(,) global_variable($2) operator(?) global_variable($2) operator(:) string + reserved(while) ident(int)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(end) + ident(int)operator(.)ident(reverse) operator(+) ident(dec) +reserved(end) + + +comment(# @@PLEAC@@_2.18) +ident(printf) stringoperator(,) ident(time)operator(,) ident(time) operator(==) integer(1) operator(?) string operator(:) string + +comment(# dunno if an equivalent to Lingua::EN::Inflect exists...) + + +comment(# @@PLEAC@@_2.19) +comment(#-----------------------------) +comment(#!/usr/bin/ruby) +comment(# bigfact - calculating prime factors) +reserved(def) method(factorize)operator(()ident(orig)operator(\)) + ident(factors) operator(=) operator({)operator(}) + ident(factors)operator(.)ident(default) operator(=) integer(0) comment(# return 0 instead nil if key not found in hash) + ident(n) operator(=) ident(orig) + ident(i) operator(=) integer(2) + ident(sqi) operator(=) integer(4) comment(# square of i) + reserved(while) ident(sqi) operator(<=) ident(n) reserved(do) + reserved(while) ident(n)operator(.)ident(modulo)operator(()ident(i)operator(\)) operator(==) integer(0) reserved(do) + ident(n) regexpcontent(" + end + # we take advantage of the fact that (i +1\)**2 = i**2 + 2*i +1 + sqi += 2 * i + 1 + i += 1 + end + + if (n != 1\) && (n != orig\) + factors[n] += 1 + end + factors +end + +def printfactorhash(orig, factorcount\) + print format("%-10d ", orig\) + if factorcount.length == 0 + print "PRIME" + else + # sorts after number, because the hash keys are numbers + factorcount.sort.each { |factor,exponent| + print factor + if exponent > 1 + print "**", exponent + end + print " " + } + end + puts +end + +for arg in ARGV + n = arg.to_i + mfactors = factorize(n\) + printfactorhash(n, mfactors\) +end +#----------------------------- + + +# @@PLEAC@@_3.0 +puts Time.now + +print "Today is day ", Time.now.yday, " of the current year.)char(\\n)content(" +print "Today is day ", Time.now.day, " of the current month.)char(\\n)content(" + + +# @@PLEAC@@_3.1 +day, month, year = Time.now.day, Time.now.month, Time.now.year +# or +day, month, year = Time.now.to_a[3..5] + +tl = Time.now.localtime +printf("The current date is %04d %02d %02d)char(\\n)content(", tl.year, tl.month, tl.day\) + +Time.now.localtime.strftime("%Y-%m-%d"\) + + +# @@PLEAC@@_3.2 +Time.local(year, month, day, hour, minute, second\).tv_sec +Time.gm(year, month, day, hour, minute, second\).tv_sec + + +# @@PLEAC@@_3.3 +sec, min, hour, day, month, year, wday, yday, isdst, zone = Time.at(epoch_secs\).to_a + + +# @@PLEAC@@_3.4 +when_ = now + difference # now -> Time ; difference -> Numeric (delta in seconds\) +then_ = now - difference + + +# @@PLEAC@@_3.5 +bree = 361535725 +nat = 96201950 + +difference = bree - nat +puts "There were )inlinecontent( seconds between Nat and Bree" + +seconds = difference % 60 +difference = (difference - seconds\) )delimiter(/)> integer(60) +ident(minutes) operator(=) ident(difference) operator(%) integer(60) +ident(difference) operator(=) operator(()ident(difference) operator(-) ident(minutes)operator(\)) operator(/) integer(60) +ident(hours) operator(=) ident(difference) operator(%) integer(24) +ident(difference) operator(=) operator(()ident(difference) operator(-) ident(hours)operator(\)) operator(/) integer(24) +ident(days) operator(=) ident(difference) operator(%) integer(7) +ident(weeks) operator(=) operator(()ident(difference) operator(-) ident(days)operator(\)) operator(/) integer(7) + +ident(puts) stringcontent( weeks, )inlinecontent( days, )inlinecontent(:)inlinecontent(:)inlinecontent(\))delimiter(")> + + +comment(# @@PLEAC@@_3.6) +ident(monthday)operator(,) ident(weekday)operator(,) ident(yearday) operator(=) ident(date)operator(.)ident(mday)operator(,) ident(date)operator(.)ident(wday)operator(,) ident(date)operator(.)ident(yday) + +comment(# AFAIK the week number is not just a division since week boundaries are on sundays) +ident(weeknum) operator(=) ident(d)operator(.)ident(strftime)operator(()stringoperator(\))operator(.)ident(to_i) operator(+) integer(1) + +ident(year) operator(=) integer(1981) +ident(month) operator(=) string comment(# or `6' if you want to emulate a broken language) +ident(day) operator(=) integer(16) +ident(t) operator(=) constant(Time)operator(.)ident(mktime)operator(()ident(year)operator(,) ident(month)operator(,) ident(day)operator(\)) +ident(print) stringcontent(/)inlinecontent(/)inlinecontent( was a )delimiter(")>operator(,) ident(t)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) string + + +comment(# @@PLEAC@@_3.7) +ident(yyyy)operator(,) ident(mm)operator(,) ident(dd) operator(=) global_variable($1)operator(,) global_variable($2)operator(,) global_variable($3) reserved(if) string operator(=)operator(~) regexp + +ident(epoch_seconds) operator(=) constant(Time)operator(.)ident(mktime)operator(()ident(yyyy)operator(,) ident(mm)operator(,) ident(dd)operator(\))operator(.)ident(tv_sec) + +comment(# dunno an equivalent to Date::Manip#ParseDate) + + +comment(# @@PLEAC@@_3.8) +ident(string) operator(=) constant(Time)operator(.)ident(at)operator(()ident(epoch_secs)operator(\)) +constant(Time)operator(.)ident(at)operator(()integer(1234567890)operator(\))operator(.)ident(gmtime) comment(# gives: Fri Feb 13 23:31:30 UTC 2009) + +ident(time) operator(=) constant(Time)operator(.)ident(mktime)operator(()integer(1973)operator(,) stringoperator(,) integer(18)operator(,) integer(3)operator(,) integer(45)operator(,) integer(50)operator(\)) +ident(print) stringoperator(,) ident(time)operator(.)ident(localtime)operator(,) string + + +comment(# @@PLEAC@@_3.9) +comment(# Ruby provides micro-seconds in Time object) +constant(Time)operator(.)ident(now)operator(.)ident(usec) + +comment(# Ruby gives the seconds in floating format when substracting two Time objects) +ident(before) operator(=) constant(Time)operator(.)ident(now) +ident(line) operator(=) ident(gets) +ident(elapsed) operator(=) constant(Time)operator(.)ident(now) operator(-) ident(before) +ident(puts) stringcontent( seconds.)delimiter(")> + +comment(# On my Celeron-400 with Linux-2.2.19-14mdk, average for three execs are:) +comment(# This Ruby version: average 0.00321 sec) +comment(# Cookbook's Perl version: average 0.00981 sec) +ident(size) operator(=) integer(500) +ident(number_of_times) operator(=) integer(100) +ident(total_time) operator(=) integer(0) +ident(number_of_times)operator(.)ident(times) operator({) + comment(# populate array) + ident(array) operator(=) operator([)operator(]) + ident(size)operator(.)ident(times) operator({) ident(array) operator(<<) ident(rand) operator(}) + comment(# sort it) + ident(begin_) operator(=) constant(Time)operator(.)ident(now) + ident(array)operator(.)ident(sort!) + ident(time) operator(=) constant(Time)operator(.)ident(now) operator(-) ident(begin_) + ident(total_time) operator(+=) ident(time) +operator(}) +ident(printf) stringoperator(,) + ident(size)operator(,) operator(()ident(total_time)operator(/)ident(Float)operator(()ident(number_of_times)operator(\))operator(\)) + + +comment(# @@PLEAC@@_3.10) +ident(sleep)operator(()float(0.005)operator(\)) comment(# Ruby is definitely not as broken as Perl :\)) +comment(# (may be interrupted by sending the process a SIGALRM\)) + + +comment(# @@PLEAC@@_3.11) +comment(#!/usr/bin/ruby -w) +comment(# hopdelta - feed mail header, produce lines) +comment(# showing delay at each hop.) +ident(require) string +reserved(class) class(MailHopDelta) + + reserved(def) method(initialize)operator(()ident(mail)operator(\)) + instance_variable(@head) operator(=) ident(mail)operator(.)ident(gsub)operator(()regexpoperator(,)stringoperator(\)) + instance_variable(@topline) operator(=) string + instance_variable(@start_from) operator(=) ident(mail)operator(.)ident(match)operator(()regexp]*\))delimiter(/)>operator(\))operator([)integer(1)operator(]) + instance_variable(@date) operator(=) constant(Time)operator(.)ident(parse)operator(()ident(mail)operator(.)ident(match)operator(()regexpoperator(\))operator([)integer(1)operator(])operator(\)) + reserved(end) + + reserved(def) method(out)operator(()ident(line)operator(\)) + string operator(%) ident(line) + reserved(end) + + reserved(def) method(hop_date)operator(()ident(day)operator(\)) + ident(day)operator(.)ident(strftime)operator(()stringoperator(\)) + reserved(end) + + reserved(def) method(puts_hops) + ident(puts) ident(out)operator(()instance_variable(@topline)operator(\)) + ident(puts) ident(out)operator(()operator([)stringoperator(,) instance_variable(@start_from)operator(,) ident(hop_date)operator(()instance_variable(@date)operator(\))operator(,)stringoperator(])operator(\)) + instance_variable(@head)operator(.)ident(split)operator(()regexpoperator(\))operator(.)ident(reverse)operator(.)ident(grep)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(hop)operator(|) + ident(hop)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) + ident(whence) operator(=) ident(hop)operator(.)ident(match)operator(()regexpoperator(\))operator([)integer(1)operator(]) + reserved(unless) ident(whence) + ident(warn) stringdelimiter(")> + reserved(next) + reserved(end) + ident(from) operator(=) global_variable($+) reserved(if) ident(hop) operator(=)operator(~) regexp + ident(by) operator(=) global_variable($1) reserved(if) ident(hop) operator(=)operator(~) regexp + reserved(next) reserved(unless) ident(now) operator(=) constant(Time)operator(.)ident(parse)operator(()ident(whence)operator(\))operator(.)ident(localtime) + ident(delta) operator(=) ident(now) operator(-) instance_variable(@date) + ident(puts) ident(out)operator(()operator([)ident(from)operator(,) ident(by)operator(,) ident(hop_date)operator(()ident(now)operator(\))operator(,) ident(hop_time)operator(()ident(delta)operator(\))operator(])operator(\)) + instance_variable(@date) operator(=) ident(now) + reserved(end) + reserved(end) + + reserved(def) method(hop_time)operator(()ident(secs)operator(\)) + ident(sign) operator(=) ident(secs) operator(<) integer(0) operator(?) integer(-1) operator(:) integer(1) + ident(days)operator(,) ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60) operator(*) integer(60) operator(*) integer(24)operator(\)) + ident(hours)operator(,)ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60) operator(*) integer(60)operator(\)) + ident(mins)operator(,) ident(secs) operator(=) ident(secs)operator(.)ident(abs)operator(.)ident(divmod)operator(()integer(60)operator(\)) + ident(rtn) operator(=) string operator(%) operator([)ident(secs) operator(*) ident(sign)operator(]) + ident(rtn) operator(<<) string operator(%) operator([)ident(mins) operator(*) ident(sign)operator(]) reserved(if) ident(mins) operator(!=) integer(0) + ident(rtn) operator(<<) string operator(%) operator([)ident(hours) operator(*) ident(sign)operator(]) reserved(if) ident(hours) operator(!=) integer(0) + ident(rtn) operator(<<) string operator(%) operator([)ident(days) operator(*) ident(sign)operator(]) reserved(if) ident(days) operator(!=) integer(0) + ident(rtn) + reserved(end) +reserved(end) + +global_variable($/) operator(=) string +ident(mail) operator(=) constant(MailHopDelta)operator(.)ident(new)operator(()pre_constant(ARGF)operator(.)ident(gets)operator(\))operator(.)ident(puts_hops) + + +comment(# @@PLEAC@@_4.0) +ident(single_level) operator(=) operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(]) + +comment(# Ruby directly supports nested arrays) +ident(double_level) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(]) +ident(still_single_level) operator(=) operator([) stringoperator(,) stringoperator(,) operator([) stringoperator(,) string operator(]) operator(])operator(.)ident(flatten) + + +comment(# @@PLEAC@@_4.1) +ident(a) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) +ident(a) operator(=) string + +ident(lines) operator(=) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\))string + +ident(bigarray) operator(=) constant(IO)operator(.)ident(readlines)operator(()stringoperator(\))operator(.)ident(collect) operator({) operator(|)ident(l)operator(|) ident(l)operator(.)ident(chomp) operator(}) + +ident(name) operator(=) string +ident(banner) operator(=) stringcontent(, and welcome!)delimiter(\))> + +ident(host_info) operator(=) shelldelimiter(`)> + +shelldelimiter(\))> + +ident(banner) operator(=) stringoperator(.)ident(split)operator(()stringoperator(\)) + +ident(rax) operator(=) string { } [ ] )delimiter(!)> + + +comment(# @@PLEAC@@_4.2) +reserved(def) method(commify_series)operator(()ident(arr)operator(\)) + reserved(return) string reserved(if) reserved(not) ident(arr) + reserved(case) ident(arr)operator(.)ident(size) + reserved(when) integer(0) reserved(then) string + reserved(when) integer(1) reserved(then) ident(arr)operator([)integer(0)operator(]) + reserved(when) integer(2) reserved(then) ident(arr)operator(.)ident(join)operator(()stringoperator(\)) + reserved(else) ident(arr)operator([)integer(0)operator(..)integer(-2)operator(])operator(.)ident(join)operator(()stringoperator(\)) operator(+) string operator(+) ident(arr)operator([)integer(-1)operator(]) + reserved(end) +reserved(end) + +ident(array) operator(=) operator([) stringoperator(,) stringoperator(,) string operator(]) + +ident(print) stringoperator(,) ident(array)operator(,) string +comment(# -> I have redyellowgreen marbles) + +comment(# But unlike Perl:) +ident(print) stringcontent( marbles)char(\\n)delimiter(")> +comment(# -> I have redyellowgreen marbles) +comment(# So, needs:) +ident(print) stringoperator(\))delimiter(})>content( marbles)char(\\n)delimiter(")> +comment(# -> I have red yellow green marbles) + +comment(#!/usr/bin/ruby) +comment(# communify_series - show proper comma insertion in list output) + +reserved(def) method(commify_series)operator(()ident(arr)operator(\)) + reserved(return) string reserved(if) reserved(not) ident(arr) + ident(sepchar) operator(=) ident(arr)operator(.)ident(find) operator({) operator(|)ident(p)operator(|) ident(p) operator(=)operator(~) regexp operator(}) operator(?) string operator(:) string + reserved(case) ident(arr)operator(.)ident(size) + reserved(when) integer(0) reserved(then) string + reserved(when) integer(1) reserved(then) ident(arr)operator([)integer(0)operator(]) + reserved(when) integer(2) reserved(then) ident(arr)operator(.)ident(join)operator(()stringoperator(\)) + reserved(else) ident(arr)operator([)integer(0)operator(..)integer(-2)operator(])operator(.)ident(join)operator(()ident(sepchar)operator(\)) operator(+) ident(sepchar) operator(+) string operator(+) ident(arr)operator([)integer(-1)operator(]) + reserved(end) +reserved(end) + +ident(lists) operator(=) operator([) + operator([) string operator(])operator(,) + stringoperator(,) + stringoperator(,) + operator([) stringoperator(,) stringoperator(,) string operator(])operator(,) + operator([) stringoperator(,) stringoperator(,) stringoperator(,) string operator(])operator(,) + operator([) stringoperator(,) string operator(])operator(,) + operator([) stringoperator(,) + stringoperator(,) + string operator(])operator(,) +operator(]) + +reserved(for) ident(list) reserved(in) ident(lists) reserved(do) + ident(puts) stringcontent(.)delimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_4.3) +comment(# (note: AFAIK Ruby doesn't allow gory change of Array length\)) +comment(# grow the array by assigning nil to past the end of array) +ident(ary)operator([)ident(new_size)integer(-1)operator(]) operator(=) pre_constant(nil) +comment(# shrink the array by slicing it down) +ident(ary)operator(.)ident(slice!)operator(()ident(new_size)operator(..)integer(-1)operator(\)) +comment(# init the array with given size) +constant(Array)operator(.)ident(new)operator(()ident(number_of_elems)operator(\)) +comment(# assign to an element past the original end enlarges the array) +ident(ary)operator([)ident(index_new_last_elem)operator(]) operator(=) ident(value) + +reserved(def) method(what_about_that_array)operator(()ident(a)operator(\)) + ident(print) stringoperator(,) ident(a)operator(.)ident(size)operator(,) string + comment(# Index of last element is not really interesting in Ruby) + ident(print) stringcontent('.)char(\\n)delimiter(")> +reserved(end) +ident(people) operator(=) string +ident(what_about_that_array)operator(()ident(people)operator(\)) + + +comment(# @@PLEAC@@_4.4) +comment(# OO style) +ident(bad_users)operator(.)ident(each) operator({) operator(|)ident(user)operator(|) + ident(complain)operator(()ident(user)operator(\)) +operator(}) +comment(# or, functional style) +reserved(for) ident(user) reserved(in) ident(bad_users) + ident(complain)operator(()ident(user)operator(\)) +reserved(end) + +reserved(for) ident(var) reserved(in) constant(ENV)operator(.)ident(keys)operator(.)ident(sort) + ident(puts) stringcontent(=)inlinedelimiter(")> +reserved(end) + +reserved(for) ident(user) reserved(in) ident(all_users) + ident(disk_space) operator(=) ident(get_usage)operator(()ident(user)operator(\)) + reserved(if) operator(()ident(disk_space) operator(>) constant(MAX_QUOTA)operator(\)) + ident(complain)operator(()ident(user)operator(\)) + reserved(end) +reserved(end) + +reserved(for) ident(l) reserved(in) constant(IO)operator(.)ident(popen)operator(()stringoperator(\))operator(.)ident(readlines) + ident(print) ident(l) reserved(if) ident(l) operator(=)operator(~) regexp +reserved(end) + +comment(# we can mimic the obfuscated Perl way) +reserved(while) ident(fh)operator(.)ident(gets) comment(# $_ is set to the line just read) + ident(chomp) comment(# $_ has a trailing \\n removed, if it had one) + ident(split)operator(.)ident(each) operator({) operator(|)ident(w)operator(|) comment(# $_ is split on whitespace) + comment(# but $_ is not set to each chunk as in Perl) + ident(print) ident(w)operator(.)ident(reverse) + operator(}) +reserved(end) +comment(# ...or use a cleaner way) +reserved(for) ident(l) reserved(in) ident(fh)operator(.)ident(readlines) + ident(l)operator(.)ident(chomp)operator(.)ident(split)operator(.)ident(each) operator({) operator(|)ident(w)operator(|) ident(print) ident(w)operator(.)ident(reverse) operator(}) +reserved(end) + +comment(# same drawback as in problem 1.4, we can't mutate a Numeric...) +ident(array)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(-) integer(1) operator(}) + +ident(a) operator(=) operator([) operator(.)integer(5)operator(,) integer(3) operator(])operator(;) ident(b) operator(=) operator([) integer(0)operator(,) integer(1) operator(]) +reserved(for) ident(ary) reserved(in) operator([) ident(a)operator(,) ident(b) operator(]) + ident(ary)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(*) integer(7) operator(}) +reserved(end) +ident(puts) stringoperator(\))delimiter(})>content( )inlineoperator(\))delimiter(})>delimiter(")> + +comment(# we can mutate Strings, cool; we need a trick for the scalar) +reserved(for) ident(ary) reserved(in) operator([) operator([) ident(scalar) operator(])operator(,) ident(array)operator(,) ident(hash)operator(.)ident(values) operator(]) + ident(ary)operator(.)ident(each) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(strip!) operator(}) comment(# String#strip rules :\)) +reserved(end) + + +comment(# @@PLEAC@@_4.5) +comment(# not relevant in Ruby since we have always references) +reserved(for) ident(item) reserved(in) ident(array) + comment(# do somethingh with item) +reserved(end) + + +comment(# @@PLEAC@@_4.6) +ident(unique) operator(=) ident(list)operator(.)ident(uniq) + +comment(# generate a list of users logged in, removing duplicates) +ident(users) operator(=) shelloperator(.)ident(collect) operator({) operator(|)ident(l)operator(|) ident(l) operator(=)operator(~) regexpoperator(;) global_variable($1) operator(})operator(.)ident(sort)operator(.)ident(uniq) +ident(puts)operator(()stringdelimiter(")>operator(\)) comment(# see 4.2 for commify_series) + + +comment(# @@PLEAC@@_4.7) +ident(a) operator(-) ident(b) +comment(# [ 1, 1, 2, 2, 3, 3, 3, 4, 5 ] - [ 1, 2, 4 ] -> [3, 5]) + + +comment(# @@PLEAC@@_4.8) +ident(union) operator(=) ident(a) operator(|) ident(b) +ident(intersection) operator(=) ident(a) operator(&) ident(b) +ident(difference) operator(=) ident(a) operator(-) ident(b) + + +comment(# @@PLEAC@@_4.9) +ident(array1)operator(.)ident(concat)operator(()ident(array2)operator(\)) +comment(# if you will assign to another object, better use:) +ident(new_ary) operator(=) ident(array1) operator(+) ident(array2) + +ident(members) operator(=) operator([) stringoperator(,) string operator(]) +ident(initiates) operator(=) operator([) stringoperator(,) string operator(]) +ident(members) operator(+=) ident(initiates) + +ident(members) operator(=) operator([) stringoperator(,) string operator(]) +ident(initiates) operator(=) operator([) stringoperator(,) string operator(]) +ident(members)operator([)integer(2)operator(,)integer(0)operator(]) operator(=) operator([) stringoperator(,) ident(initiates) operator(])operator(.)ident(flatten) + +ident(members)operator([)integer(0)operator(]) operator(=) string +ident(members)operator([)integer(3)operator(,)integer(2)operator(]) operator(=) stringoperator(,) string + + +comment(# @@PLEAC@@_4.10) +ident(reversed) operator(=) ident(ary)operator(.)ident(reverse) + +ident(ary)operator(.)ident(reverse_each) operator({) operator(|)ident(e)operator(|) + comment(# do something with e) +operator(}) + +ident(descending) operator(=) ident(ary)operator(.)ident(sort)operator(.)ident(reverse) +ident(descending) operator(=) ident(ary)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b) operator(<=>) ident(a) operator(}) + + +comment(# @@PLEAC@@_4.11) +comment(# remove n elements from front of ary (shift n\)) +ident(front) operator(=) ident(ary)operator(.)ident(slice!)operator(()integer(0)operator(,) ident(n)operator(\)) + +comment(# remove n elements from the end of ary (pop n\)) +ident(end_) operator(=) ident(ary)operator(.)ident(slice!)operator(()operator(-)ident(n) operator(..) integer(-1)operator(\)) + +comment(# let's extend the Array class, to make that useful) +reserved(class) class(Array) + reserved(def) method(shift2)operator(()operator(\)) + ident(slice!)operator(()integer(0) operator(..) integer(1)operator(\)) comment(# more symetric with pop2...) + reserved(end) + reserved(def) method(pop2)operator(()operator(\)) + ident(slice!)operator(()integer(-2) operator(..) integer(-1)operator(\)) + reserved(end) +reserved(end) + +ident(friends) operator(=) string +ident(this)operator(,) ident(that) operator(=) ident(friends)operator(.)ident(shift2) + +ident(beverages) operator(=) string +ident(pair) operator(=) ident(beverages)operator(.)ident(pop2) + + +comment(# @@PLEAC@@_4.12) +comment(# use Enumerable#detect (or the synonym Enumerable#find\)) +ident(highest_eng) operator(=) ident(employees)operator(.)ident(detect) operator({) operator(|)ident(emp)operator(|) ident(emp)operator(.)ident(category) operator(==) string operator(}) + + +comment(# @@PLEAC@@_4.13) +comment(# use Enumerable#select (or the synonym Enumerable#find_all\)) +ident(bigs) operator(=) ident(nums)operator(.)ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(>) integer(1_000_000) operator(}) +ident(pigs) operator(=) ident(users)operator(.)ident(keys)operator(.)ident(select) operator({) operator(|)ident(k)operator(|) ident(users)operator([)ident(k)operator(]) operator(>) float(1e7) operator(}) + +ident(matching) operator(=) shelloperator(.)ident(select) operator({) operator(|)ident(u)operator(|) ident(u) operator(=)operator(~) regexp operator(}) + +ident(engineers) operator(=) ident(employees)operator(.)ident(select) operator({) operator(|)ident(e)operator(|) ident(e)operator(.)ident(position) operator(==) string operator(}) + +ident(secondary_assistance) operator(=) ident(applicants)operator(.)ident(select) operator({) operator(|)ident(a)operator(|) + ident(a)operator(.)ident(income) operator(>)operator(=) integer(26_000) operator(&&) ident(a)operator(.)ident(income) operator(<) integer(30_000) +operator(}) + + +comment(# @@PLEAC@@_4.14) +comment(# normally you would have an array of Numeric (Float or) +comment(# Fixnum or Bignum\), so you would use:) +ident(sorted) operator(=) ident(unsorted)operator(.)ident(sort) +comment(# if you have strings representing Integers or Floats) +comment(# you may specify another sort method:) +ident(sorted) operator(=) ident(unsorted)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(to_f) operator(<=>) ident(b)operator(.)ident(to_f) operator(}) + +comment(# let's use the list of my own PID's) +shelloperator(.)ident(split)operator(()stringoperator(\))operator([)integer(1)operator(..)integer(-1)operator(])operator(.) + ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(=)operator(~) regexpoperator(])delimiter(})>delimiter(/)> operator(})operator(.) + ident(collect) operator({) operator(|)ident(i)operator(|) ident(i)operator(.)ident(split)operator([)integer(1)operator(]) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(to_i) operator(<=>) ident(b)operator(.)ident(to_i) operator(})operator(.)ident(each) operator({) operator(|)ident(i)operator(|) ident(puts) ident(i) operator(}) +ident(puts) string +ident(pid) operator(=) ident(gets)operator(.)ident(chomp) +ident(raise) string reserved(unless) ident(pid) operator(&&) ident(pid) operator(=)operator(~) regexp +constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid)operator(.)ident(to_i)operator(\)) +ident(sleep) integer(2) +constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid)operator(.)ident(to_i)operator(\)) + +ident(descending) operator(=) ident(unsorted)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator(.)ident(to_f) operator(<=>) ident(a)operator(.)ident(to_f) operator(}) + + +comment(# @@PLEAC@@_4.15) +ident(ordered) operator(=) ident(unordered)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(compare)operator(()ident(a)operator(,)ident(b)operator(\)) operator(}) + +ident(precomputed) operator(=) ident(unordered)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(compute)operator(,) ident(e)operator(]) operator(}) +ident(ordered_precomputed) operator(=) ident(precomputed)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(}) +ident(ordered) operator(=) ident(ordered_precomputed)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) + +ident(ordered) operator(=) ident(unordered)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(compute)operator(,) ident(e)operator(]) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) + ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) + +reserved(for) ident(employee) reserved(in) ident(employees)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(name) operator(<=>) ident(b)operator(.)ident(name) operator(}) + ident(print) ident(employee)operator(.)ident(name)operator(,) stringoperator(,) ident(employee)operator(.)ident(salary)operator(,) string +reserved(end) + +comment(# Beware! `0' is true in Ruby.) +comment(# For chaining comparisons, you may use Numeric#nonzero?, which) +comment(# returns num if num is not zero, nil otherwise) +ident(sorted) operator(=) ident(employees)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) operator(()ident(a)operator(.)ident(name) operator(<=>) ident(b)operator(.)ident(name)operator(\))operator(.)ident(nonzero?) operator(||) ident(b)operator(.)ident(age) operator(<=>) ident(a)operator(.)ident(age) operator(}) + +ident(users) operator(=) operator([)operator(]) +comment(# getpwent is not wrapped in Ruby... let's fallback) +constant(IO)operator(.)ident(readlines)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(u)operator(|) ident(users) operator(<<) ident(u)operator(.)ident(split)operator(()stringoperator(\)) operator(}) +ident(users)operator(.)ident(sort!) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(}) +reserved(for) ident(user) reserved(in) ident(users) + ident(puts) ident(user)operator([)integer(0)operator(]) +reserved(end) + +ident(sorted) operator(=) ident(names)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(,) integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(,) integer(1)operator(]) operator(}) +ident(sorted) operator(=) ident(strings)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(length) operator(<=>) ident(b)operator(.)ident(length) operator(}) + +comment(# let's show only the compact version) +ident(ordered) operator(=) ident(strings)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(e)operator(.)ident(length)operator(,) ident(e)operator(]) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) + ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) + +ident(ordered) operator(=) ident(strings)operator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)regexpoperator(.)ident(match)operator(()ident(e)operator(\))operator([)integer(0)operator(])operator(.)ident(to_i)operator(,) ident(e)operator(]) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) + ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(1)operator(]) operator(}) + +ident(print) shelloperator(.)ident(collect) operator({) operator(|)ident(e)operator(|) operator([)ident(e)operator(,) ident(e)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(indexes)operator(()integer(3)operator(,)integer(2)operator(,)integer(0)operator(\))operator(])operator(.)ident(flatten) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) operator(()ident(a)operator([)integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(])operator(\))operator(.)ident(nonzero?) operator(||) operator(()ident(a)operator([)integer(2)operator(]) operator(<=>) ident(b)operator([)integer(2)operator(])operator(\))operator(.)ident(nonzero?) operator(||) ident(a)operator([)integer(3)operator(]) operator(<=>) ident(b)operator([)integer(3)operator(]) operator(})operator(.) + ident(collect) operator({) operator(|)ident(e)operator(|) ident(e)operator([)integer(0)operator(]) operator(}) + + +comment(# @@PLEAC@@_4.16) +ident(circular)operator(.)ident(unshift)operator(()ident(circular)operator(.)ident(pop)operator(\)) comment(# the last shall be first) +ident(circular)operator(.)ident(push)operator(()ident(circular)operator(.)ident(shift)operator(\)) comment(# and vice versa) + +reserved(def) method(grab_and_rotate)operator(()ident(l)operator(\)) + ident(l)operator(.)ident(push)operator(()ident(ret) operator(=) ident(l)operator(.)ident(shift)operator(\)) + ident(ret) +reserved(end) + +ident(processes) operator(=) operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(]) +reserved(while) operator(()integer(1)operator(\)) + ident(process) operator(=) ident(grab_and_rotate)operator(()ident(processes)operator(\)) + ident(puts) stringdelimiter(")> + ident(sleep) integer(1) +reserved(end) + + +comment(# @@PLEAC@@_4.17) +reserved(def) method(fisher_yates_shuffle)operator(()ident(a)operator(\)) + operator(()ident(a)operator(.)ident(size)integer(-1)operator(\))operator(.)ident(downto)operator(()integer(1)operator(\)) operator({) operator(|)ident(i)operator(|) + ident(j) operator(=) ident(rand)operator(()ident(i)integer(+1)operator(\)) + ident(a)operator([)ident(i)operator(])operator(,) ident(a)operator([)ident(j)operator(]) operator(=) ident(a)operator([)ident(j)operator(])operator(,) ident(a)operator([)ident(i)operator(]) reserved(if) ident(i) operator(!=) ident(j) + operator(}) +reserved(end) + +reserved(def) method(naive_shuffle)operator(()ident(a)operator(\)) + reserved(for) ident(i) reserved(in) integer(0)operator(...)ident(a)operator(.)ident(size) + ident(j) operator(=) ident(rand)operator(()ident(a)operator(.)ident(size)operator(\)) + ident(a)operator([)ident(i)operator(])operator(,) ident(a)operator([)ident(j)operator(]) operator(=) ident(a)operator([)ident(j)operator(])operator(,) ident(a)operator([)ident(i)operator(]) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_4.18) +comment(#!/usr/bin/env ruby) +comment(# example 4-2 words) +comment(# words - gather lines, present in colums) + +comment(# class to encapsulate the word formatting from the input) +reserved(class) class(WordFormatter) + reserved(def) method(initialize)operator(()ident(cols)operator(\)) + instance_variable(@cols) operator(=) ident(cols) + reserved(end) + + comment(# helper to return the length of the longest word in the wordlist) + reserved(def) method(maxlen)operator(()ident(wordlist)operator(\)) + ident(max) operator(=) integer(1) + reserved(for) ident(word) reserved(in) ident(wordlist) + reserved(if) ident(word)operator(.)ident(length) operator(>) ident(max) + ident(max) operator(=) ident(word)operator(.)ident(length) + reserved(end) + reserved(end) + ident(max) + reserved(end) + + comment(# process the wordlist and print it formmated into columns) + reserved(def) method(output)operator(()ident(wordlist)operator(\)) + ident(collen) operator(=) ident(maxlen)operator(()ident(wordlist)operator(\)) operator(+) integer(1) + ident(columns) operator(=) instance_variable(@cols) operator(/) ident(collen) + ident(columns) operator(=) integer(1) reserved(if) ident(columns) operator(==) integer(0) + ident(rows) operator(=) operator(()ident(wordlist)operator(.)ident(length) operator(+) ident(columns) operator(-) integer(1)operator(\)) operator(/) ident(columns) + comment(# now process each item, picking out proper piece for this position) + integer(0)operator(.)ident(upto)operator(()ident(rows) operator(*) ident(columns) operator(-) integer(1)operator(\)) operator({) operator(|)ident(item)operator(|) + ident(target) operator(=) operator(()ident(item) operator(%) ident(columns)operator(\)) operator(*) ident(rows) operator(+) operator(()ident(item) operator(/) ident(columns)operator(\)) + ident(eol) operator(=) operator(()operator(()ident(item)integer(+1)operator(\)) operator(%) ident(columns) operator(==) integer(0)operator(\)) + ident(piece) operator(=) ident(wordlist)operator([)ident(target)operator(]) operator(||) string + ident(piece) operator(=) ident(piece)operator(.)ident(ljust)operator(()ident(collen)operator(\)) reserved(unless) ident(eol) + ident(print) ident(piece) + ident(puts) reserved(if) ident(eol) + operator(}) + comment(# no need to finish it up, because eol is always true for the last element) + reserved(end) +reserved(end) + +comment(# get nr of chars that fit in window or console, see PLEAC 15.4) +comment(# not portable -- linux only (?\)) +reserved(def) method(getWinCharWidth)operator(()operator(\)) + ident(buf) operator(=) string operator(*) integer(8) + global_variable($stdout)operator(.)ident(ioctl)operator(()integer(0x5413)operator(,) ident(buf)operator(\)) + ident(ws_row)operator(,) ident(ws_col)operator(,) ident(ws_xpixel)operator(,) ident(ws_ypixel) operator(=) ident(buf)operator(.)ident(unpack)operator(()stringoperator(\)) + ident(ws_col) operator(||) integer(80) +reserved(rescue) + integer(80) +reserved(end) + +comment(# main program) +ident(cols) operator(=) ident(getWinCharWidth)operator(()operator(\)) +ident(formatter) operator(=) constant(WordFormatter)operator(.)ident(new)operator(()ident(cols)operator(\)) +ident(words) operator(=) ident(readlines)operator(()operator(\)) +ident(words)operator(.)ident(collect!) operator({) operator(|)ident(line)operator(|) + ident(line)operator(.)ident(chomp) +operator(}) +ident(formatter)operator(.)ident(output)operator(()ident(words)operator(\)) + + +comment(# @@PLEAC@@_4.19) +comment(# In ruby, Fixnum's are automatically converted to Bignum's when) +comment(# needed, so there is no need for an extra module) +reserved(def) method(factorial)operator(()ident(n)operator(\)) + ident(s) operator(=) integer(1) + reserved(while) ident(n) operator(>) integer(0) + ident(s) operator(*=) ident(n) + ident(n) operator(-=) integer(1) + reserved(end) + ident(s) +reserved(end) + +ident(puts) ident(factorial)operator(()integer(500)operator(\)) + +comment(#---------------------------------------------------------) +comment(# Example 4-3. tsc-permute) +comment(# tsc_permute: permute each word of input) +reserved(def) method(permute)operator(()ident(items)operator(,) ident(perms)operator(\)) + reserved(unless) ident(items)operator(.)ident(length) operator(>) integer(0) + ident(puts) ident(perms)operator(.)ident(join)operator(()stringoperator(\)) + reserved(else) + reserved(for) ident(i) reserved(in) ident(items) + ident(newitems) operator(=) ident(items)operator(.)ident(dup) + ident(newperms) operator(=) ident(perms)operator(.)ident(dup) + ident(newperms)operator(.)ident(unshift)operator(()ident(newitems)operator(.)ident(delete)operator(()ident(i)operator(\))operator(\)) + ident(permute)operator(()ident(newitems)operator(,) ident(newperms)operator(\)) + reserved(end) + reserved(end) +reserved(end) +comment(# In ruby the main program must be after all definitions it is using) +ident(permute)operator(()pre_constant(ARGV)operator(,) operator([)operator(])operator(\)) + +comment(#---------------------------------------------------------) +comment(# mjd_permute: permute each word of input) + +reserved(def) method(factorial)operator(()ident(n)operator(\)) + ident(s) operator(=) integer(1) + reserved(while) ident(n) operator(>) integer(0) + ident(s) operator(*=) ident(n) + ident(n) operator(-=) integer(1) + reserved(end) + ident(s) +reserved(end) + +comment(# we use a class with a class variable store the private cache) +comment(# for the results of the factorial function.) +reserved(class) class(Factorial) + class_variable(@@fact) operator(=) operator([) integer(1) operator(]) + reserved(def) constant(Factorial)operator(.)ident(compute)operator(()ident(n)operator(\)) + reserved(if) class_variable(@@fact)operator([)ident(n)operator(]) + class_variable(@@fact)operator([)ident(n)operator(]) + reserved(else) + class_variable(@@fact)operator([)ident(n)operator(]) operator(=) ident(n) operator(*) constant(Factorial)operator(.)ident(compute)operator(()ident(n) operator(-) integer(1)operator(\)) + reserved(end) + reserved(end) +reserved(end) + +comment(#---------------------------------------------------------) +comment(# Example 4-4- mjd-permute) +comment(# n2pat(n, len\): produce the N-th pattern of length len) + +comment(# We must use a lower case letter as parameter N, otherwise it is) +comment(# handled as constant Length is the length of the resulting) +comment(# array, not the index of the last element (length -1\) like in) +comment(# the perl example.) +reserved(def) method(n2pat)operator(()ident(n)operator(,) ident(length)operator(\)) + ident(pat) operator(=) operator([)operator(]) + ident(i) operator(=) integer(1) + reserved(while) ident(i) operator(<=) ident(length) + ident(pat)operator(.)ident(push)operator(()ident(n) operator(%) ident(i)operator(\)) + ident(n) regexp 0 + perm +end + +def n2perm(n, len\) + pat2perm(n2pat(n,len\)\) +end + +# In ruby the main program must be after all definitions +while gets + data = split + # the perl solution has used $#data, which is length-1 + num_permutations = Factorial.compute(data.length(\)\) + 0.upto(num_permutations - 1\) do |i| + # in ruby we can not use an array as selector for an array + # but by exchanging the two arrays, we can use the collect method + # which returns an array with the result of all block invocations + permutation = n2perm(i, data.length\).collect { + |j| data[j] + } + puts permutation.join(" "\) + end +end + + +# @@PLEAC@@_5.0 +age = { "Nat", 24, + "Jules", 25, + "Josh", 17 } + +age["Nat"] = 24 +age["Jules"] = 25 +age["Josh"] = 17 + +food_color = { + "Apple" => "red", + "Banana" => "yellow", + "Lemon" => "yellow", + "Carrot" => "orange" + } + +# In Ruby, you cannot avoid the double or simple quoting +# while manipulatin hashes + + +# @@PLEAC@@_5.1 +hash[key] = value + +food_color["Raspberry"] = "pink" +puts "Known foods:", food_color.keys + + +# @@PLEAC@@_5.2 +# does hash have a value for key ? +if (hash.has_key?(key\)\) + # it exists +else + # it doesn't +end + +[ "Banana", "Martini" ].each { |name| + print name, " is a ", food_color.has_key?(name\) ? "food" : "drink", ")char(\\n)content(" +} + +age = {} +age['Toddler'] = 3 +age['Unborn'] = 0 +age['Phantasm'] = nil + +for thing in ['Toddler', 'Unborn', 'Phantasm', 'Relic'] + print ")inlinecontent(: " + print "Has-key " if age.has_key?(thing\) + print "True " if age[thing] + print "Nonzero " if age[thing] && age[thing].nonzero? + print ")char(\\n)content(" +end + +#=> +# Toddler: Has-key True Nonzero +# Unborn: Has-key True +# Phantasm: Has-key +# Relic: + +# You use Hash#has_key? when you use Perl's exists -> it checks +# for existence of a key in a hash. +# All Numeric are "True" in ruby, so the test doesn't have the +# same semantics as in Perl; you would use Numeric#nonzero? to +# achieve the same semantics (false if 0, true otherwise\). + + +# @@PLEAC@@_5.3 +food_color.delete("Banana"\) + + +# @@PLEAC@@_5.4 +hash.each { |key, value| + # do something with key and value +} + +hash.each_key { |key| + # do something with key +} + +food_color.each { |food, color| + puts ")inlinecontent( is )inlinecontent(" +} + +food_color.each_key { |food| + puts ")inlinecontent( is )inlinecontent(" +} + +# IMO this demonstrates that OO style is by far more readable +food_color.keys.sort.each { |food| + puts ")inlinecontent( is )inlinecontent(." +} + +#----------------------------- +#!)delimiter(/)modifier(us)>ident(r)operator(/)ident(bin)operator(/)ident(ruby) +comment(# countfrom - count number of messages from each sender) + +comment(# Default value is 0) +ident(from) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) +reserved(while) ident(gets) + regexp reserved(and) ident(from)operator([)global_variable($1)operator(]) operator(+=) integer(1) +reserved(end) + +comment(# More useful to sort by number of received mail by person) +ident(from)operator(.)ident(sort) operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(])operator(<=>)ident(a)operator([)integer(1)operator(])operator(})operator(.)ident(each) operator({) operator(|)ident(v)operator(|) + ident(puts) stringcontent(: )inlinedelimiter(")> +operator(}) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_5.5) +comment(# You may use the built-in 'inspect' method this way:) +ident(p) ident(hash) + +comment(# Or do it the Cookbook way:) +ident(hash)operator(.)ident(each) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) + +comment(# Sorted by keys) +ident(hash)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) +comment(# Sorted by values) +ident(hash)operator(.)ident(sort)operator({)operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(])operator(<=>)ident(b)operator([)integer(1)operator(])operator(})operator(.)ident(each) operator({) operator(|)ident(e)operator(|) ident(puts) stringcontent( => )inlinedelimiter(")> operator(}) + + +comment(# @@PLEAC@@_5.7) +ident(ttys) operator(=) constant(Hash)operator(.)ident(new) +reserved(for) ident(i) reserved(in) shell + ident(user)operator(,) ident(tty) operator(=) ident(i)operator(.)ident(split) + operator(()ident(ttys)operator([)ident(user)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(tty) comment(# see problems_ruby for more infos) +reserved(end) +ident(ttys)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(k)operator(|) + ident(puts) stringcontent(: )inlinedelimiter(")> comment(# from 4.2) +operator(}) + + +comment(# @@PLEAC@@_5.8) +ident(surname) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) +ident(puts) ident(surname)operator(.)ident(index)operator(()stringoperator(\)) + +comment(# If you really needed to 'invert' the whole hash, use Hash#invert) + +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# foodfind - find match for food or color) + +ident(given) operator(=) pre_constant(ARGV)operator(.)ident(shift) reserved(or) ident(raise) string + +ident(color) operator(=) operator({) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) +operator(}) + +reserved(if) operator(()ident(color)operator(.)ident(has_key?)operator(()ident(given)operator(\))operator(\)) + ident(puts) stringcontent( is a food with color )inlinecontent(.)delimiter(")> +reserved(end) +reserved(if) operator(()ident(color)operator(.)ident(has_value?)operator(()ident(given)operator(\))operator(\)) + ident(puts) stringcontent( is a food with color )inlinecontent(.)delimiter(")> +reserved(end) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_5.9) +comment(# Sorted by keys (Hash#sort gives an Array of pairs made of each key,value\)) +ident(food_color)operator(.)ident(sort)operator(.)ident(each) operator({) operator(|)ident(f)operator(|) + ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> +operator(}) + +comment(# Sorted by values) +ident(food_color)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(]) operator(<=>) ident(b)operator([)integer(1)operator(]) operator(})operator(.)ident(each) operator({) operator(|)ident(f)operator(|) + ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> +operator(}) + +comment(# Sorted by length of values) +ident(food_color)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(1)operator(])operator(.)ident(length) operator(<=>) ident(b)operator([)integer(1)operator(])operator(.)ident(length) operator(})operator(.)ident(each) operator({) operator(|)ident(f)operator(|) + ident(puts) stringcontent( is )inlinecontent(.)delimiter(")> +operator(}) + + +comment(# @@PLEAC@@_5.10) +ident(merged) operator(=) ident(a)operator(.)ident(clone)operator(.)ident(update)operator(()ident(b)operator(\)) comment(# because Hash#update changes object in place) + +ident(drink_color) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(}) +ident(ingested_color) operator(=) ident(drink_color)operator(.)ident(clone)operator(.)ident(update)operator(()ident(food_color)operator(\)) + +ident(substance_color) operator(=) operator({)operator(}) +reserved(for) ident(i) reserved(in) operator([) ident(food_color)operator(,) ident(drink_color) operator(]) + ident(i)operator(.)ident(each_key) operator({) operator(|)ident(k)operator(|) + reserved(if) ident(substance_color)operator(.)ident(has_key?)operator(()ident(k)operator(\)) + ident(puts) stringcontent( seen twice. Using the first definition.)delimiter(")> + reserved(next) + reserved(end) + ident(substance_color)operator([)ident(k)operator(]) operator(=) integer(1) + operator(}) +reserved(end) + + +comment(# @@PLEAC@@_5.11) +ident(common) operator(=) ident(hash1)operator(.)ident(keys) operator(&) ident(hash2)operator(.)ident(keys) + +ident(this_not_that) operator(=) ident(hash1)operator(.)ident(keys) operator(-) ident(hash2)operator(.)ident(keys) + + +comment(# @@PLEAC@@_5.12) +comment(# no problem here, Ruby handles any kind of object for key-ing) +comment(# (it takes Object#hash, which defaults to Object#id\)) + + +comment(# @@PLEAC@@_5.13) +comment(# AFAIK, not possible in Ruby) + + +comment(# @@PLEAC@@_5.14) +comment(# Be careful, the following is possible only because Fixnum objects are) +comment(# special (documentation says: there is effectively only one Fixnum object) +comment(# instance for any given integer value\).) +ident(count) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) +ident(array)operator(.)ident(each) operator({) operator(|)ident(e)operator(|) + ident(count)operator([)ident(e)operator(]) operator(+=) integer(1) +operator(}) + + +comment(# @@PLEAC@@_5.15) +ident(father) operator(=) operator({) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) + string operator(,) stringoperator(,) +operator(}) + +reserved(while) ident(gets) + ident(chomp) + reserved(begin) + ident(print) global_variable($_)operator(,) string + reserved(end) reserved(while) global_variable($_) operator(=) ident(father)operator([)global_variable($_)operator(]) + ident(puts) +reserved(end) + +ident(children) operator(=) operator({)operator(}) +ident(father)operator(.)ident(each) operator({) operator(|)ident(k)operator(,)ident(v)operator(|) + operator(()ident(children)operator([)ident(v)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(k) +operator(}) +reserved(while) ident(gets) + ident(chomp) + ident(puts) stringcontent( begat )inlineoperator(])operator(\))operator(.)ident(join)operator(()stringoperator(\))delimiter(})>content(.)char(\\n)delimiter(")> +reserved(end) + +ident(includes) operator(=) operator({)operator(}) +ident(files)operator(.)ident(each) operator({) operator(|)ident(f)operator(|) + reserved(begin) + reserved(for) ident(l) reserved(in) constant(IO)operator(.)ident(readlines)operator(()ident(f)operator(\)) + reserved(next) reserved(unless) ident(l) operator(=)operator(~) regexp]+\)>)delimiter(/)> + operator(()ident(includes)operator([)global_variable($1)operator(]) operator(||=) operator([)operator(])operator(\)) operator(<<) ident(f) + reserved(end) + reserved(rescue) constant(SystemCallError) + global_variable($stderr)operator(.)ident(puts) string + reserved(end) +operator(}) + +ident(include_free) operator(=) ident(includes)operator(.)ident(values)operator(.)ident(flatten)operator(.)ident(uniq) operator(-) ident(includes)operator(.)ident(keys) + + +comment(# @@PLEAC@@_5.16) +comment(# dutree - print sorted intented rendition of du output) +comment(#% dutree) +comment(#% dutree /usr) +comment(#% dutree -a) +comment(#% dutree -a /bin) + +comment(# The DuNode class collects all information about a directory,) +comment(# and provides some convenience methods) +reserved(class) class(DuNode) + + ident(attr_reader) symbol(:name) + ident(attr_accessor) symbol(:size) + ident(attr_accessor) symbol(:kids) + + reserved(def) method(initialize)operator(()ident(name)operator(\)) + instance_variable(@name) operator(=) ident(name) + instance_variable(@kids) operator(=) operator([)operator(]) + instance_variable(@size) operator(=) integer(0) + reserved(end) + + comment(# support for sorting nodes with side) + reserved(def) method(size_compare)operator(()ident(node2)operator(\)) + instance_variable(@size) operator(<=>) ident(node2)operator(.)ident(size) + reserved(end) + + reserved(def) method(basename) + instance_variable(@name)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) + reserved(end) + + comment(#returns substring before last "/", nil if not there) + reserved(def) method(parent) + ident(p) operator(=) instance_variable(@name)operator(.)ident(sub)operator(()regexpoperator(,)stringoperator(\)) + reserved(if) ident(p) operator(==) instance_variable(@name) + pre_constant(nil) + reserved(else) + ident(p) + reserved(end) + reserved(end) + +reserved(end) + +comment(# The DuTree does the acdtual work of) +comment(# getting the input, parsing it, builging up a tree) +comment(# and format it for output) +reserved(class) class(Dutree) + + ident(attr_reader) symbol(:topdir) + + reserved(def) method(initialize) + instance_variable(@nodes) operator(=) constant(Hash)operator(.)ident(new) + instance_variable(@dirsizes) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) + instance_variable(@kids) operator(=) constant(Hash)operator(.)ident(new)operator(()operator([)operator(])operator(\)) + reserved(end) + + comment(# get a node by name, create it if it does not exist yet) + reserved(def) method(get_create_node)operator(()ident(name)operator(\)) + reserved(if) instance_variable(@nodes)operator(.)ident(has_key?)operator(()ident(name)operator(\)) + instance_variable(@nodes)operator([)ident(name)operator(]) + reserved(else) + ident(node) operator(=) constant(DuNode)operator(.)ident(new)operator(()ident(name)operator(\)) + instance_variable(@nodes)operator([)ident(name)operator(]) operator(=) ident(node) + ident(node) + reserved(end) + reserved(end) + + comment(# run du, read in input, save sizes and kids) + comment(# stores last directory read in instance variable topdir) + reserved(def) method(input)operator(()ident(arguments)operator(\)) + ident(name) operator(=) string + ident(cmd) operator(=) string operator(+) ident(arguments)operator(.)ident(join)operator(()stringoperator(\)) + constant(IO)operator(.)ident(popen)operator(()ident(cmd)operator(\)) operator({) operator(|)ident(pipe)operator(|) + ident(pipe)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + ident(size)operator(,) ident(name) operator(=) ident(line)operator(.)ident(chomp)operator(.)ident(split)operator(()regexpoperator(,) integer(2)operator(\)) + ident(node) operator(=) ident(get_create_node)operator(()ident(name)operator(\)) + ident(node)operator(.)ident(size) operator(=) ident(size)operator(.)ident(to_i) + instance_variable(@nodes)operator([)ident(name)operator(]) operator(=) ident(node) + ident(parent) operator(=) ident(node)operator(.)ident(parent) + reserved(if) ident(parent) + ident(get_create_node)operator(()ident(parent)operator(\))operator(.)ident(kids)operator(.)ident(push)operator(()ident(node)operator(\)) + reserved(end) + operator(}) + operator(}) + instance_variable(@topdir) operator(=) instance_variable(@nodes)operator([)ident(name)operator(]) + reserved(end) + + comment(# figure out how much is taken in each directory) + comment(# that isn't stored in the subdirectories. Add a new) + comment(# fake kid called "." containing that much.) + reserved(def) method(get_dots)operator(()ident(node)operator(\)) + ident(cursize) operator(=) ident(node)operator(.)ident(size) + reserved(for) ident(kid) reserved(in) ident(node)operator(.)ident(kids) + ident(cursize) operator(-=) ident(kid)operator(.)ident(size) + ident(get_dots)operator(()ident(kid)operator(\)) + reserved(end) + reserved(if) ident(node)operator(.)ident(size) operator(!=) ident(cursize) + ident(newnode) operator(=) ident(get_create_node)operator(()ident(node)operator(.)ident(name) operator(+) stringoperator(\)) + ident(newnode)operator(.)ident(size) operator(=) ident(cursize) + ident(node)operator(.)ident(kids)operator(.)ident(push)operator(()ident(newnode)operator(\)) + reserved(end) + reserved(end) + + comment(# recursively output everything) + comment(# passing padding and number width as well) + comment(# on recursive calls) + reserved(def) method(output)operator(()ident(node)operator(,) ident(prefix)operator(=)stringoperator(,) ident(width)operator(=)integer(0)operator(\)) + ident(line) operator(=) ident(sprintf)operator(()stringcontent(d %s)delimiter(")>operator(,) ident(node)operator(.)ident(size)operator(,) ident(node)operator(.)ident(basename)operator(\)) + ident(puts)operator(()ident(prefix) operator(+) ident(line)operator(\)) + ident(prefix) operator(+=) ident(line)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) + ident(prefix)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(if) ident(node)operator(.)ident(kids)operator(.)ident(length) operator(>) integer(0) comment(# not a bachelor node) + ident(kids) operator(=) ident(node)operator(.)ident(kids) + ident(kids)operator(.)ident(sort!) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) + ident(b)operator(.)ident(size_compare)operator(()ident(a)operator(\)) + operator(}) + ident(width) operator(=) ident(kids)operator([)integer(0)operator(])operator(.)ident(size)operator(.)ident(to_s)operator(.)ident(length) + reserved(for) ident(kid) reserved(in) ident(kids) + ident(output)operator(()ident(kid)operator(,) ident(prefix)operator(,) ident(width)operator(\)) + reserved(end) + reserved(end) + reserved(end) + +reserved(end) + +ident(tree) operator(=) constant(Dutree)operator(.)ident(new) +ident(tree)operator(.)ident(input)operator(()pre_constant(ARGV)operator(\)) +ident(tree)operator(.)ident(get_dots)operator(()ident(tree)operator(.)ident(topdir)operator(\)) +ident(tree)operator(.)ident(output)operator(()ident(tree)operator(.)ident(topdir)operator(\)) + + +comment(# @@PLEAC@@_6.0) +comment(# The verbose version are match, sub, gsub, sub! and gsub!;) +comment(# pattern needs to be a Regexp object; it yields a MatchData) +comment(# object.) +ident(pattern)operator(.)ident(match)operator(()ident(string)operator(\)) +ident(string)operator(.)ident(sub)operator(()ident(pattern)operator(,) ident(replacement)operator(\)) +ident(string)operator(.)ident(gsub)operator(()ident(pattern)operator(,) ident(replacement)operator(\)) +comment(# As usual in Ruby, sub! does the same as sub but also modifies) +comment(# the object, the same for gsub!/gsub.) + +comment(# Sugared syntax yields the position of the match (or nil if no) +comment(# match\). Note that the object at the right of the operator needs) +comment(# not to be a Regexp object (it can be a String\). The "dont) +comment(# match" operator yields true or false.) +ident(meadow) operator(=)operator(~) regexp comment(# position of the match, nil if no match) +ident(meadow) operator(!)operator(~) regexp comment(# true if doesn't match, false if it does) +comment(# There is no sugared version for the substitution) + +ident(meadow) operator(=)operator(~) regexp reserved(and) ident(print) string + +ident(string) operator(=) string +ident(string)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + +comment(# % echo ababacaca | ruby -ne 'puts $& if /(a|ba|b\)+(a|ac\)+/') +comment(# ababa) + +comment(# The "global" (or "multiple"\) match is handled by String#scan) +ident(scan) operator(()regexpoperator(\)) operator({) + ident(puts) stringdelimiter(")> +operator(}) + +comment(# String#scan yields an Array if not used with a block) +ident(numbers) operator(=) ident(scan)operator(()regexpoperator(\)) + +ident(digits) operator(=) string +ident(nonlap) operator(=) ident(digits)operator(.)ident(scan)operator(()regexpoperator(\)) +ident(yeslap) operator(=) ident(digits)operator(.)ident(scan)operator(()regexpoperator(\)) +ident(puts) stringoperator(\))delimiter(})>delimiter(")> +ident(puts) stringoperator(\))delimiter(})>delimiter(")>operator(;) +comment(# Non-overlapping: 123 456 789) +comment(# Overlapping: 123 234 345 456 567 678 789) + +ident(string) operator(=) string +ident(string) operator(=)operator(~) regexp +ident(puts) string +comment(# (And \) (little lambs\) ( eat ivy\)) + + +comment(# @@PLEAC@@_6.1) +comment(# Ruby doesn't have the same problem:) +ident(dst) operator(=) ident(src)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) + +ident(progname) operator(=) global_variable($0)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) + +ident(bindirs) operator(=) string +ident(libdirs) operator(=) ident(bindirs)operator(.)ident(map) operator({) operator(|)ident(l)operator(|) ident(l)operator(.)ident(sub)operator(()stringoperator(,) stringoperator(\)) operator(}) + + +comment(# @@PLEAC@@_6.3) +regexp comment(# as many non-whitespace bytes as possible) +regexp comment(# as many letters, apostrophes, and hyphens) + +regexp comment(# usually best) +regexp comment(# fails at ends or w/ punctuation) + + +comment(# @@PLEAC@@_6.4) +ident(require) string +ident(str) operator(=) string +ident(re) operator(=) regexp comment(# /x for nice formatting) + +ident(str)operator(.)ident(gsub!) ident(re) reserved(do) comment(# pass a block to execute replacement) + ident(host) operator(=) constant(TCPsocket)operator(.)ident(gethostbyname)operator(()global_variable($1)operator(\)) + stringcontent( [)inlinecontent(])delimiter(")> +reserved(end) + +ident(puts) ident(str) +comment(#-----------------------------) +comment(# to match whitespace or #-characters in an extended re you need to escape) +comment(# them.) + +ident(foo) operator(=) integer(42) +ident(str) operator(=) string +ident(str)operator(.)ident(gsub!) regexp reserved(do) + ident(eval) global_variable($1) comment(# with the value of a local variable) + reserved(end) +ident(puts) ident(str) comment(# => blah 42 blah) + + +comment(# @@PLEAC@@_6.5) +comment(# The 'g' modifier doesn't exist in Ruby, a regexp can't be used) +comment(# directly in a while loop; instead, use String#scan { |match| .. } ) +ident(fish) operator(=) string +constant(WANT) operator(=) integer(3) +ident(count) operator(=) integer(0) +ident(fish)operator(.)ident(scan)operator(()regexpoperator(\)) operator({) + reserved(if) operator(()ident(count) operator(+=) integer(1)operator(\)) operator(==) constant(WANT) + ident(puts) stringcontent( one.)delimiter(")> + reserved(end) +operator(}) + +reserved(if) ident(fish) operator(=)operator(~) regexp + ident(puts) stringcontent( one.)delimiter(")> +reserved(end) + +ident(pond) operator(=) string +comment(# String#scan without a block gives an array of matches, each match) +comment(# being an array of all the specified groups) +ident(colors) operator(=) ident(pond)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten) comment(# get all matches) +ident(color) operator(=) ident(colors)operator([)integer(2)operator(]) comment(# then the one we want) +comment(# or without a temporary array) +ident(color) operator(=) ident(pond)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(flatten)operator([)integer(2)operator(]) comment(# just grab element 3) +ident(puts) stringcontent(.)delimiter(")> + +ident(count) operator(=) integer(0) +ident(fishes) operator(=) string +ident(evens) operator(=) ident(fishes)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(select) operator({) operator(()ident(count)operator(+=)integer(1)operator(\)) operator(%) integer(2) operator(==) integer(0) operator(}) +ident(print) stringoperator(\))delimiter(})>content(.)delimiter(")> + +ident(count) operator(=) integer(0) +ident(fishes)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({) + reserved(if) operator(()ident(count) operator(+=) integer(1)operator(\)) operator(==) integer(4) + string operator(+) global_variable($2) + reserved(else) + global_variable($1) operator(+) global_variable($2) + reserved(end) +operator(}) + +ident(pond) operator(=) string +ident(puts) stringoperator(\))operator(.)ident(flatten)operator([)integer(-1)operator(])delimiter(})>delimiter(")> + +regexp + +comment(# The "s" perl modifier is "m" in Ruby (not very nice since there is) +comment(# also an "m" in perl..\)) +ident(pond) operator(=) string +reserved(if) operator(()ident(pond) operator(=)operator(~) regexpoperator(\)) + ident(puts) stringcontent(.)delimiter(")> +reserved(else) + ident(puts) string +reserved(end) + + +comment(# @@PLEAC@@_6.6) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# killtags - very bad html killer) +global_variable($/) operator(=) pre_constant(nil)operator(;) comment(# each read is whole file) +reserved(while) ident(file) operator(=) ident(gets)operator(()operator(\)) reserved(do) + ident(file)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\))operator(;) comment(# strip tags (terribly\)) + ident(puts) ident(file) comment(# print file to STDOUT) +reserved(end) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(#headerfy - change certain chapter headers to html) +global_variable($/) operator(=) string +reserved(while) ident(file) operator(=) ident(gets)operator(()operator(\)) reserved(do) + ident(pattern) operator(=) regexp + ident(puts) ident(file)operator(.)ident(gsub)operator(()ident(pattern)operator(,)string)content(\\1)content()delimiter(')>operator(\)) +reserved(end) +comment(#-----------------------------) +comment(#% ruby -00pe "gsub!(/\\A(Chapter\\s+\\d+\\s*:.*\)/,'

\\1

'\)" datafile) + +comment(#!/usr/bin/ruby -w) +comment(#-----------------------------) +reserved(for) ident(file) reserved(in) pre_constant(ARGV) + ident(file) operator(=) constant(File)operator(.)ident(open)operator(()pre_constant(ARGV)operator(.)ident(shift)operator(\)) + reserved(while) ident(file)operator(.)ident(gets)operator(()stringoperator(\)) reserved(do) comment(# each read is a paragraph) + ident(print) stringcontent( in $ARGV has <<)inlinecontent(>>)char(\\n)delimiter(")> reserved(while) regexp + reserved(end) comment(# /m activates the multiline mode) +reserved(end) +comment(#-----------------------------) + +comment(# @@PLEAC@@_6.7) +comment(#-----------------------------) +global_variable($/) operator(=) pre_constant(nil)operator(;) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()stringoperator(\)) +ident(chunks) operator(=) ident(file)operator(.)ident(gets)operator(.)ident(split)operator(()regexpoperator(\)) +comment(#-----------------------------) +comment(# .Ch, .Se and .Ss divide chunks of STDIN) +ident(chunks) operator(=) ident(gets)operator(()pre_constant(nil)operator(\))operator(.)ident(split)operator(()regexpoperator(\)) +ident(print) stringcontent( chunks.)char(\\n)delimiter(")> +comment(#-----------------------------) + + +comment(# @@PLEAC@@_6.8) +reserved(while) ident(gets) + reserved(if) operator(~)regexp operator(..) operator(~)regexp + comment(# line falls between BEGIN and END inclusive) + reserved(end) +reserved(end) + +reserved(while) ident(gets) + reserved(if) operator(()global_variable($.) operator(==) ident(firstnum)operator(\)) operator(..) operator(()global_variable($.) operator(==) ident(lastnum)operator(\)) + comment(# operate between firstnum and lastnum line number) + reserved(end) +reserved(end) + +comment(# in ruby versions prior to 1.8, the above two conditional) +comment(# expressions could be shortened to:) +comment(# if /BEGIN/ .. /END/) +comment(# and) +comment(# if firstnum .. lastnum) +comment(# but these now only work this way from the command line ) + +comment(#-----------------------------) + +reserved(while) ident(gets) + reserved(if) operator(~)regexp operator(...) operator(~)regexp + comment(# line falls between BEGIN and END on different lines) + reserved(end) +reserved(end) + +reserved(while) ident(gets) + reserved(if) operator(()global_variable($.) operator(==) ident(first)operator(\)) operator(...) operator(()global_variable($.) operator(==) ident(last)operator(\)) + comment(# operate between first and last line number on different lines) + reserved(end) +reserved(end) + +comment(#-----------------------------) +comment(# command-line to print lines 15 through 17 inclusive (see below\)) +ident(ruby) operator(-)ident(ne) string ident(datafile) + +comment(# print out all .. displays from HTML doc) +reserved(while) ident(gets) + ident(print) reserved(if) operator(~)regexp)delimiter(#)modifier(i)> operator(..) operator(~)regexp)delimiter(#)modifier(i)>operator(;) +reserved(end) + +comment(# same, but as shell command) +comment(# ruby -ne 'print if %r##i .. %r##i' document.html) +comment(#-----------------------------) +comment(# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \\) +comment(# print if $top .. $bottom' /etc/passwd # FAILS) +comment(# ruby -ne 'BEGIN { $top=3; $bottom=5 }; \\) +comment(# print if $. == $top .. $. == $bottom' /etc/passwd # works) +comment(# ruby -ne 'print if 3 .. 5' /etc/passwd # also works) +comment(#-----------------------------) +ident(print) reserved(if) operator(~)regexp operator(..) operator(~)regexpoperator(;) +ident(print) reserved(if) operator(~)regexp operator(...) operator(~)regexpoperator(;) +comment(#-----------------------------) +reserved(while) ident(gets) + global_variable($in_header) operator(=) global_variable($.) operator(==) integer(1) operator(..) operator(~)regexp operator(?) pre_constant(true) operator(:) pre_constant(false) + global_variable($in_body) operator(=) operator(~)regexp operator(..) pre_constant(ARGF)operator(.)ident(eof) operator(?) pre_constant(true) operator(:) pre_constant(false) +reserved(end) +comment(#-----------------------------) +ident(seen) operator(=) operator({)operator(}) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + reserved(next) reserved(unless) ident(line) operator(=)operator(~) regexp operator(..) ident(line) operator(=)operator(~) regexpoperator(;) + ident(line)operator(.)ident(scan)operator(()regexp(\),;)char(\\s)content(]+)char(\\@)content([^<>(\),;)char(\\s)content(]+\))delimiter(/)>operator(\))operator(.)ident(each) reserved(do) operator(|)ident(addr)operator(|) + ident(puts) ident(addr) reserved(unless) ident(seen)operator([)ident(addr)operator(]) + ident(seen)operator([)ident(addr)operator(]) operator(||=) integer(1) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_6.9) +reserved(def) method(glob2pat)operator(()ident(globstr)operator(\)) + ident(patmap) operator(=) operator({) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + operator(}) + ident(globstr)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(c)operator(|) ident(patmap)operator([)ident(c)operator(]) operator(||) constant(Regexp)operator(::)ident(escape)operator(()ident(c)operator(\)) operator(}) + string operator(+) ident(globstr) operator(+) string +reserved(end) + + +comment(# @@PLEAC@@_6.10) +comment(# avoid interpolating patterns like this if the pattern) +comment(# isn't going to change:) +ident(pattern) operator(=) pre_constant(ARGV)operator(.)ident(shift) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)> +reserved(end) + +comment(# the above creates a new regex each iteration. Instead,) +comment(# use the /o modifier so the regex is compiled only once) + +ident(pattern) operator(=) pre_constant(ARGV)operator(.)ident(shift) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)modifier(o)> +reserved(end) + +comment(#-----------------------------) + +comment(#!/usr/bin/ruby) +comment(# popgrep1 - grep for abbreviations of places that say "pop") +comment(# version 1: slow but obvious way) +ident(popstates) operator(=) string +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) + reserved(if) ident(line) operator(=)operator(~) regexpchar(\\b)delimiter(/)> + ident(print) ident(line) + ident(last) + reserved(end) + reserved(end) +reserved(end) + +comment(#-----------------------------) +comment(#!/usr/bin/ruby) +comment(# popgrep2 - grep for abbreviations of places that say "pop") +comment(# version 2: eval strings; fast but hard to quote) +ident(popstates) operator(=) string +ident(code) operator(=) string +ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) + ident(code) operator(+=) stringchar(\\\\)content(b/; print(line\); next; end)char(\\n)delimiter(")> +reserved(end) +ident(code) operator(+=) string +ident(print) stringchar(\\n)content(---)char(\\n)delimiter(")> reserved(if) pre_constant(false) comment(# turn on for debugging) +ident(eval) ident(code) + +comment(# CODE IS) +comment(# ---) +comment(# ARGF.each do |line|) +comment(# if line =~ /\\bCO\\b/; print(line\); next; end) +comment(# if line =~ /\\bON\\b/; print(line\); next; end) +comment(# if line =~ /\\bMI\\b/; print(line\); next; end) +comment(# if line =~ /\\bWI\\b/; print(line\); next; end) +comment(# if line =~ /\\bMN\\b/; print(line\); next; end) +comment(# end) +comment(# ) +comment(# ---) + +comment(## alternatively, the same idea as above but compiling ) +comment(## to a case statement: (not in perlcookbook\)) +comment(#!/usr/bin/ruby -w) +comment(# popgrep2.5 - grep for abbreviations of places that say "pop") +comment(# version 2.5: eval strings; fast but hard to quote) +ident(popstates) operator(=) string +ident(code) operator(=) string +ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state)operator(|) + ident(code) operator(+=) stringchar(\\\\)content(b/ : print line)char(\\n)delimiter(")> +reserved(end) +ident(code) operator(+=) string +ident(print) stringchar(\\n)content(---)char(\\n)delimiter(")> reserved(if) pre_constant(false) comment(# turn on for debugging) +ident(eval) ident(code) + +comment(# CODE IS) +comment(# ---) +comment(# ARGF.each do |line|) +comment(# case line) +comment(# when /\\bCO\\b/ : print line) +comment(# when /\\bON\\b/ : print line) +comment(# when /\\bMI\\b/ : print line) +comment(# when /\\bWI\\b/ : print line) +comment(# when /\\bMN\\b/ : print line) +comment(# end) +comment(# end) +comment(# ) +comment(# ---) + +comment(# Note: (above\) Ruby 1.8+ allows the 'when EXP : EXPR' on one line) +comment(# with the colon separator.) + +comment(#-----------------------------) +comment(#!/usr/bin/ruby) +comment(# popgrep3 - grep for abbreviations of places that say "pop") +comment(# version3: build a match_any function) +ident(popstates) operator(=) string +ident(expr) operator(=) ident(popstates)operator(.)ident(map)operator({)operator(|)ident(e)operator(|)stringchar(\\\\)content(b/)delimiter(")>operator(})operator(.)ident(join)operator(()stringoperator(\)) +ident(eval) stringcontent(;end)delimiter(")> +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(match_any)operator(()ident(line)operator(\)) +reserved(end) +comment(#-----------------------------) + +comment(## building a match_all function is a trivial) +comment(## substitution of && for ||) +comment(## here is a generalized example:) +comment(#!/usr/bin/ruby -w) +comment(## grepauth - print lines that mention both foo and bar) +reserved(class) class(MultiMatch) + reserved(def) method(initialize)operator(()operator(*)ident(patterns)operator(\)) + ident(_any) operator(=) ident(build_match)operator(()stringoperator(,)ident(patterns)operator(\)) + ident(_all) operator(=) ident(build_match)operator(()stringoperator(,)ident(patterns)operator(\)) + ident(eval) stringcontent(;end)char(\\n)delimiter(")> + ident(eval) stringcontent(;end)char(\\n)delimiter(")> + reserved(end) + reserved(def) method(build_match)operator(()ident(sym)operator(,)ident(args)operator(\)) + ident(args)operator(.)ident(map)operator({)operator(|)ident(e)operator(|)stringcontent(/)delimiter(")>operator(})operator(.)ident(join)operator(()ident(sym)operator(\)) + reserved(end) +reserved(end) + +ident(mm) operator(=) constant(MultiMatch)operator(.)ident(new)operator(()stringoperator(,)stringoperator(\)) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(mm)operator(.)ident(match_all)operator(()ident(line)operator(\)) +reserved(end) +comment(#-----------------------------) + +comment(#!/usr/bin/ruby) +comment(# popgrep4 - grep for abbreviations of places that say "pop") +comment(# version4: pretty fast, but simple: compile all re's first:) +ident(popstates) operator(=) string +ident(popstates) operator(=) ident(popstates)operator(.)ident(map)operator({)operator(|)ident(re)operator(|) regexpchar(\\b)delimiter(/)>operator(}) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(popstates)operator(.)ident(each) reserved(do) operator(|)ident(state_re)operator(|) + reserved(if) ident(line) operator(=)operator(~) ident(state_re) + ident(print) ident(line) + reserved(break) + reserved(end) + reserved(end) +reserved(end) + +comment(## speeds trials on the jargon file(412\): 26006 lines, 1.3MB) +comment(## popgrep1 => 7.040s) +comment(## popgrep2 => 0.656s) +comment(## popgrep2.5 => 0.633s) +comment(## popgrep3 => 0.675s) +comment(## popgrep4 => 1.027s) + +comment(# unless speed is criticial, the technique in popgrep4 is a) +comment(# reasonable balance between speed and logical simplicity.) + + +comment(# @@PLEAC@@_6.11) +reserved(begin) + ident(print) string + ident(pat) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) + constant(Regexp)operator(.)ident(new)operator(()ident(pat)operator(\)) +reserved(rescue) + ident(warn) string + reserved(retry) +reserved(end) + + +comment(# @@PLEAC@@_6.13) +comment(# uses the 'amatch' extension found on:) +comment(# http://raa.ruby-lang.org/project/amatch/) +ident(require) string +ident(matcher) operator(=) constant(Amatch)operator(.)ident(new)operator(()stringoperator(\)) +comment(#$relative, $distance = 0, 1) +constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each_line) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(matcher)operator(.)ident(search)operator(()ident(line)operator(\)) operator(<=) integer(1) +reserved(end) +comment(__END__ +)comment(#CODE) +ident(ballast) +ident(ballasts) +ident(balustrade) +ident(balustrades) +ident(blast) +ident(blasted) +ident(blaster) +ident(blasters) +ident(blasting) +ident(blasts) + + +comment(# @@PLEAC@@_6.14) +ident(str)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(token)operator(|) + ident(puts) stringdelimiter(")> +reserved(end) +comment(#-----------------------------) +ident(n) operator(=) string +ident(n)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) +ident(puts) ident(n) +comment(#-----------------------------) +ident(str) operator(=) string +ident(str)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(num)operator(|) + ident(puts) stringdelimiter(")> +reserved(end) +comment(#-----------------------------) +comment(# Ruby doesn't have the String.pos or a /c re modifier like Perl ) +comment(# But it does have StringScanner in the standard library (strscn\)) +comment(# which allows similar functionality:) + +ident(require) string +ident(text) operator(=) string +ident(sc) operator(=) constant(StringScanner)operator(.)ident(new)operator(()ident(text)operator(\)) +reserved(while) ident(sc)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(print) stringchar(\\n)delimiter(")> +reserved(end) +reserved(if) ident(sc)operator(.)ident(scan)operator(()regexpoperator(\)) + ident(puts) stringcontent( after last number)delimiter(")> +reserved(end) +comment(#-----------------------------) +comment(# assuming continuing from above:) +ident(puts) stringdelimiter(")> +ident(sc)operator(.)ident(pos) operator(=) integer(30) +ident(puts) stringdelimiter(")> + + +comment(# @@PLEAC@@_6.15) +comment(#-----------------------------) +comment(# greedy pattern) +ident(str)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\)) comment(# not good) + +comment(# non-greedy (minimal\) pattern) +ident(str)operator(.)ident(gsub!)operator(()regexp)delimiter(/)modifier(m)>operator(,)stringoperator(\)) comment(# not great) + + +comment(#-----------------------------) +comment(#this and that are important Oh, me too!) +comment(#-----------------------------) +regexp(.*?\) )delimiter(})modifier(mx)> +comment(#-----------------------------) +regexp +comment(#-----------------------------) +regexp( (?: (?!|\). \)* \) )delimiter(})modifier(mx)> +comment(#-----------------------------) +regexp( (?: (?!\). \)* \) )delimiter(})modifier(mx)> +comment(#-----------------------------) +regexp + [^<]* # stuff not possibly bad, and not possibly the end. + (?: + # at this point, we can have '<' if not part of something bad + (?! \) # what we can't have + < # okay, so match the '<' + [^<]* # and continue with more safe stuff + \) * + + )delimiter(})modifier(mx)> + + +comment(# @@PLEAC@@_6.16) +comment(#-----------------------------) +global_variable($/) operator(=) string +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) + ident(para)operator(.)ident(scan) regexp reserved(do) + ident(puts) stringcontent(' at paragraph )inlinedelimiter(")> + reserved(end) +reserved(end) +comment(#-----------------------------) +ident(astr) operator(=) string +ident(bstr) operator(=) string +reserved(if) stringcontent( )inlinedelimiter(")> operator(=)operator(~) regexp + ident(print) stringcontent( overlaps in )inlinecontent(-)inlinecontent(-)inlinedelimiter(")> +reserved(end) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# prime_pattern -- find prime factors of argument using patterns) +pre_constant(ARGV) operator(<<) integer(180) +ident(cap) operator(=) string operator(*) pre_constant(ARGV)operator(.)ident(shift) +reserved(while) ident(cap) operator(=)operator(~) regexp + ident(print) global_variable($1)operator(.)ident(size)operator(,) string + ident(cap)operator(.)ident(gsub!)operator(()regexpdelimiter(/)>operator(,)stringoperator(\)) +reserved(end) +ident(puts) ident(cap)operator(.)ident(size) +comment(#-----------------------------) +comment(#diophantine) +comment(# solve for 12x + 15y + 16z = 281, maximizing x) +reserved(if) operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) + ident(x)operator(,) ident(y)operator(,) ident(z) operator(=) global_variable($1)operator(.)ident(size)operator(,) global_variable($2)operator(.)ident(size)operator(,) global_variable($3)operator(.)ident(size) + ident(puts) stringcontent(; y=)inlinecontent(; z=)inlinedelimiter(")> +reserved(else) + ident(puts) string +reserved(end) +comment(# => One solution is: x=17; y=3; z=2) + +comment(#-----------------------------) +comment(# using different quantifiers:) +operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) +comment(# => One solution is: x=17; y=3; z=2) + +operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) +comment(# => One solution is: x=0; y=7; z=11) + +operator(()string operator(*) integer(281)operator(\))operator(.)ident(match)operator(()regexpoperator(\)) +comment(# => One solution is: x=1; y=3; z=14) + + +comment(# @@PLEAC@@_6.17) +comment(# alpha OR beta) +regexp + +comment(# alpha AND beta) +regexp + +comment(# alpha AND beta, no overlap) +regexp + +comment(# NOT beta) +regexp + +comment(# NOT bad BUT good) +regexp +comment(#-----------------------------) + +reserved(if) operator(!)operator(()ident(string) operator(=)operator(~) regexpoperator(\)) comment(# ugly) + ident(something)operator(()operator(\)) +reserved(end) + +reserved(if) ident(string) operator(!)operator(~) regexp comment(# preferred) + ident(something)operator(()operator(\)) +reserved(end) + + +comment(#-----------------------------) +reserved(if) ident(string) operator(=)operator(~) regexp operator(&&) ident(string) operator(=)operator(~) regexp + ident(something)operator(()operator(\)) +reserved(end) +comment(#-----------------------------) +reserved(if) ident(string) operator(=)operator(~) regexp operator(||) ident(string) operator(=)operator(~) regexp + ident(something)operator(()operator(\)) +reserved(end) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# minigrep - trivial grep) +ident(pat) operator(=) pre_constant(ARGV)operator(.)ident(shift) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexpdelimiter(/)modifier(o)> +reserved(end) +comment(#-----------------------------) + string operator(=)operator(~) regexp +comment(#-----------------------------) +global_variable($string) operator(=)operator(~) regexp operator(&&) global_variable($string) operator(=)operator(~) regexp +comment(#-----------------------------) +global_variable($murray_hill) operator(=) string +reserved(if) global_variable($murray_hill) operator(=)operator(~) regexp comment(# /m means . can match newline) + + ident(print) stringoperator(;) +reserved(end) +comment(#-----------------------------) +string operator(=)operator(~) regexp +comment(#-----------------------------) +global_variable($brand) operator(=) stringoperator(;) +reserved(if) global_variable($brand) operator(=)operator(~) regexp comment(# /m means . can match newline) + ident(print) stringoperator(;) +reserved(end) +comment(#-----------------------------) +global_variable($map) operator(=)operator(~) regexp +comment(#-----------------------------) +global_variable($map) operator(=) string +reserved(if) global_variable($map) operator(=)operator(~) regexp comment(# /m means . can match newline) + ident(print) stringoperator(;) +reserved(end) +comment(=begin + 7:15am up 206 days, 13:30, 4 users, load average: 1.04, 1.07, 1.04 + +USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT + +tchrist tty1 5:16pm 36days 24:43 0.03s xinit + +tchrist tty2 5:19pm 6days 0.43s 0.43s -tcsh + +tchrist ttyp0 chthon 7:58am 3days 23.44s 0.44s -tcsh + +gnat ttyS4 coprolith 2:01pm 13:36m 0.30s 0.30s -tcsh +=end) +comment(#% w | minigrep '^(?!.*ttyp\).*tchrist') +comment(#-----------------------------) +regexp +comment(#-----------------------------) +comment(#% w | grep tchrist | grep -v ttyp) +comment(#-----------------------------) +comment(#% grep -i 'pattern' files) +comment(#% minigrep '(?i\)pattern' files) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_6.20) +ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) +ident(re) operator(=) regexpdelimiter(/)> +reserved(case) + reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string + reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string + reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string + reserved(when) string operator(=)operator(~) ident(re) operator(:) ident(puts) string +reserved(end) +comment(#-----------------------------) +ident(require) string +ident(table) operator(=) constant(Abbrev)operator(.)ident(abbrev) string +ident(loop) reserved(do) + ident(print) string + ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp) + ident(puts) stringcontent( is )inlinedelimiter(")> +reserved(end) + + +comment(#-----------------------------) +comment(# dummy values are defined for 'file', 'PAGER', and) +comment(# the 'invoke_editor' and 'deliver_message' methods) +comment(# do not do anything interesting in this example.) +comment(#!/usr/bin/ruby -w) +ident(require) string + +ident(file) operator(=) string +constant(PAGER) operator(=) string + +reserved(def) method(invoke_editor) + ident(puts) string +reserved(end) + +reserved(def) method(deliver_message) + ident(puts) string +reserved(end) + +ident(actions) operator(=) operator({) + string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:invoke_editor)operator(\))operator(,) + string operator(=)operator(>) pre_constant(self)operator(.)ident(method)operator(()symbol(:deliver_message)operator(\))operator(,) + string operator(=)operator(>) ident(proc) operator({)ident(system)operator(()constant(PAGER)operator(,) ident(file)operator(\))operator(})operator(,) + string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(;) ident(exit)operator(})operator(,) + string operator(=)operator(>) ident(proc) operator({)ident(puts) stringoperator(}) +operator(}) + +ident(dtable) operator(=) constant(Abbrev)operator(.)ident(abbrev)operator(()ident(actions)operator(.)ident(keys)operator(\)) +ident(loop) reserved(do) + ident(print) string + ident(ans) operator(=) global_variable($stdin)operator(.)ident(gets)operator(.)ident(chomp)operator(.)ident(delete)operator(()stringoperator(\)) + ident(actions)operator([) ident(dtable)operator([)ident(ans)operator(.)ident(downcase)operator(]) operator(||) string operator(])operator(.)ident(call) +reserved(end) + + +comment(# @@PLEAC@@_6.19) +comment(#-----------------------------) +comment(# basically, the Perl Cookbook categorizes this as an) +comment(# unsolvable problem ...) +comment(#-----------------------------) +integer(1) reserved(while) ident(addr)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) +comment(#-----------------------------) +constant(Dear) ident(someuser)instance_variable(@host)operator(.)ident(com)operator(,) + +constant(Please) ident(confirm) ident(the) ident(mail) ident(address) ident(you) ident(gave) ident(us) constant(Wed) constant(May) integer(6) integer(09)operator(:)integer(38)operator(:)integer(41) +constant(MDT) integer(1998) ident(by) ident(replying) ident(to) ident(this) ident(message)operator(.) constant(Include) ident(the) ident(string) +string reserved(in) ident(that) ident(reply)operator(,) ident(but) ident(spelled) reserved(in) ident(reverse)operator(;) ident(that) ident(is)operator(,) +ident(start) ident(with) stringoperator(.) constant(Once) ident(this) ident(is) ident(done)operator(,) ident(your) ident(confirmed) ident(address) ident(will) +ident(be) ident(entered) ident(into) ident(our) ident(records)operator(.) + + +comment(# @@PLEAC@@_6.21) +comment(#-----------------------------) +comment(#% gunzip -c ~/mail/archive.gz | urlify > archive.urlified) +comment(#-----------------------------) +comment(#% urlify ~/mail/*.inbox > ~/allmail.urlified) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# urlify - wrap HTML links around URL-like constructs) + +ident(urls) operator(=) stringoperator(;) +ident(ltrs) operator(=) stringoperator(;) +ident(gunk) operator(=) stringoperator(;) +ident(punc) operator(=) stringoperator(;) +ident(any) operator(=) stringinlineinlinedelimiter(")>operator(;) + +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(line)operator(.)ident(gsub!) regexpcontent( : # need resource and a colon + [)inlinecontent(] +? # followed by on or more + # of any valid character, but + # be conservative and take only + # what you need to.... + \) # end $1 } + (?= # look-ahead non-consumptive assertion + [)inlinecontent(]* # either 0 or more punctuation + [^)inlinecontent(] # followed by a non-url char + | # or else + $ # then end of the string + \) + )delimiter(/)modifier(iox)> reserved(do) + string)inlinecontent()delimiter(|)> + reserved(end) + ident(print) ident(line) +reserved(end) + + +comment(# @@PLEAC@@_6.23) +regexp +comment(#-----------------------------) +ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) +regexp comment(# keyword is $1, value is $2) +comment(#-----------------------------) +regexp +comment(#-----------------------------) +regexp +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(\))operator({) global_variable($1)operator(.)ident(hex)operator(.)ident(chr) operator(}) +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) +comment(#-----------------------------) +ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) +ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + +comment(# but really, in Ruby we'd just do:) +ident(str)operator(.)ident(strip!) +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) +comment(#-----------------------------) +ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) +regexp +comment(#-----------------------------) +ident(str)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) +ident(cols) operator(=) operator(() operator(()constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(\)) operator(=)operator(~) regexp operator(\)) operator(?) global_variable($1) operator(:) integer(80)operator(;) +comment(#-----------------------------) +ident(name) operator(=) stringcontent( )inlinedelimiter(")>operator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) +ident(require) string +ident(include) constant(Config) +ident(raise) string reserved(unless) constant(CONFIG)operator([)stringoperator(]) operator(=)operator(~) regexpoperator(;) +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) +ident(nums) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) +comment(#-----------------------------) +ident(capwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) +comment(#-----------------------------) +ident(lowords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) +comment(#-----------------------------) +ident(icwords) operator(=) ident(str)operator(.)ident(scan)operator(()regexpoperator(\)) +comment(#-----------------------------) +ident(links) operator(=) ident(str)operator(.)ident(scan)operator(()regexp]+?HREF)char(\\s)content(*=)char(\\s)content(*["']?([^'" >]+?\)[ '"]?>)delimiter(/)modifier(mi)>operator(\)) +comment(#-----------------------------) +ident(initial) operator(=) ident(str) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) string +comment(#-----------------------------) +ident(str)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) +comment(#-----------------------------) + +global_variable($/) operator(=) string +ident(sentences) operator(=) operator([)operator(]) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(para)operator(|) + ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + ident(para)operator(.)ident(gsub!)operator(()regexpoperator(,)stringoperator(\)) + ident(sentences) operator(<<) ident(para)operator(.)ident(scan)operator(()regexpoperator(\)) +reserved(end) + +comment(#-----------------------------) +regexp comment(# YYYY in $1, MM in $2, DD in $3) +comment(#-----------------------------) +regexp +comment(#-----------------------------) +regexp +comment(#-----------------------------) +ident(lines) operator(=) operator([)operator(]) +ident(lines) operator(<<) global_variable($1) reserved(while) ident(input)operator(.)ident(sub!)operator(()regexpoperator(,)stringoperator(\)) + + +comment(# @@PLEAC@@_7.0) +comment(# An IO object being Enumerable, we can use 'each' directly on it) +constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp +operator(}) + +ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) +ident(mysub)operator(()global_variable($stdin)operator(,) ident(logfile)operator(\)) + +comment(# The method IO#readline is similar to IO#gets) +comment(# but throws an exception when it reaches EOF) +ident(f) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(\)) +reserved(begin) + reserved(while) operator(()ident(line) operator(=) ident(f)operator(.)ident(readline)operator(\)) + ident(line)operator(.)ident(chomp) + global_variable($stdout)operator(.)ident(print) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp + reserved(end) +reserved(rescue) constant(EOFError) + ident(f)operator(.)ident(close) +reserved(end) + +reserved(while) global_variable($stdin)operator(.)ident(gets) comment(# reads from STDIN) + reserved(unless) operator(()regexpoperator(\)) + global_variable($stderr)operator(.)ident(puts) string comment(# writes to STDERR) + reserved(end) + ident(puts) stringdelimiter(")> comment(# writes to STDOUT) +reserved(end) + +ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) + +ident(logfile)operator(.)ident(close) + +comment(# $defout (or its synonym '$>'\) is the destination of output) +comment(# for Kernel#print, Kernel#puts, and family functions) +ident(logfile) operator(=) constant(File)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) +ident(old) operator(=) global_variable($defout) +global_variable($defout) operator(=) ident(logfile) comment(# switch to logfile for output) +ident(puts) string +global_variable($defout) operator(=) ident(old) comment(# return to original output) +ident(puts) string + + +comment(# @@PLEAC@@_7.1) +ident(source) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for reading only) +ident(sink) operator(=) constant(File)operator(.)ident(new)operator(()ident(path)operator(,) stringoperator(\)) comment(# open file "path" for writing only) + +ident(source) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) comment(# open file "path" for reading only) +ident(sink) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(\)) comment(# open file "path" for writing only) + +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) comment(# open "path" for reading and writing) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) ident(flags)operator(\)) comment(# open "path" with the flags "flags" (see examples below for flags\)) + +comment(# open file "path" read only) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDONLY)operator(\)) + +comment(# open file "path" write only, create it if it does not exist) +comment(# truncate it to zero length if it exists) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(TRUNC)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) comment(# with permission 0666) + +comment(# open file "path" write only, fails if file exists) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) + +comment(# open file "path" for appending) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0666)operator(\)) + +comment(# open file "path" for appending only when file exists) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(WRONLY)operator(|)constant(File)operator(::)constant(APPEND)operator(\)) + +comment(# open file "path" for reading and writing) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) stringoperator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(\)) + +comment(# open file for reading and writing, create a new file if it does not exist) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) + +comment(# open file "path" reading and writing, fails if file exists) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) +ident(file) operator(=) constant(File)operator(.)ident(open)operator(()ident(path)operator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(EXCL)operator(|)constant(File)operator(::)constant(CREAT)operator(,) integer(0600)operator(\)) + + +comment(# @@PLEAC@@_7.2) +comment(# No problem with Ruby since the filename doesn't contain characters with) +comment(# special meaning; like Perl's sysopen) +constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) + + +comment(# @@PLEAC@@_7.3) +constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) +comment(#=> "/root/tmp") +constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) +comment(#=> "/var/lib/nfs") + +comment(# To expand ~/.. it explicitely needs the environment variable HOME) +constant(File)operator(.)ident(expand_path)operator(()stringoperator(\)) +comment(#=> "/home/gc/tmp") + + +comment(# @@PLEAC@@_7.4) +comment(# The exception raised in Ruby reports the filename) +constant(File)operator(.)ident(open)operator(()stringoperator(\)) + + +comment(# @@PLEAC@@_7.5) +comment(# Standard Ruby distribution provides the following useful extension) +ident(require) string +comment(# With the Tempfile class, the file is automatically deleted on garbage) +comment(# collection, so you won't need to remove it, later on.) +ident(tf) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) comment(# a name is required to create the filename) + +comment(# If you need to pass the filename to an external program you can use) +comment(# File#path, but don't forget to File#flush in order to flush anything) +comment(# living in some buffer somewhere.) +ident(tf)operator(.)ident(flush) +ident(system)operator(()stringdelimiter(")>operator(\)) + +ident(fh) operator(=) constant(Tempfile)operator(.)ident(new)operator(()stringoperator(\)) +ident(fh)operator(.)ident(sync) operator(=) pre_constant(true) comment(# autoflushes) +integer(10)operator(.)ident(times) operator({) operator(|)ident(i)operator(|) ident(fh)operator(.)ident(puts) ident(i) operator(}) +ident(fh)operator(.)ident(rewind) +ident(puts) stringoperator(,) ident(fh)operator(.)ident(readlines) + + +comment(# @@PLEAC@@_7.6) +reserved(while) operator(()pre_constant(DATA)operator(.)ident(gets)operator(\)) reserved(do) + comment(# process the line ) +reserved(end) +comment(__END__ +# your data goes here +# __DATA__ doesn't exist in Ruby + +)comment(#CODE) +comment(# get info about the script (size, date of last modification\)) +ident(kilosize) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(size) operator(/) integer(1024) +ident(last_modif) operator(=) pre_constant(DATA)operator(.)ident(stat)operator(.)ident(mtime) +ident(puts) stringScript size is )inlinedelimiter(")> +ident(puts) stringLast script update: )inlinedelimiter(")> +comment(__END__ +# DO NOT REMOVE THE PRECEEDING LINE. +# Everything else in this file will be ignored. +)comment(#CODE) + + +comment(# @@PLEAC@@_7.7) +reserved(while) ident(line) operator(=) ident(gets) reserved(do) + comment(# do something with line.) +reserved(end) + +comment(# or ) +reserved(while) ident(gets) reserved(do) + comment(# do something with $_) +reserved(end) + +comment(# or more rubyish) +global_variable($stdin)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + comment(# do stuff with line) +reserved(end) + + +comment(# ARGF may makes this more easy) +comment(# this is skipped if ARGV.size==0) +pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) + comment(# closing and exception handling are done by the block) + ident(open)operator(()ident(filename)operator(\)) reserved(do) operator(|)ident(fd)operator(|) + ident(fd)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + comment(# do stuff with line) + reserved(end) + reserved(end) reserved(rescue) ident(abort)operator(()string operator(%) ident(filename)operator(\)) +reserved(end) + +comment(# globbing is done in the Dir module) +pre_constant(ARGV) operator(=) constant(Dir)operator([)stringoperator(]) reserved(if) pre_constant(ARGV)operator(.)ident(empty?) + +comment(# note: optparse is the preferred way to handle this) +reserved(if) operator(()pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) stringoperator(\)) + ident(chop_first) operator(+=) integer(1) + pre_constant(ARGV)operator(.)ident(shift) +reserved(end) + + +comment(# processing numerical options) +reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(=)operator(~) regexp + ident(columns) operator(=) global_variable($1) + pre_constant(ARGV)operator(.)ident(shift) +reserved(end) + +comment(# again, better to use optparse:) +ident(require) string +ident(nostdout) operator(=) integer(0) +ident(append) operator(=) integer(0) +ident(unbuffer) operator(=) integer(0) +ident(ignore_ints) operator(=) integer(0) +pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opt)operator(|) + ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(nostdout) operator(+=)integer(1) operator(}) + ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(append) operator(+=)integer(1) operator(}) + ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(unbuffer) operator(+=)integer(1) operator(}) + ident(opt)operator(.)ident(on)operator(()stringoperator(\)) operator({) ident(ignore_ints) operator(+=)integer(1) operator(}) + ident(opt)operator(.)ident(parse!) +reserved(end) reserved(or) ident(abort)operator(()string operator(+) pre_constant(__FILE__) operator(+) stringoperator(\)) + +comment(# no need to do undef $/, we have File.read) +ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) + +comment(# again we have File.read) +ident(str) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\)) + +comment(# not sure what this should do:) +comment(# I believe open the file, print filename, lineno and line:) +pre_constant(ARGF)operator(.)ident(each_with_index) reserved(do) operator(|)ident(line)operator(,) ident(idx)operator(|) + ident(print) pre_constant(ARGF)operator(.)ident(filename)operator(,) stringoperator(,) ident(idx)operator(,) stringoperator(,) ident(line) +reserved(end) + +comment(# print all the lines in every file passed via command line that contains login) +pre_constant(ARGF)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(puts) ident(line) reserved(if) ident(line) operator(=)operator(~) regexp +reserved(end) +comment(#) +comment(# even this would fit) +comment(#%ruby -ne "print if /f/" 2.log) +comment(#) + +pre_constant(ARGF)operator(.)ident(each) operator({) operator(|)ident(l)operator(|) ident(puts) ident(l)operator(.)ident(downcase!) operator(}) + +comment(#------------------) +comment(#!/usr/bin/ruby -p) +comment(# just like perl's -p) +global_variable($_)operator(.)ident(downcase!) +comment(#) + +comment(# I don't know who should I trust. ) +comment(# perl's version splits on \\w+ while python's on \\w.) + +ident(chunks) operator(=) integer(0) + +constant(File)operator(.)ident(read)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(\))operator(.)ident(split)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) + reserved(next) reserved(if) ident(word) operator(=)operator(~) regexp + reserved(break) reserved(if) operator([)stringoperator(,) stringoperator(])operator(.)ident(member?) ident(word) + ident(chunks) operator(+=) integer(1) +reserved(end) + +ident(print) stringoperator(,) ident(chunks)operator(,) string + + +comment(# @@PLEAC@@_7.8) +ident(old) operator(=) constant(File)operator(.)ident(open)operator(()ident(old_file)operator(\)) +ident(new) operator(=) constant(File)operator(.)ident(open)operator(()ident(new_file)operator(,) stringoperator(\)) +reserved(while) ident(old)operator(.)ident(gets) reserved(do) + comment(# change $_, then...) + ident(new)operator(.)ident(print) global_variable($_) +reserved(end) +ident(old)operator(.)ident(close) +ident(new)operator(.)ident(close) +constant(File)operator(.)ident(rename)operator(()ident(old_file)operator(,) stringoperator(\)) +constant(File)operator(.)ident(rename)operator(()ident(new_file)operator(,) ident(old_file)operator(\)) + +reserved(while) ident(old)operator(.)ident(gets) reserved(do) + reserved(if) global_variable($.) operator(==) integer(20) reserved(then) comment(# we are at the 20th line) + ident(new)operator(.)ident(puts) string + ident(new)operator(.)ident(puts) string + reserved(end) + ident(new)operator(.)ident(print) global_variable($_) +reserved(end) + +reserved(while) ident(old)operator(.)ident(gets) reserved(do) + reserved(next) reserved(if) integer(20)operator(..)integer(30) comment(# skip the 20th line to the 30th) + comment(# Ruby (and Perl\) permit to write if 20..30 ) + comment(# instead of if (20 <= $.\) and ($. <= 30\)) + ident(new)operator(.)ident(print) global_variable($_) +reserved(end) + + +comment(# @@PLEAC@@_7.9) +comment(#% ruby -i.orig -pe 'FILTER COMMAND' file1 file2 file3 ...) +comment(#) +comment(#-----------------------------) +comment(##!/usr/bin/ruby -i.orig -p) +comment(# filter commands go here) +comment(#-----------------------------) + +comment(#% ruby -pi.orig -e 'gsub!(/DATE/\){Time.now\)') + +comment(# effectively becomes:) +pre_constant(ARGV) operator(<<) string +ident(oldfile) operator(=) string +reserved(while) ident(gets) + reserved(if) pre_constant(ARGF)operator(.)ident(filename) operator(!=) ident(oldfile) + ident(newfile) operator(=) pre_constant(ARGF)operator(.)ident(filename) + constant(File)operator(.)ident(rename)operator(()ident(newfile)operator(,) ident(newfile) operator(+) stringoperator(\)) + global_variable($stdout) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,)stringoperator(\)) + ident(oldfile) operator(=) ident(newfile) + reserved(end) + ident(gsub!)operator(()regexpoperator(\))operator({)constant(Time)operator(.)ident(now)operator(}) + ident(print) +reserved(end) +global_variable($stdout) operator(=) constant(STDOUT) +comment(#-----------------------------) +comment(#% ruby -i.old -pe 'gsub!(%r{\\bhisvar\\b}, 'hervar'\)' *.[Cchy]) + +comment(#-----------------------------) +comment(# set up to iterate over the *.c files in the current directory,) +comment(# editing in place and saving the old file with a .orig extension) +global_variable($-i) operator(=) string comment(# set up -i mode) +pre_constant(ARGV)operator(.)ident(replace)operator(()constant(Dir)operator([)stringoperator(])operator(\)) +reserved(while) ident(gets) + reserved(if) global_variable($.) operator(==) integer(1) + ident(print) string + reserved(end) + ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) comment(# Correct typos, preserving case) + ident(print) + pre_constant(ARGF)operator(.)ident(close) reserved(if) pre_constant(ARGF)operator(.)ident(eof) +reserved(end) + + +comment(# @@PLEAC@@_7.10) +constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) comment(# open file for update) + ident(lines) operator(=) ident(f)operator(.)ident(readlines) comment(# read into array of lines) + ident(lines)operator(.)ident(each) reserved(do) operator(|)ident(it)operator(|) comment(# modify lines) + ident(it)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(end) + ident(f)operator(.)ident(pos) operator(=) integer(0) comment(# back to start) + ident(f)operator(.)ident(print) ident(lines) comment(# write out modified lines) + ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) comment(# truncate to new length) +reserved(end) comment(# file is automatically closed) +comment(#-----------------------------) +constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) + ident(out) operator(=) string + ident(f)operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(out) operator(<<) ident(line)operator(.)ident(gsub)operator(()regexpoperator(\)) operator({)constant(Time)operator(.)ident(now)operator(}) + reserved(end) + ident(f)operator(.)ident(pos) operator(=) integer(0) + ident(f)operator(.)ident(print) ident(out) + ident(f)operator(.)ident(truncate)operator(()ident(f)operator(.)ident(pos)operator(\)) +reserved(end) + +comment(# @@PLEAC@@_7.11) +constant(File)operator(.)ident(open)operator(()stringoperator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) + ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) + comment(# update file) +reserved(end) +comment(#-----------------------------) +constant(File)operator(::)constant(LOCK_SH) comment(# shared lock (for reading\)) +constant(File)operator(::)constant(LOCK_EX) comment(# exclusive lock (for writing\)) +constant(File)operator(::)constant(LOCK_NB) comment(# non-blocking request) +constant(File)operator(::)constant(LOCK_UN) comment(# free lock) +comment(#-----------------------------) +reserved(unless) ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) operator(|) constant(File)operator(::)constant(LOCK_NB) + ident(warn) string + ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) +reserved(end) +comment(#-----------------------------) +constant(File)operator(.)ident(open)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) reserved(do) operator(|)ident(f)operator(|) + ident(f)operator(.)ident(flock)operator(()constant(File)operator(::)constant(LOCK_EX)operator(\)) + ident(num) operator(=) ident(f)operator(.)ident(gets)operator(.)ident(to_i) operator(||) integer(0) + ident(f)operator(.)ident(pos) operator(=) integer(0) + ident(f)operator(.)ident(truncate) integer(0) + ident(f)operator(.)ident(puts) ident(num) operator(+) integer(1)ident(q) +reserved(end) + + +comment(# @@PLEAC@@_7.12) +ident(output_handle)operator(.)ident(sync) operator(=) pre_constant(true) +comment(# Please note that like in Perl, $stderr is already unbuffered) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# seeme - demo stdio output buffering) +global_variable($stdout)operator(.)ident(sync) operator(=) pre_constant(ARGV)operator(.)ident(size) operator(>) integer(0) +ident(print) string +ident(sleep) integer(2) +ident(puts) string +comment(#-----------------------------) +global_variable($stderr)operator(.)ident(sync) operator(=) pre_constant(true) +ident(afile)operator(.)ident(sync) operator(=) pre_constant(false) +comment(#-----------------------------) +comment(# assume 'remote_con' is an interactive socket handle,) +comment(# but 'disk_file' is a handle to a regular file.) +ident(remote_con)operator(.)ident(sync) operator(=) pre_constant(true) comment(# unbuffer for clarity) +ident(disk_file)operator(.)ident(sync) operator(=) pre_constant(false) comment(# buffered for speed) +comment(#-----------------------------) +ident(require) string +ident(sock) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) integer(80)operator(\)) +ident(sock)operator(.)ident(sync) operator(=) pre_constant(true) +ident(sock)operator(.)ident(puts) string +ident(resp) operator(=) ident(sock)operator(.)ident(read) +ident(print) stringchar(\\n)delimiter(")> + + +comment(# @@PLEAC@@_7.13) +comment(#-----------------------------) +comment(# assumes fh1, fh2, fh2 are oen IO objects) +ident(nfound) operator(=) ident(select)operator(()operator([)global_variable($stdin)operator(,) ident(fh1)operator(,) ident(fh2)operator(,) ident(fh3)operator(])operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) +ident(nfound)operator([)integer(0)operator(])operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + reserved(case) ident(file) + reserved(when) ident(fh1) + comment(# do something with fh1) + reserved(when) ident(fh2) + comment(# do something with fh2) + reserved(when) ident(fh3) + comment(# do something with fh3) + reserved(end) +reserved(end) +comment(#-----------------------------) +ident(input_files) operator(=) operator([)operator(]) +comment(# repeat next line for all in-files to poll) +ident(input_files) operator(<<) ident(fh1) +reserved(if) ident(nfound) operator(=) ident(select)operator(()ident(input_files)operator(,) pre_constant(nil)operator(,) pre_constant(nil)operator(,) integer(0)operator(\)) + comment(# input ready on files in nfound[0]) +reserved(end) + + +comment(# @@PLEAC@@_8.0) +comment(#-----------------------------) +comment(# datafile is a file or IO object) +ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + ident(line)operator(.)ident(chomp!) + ident(size) operator(=) ident(line)operator(.)ident(length) + ident(puts) ident(size) +operator(}) +comment(#-----------------------------) +ident(datafile)operator(.)ident(readlines)operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + ident(puts) ident(line)operator(.)ident(chomp!)operator(.)ident(length) +operator(}) +comment(#-----------------------------) +ident(lines) operator(=) ident(datafile)operator(.)ident(readlines) +comment(#-----------------------------) +ident(whole_file) operator(=) ident(file)operator(.)ident(read) +comment(#-----------------------------) +comment(# ruby -040 -e 'word = gets; puts "First word is #{word}"') +comment(#-----------------------------) +comment(# ruby -ne 'BEGIN { $/="%%\\n" }; $_.chomp; puts $_ if( $_=~/Unix/i\)' fortune.dat) +comment(#-----------------------------) +ident(handle)operator(.)ident(print) stringoperator(,) stringoperator(,) string comment(# "onetwothree") +ident(puts) string comment(# sent to $stdout) +comment(#-----------------------------) +ident(buffer) operator(=) ident(handle)operator(.)ident(read)operator(()integer(4096)operator(\)) +ident(rv) operator(=) ident(buffer)operator(.)ident(length) +comment(#-----------------------------) +ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) +ident(open)operator(()stringcontent(.pid)delimiter(")>operator(,) stringoperator(\)) operator({) operator(|)ident(handle)operator(|) ident(handle)operator(.)ident(truncate)operator(()ident(length)operator(\)) operator(}) +comment(#-----------------------------) +ident(pos) operator(=) ident(datafile)operator(.)ident(pos) comment(# tell is an alias of pos) +ident(puts) stringcontent( bytes from the start of datafile)delimiter(")> +comment(#-----------------------------) +ident(logfile)operator(.)ident(seek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_END)operator(\)) +ident(datafile)operator(.)ident(seek)operator(()ident(pos)operator(\)) comment(# IO::SEEK_SET is the default) +ident(out)operator(.)ident(seek)operator(()integer(-20)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) +comment(#-----------------------------) +ident(written) operator(=) ident(datafile)operator(.)ident(syswrite)operator(()ident(mystring)operator(\)) +ident(raise) constant(RunTimeError) reserved(unless) ident(written) operator(==) ident(mystring)operator(.)ident(length) +ident(block) operator(=) ident(infile)operator(.)ident(sysread)operator(()integer(256)operator(\)) comment(# no equivalent to perl offset parameter in sysread) +ident(puts) stringcontent( bytes)delimiter(")> reserved(if) integer(256) operator(!=) ident(block)operator(.)ident(length) +comment(#-----------------------------) +ident(pos) operator(=) ident(handle)operator(.)ident(sysseek)operator(()integer(0)operator(,) constant(IO)operator(::)constant(SEEK_CUR)operator(\)) comment(# don't change position) + + +comment(# @@PLEAC@@_8.1) +reserved(while) operator(()ident(line) operator(=) ident(fh)operator(.)ident(gets)operator(\)) + ident(line)operator(.)ident(chomp!) + ident(nextline) operator(=) pre_constant(nil) + ident(line)operator(.)ident(gsub!)operator(()regexpoperator(\)) operator({) operator(|)ident(match)operator(|) ident(nextline) operator(=) ident(fh)operator(.)ident(gets)operator(;) string operator(}) + reserved(if) operator(()ident(nextline) operator(!=) pre_constant(nil)operator(\)) + ident(line) operator(+=) ident(nextline) + reserved(redo) + reserved(end) + comment(# process full record in line here) +reserved(end) +comment(#-----------------------------) +comment(# DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) +comment(# $(TEXINFOS\) $(INFOS\) $(MANS\) $(DATA\)) +comment(# DEP_DISTFILES = $(DIST_COMMON\) $(SOURCES\) $(HEADERS\) \\) +comment(# $(TEXINFOS\) $(INFO_DEPS\) $(MANS\) $(DATA\) \\) +comment(# $(EXTRA_DIST\)) +comment(#-----------------------------) +ident(line)operator(.)ident(gsub!)operator(()regexpoperator(,) stringoperator(\)) operator({) + comment(# as before) +operator(}) + + +comment(# @@PLEAC@@_8.2) +comment(#-----------------------------) +ident(count) operator(=) shelldelimiter(`)> +ident(fail) stringdelimiter(")> reserved(if) global_variable($?) operator(!=) integer(0) +ident(count)operator(.)ident(chomp!) +comment(#-----------------------------) +ident(count) operator(=) integer(0) +constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) + ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) +operator(}) +comment(# count now holds the number of lines read) +comment(#-----------------------------) +ident(count) operator(=) integer(0) +reserved(while) operator(()ident(chunk) operator(=) ident(file)operator(.)ident(sysread)operator(()integer(2)operator(**)integer(16)operator(\))operator(\)) + ident(count) operator(+=) ident(chunk)operator(.)ident(count)operator(()stringoperator(\)) +reserved(end) reserved(rescue) constant(EOFError) +comment(#-----------------------------) +constant(File)operator(.)ident(open)operator(()ident(filename)operator(,)stringoperator(\)) operator({) operator(|)ident(fh)operator(|) + ident(count) operator(+=) integer(1) reserved(while) ident(fh)operator(.)ident(gets) +operator(}) +comment(# count now holds the number of lines read) +comment(#-----------------------------) +comment(# As ruby doesn't quite have an equivalent to using a for) +comment(# statement as in perl, I threw this in) +ident(count) operator(=) constant(File)operator(.)ident(readlines)operator(()ident(filename)operator(\))operator(.)ident(size) +comment(#-----------------------------) +integer(1) reserved(while) ident(file)operator(.)ident(gets) +ident(count) operator(=) global_variable($.) +comment(#-----------------------------) +global_variable($/) operator(=) string +ident(open)operator(()ident(filename)operator(,) stringoperator(\)) operator({) operator(|)ident(fh)operator(|) + integer(1) reserved(while) ident(fh)operator(.)ident(gets) + ident(para_count) operator(=) global_variable($.) +operator(}) reserved(rescue) ident(fail)operator(()stringcontent(: $!)delimiter(")>operator(\)) +comment(#-----------------------------) + + +comment(# ^^PLEAC^^_8.3) +comment(#-----------------------------) +reserved(while) operator(()ident(gets)operator(\)) + ident(split)operator(.)ident(each) operator({) operator(|)ident(chunk)operator(|) + comment(# do something with chunk) + operator(}) +reserved(end) +comment(#-----------------------------) +reserved(while) operator(()ident(gets)operator(\)) + ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) + comment(# do something with word) + operator(}) +reserved(end) +comment(#-----------------------------) +comment(# Make a word frequency count) +comment(# normally hashes can be created using {} or just Hash.new) +comment(# but we want the default value of an entry to be 0 instead ) +comment(# of nil. (nil can't be incremented\)) +ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) +reserved(while) operator(()ident(gets)operator(\)) + ident(gsub)operator(()regexpoperator(\)) operator({) operator(|)ident(word)operator(|) + ident(seen)operator([)ident(word)operator(.)ident(downcase)operator(]) operator(+=) integer(1) + operator(}) +reserved(end) +comment(# output hash in a descending numeric sort of its values) +ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) + ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) +reserved(end) + +comment(#-----------------------------) +comment(# Line frequency count) +ident(seen) operator(=) constant(Hash)operator(.)ident(new)operator(()integer(0)operator(\)) +reserved(while) operator(()ident(gets)operator(\)) + ident(seen)operator([)global_variable($_)operator(.)ident(downcase)operator(]) operator(+=) integer(1) +reserved(end) +ident(seen)operator(.)ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(b)operator([)integer(1)operator(]) operator(<=>) ident(a)operator([)integer(1)operator(]) operator(})operator(.)ident(each) reserved(do) operator(|)ident(k)operator(,)ident(v)operator(|) + ident(printf)operator(()stringoperator(,) ident(v)operator(,) ident(k) operator(\)) +reserved(end) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_8.4) +comment(#-----------------------------) +comment(# instead of file handle FILE, we can just) +comment(# use a string containing the filename) +constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + comment(# do something with line) +operator(}) +comment(#-----------------------------) +constant(File)operator(.)ident(readlines)operator(()ident(file)operator(\))operator(.)ident(reverse_each) operator({) operator(|)ident(line)operator(|) + comment(# do something with line) +operator(}) +comment(#-----------------------------) +comment(# the variable lines might have been created) +comment(# this way) +comment(# lines = File.readlines(file\)) +comment(#) +comment(# normally one would use the reverse_each, but) +comment(# if you insist on using a numerical index to) +comment(# iterate over the lines array...) +operator(()ident(lines)operator(.)ident(size) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\)) operator({) operator(|)ident(i)operator(|) + ident(line) operator(=) ident(lines)operator([)ident(i)operator(]) +operator(}) +comment(#-----------------------------) +comment(# the second readlines argument is a the ) +comment(# record separator $/, just like perl, a blank) +comment(# separator splits the records into paragraphs) +constant(File)operator(.)ident(readlines)operator(()ident(file)operator(,) stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(paragraph)operator(|) + comment(# do something with paragraph) + ident(puts) stringParagraph )inlinedelimiter(")> +operator(}) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_8.6) + +global_variable($/) operator(=) stringoperator(;) +ident(srand)operator(;) + +constant(File)operator(.)ident(open)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(line)operator(|) + ident(adage) operator(=) ident(line) reserved(if) ident(rand)operator(()global_variable($.)operator(\)) operator(<) integer(1) +reserved(end) + +ident(puts) ident(adage)operator(;) + + +comment(# @@PLEAC@@_8.10) +reserved(begin) + ident(fh) operator(=) constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) + ident(addr) operator(=) ident(fh)operator(.)ident(tell) reserved(unless) ident(fh)operator(.)ident(eof) reserved(while) ident(fh)operator(.)ident(gets) + ident(fh)operator(.)ident(truncate)operator(()ident(addr)operator(\)) +reserved(rescue) constant(SystemCallError) + global_variable($stderr)operator(.)ident(puts) string +reserved(end) + + +comment(# @@PLEAC@@_9.0) +ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) +ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) +ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()constant(INFILE)operator(\)) + +ident(entry) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) +ident(ctime) operator(=) ident(entry)operator(.)ident(ctime) +ident(size) operator(=) ident(entry)operator(.)ident(size) + +ident(f) operator(=) constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) + +comment(## There is no -T equivalent in Ruby, but we can still test emptiness) +reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) + ident(puts) stringcontent( doesn't have text in it.)delimiter(")> + ident(exit) +reserved(end) + +constant(Dir)operator(.)ident(new)operator(()stringoperator(\))operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) + ident(puts) stringdelimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_9.1) +ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) +ident(readtime)operator(,) ident(writetime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) +ident(file)operator(.)ident(utime)operator(()ident(readtime)operator(,) ident(writetime)operator(\)) + +constant(SECONDS_PER_DAY) operator(=) integer(60) operator(*) integer(60) operator(*) integer(24) +ident(file) operator(=) constant(File)operator(.)ident(stat)operator(()stringoperator(\)) +ident(atime)operator(,) ident(mtime) operator(=) ident(file)operator(.)ident(atime)operator(,) ident(file)operator(.)ident(mtime) + +ident(atime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) +ident(mtime) operator(-=) integer(7) operator(*) constant(SECONDS_PER_DAY) + +constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) +ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) +constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) ident(mtime)operator(,) ident(file)operator(\)) +constant(File)operator(.)ident(utime)operator(()constant(Time)operator(.)ident(new)operator(,) constant(File)operator(.)ident(stat)operator(()stringoperator(\))operator(.)ident(mtime)operator(,) ident(file)operator(\)) + +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(## uvi - vi a file without changing it's access times) + +reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(!=) integer(1) + ident(puts) string + ident(exit) +reserved(end) +ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) +ident(atime)operator(,) ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(atime)operator(,) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) +ident(system)operator(()constant(ENV)operator([)stringoperator(]) operator(||) stringoperator(,) ident(file)operator(\)) +constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_9.2) +constant(File)operator(.)ident(unlink)operator(()constant(FILENAME)operator(\)) + +ident(err_flg) operator(=) pre_constant(false) +ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + reserved(begin) + constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) + reserved(rescue) + ident(err_flg) operator(=) global_variable($!) + reserved(end) +reserved(end) +ident(err_flg) reserved(and) ident(raise) stringoperator(\))delimiter(})>content(: )inlinedelimiter(")> + +constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) + +ident(count) operator(=) ident(filenames)operator(.)ident(length) +ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + reserved(begin) + constant(File)operator(.)ident(unlink)operator(()ident(file)operator(\)) + reserved(rescue) + ident(count) operator(-=) integer(1) + reserved(end) +reserved(end) +reserved(if) ident(count) operator(!=) ident(filenames)operator(.)ident(length) + constant(STDERR)operator(.)ident(puts) stringcontent( of )inlinecontent( files)delimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_9.3) +ident(require) string +constant(File)operator(.)ident(copy)operator(()ident(oldfile)operator(,) ident(newfile)operator(\)) + +ident(infile) operator(=) constant(File)operator(.)ident(open)operator(()ident(oldfile)operator(,) stringoperator(\)) +ident(outfile) operator(=) constant(File)operator(.)ident(open)operator(()ident(newfile)operator(,) stringoperator(\)) + +ident(blksize) operator(=) ident(infile)operator(.)ident(stat)operator(.)ident(blksize) +comment(# This doesn't handle partial writes or ^Z) +comment(# like the Perl version does.) +reserved(while) operator(()ident(line) operator(=) ident(infile)operator(.)ident(read)operator(()ident(blksize)operator(\))operator(\)) + ident(outfile)operator(.)ident(write)operator(()ident(line)operator(\)) +reserved(end) + +ident(infile)operator(.)ident(close) +ident(outfile)operator(.)ident(close) + +ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# unix) +ident(system)operator(()stringcontent( )inlinedelimiter(")>operator(\)) comment(# dos, vms) + +ident(require) string +constant(File)operator(.)ident(copy)operator(()stringoperator(,) stringoperator(\)) +constant(File)operator(.)ident(move)operator(()stringoperator(,) stringoperator(\)) + + +comment(# @@PLEAC@@_9.4) +global_variable($seen) operator(=) operator({)operator(}) comment(# must use global var to be seen inside of method below) + +reserved(def) method(do_my_thing)operator(()ident(filename)operator(\)) + ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) + reserved(unless) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) + comment(# do something with $filename because we haven't) + comment(# seen it before) + reserved(end) + global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) +reserved(end) + +ident(files)operator(.)ident(each) reserved(do) operator(|)ident(filename)operator(|) + ident(dev)operator(,) ident(ino) operator(=) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(dev)operator(,) constant(File)operator(.)ident(stat)operator(()ident(filename)operator(\))operator(.)ident(ino) + reserved(if) operator(!)global_variable($seen)operator(.)ident(has_key?)operator(()operator([)ident(dev)operator(,) ident(ino)operator(])operator(\)) + global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(]) operator(=) operator([)operator(]) + reserved(end) + global_variable($seen)operator([)operator([)ident(dev)operator(,) ident(ino)operator(])operator(])operator(.)ident(push)operator(()ident(filename)operator(\)) +reserved(end) + +global_variable($seen)operator(.)ident(keys)operator(.)ident(sort)operator(.)ident(each) reserved(do) operator(|)ident(devino)operator(|) + ident(ino)operator(,) ident(dev) operator(=) ident(devino) + reserved(if) global_variable($seen)operator([)ident(devino)operator(])operator(.)ident(length) operator(>) integer(1) + comment(# $seen[devino] is a list of filenames for the same file) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_9.5) +constant(Dir)operator(.)ident(open)operator(()ident(dirname)operator(\)) reserved(do) operator(|)ident(dir)operator(|) + ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + comment(# do something with dirname/file) + ident(puts) ident(file) + reserved(end) +reserved(end) +comment(# Dir.close is automatic) + +comment(# No -T equivalent in Ruby) + +ident(dir)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + reserved(next) reserved(if) ident(file) operator(=)operator(~) regexp + comment(# ...) +reserved(end) + +reserved(def) method(plainfiles)operator(()ident(dir)operator(\)) + ident(dh) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) + ident(dh)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) + ident(map) operator({)operator(|)ident(file)operator(|) stringcontent(/)inlinedelimiter(")>operator(})operator(.) + ident(find_all) operator({)operator(|)ident(file)operator(|) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\))operator(})operator(.) + ident(sort) +reserved(end) + + +comment(# @@PLEAC@@_9.6) +ident(list) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) + +ident(dir) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\)) +ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) +ident(dir)operator(.)ident(close) + +ident(files) operator(=) constant(Dir)operator(.)ident(glob)operator(()stringoperator(\)) +ident(files) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(path)operator(\))operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) + +ident(dir) operator(=) constant(Dir)operator(.)ident(new)operator(()ident(path)operator(\)) +ident(files) operator(=) ident(dir)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\)) + +reserved(begin) + ident(d) operator(=) constant(Dir)operator(.)ident(open)operator(()ident(dir)operator(\)) +reserved(rescue) constant(Errno)operator(::)constant(ENOENT) + ident(raise) stringcontent( for reading: )inlinedelimiter(")> +reserved(end) + +ident(files) operator(=) operator([)operator(]) +ident(d)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + ident(puts) ident(file) + reserved(next) reserved(unless) ident(file) operator(=)operator(~) regexp + + ident(filename) operator(=) stringcontent(/)inlinedelimiter(")> + comment(# There is no -T equivalent in Ruby, but we can still test emptiness) + ident(files)operator(.)ident(push)operator(()ident(filename)operator(\)) reserved(if) ident(test)operator(()integer(?s)operator(,) ident(filename)operator(\)) +reserved(end) + +ident(dirs)operator(.)ident(entries)operator(.)ident(grep)operator(()regexpoperator(\))operator(.) + ident(map) operator({) operator(|)ident(file)operator(|) operator([)ident(file)operator(,) stringcontent(/)inlinedelimiter(")>operator(])operator(}) operator(.) + ident(select) operator({) operator(|)ident(file)operator(|) ident(test)operator(()integer(?d)operator(,) ident(file)operator([)integer(1)operator(])operator(\)) operator(})operator(.) + ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator([)integer(0)operator(]) operator(<=>) ident(b)operator([)integer(0)operator(]) operator(})operator(.) + ident(map) operator({) operator(|)ident(file)operator(|) ident(file)operator([)integer(1)operator(]) operator(}) + + +comment(# @@PLEAC@@_9.7) +ident(require) string +constant(Find)operator(.)ident(find)operator(()ident(dirlist)operator(\)) reserved(do) operator(|)ident(file)operator(|) + comment(# do whatever) +reserved(end) + +ident(require) string +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) +constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) + ident(print) ident(file)operator(,) operator(()ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(?) string operator(:) stringoperator(\)) +reserved(end) + +ident(require) string +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) +ident(sum) operator(=) integer(0) +constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) + ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) + ident(sum) operator(+=) ident(size) +reserved(end) +ident(puts) stringoperator(\))delimiter(})>content( contains )inlinecontent( bytes)delimiter(")> + +ident(require) string +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) +ident(saved_size)operator(,) ident(saved_name) operator(=) integer(-1)operator(,) string +constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) + ident(size) operator(=) ident(test)operator(()integer(?s)operator(,) ident(file)operator(\)) operator(||) integer(0) + reserved(next) reserved(unless) ident(test)operator(()integer(?f)operator(,) ident(file)operator(\)) operator(&&) ident(size) operator(>) ident(saved_size) + ident(saved_size) operator(=) ident(size) + ident(saved_name) operator(=) ident(file) +reserved(end) +ident(puts) stringcontent( in )inlineoperator(\))delimiter(})>content( is )inlinedelimiter(")> + +ident(require) string +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) +ident(age)operator(,) ident(name) operator(=) pre_constant(nil) +constant(Find)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) reserved(do) operator(|)ident(file)operator(|) + ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) + reserved(next) reserved(if) ident(age) operator(&&) ident(age) operator(>) ident(mtime) + ident(age) operator(=) ident(mtime) + ident(name) operator(=) ident(file) +reserved(end) +ident(puts) stringcontent( )inlinedelimiter(")> + +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# fdirs - find all directories) +ident(require) string +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) string operator(:) pre_constant(ARGV) +constant(File)operator(.)ident(find)operator(()operator(*)ident(argv)operator(\)) operator({) operator(|)ident(file)operator(|) ident(puts) ident(file) reserved(if) ident(test)operator(()integer(?d)operator(,) ident(file)operator(\)) operator(}) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_9.8) +ident(require) string + +ident(puts) stringcontent( dir ...)delimiter(")> reserved(if) pre_constant(ARGV)operator(.)ident(empty?) +pre_constant(ARGV)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) + constant(FileUtils)operator(.)ident(rmtree)operator(()ident(dir)operator(\)) +reserved(end) + + +comment(# @@PLEAC@@_9.9) +ident(require) string +ident(names)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + ident(newname) operator(=) ident(file) + reserved(begin) + constant(File)operator(.)ident(move)operator(()ident(file)operator(,) ident(newname)operator(\)) + reserved(rescue) constant(Errno)operator(::)constant(EPERM) + global_variable($stderr)operator(.)ident(puts) stringcontent( to )inlinecontent(: )inlinedelimiter(")> + reserved(end) +reserved(end) + +ident(require) string +ident(op) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) operator(()ident(raise) stringoperator(\)) operator(:) pre_constant(ARGV)operator(.)ident(shift) +ident(argv) operator(=) pre_constant(ARGV)operator(.)ident(empty?) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(chomp) operator(}) operator(:) pre_constant(ARGV) +ident(argv)operator(.)ident(each) reserved(do) operator(|)ident(file)operator(|) + ident(was) operator(=) ident(file) + ident(file) operator(=) ident(eval)operator(()stringdelimiter(")>operator(\)) + constant(File)operator(.)ident(move)operator(()ident(was)operator(,) ident(file)operator(\)) reserved(unless) ident(was) operator(==) ident(file) +reserved(end) + + +comment(# @@PLEAC@@_9.10) +ident(base) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) +ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) +comment(# ruby has no fileparse equivalent) +ident(dir)operator(,) ident(base) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) +ident(ext) operator(=) ident(base)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) + +ident(path) operator(=) string +ident(file) operator(=) constant(File)operator(.)ident(basename)operator(()ident(path)operator(\)) +ident(dir) operator(=) constant(File)operator(.)ident(dirname)operator(()ident(path)operator(\)) + +ident(puts) stringcontent(, file is )inlinedelimiter(")> +comment(# dir is /usr/lib, file is libc.a) + +ident(path) operator(=) string +ident(dir)operator(,) ident(filename) operator(=) constant(File)operator(.)ident(split)operator(()ident(path)operator(\)) +ident(name)operator(,) ident(ext) operator(=) ident(filename)operator(.)ident(split)operator(()regexpoperator(\)) +ident(puts) stringcontent(, name is )inlinecontent(, ext is )inlinedelimiter(")> +comment(# NOTE: The Ruby code prints) +comment(# dir is /usr/lib, name is libc, extension is .a) +comment(# while the Perl code prints a '/' after the directory name) +comment(# dir is /usr/lib/, name is libc, extension is .a) + +comment(# No fileparse_set_fstype(\) equivalent in ruby) + +reserved(def) method(extension)operator(()ident(path)operator(\)) + ident(ext) operator(=) ident(path)operator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(to_s) + ident(ext)operator(.)ident(sub)operator(()regexpoperator(,) stringoperator(\)) +reserved(end) + + +comment(# @@PLEAC@@_9.11) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# symirror - build spectral forest of symlinks) + +ident(require) string +ident(require) string + +ident(raise) stringcontent( realdir mirrordir)delimiter(")> reserved(unless) pre_constant(ARGV)operator(.)ident(size) operator(==) integer(2) + +ident(srcdir)operator(,)ident(dstdir) operator(=) pre_constant(ARGV) +ident(srcmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcdir)operator(\))operator(.)ident(mode) +constant(Dir)operator(.)ident(mkdir)operator(()ident(dstdir)operator(,) ident(srcmode) operator(&) integer(07777)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dstdir)operator(\)) + +comment(# fix relative paths) +constant(Dir)operator(.)ident(chdir)operator(()ident(srcdir)operator(\)) operator({)ident(srcdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) +constant(Dir)operator(.)ident(chdir)operator(()ident(dstdir)operator(\)) operator({)ident(dstdir) operator(=) constant(Dir)operator(.)ident(pwd)operator(}) + +constant(Find)operator(.)ident(find)operator(()ident(srcdir)operator(\)) reserved(do) operator(|)ident(srcfile)operator(|) + reserved(if) ident(test)operator(()integer(?d)operator(,) ident(srcfile)operator(\)) + ident(dest) operator(=) ident(srcfile)operator(.)ident(sub)operator(()regexpdelimiter(/)>operator(,) ident(dstdir)operator(\)) + ident(dmode) operator(=) constant(File)operator(::)ident(stat)operator(()ident(srcfile)operator(\))operator(.)ident(mode) operator(&) integer(07777) + constant(Dir)operator(.)ident(mkdir)operator(()ident(dest)operator(,) ident(dmode)operator(\)) reserved(unless) ident(test)operator(()integer(?d)operator(,) ident(dest)operator(\)) + ident(a) operator(=) constant(Dir)operator([)stringcontent(/*)delimiter(")>operator(])operator(.)ident(reject)operator({)operator(|)ident(f)operator(|) ident(test)operator(()integer(?d)operator(,) ident(f)operator(\))operator(}) + constant(FileUtils)operator(.)ident(ln_s)operator(()ident(a)operator(,) ident(dest)operator(\)) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_9.12) +comment(# we use the Getopt/Declare library here for convenience:) +comment(# http://raa.ruby-lang.org/project/getoptdeclare/) +comment(#-----------------------------) +comment(#!/usr/bin/ruby -w) +comment(# lst - list sorted directory contents (depth first\)) + +ident(require) string +ident(require) string +ident(require) string + +comment(# Note: in the option-spec below there must by at least one hard) +comment(# tab in between each -option and its description. For example) +comment(# -i read from stdin) + +ident(opts) operator(=) constant(Getopt)operator(::)constant(Declare)operator(.)ident(new)operator(()stringoperator(\))string + +global_variable($sort_criteria) operator(||=) symbol(:mtime) +ident(files) operator(=) operator({)operator(}) +constant(DIRS) operator(=) ident(opts)operator([)stringoperator(]) operator(?) global_variable($stdin)operator(.)ident(readlines)operator(.)ident(map)operator({)operator(|)ident(f)operator(|)ident(f)operator(.)ident(chomp!)operator(}) operator(:) pre_constant(ARGV) +constant(DIRS)operator(.)ident(each) reserved(do) operator(|)ident(dir)operator(|) + constant(Find)operator(.)ident(find)operator(()ident(dir)operator(\)) reserved(do) operator(|)ident(ent)operator(|) + ident(files)operator([)ident(ent)operator(]) operator(=) constant(File)operator(::)ident(stat)operator(()ident(ent)operator(\)) + reserved(end) +reserved(end) +ident(entries) operator(=) ident(files)operator(.)ident(keys)operator(.)ident(sort_by)operator({)operator(|)ident(f)operator(|) ident(files)operator([)ident(f)operator(])operator(.)ident(send)operator(()global_variable($sort_criteria)operator(\))operator(}) +ident(entries) operator(=) ident(entries)operator(.)ident(reverse) reserved(unless) ident(opts)operator([)stringoperator(]) + +ident(entries)operator(.)ident(each) reserved(do) operator(|)ident(ent)operator(|) + reserved(unless) ident(opts)operator([)stringoperator(]) + ident(puts) ident(ent) + reserved(next) + reserved(end) + ident(stats) operator(=) ident(files)operator([)ident(ent)operator(]) + ident(ftime) operator(=) ident(stats)operator(.)ident(send)operator(()global_variable($sort_criteria) operator(==) symbol(:size) operator(?) symbol(:mtime) operator(:) global_variable($sort_criteria)operator(\)) + ident(printf) stringoperator(,) + ident(stats)operator(.)ident(ino)operator(,) + ident(stats)operator(.)ident(mode) operator(&) integer(07777)operator(,) + ident(stats)operator(.)ident(nlink)operator(,) + constant(ETC)operator(::)constant(PASSWD)operator([)ident(stats)operator(.)ident(uid)operator(])operator(.)ident(name)operator(,) + constant(ETC)operator(::)constant(GROUP)operator([)ident(stats)operator(.)ident(gid)operator(])operator(.)ident(name)operator(,) + ident(stats)operator(.)ident(size)operator(,) + ident(ftime)operator(.)ident(strftime)operator(()stringoperator(\))operator(,) + ident(ent) +reserved(end) + + +comment(# @@PLEAC@@_10.0) +reserved(def) method(hello) + global_variable($greeted) operator(+=) integer(1) comment(# in Ruby, a variable beginning with $ is global (can be any type of course\)) + ident(puts) string +reserved(end) + +comment(# We need to initialize $greeted before it can be used, because "+=" is waiting a Numeric object) +global_variable($greeted) operator(=) integer(0) +ident(hello) comment(# note that appending (\) is optional to function calls with no parameters) + + +comment(# @@PLEAC@@_10.1) +comment(# In Ruby, parameters are named anyway) +reserved(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\)) + constant(Math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\)) comment(# the sqrt function comes from the Math module) +reserved(end) +ident(diag) operator(=) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) + +ident(puts) ident(hypotenuse)operator(()integer(3)operator(,) integer(4)operator(\)) + +ident(a) operator(=) operator([)integer(3)operator(,) integer(4)operator(]) +ident(print) ident(hypotenuse)operator(()operator(*)ident(a)operator(\)) comment(# the star operator will magically convert an Array into a "tuple") + +ident(both) operator(=) ident(men) operator(+) ident(women) + +comment(# In Ruby, all objects are references, so the same problem arises; we then return a new object) +ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) +reserved(def) method(int_all)operator(()ident(n)operator(\)) + ident(n)operator(.)ident(collect) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) +reserved(end) +ident(ints) operator(=) ident(int_all)operator(()ident(nums)operator(\)) + +ident(nums) operator(=) operator([)float(1.4)operator(,) float(3.5)operator(,) float(6.7)operator(]) +reserved(def) method(trunc_em)operator(()ident(n)operator(\)) + ident(n)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v)operator(.)ident(to_i) operator(}) comment(# the bang-version of collect modifies the object) +reserved(end) +ident(trunc_em)operator(()ident(nums)operator(\)) + +comment(# Ruby has two chomp version:) +comment(# ``chomp'' chomps the record separator and returns what's expected) +comment(# ``chomp!'' does the same but also modifies the parameter object) + + +comment(# @@PLEAC@@_10.2) +reserved(def) method(somefunc) + ident(variable) operator(=) ident(something) comment(# variable is local by default) +reserved(end) + +ident(name)operator(,) ident(age) operator(=) pre_constant(ARGV) +ident(start) operator(=) ident(fetch_time) + +ident(a)operator(,) ident(b) operator(=) ident(pair) comment(# will succeed if pair is an Array object (like ARGV is\)) +ident(c) operator(=) ident(fetch_time) + +comment(# In ruby, run_check can't access a, b, or c until they are) +comment(# explicitely defined global (using leading $\), even if they are) +comment(# both defined in the same scope) + +reserved(def) method(check_x)operator(()ident(x)operator(\)) + ident(y) operator(=) string + ident(run_check) + reserved(if) global_variable($condition) + ident(puts) string + reserved(end) +reserved(end) + +comment(# The following will keep a reference to the array, though the) +comment(# results will be slightly different from perl: the last element) +comment(# of $global_array will be itself an array) +reserved(def) method(save_array)operator(()ident(ary)operator(\)) + global_variable($global_array) operator(<<) ident(ary) +reserved(end) + +comment(# The following gives the same results as in Perl for $global_array,) +comment(# though it doesn't illustrate anymore the way to keep a reference) +comment(# to an object: $global_array is extended with the elements of ary) +reserved(def) method(save_array)operator(()ident(ary)operator(\)) + global_variable($global_array) operator(+=) ident(ary) +reserved(end) + + +comment(# @@PLEAC@@_10.3) +comment(# In Ruby, AFAIK a method cannot access "local variables" defined) +comment(# upper scope; mostly because everything is an object, so you'll) +comment(# do the same by defining an attribute or a static attribute) + +comment(# In Ruby the BEGIN also exists:) +reserved(BEGIN) operator({) ident(puts) string operator(}) +ident(puts) string +reserved(BEGIN) operator({) ident(puts) string operator(}) +comment(# gives:) +comment(# hello from BEGIN) +comment(# hello from 2nd BEGIN) +comment(# hello from main) + +comment(# In Ruby, it can be written as a static method and a static) +comment(# variable) +reserved(class) class(Counter) + class_variable(@@counter) operator(=) integer(0) + reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) +reserved(end) + +comment(# There is no need of BEGIN since the variable will get) +comment(# initialized when parsing) +reserved(class) class(Counter) + class_variable(@@counter) operator(=) integer(42) + reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) + reserved(def) constant(Counter)operator(.)ident(prev_counter)operator(;) class_variable(@@counter) operator(-=) integer(1)operator(;) reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_10.4) +comment(# You can either get the whole trace as an array of strings, each) +comment(# string telling which file, line and method is calling:) +ident(caller) + +comment(# ...or only the last caller) +ident(caller)operator([)integer(0)operator(]) + +comment(# We need to extract just the method name of the backtrace:) +reserved(def) method(whoami)operator(;) ident(caller)operator(()operator(\))operator([)integer(0)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) +reserved(def) method(whowasi)operator(;) ident(caller)operator(()operator(\))operator([)integer(1)operator(]) operator(=)operator(~) regexp operator(?) global_variable($1) operator(:) stringoperator(;) reserved(end) + + +comment(# @@PLEAC@@_10.5) +comment(# In Ruby, every value is a reference on an object, thus there is) +comment(# no such problem) +ident(array_diff)operator(()ident(array1)operator(,) ident(array2)operator(\)) + +reserved(def) method(add_vecpair)operator(()ident(a1)operator(,) ident(a2)operator(\)) + ident(results) operator(=) operator([)operator(]) + ident(a1)operator(.)ident(each_index) operator({) operator(|)ident(i)operator(|) ident(results) operator(<<) operator(()ident(a1)operator([)ident(i)operator(]) operator(+) ident(a2)operator([)ident(i)operator(])operator(\)) operator(}) + ident(results) +reserved(end) +ident(a) operator(=) operator([)integer(1)operator(,) integer(2)operator(]) +ident(b) operator(=) operator([)integer(5)operator(,) integer(8)operator(]) +ident(c) operator(=) ident(add_vecpair)operator(()ident(a)operator(,) ident(b)operator(\)) +ident(p) ident(c) + +comment(# Add this to the beginning of the function to check if we were) +comment(# given two arrays) +ident(a1)operator(.)ident(type) operator(==) constant(Array) operator(&&) ident(a2)operator(.)ident(type) operator(==) constant(Array) reserved(or) + ident(raise) stringcontent( )inlinecontent(\))delimiter(")> + + +comment(# @@PLEAC@@_10.6) +comment(# There is no return context in Ruby) + + +comment(# @@PLEAC@@_10.7) +comment(# Like in Perl, we need to fake with a hash, but it's dirty :-() +reserved(def) method(thefunc)operator(()ident(param_args)operator(\)) + ident(args) operator(=) operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) integer(0) operator(}) + ident(args)operator(.)ident(update)operator(()ident(param_args)operator(\)) + reserved(if) operator(()ident(args)operator([)stringoperator(]) operator(=)operator(~) regexp operator(\)) + comment(# .....) + reserved(end) +reserved(end) + +ident(thefunc)operator(()operator({) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) stringoperator(,) string operator(=)operator(>) string operator(})operator(\)) +ident(thefunc)operator(()operator({)operator(})operator(\)) + + +comment(# @@PLEAC@@_10.8) +comment(# there is no "undef" direct equivalent but there is the slice equiv:) +ident(a)operator(,) ident(c) operator(=) ident(func)operator(.)ident(indexes)operator(()integer(0)operator(,) integer(2)operator(\)) + + +comment(# @@PLEAC@@_10.9) +comment(# Ruby has no such limitation:) +reserved(def) method(somefunc) + ident(ary) operator(=) operator([)operator(]) + ident(hash) operator(=) operator({)operator(}) + comment(# ...) + reserved(return) ident(ary)operator(,) ident(hash) +reserved(end) +ident(arr)operator(,) ident(dict) operator(=) ident(somefunc) + +ident(array_of_hashes) operator(=) ident(fn) +ident(h1)operator(,) ident(h2)operator(,) ident(h3) operator(=) ident(fn) + + +comment(# @@PLEAC@@_10.10) +reserved(return) +comment(# or (equivalent\)) +reserved(return) pre_constant(nil) + + +comment(# @@PLEAC@@_10.11) +comment(# You can't prototype in Ruby regarding types :-() +comment(# Though, you can force the number of arguments:) +reserved(def) method(func_with_no_arg)operator(;) reserved(end) +reserved(def) method(func_with_no_arg)operator(()operator(\))operator(;) reserved(end) +reserved(def) method(func_with_one_arg)operator(()ident(a1)operator(\))operator(;) reserved(end) +reserved(def) method(func_with_two_args)operator(()ident(a1)operator(,) ident(a2)operator(\))operator(;) reserved(end) +reserved(def) method(func_with_any_number_of_args)operator(()operator(*)ident(args)operator(\))operator(;) reserved(end) + + +comment(# @@PLEAC@@_10.12) +ident(raise) string comment(# raise exception) + +reserved(begin) + ident(val) operator(=) ident(func) +reserved(rescue) constant(Exception) operator(=)operator(>) ident(msg) + global_variable($stderr)operator(.)ident(puts) stringdelimiter(")> +reserved(end) + +comment(# In Ruby the rescue statement uses an exception class, every) +comment(# exception which is not matched is still continuing) +reserved(begin) + ident(val) operator(=) ident(func) +reserved(rescue) constant(FullMoonError) + operator(...) +reserved(end) + + +comment(# @@PLEAC@@_10.13) +comment(# Saving Global Values) +comment(# Of course we can just save the value and restore it later:) +reserved(def) method(print_age) + ident(puts) stringdelimiter(")> +reserved(end) + +global_variable($age) operator(=) integer(18) comment(# global variable) +ident(print_age)operator(()operator(\)) +reserved(if) ident(condition) + ident(safeage) operator(=) global_variable($age) + global_variable($age) operator(=) integer(23) + ident(print_age)operator(()operator(\)) + global_variable($age) operator(=) ident(safeage) +reserved(end) + +comment(# We can also use a method that saves the global variable and) +comment(# restores it automatically when the block is left:) + +reserved(def) method(local)operator(()ident(var)operator(\)) + ident(eval)operator(()stringdelimiter(")>operator(\)) + reserved(begin) + ident(result) operator(=) reserved(yield) + reserved(ensure) + comment(# we want to call this even if we got an exception) + ident(eval)operator(()stringcontent( = save)delimiter(")>operator(\)) + reserved(end) + ident(result) +reserved(end) + +ident(condition) operator(=) pre_constant(true) +global_variable($age) operator(=) integer(18) +ident(print_age)operator(()operator(\)) +reserved(if) ident(condition) + ident(local)operator(()symbol(:$age)operator(\)) operator({) + global_variable($age) operator(=) integer(23) + ident(print_age)operator(()operator(\)) + operator(}) +reserved(end) +ident(print_age)operator(()operator(\)) + +comment(# There is no need to use local(\) for filehandles or directory) +comment(# handles in ruby because filehandles are normal objects.) + + +comment(# @@PLEAC@@_10.14) +comment(# In Ruby you may redefine a method [but not overload it :-(]) +comment(# just by defining again with the same name.) +reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) +reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) +ident(foo) +comment(#=> bar) + +comment(# You can also take a reference to an existing method before) +comment(# redefining a new one, using the `alias' keyword) +reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) +reserved(alias) ident(foo_orig) ident(foo) +reserved(def) method(foo)operator(;) ident(puts) stringoperator(;) reserved(end) +ident(foo_orig) +ident(foo) +comment(#=> foo) +comment(#=> bar) + +comment(# AFAIK, there is no direct way to create a new method whose name) +comment(# comes from a variable, so use "eval") +ident(colors) operator(=) string +ident(colors)operator(.)ident(each) operator({) operator(|)ident(c)operator(|) + ident(eval) stringstringcontent((*a\) + "" + a.to_s + "" + end)delimiter( + EOS)> +operator(}) + + +comment(# @@PLEAC@@_10.15) +reserved(def) method(method_missing)operator(()ident(name)operator(,) operator(*)ident(args)operator(\)) + string)delimiter(")> operator(+) ident(args)operator(.)ident(join)operator(()stringoperator(\)) operator(+) string)delimiter(")> +reserved(end) +ident(puts) ident(chartreuse)operator(()stringoperator(\)) + + +comment(# @@PLEAC@@_10.16) +reserved(def) method(outer)operator(()ident(arg)operator(\)) + ident(x) operator(=) ident(arg) operator(+) integer(35) + ident(inner) operator(=) ident(proc) operator({) ident(x) operator(*) integer(19) operator(}) + ident(x) operator(+) ident(inner)operator(.)ident(call)operator(()operator(\)) +reserved(end) + + +comment(# @@PLEAC@@_10.17) +comment(#!/usr/bin/ruby -w) +comment(# mailsort - sort mbox by different criteria) +ident(require) string +ident(require) string + +comment(# Objects of class Mail represent a single mail.) +reserved(class) class(Mail) + ident(attr_accessor) symbol(:no) + ident(attr_accessor) symbol(:subject) + ident(attr_accessor) symbol(:fulltext) + ident(attr_accessor) symbol(:date) + + reserved(def) method(initialize) + instance_variable(@fulltext) operator(=) string + instance_variable(@subject) operator(=) string + reserved(end) + + reserved(def) method(append)operator(()ident(para)operator(\)) + instance_variable(@fulltext) operator(<<) ident(para) + reserved(end) + + comment(# this is called if you call puts(mail\)) + reserved(def) method(to_s) + instance_variable(@fulltext) + reserved(end) +reserved(end) + +comment(# represents a list of mails.) +reserved(class) class(Mailbox) operator(<) constant(Array) + + constant(Subjectpattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) + constant(Datepattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) + + comment(# reads mails from open file and stores them) + reserved(def) method(read)operator(()ident(file)operator(\)) + global_variable($INPUT_RECORD_SEPARATOR) operator(=) string comment(# paragraph reads) + ident(msgno) operator(=) integer(-1) + ident(file)operator(.)ident(each) operator({) operator(|)ident(para)operator(|) + reserved(if) ident(para) operator(=)operator(~) regexp + ident(mail) operator(=) constant(Mail)operator(.)ident(new) + ident(mail)operator(.)ident(no) operator(=) operator(()ident(msgno) operator(+=) integer(1)operator(\)) + ident(md) operator(=) constant(Subjectpattern)operator(.)ident(match)operator(()ident(para)operator(\)) + reserved(if) ident(md) + ident(mail)operator(.)ident(subject) operator(=) ident(md)operator([)integer(1)operator(]) + reserved(end) + ident(md) operator(=) constant(Datepattern)operator(.)ident(match)operator(()ident(para)operator(\)) + reserved(if) ident(md) + ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(parse)operator(()ident(md)operator([)integer(1)operator(])operator(\)) + reserved(else) + ident(mail)operator(.)ident(date) operator(=) constant(DateTime)operator(.)ident(now) + reserved(end) + pre_constant(self)operator(.)ident(push)operator(()ident(mail)operator(\)) + reserved(end) + ident(mail)operator(.)ident(append)operator(()ident(para)operator(\)) reserved(if) ident(mail) + operator(}) + reserved(end) + + reserved(def) method(sort_by_subject_and_no) + pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(m)operator(|) + operator([)ident(m)operator(.)ident(subject)operator(,) ident(m)operator(.)ident(no)operator(]) + operator(}) + reserved(end) + + comment(# sorts by a list of attributs of mail, given as symbols) + reserved(def) method(sort_by_attributs)operator(()operator(*)ident(attrs)operator(\)) + comment(# you can sort an Enumerable by an array of) + comment(# values, they would be compared) + comment(# from ary[0] to ary[n]t, say:) + comment(# ['b',1] > ['a',10] > ['a',9]) + pre_constant(self)operator(.)ident(sort_by) operator({) operator(|)ident(elem)operator(|) + ident(attrs)operator(.)ident(map) operator({) operator(|)ident(attr)operator(|) + ident(elem)operator(.)ident(send)operator(()ident(attr)operator(\)) + operator(}) + operator(}) + reserved(end) + +reserved(end) + +ident(mailbox) operator(=) constant(Mailbox)operator(.)ident(new) +ident(mailbox)operator(.)ident(read)operator(()pre_constant(ARGF)operator(\)) + +comment(# print only subjects sorted by subject and number) +reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_subject_and_no) + ident(puts)operator(()ident(m)operator(.)ident(subject)operator(\)) +reserved(end) + +comment(# print complete mails sorted by date, then subject, then number) +reserved(for) ident(m) reserved(in) ident(mailbox)operator(.)ident(sort_by_attributs)operator(()symbol(:date)operator(,) symbol(:subject)operator(\)) + ident(puts)operator(()ident(m)operator(\)) +reserved(end) + + +comment(# @@PLEAC@@_11.7) +reserved(def) method(mkcounter)operator(()ident(count)operator(\)) + ident(start) operator(=) ident(count) + ident(bundle) operator(=) operator({) + string operator(=)operator(>) ident(proc) operator({) ident(count) operator(+=) integer(1) operator(})operator(,) + string operator(=)operator(>) ident(proc) operator({) ident(count) operator(-=) integer(1) operator(})operator(,) + string operator(=)operator(>) ident(proc) operator({) ident(count) operator(=) ident(start) operator(}) + operator(}) + ident(bundle)operator([)stringoperator(]) operator(=) ident(bundle)operator([)stringoperator(]) + reserved(return) ident(bundle) +reserved(end) + +ident(c1) operator(=) ident(mkcounter)operator(()integer(20)operator(\)) +ident(c2) operator(=) ident(mkcounter)operator(()integer(77)operator(\)) + +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 21 ) +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 78 ) +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 22 ) +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 21 ) +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 20 ) +ident(puts) stringoperator(])operator(.)ident(call)delimiter(})>delimiter(")> comment(# 77 ) + + +comment(# @@PLEAC@@_11.15) +reserved(class) class(Binary_tree) + reserved(def) method(initialize)operator(()ident(val)operator(\)) + instance_variable(@value) operator(=) ident(val) + instance_variable(@left) operator(=) pre_constant(nil) + instance_variable(@right) operator(=) pre_constant(nil) + reserved(end) + + comment(# insert given value into proper point of) + comment(# provided tree. If no tree provided, ) + comment(# use implicit pass by reference aspect of @_) + comment(# to fill one in for our caller.) + reserved(def) method(insert)operator(()ident(val)operator(\)) + reserved(if) ident(val) operator(<) instance_variable(@value) reserved(then) + reserved(if) instance_variable(@left) reserved(then) + instance_variable(@left)operator(.)ident(insert)operator(()ident(val)operator(\)) + reserved(else) + instance_variable(@left) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) + reserved(end) + reserved(elsif) ident(val) operator(>) instance_variable(@value) reserved(then) + reserved(if) instance_variable(@right) reserved(then) + instance_variable(@right)operator(.)ident(insert)operator(()ident(val)operator(\)) + reserved(else) + instance_variable(@right) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()ident(val)operator(\)) + reserved(end) + reserved(else) + ident(puts) string + comment(# do nothing, no double values) + reserved(end) + reserved(end) + + comment(# recurse on left child, ) + comment(# then show current value, ) + comment(# then recurse on right child. ) + reserved(def) method(in_order) + instance_variable(@left)operator(.)ident(in_order) reserved(if) instance_variable(@left) + ident(print) instance_variable(@value)operator(,) string + instance_variable(@right)operator(.)ident(in_order) reserved(if) instance_variable(@right) + reserved(end) + + comment(# show current value, ) + comment(# then recurse on left child, ) + comment(# then recurse on right child.) + reserved(def) method(pre_order) + ident(print) instance_variable(@value)operator(,) string + instance_variable(@left)operator(.)ident(pre_order) reserved(if) instance_variable(@left) + instance_variable(@right)operator(.)ident(pre_order) reserved(if) instance_variable(@right) + reserved(end) + + comment(# recurse on left child, ) + comment(# then recurse on right child,) + comment(# then show current value.) + reserved(def) method(post_order) + instance_variable(@left)operator(.)ident(post_order) reserved(if) instance_variable(@left) + instance_variable(@right)operator(.)ident(post_order) reserved(if) instance_variable(@right) + ident(print) instance_variable(@value)operator(,) string + reserved(end) + + comment(# find out whether provided value is in the tree.) + comment(# if so, return the node at which the value was found.) + comment(# cut down search time by only looking in the correct) + comment(# branch, based on current value.) + reserved(def) method(search)operator(()ident(val)operator(\)) + reserved(if) ident(val) operator(==) instance_variable(@value) reserved(then) + reserved(return) pre_constant(self) + reserved(elsif) ident(val) operator(<) instance_variable(@value) reserved(then) + reserved(return) instance_variable(@left)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@left) + reserved(return) pre_constant(nil) + reserved(else) + reserved(return) instance_variable(@right)operator(.)ident(search)operator(()ident(val)operator(\)) reserved(if) instance_variable(@right) + reserved(return) pre_constant(nil) + reserved(end) + reserved(end) +reserved(end) + +comment(# first generate 20 random inserts) +ident(test) operator(=) constant(Binary_tree)operator(.)ident(new)operator(()integer(0)operator(\)) +reserved(for) ident(a) reserved(in) integer(0)operator(..)integer(20) + ident(test)operator(.)ident(insert)operator(()ident(rand)operator(()integer(1000)operator(\))operator(\)) +reserved(end) + +comment(# now dump out the tree all three ways) +ident(print) stringoperator(;) ident(test)operator(.)ident(pre_order)operator(;) ident(puts) string +ident(print) stringoperator(;) ident(test)operator(.)ident(in_order)operator(;) ident(puts) string +ident(print) stringoperator(;) ident(test)operator(.)ident(post_order)operator(;) ident(puts) string + +ident(print) string +reserved(while) ident(gets) + ident(print) ident(test)operator(.)ident(search)operator(()global_variable($_)operator(.)ident(to_i)operator(\)) + ident(print) string +reserved(end) + + +comment(# @@PLEAC@@_12.0) +comment(# class and module names need to have the first letter capitalized) +reserved(module) class(Alpha) + constant(NAME) operator(=) string +reserved(end) +reserved(module) class(Omega) + constant(NAME) operator(=) string +reserved(end) +ident(puts) stringcontent(, Omega is )inlinedelimiter(")> + +comment(# ruby doesn't differentiate beteen compile-time and run-time) +ident(require) string +ident(require) string comment(# assumes the .rb) +ident(require) string +ident(require) string comment(# assumes the .rb) +ident(load) string comment(# require only loads the file once) + +reserved(module) class(Cards) + reserved(module) class(Poker) + instance_variable(@card_deck) operator(=) constant(Array)operator(.)ident(new) comment(# or @card_deck = []) + reserved(def) method(shuffle) + reserved(end) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_12.1) +comment(# a module exports all of its functions) +reserved(module) class(Your_Module) + reserved(def) pre_constant(self)operator(.)ident(function) + comment(# this would be called as Your_Module.function) + reserved(end) + + reserved(def) constant(Your_Module)operator(.)ident(another) + comment(# this is the same as above, but more specific) + reserved(end) +reserved(end) + +comment(# @@PLEAC@@_12.2) +reserved(begin) + ident(require) string +reserved(rescue) constant(LoadError) + ident(puts) stringdelimiter(")> comment(# $! contains the last error string) +reserved(end) + +comment(# @@PLEAC@@_12.4) +comment(# module variables are private unless access functions are defined) +reserved(module) class(Alpha) + instance_variable(@aa) operator(=) integer(10) + instance_variable(@bb) operator(=) integer(11) + + reserved(def) pre_constant(self)operator(.)ident(put_aa) + ident(puts) instance_variable(@aa) + reserved(end) + + reserved(def) pre_constant(self)operator(.)ident(bb)operator(=)operator(()ident(val)operator(\)) + instance_variable(@bb) operator(=) ident(val) + reserved(end) +reserved(end) + +constant(Alpha)operator(.)ident(bb) operator(=) integer(12) +comment(# Alpha.aa = 10 # error, no aa=method) + + +comment(# @@PLEAC@@_12.5) +comment(# caller provides a backtrace of the call stack) +reserved(module) class(MyModule) + reserved(def) method(find_caller) + ident(caller) + reserved(end) + + reserved(def) method(find_caller2)operator(()ident(i)operator(\)) + ident(caller)operator(()ident(i)operator(\)) comment(# an argument limits the size of the stack returned) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_12.6) +reserved(BEGIN) operator({) + global_variable($logfile) operator(=) string reserved(unless) reserved(defined?) global_variable($logfile) + global_variable($LF) operator(=) constant(File)operator(.)ident(open)operator(()global_variable($logfile)operator(,) stringoperator(\)) +operator(}) + +reserved(module) class(Logger) + reserved(def) pre_constant(self)operator(.)ident(logmsg)operator(()ident(msg)operator(\)) + global_variable($LF)operator(.)ident(puts) ident(msg) + reserved(end) + + ident(logmsg)operator(()stringoperator(\)) +reserved(end) + +reserved(END) operator({) + constant(Logger)operator(::)ident(logmsg)operator(()stringoperator(\)) + global_variable($LF)operator(.)ident(close) +operator(}) + + +comment(# @@PLEAC@@_12.7) +comment(#-----------------------------) +comment(# results may be different on your system) +comment(# % ruby -e "$LOAD_PATH.each_index { |i| printf("%d %s\\n", i, $LOAD_PATH[i] }) +comment(#0 /usr/local/lib/site_ruby/1.6) +comment(#1 /usr/local/lib/site_ruby/1.6/i386-linux) +comment(#2 /usr/local/lib/site_ruby/) +comment(#3 /usr/lib/ruby/1.6) +comment(#4 /usr/lib/ruby/1.6/i136-linux) +comment(#5 .) +comment(#-----------------------------) +comment(# syntax for sh, bash, ksh, or zsh) +comment(#$ export RUBYLIB=$HOME/rubylib) + +comment(# syntax for csh or tcsh) +comment(# % setenv RUBYLIB ~/rubylib) +comment(#-----------------------------) +global_variable($LOAD_PATH)operator(.)ident(unshift) stringoperator(;) + + +comment(# @@PLEAC@@_12.8) +comment(# equivalents in ruby are mkmf, SWIG, or Ruby/DL depending on usage) + + +comment(# @@PLEAC@@_12.9) +comment(# no equivalent in ruby) + + +comment(# @@PLEAC@@_12.10) +comment(# no equivalent in ruby) + + +comment(# @@PLEAC@@_12.11) +reserved(module) class(FineTime) + reserved(def) pre_constant(self)operator(.)ident(time) + comment(# to be defined later) + reserved(end) +reserved(end) + + +reserved(module) class(FineTime) + reserved(def) pre_constant(self)operator(.)ident(time) + string + reserved(end) +reserved(end) + +ident(puts) constant(FineTime)operator(.)ident(time) comment(#=> "its a fine time") + + +comment(# @@PLEAC@@_12.12) +reserved(def) method(even_only)operator(()ident(n)operator(\)) + ident(raise) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) comment(# one way to test) + comment(# ...) +reserved(end) +reserved(def) method(even_only)operator(()ident(n)operator(\)) + global_variable($stderr)operator(.)ident(puts) stringcontent( is not even)delimiter(")> reserved(if) operator(()ident(n) operator(&) integer(1)operator(\)) operator(!=) integer(0) + comment(# ...) +reserved(end) + + +comment(# @@PLEAC@@_12.17) +comment(# The library archive for ruby is called Ruby Application archive,) +comment(# or shorter RAA, and can be found at http://raa.ruby-lang.org.) +comment(# A typical library is installed like this:) +comment(# % gunzip some-module-4.54.tar.gz) +comment(# % tar xf some-module-4.54.tar) +comment(# % cd some-module-4.54.tar) +comment(# % ruby install.rb config) +comment(# % ruby install.rb setup) +comment(# get superuser previleges here if needed for next step) +comment(# % ruby install.rb install) + +comment(# Some modules use a different process,) +comment(# you should find details in the documentation) +comment(# Here is an example of such a different process) +comment(# % ruby extconf.rb) +comment(# % make) +comment(# % make install) + +comment(# If you want the module installed in your own directory:) +comment(# For ruby version specific libraries) +comment(# % ruby install.rb config --site-ruby=~/lib) +comment(# For version independent libraries) +comment(# % ruby install.rb config --site-ruby-common=~/lib) + +comment(# Information about possible options for config) +comment(# % ruby install.rb --help) + +comment(# If you have your own complete distribution) +comment(# % ruby install.rb --prefix=path=~/ruby-private) + + +comment(# @@PLEAC@@_13.0) +comment(# Classes and objects in Ruby are rather straigthforward) +reserved(class) class(Person) + comment(# Class variables (also called static attributes\) are prefixed by @@) + class_variable(@@person_counter)operator(=)integer(0) + + comment(# object constructor) + reserved(def) method(initialize)operator(()ident(age)operator(,) ident(name)operator(,) ident(alive) operator(=) pre_constant(true)operator(\)) comment(# Default arg like in C++) + instance_variable(@age)operator(,) instance_variable(@name)operator(,) instance_variable(@alive) operator(=) ident(age)operator(,) ident(name)operator(,) ident(alive) comment(# Object attributes are prefixed by '@') + class_variable(@@person_counter) operator(+=) integer(1) + comment(# There is no '++' operator in Ruby. The '++'/'--' operators are in fact ) + comment(# hidden assignments which affect variables, not objects. You cannot accomplish) + comment(# assignment via method. Since everything in Ruby is object, '++' and '--' ) + comment(# contradict Ruby OO ideology. Instead '-=' and '+=' are used.) + reserved(end) + + ident(attr_accessor) symbol(:name)operator(,) symbol(:age) comment(# This creates setter and getter methods for @name) + comment(# and @age. See 13.3 for detailes.) + + comment(# methods modifying the receiver object usually have the '!' suffix) + reserved(def) method(die!) + instance_variable(@alive) operator(=) pre_constant(false) + ident(puts) stringcontent( has died at the age of )inlinecontent(.)delimiter(")> + instance_variable(@alive) + reserved(end) + + reserved(def) method(kill)operator(()ident(anotherPerson)operator(\)) + ident(print) instance_variable(@name)operator(,) stringoperator(,) ident(anotherPerson)operator(.)ident(name)operator(,) string + ident(anotherPerson)operator(.)ident(die!) + reserved(end) + + comment(# methods used as queries) + comment(# usually have the '?' suffix ) + reserved(def) method(alive?) + instance_variable(@alive) operator(&&) pre_constant(true) + reserved(end) + + reserved(def) method(year_of_birth) + constant(Time)operator(.)ident(now)operator(.)ident(year) operator(-) instance_variable(@age) + reserved(end) + + comment(# Class method (also called static method\)) + reserved(def) constant(Person)operator(.)ident(number_of_people) + class_variable(@@person_counter) + reserved(end) +reserved(end) + +comment(# Using the class:) +comment(# Create objects of class Person) +ident(lecter) operator(=) constant(Person)operator(.)ident(new)operator(()integer(47)operator(,) stringoperator(\)) +ident(starling) operator(=) constant(Person)operator(.)ident(new)operator(()integer(29)operator(,) stringoperator(,) pre_constant(true)operator(\)) +ident(pazzi) operator(=) constant(Person)operator(.)ident(new)operator(()integer(40)operator(,) stringoperator(,) pre_constant(true)operator(\)) + +comment(# Calling a class method) +ident(print) stringoperator(,) constant(Person)operator(.)ident(number_of_people)operator(,) string + +ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string +ident(lecter)operator(.)ident(kill)operator(()ident(pazzi)operator(\)) +ident(print) ident(pazzi)operator(.)ident(name)operator(,) stringoperator(,) operator(()ident(pazzi)operator(.)ident(alive?)operator(\)) operator(?) string operator(:) stringoperator(,) string + +ident(print) ident(starling)operator(.)ident(name) operator(,) stringoperator(,) ident(starling)operator(.)ident(year_of_birth)operator(,) string + + +comment(# @@PLEAC@@_13.1) +comment(# If you don't need any initialisation in the constructor,) +comment(# you don't need to write a constructor.) +reserved(class) class(MyClass) +reserved(end) + +reserved(class) class(MyClass) + reserved(def) method(initialize) + instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) + instance_variable(@age) operator(=) integer(0) + reserved(end) +reserved(end) + +reserved(class) class(MyClass) + reserved(def) method(initialize)operator(()ident(inithash)operator(\)) + instance_variable(@start) operator(=) constant(Time)operator(.)ident(new) + instance_variable(@age) operator(=) integer(0) + reserved(for) ident(key)operator(,) ident(value) reserved(in) ident(inithash) + ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) ident(value)operator(\)) + reserved(end) + reserved(end) +reserved(end) + +comment(# @@PLEAC@@_13.2) +comment(# Objects are destroyed by the garbage collector.) +comment(# The time of destroying is not predictable.) +comment(# The ruby garbage collector can handle circular references,) +comment(# so there is no need to write destructor for that.) + +comment(# There is no direct support for destructor.) +comment(# You can call a custom function, or more specific a proc object, when the) +comment(# garbage collector is about to destruct the object, but it is unpredictable) +comment(# when this occurs.) +comment(# Also if such a finalizer object has a reference to the orignal object,) +comment(# this may prevent the original object to get garbage collected.) +comment(# Because of this problem the finalize method below is) +comment(# a class method and not a instance method.) +comment(# So if you need to free resources for an object, like) +comment(# closing a socket or kill a spawned subprocess,) +comment(# you should do it explicitly.) + +reserved(class) class(MyClass) + reserved(def) method(initialize) + constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) + pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) + reserved(end) + reserved(def) constant(MyClass)operator(.)ident(finalize)operator(()ident(id)operator(\)) + ident(puts) stringcontent( dying at )inlinedelimiter(")> + reserved(end) +reserved(end) + +comment(# test code) +integer(3)operator(.)ident(times) operator({) + constant(MyClass)operator(.)ident(new) +operator(}) +constant(ObjectSpace)operator(.)ident(garbage_collect) + + +comment(# @@PLEAC@@_13.3) +comment(# You can write getter and setter methods in a natural way:) +reserved(class) class(Person) + reserved(def) method(name) + instance_variable(@name) + reserved(end) + reserved(def) method(name=)operator(()ident(name)operator(\)) + instance_variable(@name) operator(=) ident(name) + reserved(end) +reserved(end) + +comment(# But there is a better and shorter way) +reserved(class) class(Person) + ident(attr_reader) symbol(:age) + ident(attr_writer) symbol(:name) + comment(# attr_reader and attr_writer are actually methods in class Class) + comment(# which set getter and setter methods for you.) +reserved(end) + +comment(# There is also attr_accessor to create both setters and getters) +reserved(class) class(Person) + ident(attr_accessor) symbol(:age)operator(,) symbol(:name) +reserved(end) + + +comment(# @@PLEAC@@_13.4) +reserved(class) class(Person) + comment(# Class variables (also called static attributes\) are prefixed by @@) + class_variable(@@person_counter) operator(=) integer(0) + + reserved(def) constant(Person)operator(.)ident(population) + class_variable(@@person_counter) + reserved(end) + reserved(def) method(initialize) + class_variable(@@person_counter) operator(+=) integer(1) + constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) + pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) + reserved(end) + reserved(def) constant(Person)operator(.)ident(finalize)operator(()ident(id)operator(\)) + class_variable(@@person_counter) operator(-=) integer(1) + reserved(end) +reserved(end) +ident(people) operator(=) operator([)operator(]) +integer(10)operator(.)ident(times) operator({) + ident(people)operator(.)ident(push)operator(()constant(Person)operator(.)ident(new)operator(\)) +operator(}) +ident(printf)operator(()stringoperator(,) constant(Person)operator(.)ident(population)operator(\)) + + +constant(FixedArray)operator(.)ident(class_max_bounds) operator(=) integer(100) +ident(alpha) operator(=) constant(FixedArray)operator(.)ident(new) +ident(puts) stringdelimiter(")> + +ident(beta) operator(=) constant(FixedArray)operator(.)ident(new) +ident(beta)operator(.)ident(max_bounds) operator(=) integer(50) comment(# calls the instance method) +ident(beta)operator(.)ident(class)operator(.)ident(class_max_bounds) operator(=) integer(50) comment(# alternative, calls the class method) +ident(puts) stringdelimiter(")> + +reserved(class) class(FixedArray) + class_variable(@@bounds) operator(=) integer(7) + + reserved(def) method(max_bounds) + class_variable(@@max_bounds) + reserved(end) + comment(# instance method, which sets the class variable) + reserved(def) method(max_bounds=)operator(()ident(value)operator(\)) + class_variable(@@max_bounds) operator(=) ident(value) + reserved(end) + comment(# class method. This can only be called on a class,) + comment(# but not on the instances) + reserved(def) constant(FixedArray)operator(.)ident(class_max_bounds)operator(=)operator(()ident(value)operator(\)) + class_variable(@@max_bounds) operator(=) ident(value) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_13.5) +constant(PersonStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:name)operator(,) symbol(:age)operator(,) symbol(:peers)operator(\)) +comment(# creates a class "Person::Struct", which is accessiable with the) +comment(# constant "PersonStruct") +ident(p) operator(=) constant(PersonStruct)operator(.)ident(new) +ident(p) operator(=) constant(Struct)operator(::)constant(Person)operator(.)ident(new) comment(# alternative using the classname) +ident(p)operator(.)ident(name) operator(=) string +ident(p)operator(.)ident(age) operator(=) integer(13) +ident(p)operator(.)ident(peers) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) +ident(p)operator([)symbol(:peers)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using symbol) +ident(p)operator([)stringoperator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using name of field) +ident(p)operator([)integer(2)operator(]) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) comment(# alternative access using index of field) +ident(puts) stringcontent(, )inlinecontent('s first friend is )inlinedelimiter(")> + +comment(# The fields of a struct have no special type, like other ruby variables) +comment(# you can put any objects in. Therefore the discussions how to specify) +comment(# the types of the fields do not apply to ruby.) + +constant(FamilyStruct) operator(=) constant(Struct)operator(.)ident(new)operator(()stringoperator(,) symbol(:head)operator(,) symbol(:address)operator(,) symbol(:members)operator(\)) +ident(folks) operator(=) constant(FamilyStruct)operator(.)ident(new) +ident(folks)operator(.)ident(head) operator(=) constant(PersonStruct)operator(.)ident(new) +ident(dad) operator(=) ident(folks)operator(.)ident(head) +ident(dad)operator(.)ident(name) operator(=) string +ident(dad)operator(.)ident(age) operator(=) integer(34) + +comment(# supply of own accessor method for the struct for error checking) +reserved(class) class(PersonStruct) + reserved(def) method(age=)operator(()ident(value)operator(\)) + reserved(if) operator(!)ident(value)operator(.)ident(kind_of?)operator(()constant(Integer)operator(\)) + ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( isn't an Integer)delimiter(")>operator(\)) + reserved(elsif) ident(value) operator(>) integer(150) + ident(raise)operator(()constant(ArgumentError)operator(,) stringcontent( is unreasonable)delimiter(")>operator(\)) + reserved(end) + instance_variable(@age) operator(=) ident(value) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_13.6) +comment(# The ruby Object class defines a dup and a clone method.) +comment(# The dup method is recommended for prototype object creation.) +comment(# The default implementation makes a shallow copy,) +comment(# but each class can override it, for example to make a deep copy.) + +comment(# If you want to call 'new' directly on the instances,) +comment(# you can create a instance method "new", which returns a new duplicate.) +comment(# This method is distinct from the class method new.) +comment(#) +reserved(class) class(A) + reserved(def) method(new) + ident(dup) + reserved(end) +reserved(end) + +ident(ob1) operator(=) constant(A)operator(.)ident(new) +comment(# later on) +ident(ob2) operator(=) ident(ob1)operator(.)ident(new) + + +comment(# @@PLEAC@@_13.7) +ident(methname) operator(=) string +ident(obj)operator(.)ident(send)operator(()ident(methname)operator(,) integer(10)operator(\)) comment(# calls obj.flicker(10\)) + +comment(# call three methods on the object, by name) +operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(.)ident(each) reserved(do) operator(|)ident(method_string)operator(|) + ident(obj)operator(.)ident(send)operator(()ident(method_string)operator(\)) +reserved(end) + +comment(# Another way is to create a Method object) +ident(method_obj) operator(=) ident(obj)operator(.)ident(method)operator(()stringoperator(\)) +comment(# And then call it) +ident(method_obj)operator(.)ident(call)operator(()integer(10)operator(\)) + + +comment(# @@PLEAC@@_13.8) +comment(# All classes in Ruby inherit from class Object) +comment(# and thus all objects share methods defined in this class) + +comment(# the class of the object) +ident(puts) ident(any_object)operator(.)ident(type) + +comment(# Ruby classes are actually objects of class Class and they) +comment(# respond to methods defined in Object class as well) + +comment(# the superclass of this class) +ident(puts) ident(any_object)operator(.)ident(class)operator(.)ident(superclass) + +comment(# ask an object whether it is an instance of particular class) +ident(n) operator(=) float(4.7) +ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Float)operator(\)) comment(# true) +ident(puts) ident(n)operator(.)ident(instance_of?)operator(()constant(Numeric)operator(\)) comment(# false) + +comment(# ask an object whether it is an instance of class, one of the) +comment(# superclasses of the object, or modules included in it) +ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Float)operator(\)) comment(# true (the class\)) +ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Numeric)operator(\)) comment(# true (an ancestor class\)) +ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(Comparable)operator(\)) comment(# true (a mixin module\)) +ident(puts) ident(n)operator(.)ident(kind_of?)operator(()constant(String)operator(\)) comment(# false) + +comment(# ask an object whether it can respond to a particular method) +ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# true) +ident(puts) ident(n)operator(.)ident(respond_to?)operator(()stringoperator(\)) comment(# false) + +comment(# all methods an object can respond to) +stringoperator(.)ident(methods)operator(.)ident(each) operator({) operator(|)ident(m)operator(|) ident(puts) ident(m) operator(}) + + +comment(# @@PLEAC@@_13.9) +comment(# Actually any class in Ruby is inheritable) +reserved(class) class(Person) + ident(attr_accessor) symbol(:age)operator(,) symbol(:name) + reserved(def) method(initialize) + instance_variable(@name) + instance_variable(@age) + reserved(end) +reserved(end) +comment(#-----------------------------) +ident(dude) operator(=) constant(Person)operator(.)ident(new) +ident(dude)operator(.)ident(name) operator(=) string +ident(dude)operator(.)ident(age) operator(=) integer(23) +ident(printf) stringoperator(,) ident(dude)operator(.)ident(name)operator(,) ident(dude)operator(.)ident(age) +comment(#-----------------------------) +comment(# Inheriting from Person) +reserved(class) class(Employee) operator(<) constant(Person) + ident(attr_accessor) symbol(:salary) +reserved(end) +comment(#-----------------------------) +ident(empl) operator(=) constant(Employee)operator(.)ident(new) +ident(empl)operator(.)ident(name) operator(=) string +ident(empl)operator(.)ident(age) operator(=) integer(23) +ident(empl)operator(.)ident(salary) operator(=) integer(200) +ident(printf) stringoperator(,) ident(empl)operator(.)ident(name)operator(,) ident(empl)operator(.)ident(age)operator(,) ident(empl)operator(.)ident(salary) +comment(#-----------------------------) +comment(# Any built-in class can be inherited the same way) +reserved(class) class(WeirdString) operator(<) constant(String) + reserved(def) method(initialize)operator(()ident(obj)operator(\)) + reserved(super) ident(obj) + reserved(end) + reserved(def) method(+)operator(()ident(anotherObj)operator(\)) comment(# + method in this class is overridden) + comment(# to return the sum of string lengths) + pre_constant(self)operator(.)ident(length) operator(+) ident(anotherObj)operator(.)ident(length) comment(# 'self' can be omitted) + reserved(end) +reserved(end) +comment(#-----------------------------) +ident(a) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) +ident(b) operator(=) constant(WeirdString)operator(.)ident(new)operator(()stringoperator(\)) + +ident(puts) ident(a) operator(+) ident(b) comment(# the overridden +) +comment(#=> 8) +ident(puts) ident(a)operator(.)ident(length) comment(# method from the superclass, String) +comment(#=> 5) + + +comment(# @@PLEAC@@_13.11) +comment(# In ruby you can override the method_missing method) +comment(# to have a solution similar to perls AUTOLOAD.) +reserved(class) class(Person) + + reserved(def) method(initialize) + instance_variable(@ok_fields) operator(=) string + reserved(end) + + reserved(def) method(valid_attribute?)operator(()ident(name)operator(\)) + instance_variable(@ok_fields)operator(.)ident(include?)operator(()ident(name)operator(\)) + reserved(end) + + reserved(def) method(method_missing)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) + ident(name) operator(=) ident(namesymbol)operator(.)ident(to_s) + reserved(return) reserved(if) ident(name) operator(=)operator(~) regexp + reserved(if) ident(name)operator(.)ident(to_s)operator([)integer(-1)operator(]) operator(==) operator(()stringoperator([)integer(0)operator(])operator(\)) comment(# we have a setter) + ident(isSetter) operator(=) pre_constant(true) + ident(name)operator(.)ident(sub!)operator(()regexpoperator(,) stringoperator(\)) + reserved(end) + reserved(if) ident(valid_attribute?)operator(()ident(name)operator(\)) + reserved(if) ident(isSetter) + ident(instance_variable_set)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) + reserved(else) + ident(instance_variable_get)operator(()stringdelimiter(")>operator(,) operator(*)ident(params)operator(\)) + reserved(end) + reserved(else) + comment(# if no annestor is responsible,) + comment(# the Object class will throw a NoMethodError exception) + reserved(super)operator(()ident(namesymbol)operator(,) operator(*)ident(params)operator(\)) + reserved(end) + reserved(end) + + reserved(def) method(new) + ident(kid) operator(=) constant(Person)operator(.)ident(new) + ident(kid)operator(.)ident(parent) operator(=) pre_constant(self) + ident(kid) + reserved(end) + +reserved(end) + +ident(dad) operator(=) constant(Person)operator(.)ident(new) +ident(dad)operator(.)ident(name) operator(=) string +ident(dad)operator(.)ident(age) operator(=) integer(23) +ident(kid) operator(=) ident(dad)operator(.)ident(new) +ident(kid)operator(.)ident(name) operator(=) string +ident(kid)operator(.)ident(age) operator(=) integer(2) +ident(puts) stringdelimiter(")> +ident(puts) ident(dad) +ident(puts) ident(kid) + +reserved(class) class(Employee) operator(<) constant(Person) + reserved(def) method(initialize) + reserved(super) + instance_variable(@ok_fields)operator(.)ident(push)operator(()stringoperator(,) stringoperator(\)) + reserved(end) + reserved(def) method(ok_fields) + instance_variable(@ok_fields) + reserved(end) +reserved(end) + + +comment(# @@PLEAC@@_13.13) +comment(# The ruby garbage collector pretends to cope with circular structures.) +comment(# You can test it with this code:) +reserved(class) class(RingNode) + ident(attr_accessor) symbol(:next) + ident(attr_accessor) symbol(:prev) + ident(attr_reader) symbol(:name) + + reserved(def) method(initialize)operator(()ident(aName)operator(\)) + instance_variable(@name) operator(=) ident(aName) + constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) + pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) + reserved(end) + + reserved(def) constant(RingNode)operator(.)ident(finalize)operator(()ident(id)operator(\)) + ident(puts) stringcontent( dying)delimiter(")> + reserved(end) + + reserved(def) constant(RingNode)operator(.)ident(show_all_objects) + constant(ObjectSpace)operator(.)ident(each_object) operator({)operator(|)ident(id)operator(|) + ident(puts) ident(id)operator(.)ident(name) reserved(if) ident(id)operator(.)ident(class) operator(==) constant(RingNode) + operator(}) + reserved(end) +reserved(end) + +reserved(def) method(create_test) + ident(a) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) + ident(b) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) + ident(c) operator(=) constant(RingNode)operator(.)ident(new)operator(()stringoperator(\)) + ident(a)operator(.)ident(next) operator(=) ident(b) + ident(b)operator(.)ident(next) operator(=) ident(c) + ident(c)operator(.)ident(next) operator(=) ident(a) + ident(a)operator(.)ident(prev) operator(=) ident(c) + ident(c)operator(.)ident(prev) operator(=) ident(b) + ident(b)operator(.)ident(prev) operator(=) ident(a) + + ident(a) operator(=) pre_constant(nil) + ident(b) operator(=) pre_constant(nil) + ident(c) operator(=) pre_constant(nil) +reserved(end) + +ident(create_test) +constant(RingNode)operator(.)ident(show_all_objects) +constant(ObjectSpace)operator(.)ident(garbage_collect) +ident(puts) string +constant(RingNode)operator(.)ident(show_all_objects) + + +comment(# @@PLEAC@@_13.14) +reserved(class) class(String) + reserved(def) method(<=>)operator(()ident(other)operator(\)) + pre_constant(self)operator(.)ident(casecmp) ident(other) + reserved(end) +reserved(end) + +comment(# There is no way to directly overload the '""' (stringify\) ) +comment(# operator in Ruby. However, by convention, classes which ) +comment(# can reasonably be converted to a String will define a ) +comment(# 'to_s' method as in the TimeNumber class defined below.) +comment(# The 'puts' method will automatcally call an object's) +comment(# 'to_s' method as is demonstrated below.) +comment(# Furthermore, if a class defines a to_str method, an object of that) +comment(# class can be used most any place where the interpreter is looking ) +comment(# for a String value.) + +comment(#---------------------------------------) +comment(# NOTE: Ruby has a builtin Time class which would usually be used ) +comment(# to manipulate time objects, the following is supplied for) +comment(# educational purposes to demonstrate operator overloading.) +comment(#) +reserved(class) class(TimeNumber) + ident(attr_accessor) symbol(:hours)operator(,)symbol(:minutes)operator(,)symbol(:seconds) + reserved(def) method(initialize)operator(() ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) + instance_variable(@hours) operator(=) ident(hours) + instance_variable(@minutes) operator(=) ident(minutes) + instance_variable(@seconds) operator(=) ident(seconds) + reserved(end) + + reserved(def) method(to_s) + reserved(return) ident(sprintf)operator(() stringoperator(,) instance_variable(@hours)operator(,) instance_variable(@minutes)operator(,) instance_variable(@seconds)operator(\)) + reserved(end) + + reserved(def) method(to_str) + ident(to_s) + reserved(end) + + reserved(def) method(+)operator(() ident(other)operator(\)) + ident(seconds) operator(=) instance_variable(@seconds) operator(+) ident(other)operator(.)ident(seconds) + ident(minutes) operator(=) instance_variable(@minutes) operator(+) ident(other)operator(.)ident(minutes) + ident(hours) operator(=) instance_variable(@hours) operator(+) ident(other)operator(.)ident(hours) + reserved(if) ident(seconds) operator(>)operator(=) integer(60) + ident(seconds) operator(%=) integer(60) + ident(minutes) operator(+=) integer(1) + reserved(end) + reserved(if) ident(minutes) operator(>)operator(=) integer(60) + ident(minutes) operator(%=) integer(60) + ident(hours) operator(+=) integer(1) + reserved(end) + reserved(return) constant(TimeNumber)operator(.)ident(new)operator(()ident(hours)operator(,) ident(minutes)operator(,) ident(seconds)operator(\)) + reserved(end) + + reserved(def) method(-)operator(()ident(other)operator(\)) + ident(raise) constant(NotImplementedError) + reserved(end) + + reserved(def) method(*)operator(()ident(other)operator(\)) + ident(raise) constant(NotImplementedError) + reserved(end) + + reserved(def) method(/)operator(() ident(other)operator(\)) + ident(raise) constant(NotImplementedError) + reserved(end) +reserved(end) + +ident(t1) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(58)operator(,) integer(59)operator(\)) +ident(sec) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(0)operator(,) integer(1)operator(\)) +ident(min) operator(=) constant(TimeNumber)operator(.)ident(new)operator(()integer(0)operator(,) integer(1)operator(,) integer(0)operator(\)) +ident(puts) ident(t1) operator(+) ident(sec) operator(+) ident(min) operator(+) ident(min) + +comment(#-----------------------------) +comment(# StrNum class example: Ruby's builtin String class already has the ) +comment(# capabilities outlined in StrNum Perl example, however the '*' operator) +comment(# on Ruby's String class acts differently: It creates a string which) +comment(# is the original string repeated N times.) +comment(#) +comment(# Using Ruby's String class as is in this example:) +ident(x) operator(=) stringoperator(;) ident(y) operator(=) string +ident(z) operator(=) ident(x)operator(+)ident(y) +ident(r) operator(=) ident(z)operator(*)integer(3) comment(# r is "RedBlackRedBlackRedBlack") +ident(puts) stringcontent(, )inlinecontent(, )inlinecontent(, and )inlinedelimiter(")> +ident(print) stringcontent( is )delimiter(")>operator(,) ident(x) operator(<) ident(y) operator(?) string operator(:) stringoperator(,) stringchar(\\n)delimiter(")> +comment(# prints:) +comment(# values are Red, Black, RedBlack, and RedBlackRedBlackRedBlack) +comment(# Red is GE Black) + +comment(#-----------------------------) +reserved(class) class(FixNum) + constant(REGEX) operator(=) regexp + constant(DEFAULT_PLACES) operator(=) integer(0) + ident(attr_accessor) symbol(:value)operator(,) symbol(:places) + reserved(def) method(initialize)operator(()ident(value)operator(,) ident(places) operator(=) pre_constant(nil)operator(\)) + instance_variable(@value) operator(=) ident(value) + reserved(if) ident(places) + instance_variable(@places) operator(=) ident(places) + reserved(else) + ident(m) operator(=) constant(REGEX)operator(.)ident(match)operator(()ident(value)operator(.)ident(to_s)operator(\)) + reserved(if) ident(m) + instance_variable(@places) operator(=) ident(m)operator([)integer(0)operator(])operator(.)ident(length) operator(-) integer(1) + reserved(else) + instance_variable(@places) operator(=) constant(DEFAULT_PLACES) + reserved(end) + reserved(end) + reserved(end) + + reserved(def) method(+)operator(()ident(other)operator(\)) + constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(+) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) + reserved(end) + + reserved(def) method(*)operator(()ident(other)operator(\)) + constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value) operator(*) ident(other)operator(.)ident(value)operator(,) ident(max)operator(()instance_variable(@places)operator(,) ident(other)operator(.)ident(places)operator(\))operator(\)) + reserved(end) + + reserved(def) method(/)operator(()ident(other)operator(\)) + ident(puts) stringdelimiter(")> + ident(result) operator(=) constant(FixNum)operator(.)ident(new)operator(()instance_variable(@value)operator(.)ident(to_f)operator(/)ident(other)operator(.)ident(value)operator(.)ident(to_f)operator(\)) + ident(result)operator(.)ident(places) operator(=) ident(max)operator(()ident(result)operator(.)ident(places)operator(,)ident(other)operator(.)ident(places)operator(\)) + ident(result) + reserved(end) + + reserved(def) method(to_s) + ident(sprintf)operator(()stringoperator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(to_s) operator(,) instance_variable(@places)operator(,) instance_variable(@value)operator(\)) comment(#.) + reserved(end) + + reserved(def) method(to_str) + ident(to_s) + reserved(end) + + reserved(def) method(to_i) comment(#convert to int) + instance_variable(@value)operator(.)ident(to_i) + reserved(end) + + reserved(def) method(to_f) comment(#convert to float`) + instance_variable(@value)operator(.)ident(to_f) + reserved(end) + + ident(private) + reserved(def) method(max)operator(()ident(a)operator(,)ident(b)operator(\)) + ident(a) operator(>) ident(b) operator(?) ident(a) operator(:) ident(b) + reserved(end) +reserved(end) + +reserved(def) method(demo)operator(()operator(\)) + ident(x) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(40)operator(\)) + ident(y) operator(=) constant(FixNum)operator(.)ident(new)operator(()integer(12)operator(,) integer(0)operator(\)) + + ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> + ident(puts) stringcontent( and )inlinecontent( is )inlinedelimiter(")> + + ident(z) operator(=) ident(x)operator(/)ident(y) + ident(puts) stringcontent( has )inlinecontent( places)delimiter(")> + reserved(unless) ident(z)operator(.)ident(places) + ident(z)operator(.)ident(places) operator(=) integer(2) + reserved(end) + + ident(puts) stringcontent( by )inlinecontent( is )inlinedelimiter(")> + ident(puts) stringdelimiter(")> +reserved(end) + +reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) + ident(demo)operator(()operator(\)) +reserved(end) + + +comment(# @@PLEAC@@_14.1) +comment(# There are dbm, sdbm, gdbm modules) +comment(# and the bdb module for accessing the berkeley db) +comment(# sdbm seem to be available on the most systems,) +comment(# so we use it here) +comment(#) +ident(require) string +constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) + comment(# raises exception if open error) + + comment(# the returned sdbm-dbobj has most of the methods of a hash) + ident(v) operator(=) ident(dbobj)operator([)stringoperator(]) + ident(dbobj)operator([)stringoperator(]) operator(=) string + reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()stringoperator(\)) + comment(# ...) + reserved(end) + ident(dbobj)operator(.)ident(delete)operator(()stringoperator(\)) +operator(}) +comment(# database is open only inside the block.) + +comment(# It is also possible to use a open .. close pair:) +ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) +comment(#.. do something with dbobj) +ident(dbobj)operator(.)ident(close) + +comment(#!/usr/bin/ruby -w) +comment(# userstats - generate statistics on who is logged in) +comment(# call with usernames as argument to display the totals) +comment(# for the given usernames, call with "ALL" to display all users) + +ident(require) string +ident(filename) operator(=) string +constant(SDBM)operator(.)ident(open)operator(()ident(filename)operator(,) integer(0666)operator(\)) operator({) operator(|)ident(dbobj)operator(|) + reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(>) integer(0) + reserved(if) pre_constant(ARGV)operator([)integer(0)operator(]) operator(==) string + comment(# ARGV is constant, so we need the variable userlist) + ident(userlist) operator(=) ident(dbobj)operator(.)ident(keys)operator(()operator(\))operator(.)ident(sort)operator(()operator(\)) + reserved(else) + ident(userlist) operator(=) pre_constant(ARGV) + reserved(end) + ident(userlist)operator(.)ident(each) operator({) operator(|)ident(user)operator(|) + ident(print) stringchar(\\t)inlinechar(\\n)delimiter(")> + operator(}) + reserved(else) + ident(who) operator(=) shell + ident(who)operator(.)ident(split)operator(()stringoperator(\))operator(.)ident(each) operator({) operator(|)ident(line)operator(|) + ident(md) operator(=) regexpoperator(.)ident(match)operator(()ident(line)operator(\)) + ident(raise) stringdelimiter(")> reserved(unless) ident(md) + comment(# sdbm stores only strings, so "+=" doesn't work,) + comment(# we need to convert them expicitly back to integer.) + reserved(if) ident(dbobj)operator(.)ident(has_key?)operator(()ident(md)operator([)integer(0)operator(])operator(\)) + ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(])operator(.)ident(to_i) operator(+) integer(1) + reserved(else) + ident(dbobj)operator([)ident(md)operator([)integer(0)operator(])operator(]) operator(=) string + reserved(end) + operator(}) + reserved(end) +operator(}) + + +comment(# @@PLEAC@@_14.2) +comment(# using open and clear) +ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) +ident(dbobj)operator(.)ident(clear)operator(()operator(\)) +ident(dbobj)operator(.)ident(close)operator(()operator(\)) +comment(# deleting file and recreating it) +comment(# the filenames depend on the flavor of dbm you use,) +comment(# for example sdbm has two files named filename.pag and filename.dir,) +comment(# so you need to delete both files) +reserved(begin) + constant(File)operator(.)ident(delete)operator(()stringoperator(\)) + comment(# raises Exception if not exist) + ident(dbobj) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) +reserved(rescue) + comment(# add error handling here) +reserved(end) + + +comment(# @@PLEAC@@_14.3) +comment(# sdbm2gdbm: converts sdbm database to a gdbm database) +ident(require) string +ident(require) string + +reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(2) + ident(fail) string +reserved(end) +ident(infile) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) +ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(1)operator(]) + +ident(sdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile)operator(\)) +ident(gdb) operator(=) constant(GDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) +ident(sdb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) + ident(gdb)operator([)ident(key)operator(]) operator(=) ident(val) +operator(}) +ident(gdb)operator(.)ident(close) +ident(sdb)operator(.)ident(close) + + +comment(# @@PLEAC@@_14.4) +comment(#!/usr/bin/ruby -w) +comment(# dbmmerge: merges two dbm databases) +ident(require) string + +reserved(unless) pre_constant(ARGV)operator(.)ident(length) operator(==) integer(3) + ident(fail) string +reserved(end) +ident(infile1) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) +ident(infile2) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) +ident(outfile) operator(=) pre_constant(ARGV)operator([)integer(2)operator(]) + +ident(in1) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile1)operator(,) pre_constant(nil)operator(\)) +ident(in2) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(infile2)operator(,) pre_constant(nil)operator(\)) +ident(outdb) operator(=) constant(SDBM)operator(.)ident(open)operator(()ident(outfile)operator(,) integer(0666)operator(\)) + +operator([)ident(in1)operator(,) ident(in2)operator(])operator(.)ident(each) operator({) operator(|)ident(indb)operator(|) + ident(indb)operator(.)ident(each) operator({) operator(|)ident(key)operator(,) ident(val)operator(|) + reserved(if) ident(outdb)operator(.)ident(has_key?)operator(()ident(key)operator(\)) + comment(# decide which value to set.) + comment(# set outdb[key] if necessary) + reserved(else) + ident(outdb)operator([)ident(key)operator(]) operator(=) ident(val) + reserved(end) + operator(}) +operator(}) +ident(in1)operator(.)ident(close) +ident(in2)operator(.)ident(close) +ident(outdb)operator(.)ident(close) + + +comment(# @@PLEAC@@_14.7) +comment(# we write a tie method that extends the Array class.) +comment(# It reads the file into the memory, executes the code block) +comment(# in which you can manipulate the array as needed, and writes) +comment(# the array back to the file after the end of the block execution) +reserved(class) class(Array) + reserved(def) method(tie)operator(()ident(filename)operator(,) ident(flags)operator(\)) + constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) ident(flags)operator(\)) operator({) operator(|)ident(f)operator(|) + ident(f)operator(.)ident(each_line) operator({) operator(|)ident(line)operator(|) + pre_constant(self)operator(.)ident(push)operator(()ident(line)operator(.)ident(chomp)operator(\)) + operator(}) + reserved(yield) + ident(f)operator(.)ident(rewind) + ident(each) operator({) operator(|)ident(line)operator(|) + reserved(if) ident(line) + ident(f)operator(.)ident(puts)operator(()ident(line)operator(\)) + reserved(else) + ident(f)operator(.)ident(puts) string + reserved(end) + operator(}) + operator(}) + reserved(end) +reserved(end) + +ident(array) operator(=) constant(Array)operator(.)ident(new) +ident(array)operator(.)ident(tie)operator(()stringoperator(,) constant(File)operator(::)constant(RDWR)operator(|)constant(File)operator(::)constant(CREAT)operator(\)) operator({) + ident(array)operator([)integer(4)operator(]) operator(=) string +operator(}) + +comment(# The tied array can be manipulated like a normal array,) +comment(# so there is no need for a special API, and the recno_demo program) +comment(# to demonstrate is API is useless) + + +comment(# tied array demo: show how to use array with a tied file) +ident(filename) operator(=) string +ident(lines) operator(=) constant(Array)operator(.)ident(new) +constant(File)operator(.)ident(unlink)operator(()ident(filename)operator(\)) reserved(if) constant(File)operator(.)ident(exists?)operator(()ident(filename)operator(\)) +ident(lines)operator(.)ident(tie)operator(()ident(filename)operator(,) constant(File)operator(::)constant(RDWR) operator(|) constant(File)operator(::)constant(CREAT)operator(\)) operator({) + comment(# first create a textfile to play with) + ident(lines)operator([)integer(0)operator(]) operator(=) string + ident(lines)operator([)integer(1)operator(]) operator(=) string + ident(lines)operator([)integer(2)operator(]) operator(=) string + ident(lines)operator([)integer(3)operator(]) operator(=) string + ident(lines)operator([)integer(4)operator(]) operator(=) string + + comment(# print the records in order.) + comment(# Opposed to perl, the tied array behaves exactly as a normal array) + ident(puts) string + reserved(for) ident(i) reserved(in) integer(0)operator(..)operator(()ident(lines)operator(.)ident(length)integer(-1)operator(\)) + ident(puts) stringcontent(: )inlinedelimiter(")> + reserved(end) + + comment(#use push and pop) + ident(a) operator(=) ident(lines)operator(.)ident(pop) + ident(lines)operator(.)ident(push)operator(()stringoperator(\)) + ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) + + comment(#use shift and unshift) + ident(a) operator(=) ident(lines)operator(.)ident(shift) + ident(lines)operator(.)ident(unshift)operator(()stringoperator(\)) + ident(puts)operator(()stringcontent(])delimiter(")>operator(\)) + + comment(# add record after record 2) + ident(i) operator(=) integer(2) + ident(lines)operator(.)ident(insert)operator(()ident(i) operator(+) integer(1)operator(,) stringoperator(\)) + + comment(# add record before record one) + ident(i) operator(=) integer(1) + ident(lines)operator(.)ident(insert)operator(()ident(i)operator(,) stringoperator(\)) + + comment(# delete record 3) + ident(lines)operator(.)ident(delete_at)operator(()integer(3)operator(\)) + + comment(#now print the records in reverse order) + ident(puts) string + operator(()ident(lines)operator(.)ident(length) operator(-) integer(1)operator(\))operator(.)ident(downto)operator(()integer(0)operator(\))operator({) operator(|)ident(i)operator(|) + ident(puts) stringcontent(: )inlinedelimiter(")> + operator(}) + +operator(}) + + +comment(# @@PLEAC@@_14.8) +comment(# example to store complex data in a database) +comment(# uses marshall from the standard library) +ident(require) string +ident(db) operator(=) constant(SDBM)operator(.)ident(open)operator(()stringoperator(,) integer(0666)operator(\)) + +comment(# convert the Objects into strings and back by using the Marshal module.) +comment(# Most normal objects can be converted out of the box,) +comment(# but not special things like procedure objects,) +comment(# IO instance variables, singleton objects) + +ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) +ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()operator([)stringoperator(,) +stringoperator(])operator(\)) + +ident(name1) operator(=) string +ident(name2) operator(=) string + +ident(tom1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name1)operator(])operator(\)) +ident(tom2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)ident(name2)operator(])operator(\)) + +ident(puts) stringcontent( )inlinedelimiter(")> + +reserved(if) ident(tom1)operator([)integer(0)operator(]) operator(==) ident(tom2)operator([)integer(0)operator(]) operator(&&) ident(tom1)operator([)integer(1)operator(]) operator(==) ident(tom2)operator([)integer(1)operator(]) + ident(puts) string +reserved(else) + ident(puts) string +reserved(end) + +comment(# To change parts of an entry, get the whole entry, change the parts,) +comment(# and save the whole entry back) +ident(entry) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(db)operator([)stringoperator(])operator(\)) +ident(entry)operator([)integer(0)operator(]) operator(=) string +ident(db)operator([)stringoperator(]) operator(=) constant(Marshal)operator(.)ident(dump)operator(()ident(entry)operator(\)) +ident(db)operator(.)ident(close) + + +comment(# @@PLEAC@@_14.9) +comment(# example to make data persistent) +comment(# uses Marshal from the standard lib) +comment(# Stores the data in a simple file,) +comment(# see 14.8 on how to store it in a dbm file) + +comment(# The BEGIN block is executed before the rest of the script) +comment(# we use global variables here because local variables) +comment(# will go out of scope and are not accessible from the main script) + +reserved(BEGIN) operator({) + global_variable($persistent_store) operator(=) string + reserved(begin) + constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(\)) reserved(do) operator(|)ident(f)operator(|) + global_variable($stringvariable1) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) + global_variable($arrayvariable2) operator(=) constant(Marshal)operator(.)ident(load)operator(()ident(f)operator(\)) + reserved(end) + reserved(rescue) + ident(puts) stringdelimiter(")> + comment(# Initialisation if this script runs the first time) + global_variable($stringvariable1) operator(=) string + global_variable($arrayvariable2) operator(=) operator([)operator(]) + reserved(end) +operator(}) + +reserved(END) operator({) + constant(File)operator(.)ident(open)operator(()global_variable($persistent_store)operator(,) stringoperator(\)) reserved(do) operator(|)ident(f)operator(|) + constant(Marshal)operator(.)ident(dump)operator(()global_variable($stringvariable1)operator(,) ident(f)operator(\)) + constant(Marshal)operator(.)ident(dump)operator(()global_variable($arrayvariable2)operator(,) ident(f)operator(\)) + reserved(end) +operator(}) + +comment(# simple test program) +ident(puts) global_variable($stringvariable1) +ident(puts) global_variable($arrayvariable2) +global_variable($stringvariable1) operator(=) string +global_variable($arrayvariable2)operator(.)ident(push)operator(()integer(5)operator(\)) +ident(puts) global_variable($stringvariable1) +ident(puts) global_variable($arrayvariable2) + + +comment(# @@PLEAC@@_14.10) +comment(#!/usr/bin/ruby -w) +comment(# Ruby has a dbi module with an architecture similar) +comment(# to the Perl dbi module: the dbi module provides an unified) +comment(# interface and uses specialized drivers for each dbms vendor) +comment(#) +reserved(begin) + constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) + operator(|)ident(dbh)operator(|) + + ident(dbh)operator(.)ident(do)operator(()constant(SQL1)operator(\)) + + ident(dbh)operator(.)ident(prepare)operator(()constant(SQL2)operator(\))operator({) operator(|)ident(sth)operator(|) + ident(sth)operator(.)ident(execute) + ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) + comment(# ...) + operator(}) + operator(}) comment(# end of block finishes the statement handle) + operator(}) comment(# end of block closes the database connection) +reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) + ident(puts) string + ident(puts) stringdelimiter(")> + ident(puts) stringdelimiter(")> +reserved(end) + +comment(#!/usr/bin/ruby -w) +comment(# dbusers - example for mysql which creates a table,) +comment(# fills it with values, retrieves the values back,) +comment(# and finally destroys the table.) + +ident(require) string + +comment(# replacement for the User::pwnt module) +reserved(def) method(getpwent) + ident(result) operator(=) operator([)operator(]) + constant(File)operator(.)ident(open)operator(()stringoperator(\)) operator({)operator(|)ident(file)operator(|) + ident(file)operator(.)ident(each_line) operator({)operator(|)ident(line)operator(|) + reserved(next) reserved(if) ident(line)operator(.)ident(match)operator(()regexpoperator(\)) + ident(cols) operator(=) ident(line)operator(.)ident(split)operator(()stringoperator(\)) + ident(result)operator(.)ident(push)operator(()operator([)ident(cols)operator([)integer(2)operator(])operator(,) ident(cols)operator([)integer(0)operator(])operator(])operator(\)) + operator(}) + operator(}) + ident(result) +reserved(end) + +reserved(begin) + constant(DBI)operator(.)ident(connect)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) + operator(|)ident(conn)operator(|) + + ident(conn)operator(.)ident(do)operator(()stringoperator(\)) + + ident(users) operator(=) ident(getpwent) + + ident(conn)operator(.)ident(prepare)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) + ident(users)operator(.)ident(each) operator({)operator(|)ident(entry)operator(|) + ident(sth)operator(.)ident(execute)operator(()ident(entry)operator([)integer(0)operator(])operator(,) ident(entry)operator([)integer(1)operator(])operator(\)) + operator(}) + operator(}) + + ident(conn)operator(.)ident(execute)operator(()stringoperator(\)) operator({)operator(|)ident(sth)operator(|) + ident(sth)operator(.)ident(fetch) operator({)operator(|)ident(row)operator(|) + ident(puts) ident(row)operator(.)ident(collect) operator({)operator(|)ident(col)operator(|) + reserved(if) ident(col)operator(.)ident(nil?) + string + reserved(else) + ident(col) + reserved(end) + operator(})operator(.)ident(join)operator(()stringoperator(\)) + operator(}) + operator(}) + + ident(conn)operator(.)ident(do)operator(()stringoperator(\)) + operator(}) +reserved(rescue) constant(DBI)operator(::)constant(DatabaseError) operator(=)operator(>) ident(e) + ident(puts) string + ident(puts) stringdelimiter(")> + ident(puts) stringdelimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_15.1) +comment(# This test program demonstrates parsing program arguments.) +comment(# It uses the optparse library, which is included with ruby 1.8) +comment(# It handles classic unix style and gnu style options) +ident(require) string + +instance_variable(@debugmode) operator(=) pre_constant(false) +instance_variable(@verbose) operator(=) pre_constant(false) + +pre_constant(ARGV)operator(.)ident(options) reserved(do) operator(|)ident(opts)operator(|) + ident(opts)operator(.)ident(banner) operator(=) stringcontent( [OPTIONS] INPUTFILES)delimiter(")> + + ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) operator({) + ident(puts) ident(opts) + ident(exit) + operator(}) + comment(# The OptionParser#on method is called with a specification of short) + comment(# options, of long options, a data type spezification and user help) + comment(# messages for this option.) + comment(# The method analyses the given parameter and decides what it is,) + comment(# so you can leave out the long option if you don't need it) + ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) stringoperator(\)) operator({) + operator(|)instance_variable(@verbose)operator(|) comment(# sets @verbose to true or false) + operator(}) + ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(TrueClass)operator(,) string operator(\))operator({) + operator(|)instance_variable(@debugmode)operator(|) comment(# sets @debugmode to true) + operator(}) + ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(Integer)operator(,) string operator(\))operator({) + operator(|)instance_variable(@count)operator(|) comment(# sets @count to given integer) + operator(}) + ident(opts)operator(.)ident(on)operator(()stringoperator(,) stringoperator(,) constant(String)operator(,) stringoperator(\))operator({) + operator(|)instance_variable(@outputfile)operator(|) comment(# sets @outputfile to given string) + operator(}) + ident(opts)operator(.)ident(parse!) +reserved(end) + +comment(# example to use the options in the main program) +ident(puts) string reserved(if) instance_variable(@verbose) +ident(puts) string reserved(if) instance_variable(@debugmode) +ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@outputfile) +ident(puts) stringdelimiter(")> reserved(if) reserved(defined?) instance_variable(@count) +pre_constant(ARGV)operator(.)ident(each) operator({) operator(|)ident(param)operator(|) + ident(puts) stringdelimiter(")> +operator(}) + + +comment(# @@PLEAC@@_15.4) +ident(buf) operator(=) string operator(*) integer(8) +global_variable($stdout)operator(.)ident(ioctl)operator(()integer(0x5413)operator(,) ident(buf)operator(\)) +ident(ws_row)operator(,) ident(ws_col)operator(,) ident(ws_xpixel)operator(,) ident(ws_ypixel) operator(=) ident(buf)operator(.)ident(unpack)operator(()stringoperator(\)) + +ident(raise) string reserved(unless) ident(ws_col) operator(>)operator(=) integer(20) +ident(max) operator(=) integer(0) +ident(values) operator(=) operator(()integer(1)operator(..)integer(5)operator(\))operator(.)ident(collect) operator({) ident(rand)operator(()integer(20)operator(\)) operator(}) comment(# generate an array[5] of rand values) +reserved(for) ident(i) reserved(in) ident(values) + ident(max) operator(=) ident(i) reserved(if) ident(max) operator(<) ident(i) +reserved(end) +ident(ratio) operator(=) ident(Float)operator(()ident(ws_col)integer(-12)operator(\))operator(/)ident(max) comment(# chars per unit) +reserved(for) ident(i) reserved(in) ident(values) + ident(printf) stringoperator(,) ident(i)operator(,) string operator(*) operator(()ident(ratio)operator(*)ident(i)operator(\)) +reserved(end) + +comment(# gives, for example:) +comment(# 15.0 *******************************) +comment(# 10.0 *********************) +comment(# 5.0 **********) +comment(# 14.0 *****************************) +comment(# 18.0 **************************************) + + +comment(# @@PLEAC@@_16.1) +ident(output) operator(=) shell comment(# collect output into one multiline string) +ident(output) operator(=) shelloperator(.)ident(split) comment(# collect output into array, one line per) +ident(element) + +ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) +ident(output) operator(=) string +reserved(while) ident(readme)operator(.)ident(gets) reserved(do) + ident(output) operator(+=) global_variable($_) +reserved(end) +ident(readme)operator(.)ident(close) + +shell comment(# BAD AND SCARY in Perl because it's managed by the shell) + comment(# I donna in Ruby ...) + +comment(# so the "clean and secure" version) +ident(readme)operator(,) ident(writeme) operator(=) constant(IO)operator(.)ident(pipe) +ident(pid) operator(=) ident(fork) operator({) + comment(# child) + global_variable($stdout) operator(=) ident(writeme) + ident(readme)operator(.)ident(close) + ident(exec)operator(()stringoperator(,) stringoperator(\)) +operator(}) +comment(# parent) +constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) +ident(writeme)operator(.)ident(close) +reserved(while) ident(readme)operator(.)ident(gets) reserved(do) + comment(# do something with $_) +reserved(end) + + +comment(# @@PLEAC@@_16.2) +ident(status) operator(=) ident(system)operator(()stringdelimiter(")>operator(\)) + +ident(status) operator(=) ident(system)operator(()stringoperator(,) ident(myfile)operator(\)) + +ident(system)operator(()stringoutfile)delimiter(")>operator(\)) +ident(system)operator(()stringoutfile 2>errfile)delimiter(")>operator(\)) + +comment(# stop if the command fails) +ident(raise) stringdelimiter(")> reserved(unless) ident(system)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) + +comment(# get the value of the signal sent to the child) +comment(# even if it is a SIGINT or SIGQUIT) +ident(system)operator(()ident(arglist)operator(\)) +ident(raise) stringdelimiter(")> reserved(if) operator(()global_variable($?) operator(&) integer(127)operator(\)) operator(!=) integer(0) + +ident(pid) operator(=) ident(fork) operator({) + ident(trap)operator(()stringoperator(,) stringoperator(\)) + ident(exec)operator(()stringoperator(,) stringoperator(\)) +operator(}) +ident(trap) operator(()stringoperator(\)) operator({) + ident(puts) string +operator(}) +constant(Process)operator(.)ident(waitpid)operator(()ident(pid)operator(,) integer(0)operator(\)) + +comment(# Ruby doesn't permit to lie to the program called by a 'system'.) +comment(# (ie specify what return argv[0] in C, $0 in Perl/Ruby ...\)) +comment(# A (dirty\) way is to create a link (under Unix\), run this link and) +comment(# erase it. Somebody has a best idea ?) + + +comment(# @@PLEAC@@_16.3) +ident(exec)operator(()stringoperator(\)) + +ident(exec)operator(()stringoperator(,) stringoperator(\)) + +ident(exec)operator(()stringoperator(\)) + + +comment(# @@PLEAC@@_16.4) +comment(# read the output of a program) +constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) operator({)operator(|)ident(readme)operator(|) + reserved(while) ident(readme)operator(.)ident(gets) reserved(do) + comment(# ...) + reserved(end) +operator(}) +comment(# or) +ident(readme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) +reserved(while) ident(readme)operator(.)ident(gets) reserved(do) + comment(# ...) +reserved(end) +ident(readme)operator(.)ident(close) + +comment(# "write" in a program) +constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) operator({)operator(|)ident(pipe)operator(|) + ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) + ident(pipe)operator(.)ident(puts)operator(()stringoperator(\)) +operator(}) + +comment(# close wait for the end of the process) +ident(read) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(\)) comment(# child goes to sleep) +ident(read)operator(.)ident(close) comment(# and the parent goes to lala land) + +ident(writeme) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,) stringoperator(\)) +ident(writeme)operator(.)ident(puts) string comment(# program will get hello\\n on STDIN) +ident(writeme)operator(.)ident(close) comment(# program will get EOF on STDIN) + +comment(# send in a pager (eg less\) all output) +global_variable($stdout) operator(=) constant(IO)operator(.)ident(popen)operator(()stringoperator(,)stringoperator(\)) +ident(print) string operator(*) integer(10000) + + +comment(# @@PLEAC@@_16.5) +comment(#-----------------------------) +reserved(def) method(head)operator(()ident(lines) operator(=) integer(20)operator(\)) + ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) + reserved(if) ident(pid) operator(==) pre_constant(nil) + reserved(return) + reserved(else) + reserved(while) ident(gets)operator(()operator(\)) reserved(do) + ident(pid)operator(.)ident(print) + ident(lines) operator(-=) integer(1) + reserved(break) reserved(if) ident(lines) operator(==) integer(0) + reserved(end) + reserved(end) + ident(exit) +reserved(end) + +ident(head)operator(()integer(100)operator(\)) +reserved(while) ident(gets)operator(()operator(\)) reserved(do) + ident(print) +reserved(end) +comment(#-----------------------------) +integer(1)operator(:) operator(>) constant(Welcome) ident(to) constant(Linux)operator(,) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) + +integer(2)operator(:) operator(>) + +integer(3)operator(:) operator(>) string so I installed Linux.)delimiter(")> +comment(#-----------------------------) +operator(>) integer(1)operator(:) constant(Welcome) ident(to) constant(Linux)operator(,) constant(Kernel) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) + +operator(>) integer(2)operator(:) + +operator(>) integer(3)operator(:) string 4: so I installed Linux.)delimiter(")> +comment(#-----------------------------) +comment(#!/usr/bin/ruby) +comment(# qnumcat - demo additive output filters) + +reserved(def) method(number)operator(()operator(\)) + ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) + reserved(if) ident(pid) operator(==) pre_constant(nil) + reserved(return) + reserved(else) + reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(printf)operator(()stringoperator(,) global_variable($.)operator(,) global_variable($_)operator(\))operator(;) reserved(end) + reserved(end) + ident(exit) +reserved(end) + +reserved(def) method(quote)operator(()operator(\)) + ident(pid) operator(=) ident(open)operator(()stringoperator(,)stringoperator(\)) + reserved(if) ident(pid) operator(==) pre_constant(nil) + reserved(return) + reserved(else) + reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(pid)operator(.)ident(print) string )inlinedelimiter(")> reserved(end) + reserved(end) + ident(exit) +reserved(end) + +ident(number)operator(()operator(\)) +ident(quote)operator(()operator(\)) + +reserved(while) ident(gets)operator(()operator(\)) reserved(do) + ident(print) +reserved(end) +global_variable($stdout)operator(.)ident(close) +ident(exit) + + +comment(# @@PLEAC@@_16.6) +pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) + ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) +operator(}) +reserved(for) ident(file) reserved(in) pre_constant(ARGV) + ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) + reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) + comment(# .......) + reserved(end) +reserved(end) +comment(#-----------------------------) +pre_constant(ARGV)operator(.)ident(map!) operator({) operator(|)ident(arg)operator(|) + ident(arg) operator(=)operator(~) regexp operator(?) stringdelimiter(")> operator(:) ident(arg) comment(#) +operator(}) +reserved(for) ident(file) reserved(in) pre_constant(ARGV) + ident(fh) operator(=) ident(open)operator(()ident(file)operator(\)) + reserved(while) ident(fh)operator(.)ident(gets)operator(()operator(\)) reserved(do) + comment(# .......) + reserved(end) +reserved(end) +comment(#-----------------------------) +ident(pwdinfo) operator(=) operator(()shell operator(=)operator(~) regexpoperator(\)) operator(?) string operator(:) stringoperator(;) +ident(pwd) operator(=) ident(open)operator(()ident(pwdinfo)operator(\))operator(;) +comment(#-----------------------------) +ident(puts) stringoperator(;) +ident(file) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\))operator(;) +ident(fh) operator(=) ident(open)operator(()ident(file)operator(\))operator(;) + + +comment(# @@PLEAC@@_16.7) +ident(output) operator(=) shell&1)delimiter(`)> comment(# with backticks) +comment(# or) +ident(ph) operator(=) ident(open)operator(()string&1)delimiter(")>operator(\)) comment(# with an open pipe) +reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) +comment(#-----------------------------) +ident(output) operator(=) shell/dev/null)delimiter(`)> comment(# with backticks) +comment(# or) +ident(ph) operator(=) ident(open)operator(()string/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) +reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) +comment(#-----------------------------) +ident(output) operator(=) shell&1 1>/dev/null)delimiter(`)> comment(# with backticks) +comment(# or) +ident(ph) operator(=) ident(open)operator(()string&1 1>/dev/null)delimiter(")>operator(\)) comment(# with an open pipe) +reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) +comment(#-----------------------------) +ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> comment(# with backticks) +comment(# or) +ident(ph) operator(=) ident(open)operator(()string&1 1>&2 2>&3 3>&-)delimiter(")>operator(\)) comment(# with an open pipe) +reserved(while) ident(ph)operator(.)ident(gets)operator(()operator(\)) operator({) operator(}) comment(# plus a read) +comment(#-----------------------------) +ident(system)operator(()string/tmp/program.stdout 2>/tmp/program.stderr)delimiter(")>operator(\)) +comment(#-----------------------------) +ident(output) operator(=) shell&1 1>&2 2>&3 3>&-)delimiter(`)> +comment(#-----------------------------) +ident(fd3) operator(=) ident(fd1) +ident(fd1) operator(=) ident(fd2) +ident(fd2) operator(=) ident(fd3) +ident(fd3) operator(=) pre_constant(nil) +comment(#-----------------------------) +ident(system)operator(()stringtmpfile 2>&1)delimiter(")>operator(\)) +ident(system)operator(()string&1 1>tmpfile)delimiter(")>operator(\)) +comment(#-----------------------------) +comment(# system ("prog args 1>tmpfile 2>&1"\) ) +ident(fd1) operator(=) string comment(# change stdout destination first) +ident(fd2) operator(=) ident(fd1) comment(# now point stderr there, too) +comment(#-----------------------------) +comment(# system("prog args 2>&1 1>tmpfile"\) ) +ident(fd2) operator(=) ident(fd1) comment(# stderr same destination as stdout) +ident(fd1) operator(=) string comment(# but change stdout destination ) +comment(#-----------------------------) +comment(# It is often better not to rely on the shell, ) +comment(# because of portability, possible security problems ) +comment(# and bigger resource usage. So, it is often better to use the open3 library. ) +comment(# See below for an example.) +comment(# opening stdin, stdout, stderr) +ident(require) string +ident(stdin)operator(,) ident(stdout)operator(,) ident(stderr) operator(=) constant(Open3)operator(.)ident(popen)operator(()stringoperator(\)) + + +comment(# @@PLEAC@@_16.8) +comment(#-----------------------------) +comment(# Contrary to perl, we don't need to use a module in Ruby) +ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program)operator(,) stringoperator(\)) +ident(fh)operator(.)ident(puts) string +ident(output) operator(=) ident(fh)operator(.)ident(gets)operator(()operator(\)) +ident(fh)operator(.)ident(close)operator(()operator(\)) +comment(#-----------------------------) +constant(Kernel)operator(.)ident(open)operator(()stringoperator(\))operator(,)stringoperator(\)) comment(# RIGHT !) +comment(#-----------------------------) +comment(# Ruby has already object methods for I/O handles) +comment(#-----------------------------) +reserved(begin) + ident(fh) operator(=) constant(Kernel)operator(.)ident(open)operator(()string operator(+) ident(program_and_options)operator(,) stringoperator(\)) +reserved(rescue) + reserved(if) operator(()global_variable($@) operator(~=) regexpoperator(\)) + global_variable($stderr)operator(.)ident(puts) stringcontent( )char(\\n)content( )inlinecontent( )char(\\n)delimiter(")> + reserved(break) + reserved(end) + ident(raise) comment(# reraise unforseen exception) +reserved(end) + + +comment(# @@PLEAC@@_16.13) +comment(#% kill -l) +comment(#HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE) +comment(#ALRM TERM CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM) +comment(#PROF WINCH POLL PWR) +comment(#-----------------------------) +comment(#% ruby -e 'puts Signal.list.keys.join(" "\)') +comment(#PWR USR1 BUS USR2 TERM SEGV KILL POLL STOP SYS TRAP IOT HUP INT #) +comment(#WINCH XCPU TTIN CLD TSTP FPE IO TTOU PROF CHLD CONT PIPE ABRT) +comment(#VTALRM QUIT ILL XFSZ URG ALRM) +comment(#-----------------------------) +comment(# After that, the perl script create an hash equivalent to Signal.list, ) +comment(# and an array. The array can be obtained by :) +ident(signame) operator(=) operator([)operator(]) +constant(Signal)operator(.)ident(list)operator(.)ident(each) operator({) operator(|)ident(name)operator(,) ident(i)operator(|) ident(signame)operator([)ident(i)operator(]) operator(=) ident(name) operator(}) + + +comment(# @@PLEAC@@_16.14) +constant(Process)operator(.)ident(kill)operator(()integer(9)operator(,) ident(pid)operator(\)) comment(# send $pid a signal 9) +constant(Process)operator(.)ident(kill)operator(()integer(-1)operator(,) constant(Process)operator(.)ident(getpgrp)operator(()operator(\))operator(\)) comment(# send whole job a signal 1) +constant(Process)operator(.)ident(kill)operator(()stringoperator(,) global_variable($$)operator(\)) comment(# send myself a SIGUSR1) +constant(Process)operator(.)ident(kill)operator(()stringoperator(,) ident(pid1)operator(,) ident(pid2)operator(,) ident(pid3)operator(\)) comment(# send a SIGHUP to processes in @pids) +comment(#-----------------------------) +reserved(begin) + constant(Process)operator(.)ident(kill)operator(()integer(0)operator(,) ident(minion)operator(\)) + ident(puts) stringcontent( is alive!)delimiter(")> +reserved(rescue) constant(Errno)operator(::)constant(EPERM) comment(# changed uid) + ident(puts) stringcontent( has escaped my control!)delimiter(")>operator(;) +reserved(rescue) constant(Errno)operator(::)constant(ESRCH) + ident(puts) stringcontent( is deceased.)delimiter(")>operator(;) comment(# or zombied) +reserved(rescue) + ident(puts) stringcontent( : )inlinedelimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_16.15) +constant(Kernel)operator(.)ident(trap)operator(()stringoperator(,) ident(got_sig_quit)operator(\)) comment(# got_sig_quit = Proc.new { puts "Quit\\n" }) +ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# def got_sig_pipe ...) +ident(trap)operator(()stringoperator(\)) operator({) ident(ouch)operator(+)operator(+) operator(}) comment(# increment ouch for every SIGINT) +comment(#-----------------------------) +ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# ignore the signal INT) +comment(#-----------------------------) +ident(trap)operator(()stringoperator(,) stringoperator(\)) comment(# restore default STOP signal handling) + + +comment(# @@PLEAC@@_16.16) +comment(# the signal handler) +reserved(def) method(ding) + ident(trap)operator(()stringoperator(,) stringoperator(\)) + ident(puts) string +reserved(end) + +comment(# prompt for name, overriding SIGINT) +reserved(def) method(get_name) + ident(save) operator(=) ident(trap)operator(()stringoperator(,) stringoperator(\)) + + ident(puts) string + ident(name) operator(=) ident(gets)operator(()operator(\))operator(.)ident(chomp)operator(()operator(\)) + ident(trap)operator(()stringoperator(,) ident(save)operator(\)) + ident(name) +reserved(end) + + +comment(# @@PLEAC@@_16.21) +comment(# implemented thanks to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/1760) +ident(require) string + +comment(# we'll do something vastly more useful than cookbook to demonstrate timeouts) +reserved(begin) + ident(timeout)operator(()integer(5)operator(\)) operator({) + ident(waitsec) operator(=) ident(rand)operator(()integer(10)operator(\)) + ident(puts) stringcontent( seconds is longer than 5 seconds...)delimiter(")> + ident(system)operator(()stringdelimiter(")>operator(\)) + operator(}) + ident(puts) string +reserved(rescue) constant(Timeout)operator(::)constant(Error) + ident(puts) string +reserved(end) + + +comment(# @@PLEAC@@_17.1) +comment(# A basic TCP client connection) +ident(require) string +reserved(begin) + ident(t) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) +reserved(rescue) + ident(puts) stringdelimiter(")> +reserved(else) + comment(# ... do something with the socket) + ident(t)operator(.)ident(print) string + ident(answer) operator(=) ident(t)operator(.)ident(gets)operator(()pre_constant(nil)operator(\)) + comment(# and terminate the connection when we're done) + ident(t)operator(.)ident(close) +reserved(end) + +comment(# Using the evil low level socket API) +ident(require) string +comment(# create a socket) +ident(s) operator(=) constant(Socket)operator(.)ident(new)operator(()constant(Socket)operator(::)constant(AF_INET)operator(,) constant(Socket)operator(::)constant(SOCK_STREAM)operator(,) integer(0)operator(\)) +comment(# build the address of the remote machine) +ident(sockaddr_server) operator(=) operator([)constant(Socket)operator(::)constant(AF_INET)operator(,) integer(80)operator(,) + constant(Socket)operator(.)ident(gethostbyname)operator(()stringoperator(\))operator([)integer(3)operator(])operator(,) + integer(0)operator(,) integer(0)operator(])operator(.)ident(pack)operator(()stringoperator(\)) +comment(# connect) +reserved(begin) + ident(s)operator(.)ident(connect)operator(()ident(sockaddr_server)operator(\)) +reserved(rescue) + ident(puts) stringdelimiter(")> +reserved(else) + comment(# ... do something with the socket) + ident(s)operator(.)ident(print) string + comment(# and terminate the connection when we're done) + ident(s)operator(.)ident(close) +reserved(end) + +comment(# TCP connection with management of error (DNS\)) +ident(require) string +reserved(begin) + ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) +reserved(rescue) + ident(puts) stringdelimiter(")> +reserved(end) + +comment(# TCP connection with a time out) +ident(require) string +ident(require) string +reserved(begin) + ident(timeout)operator(()integer(1)operator(\)) reserved(do) comment(#the server has one second to answer) + ident(client) operator(=) constant(TCPSocket)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\)) + reserved(end) +reserved(rescue) + ident(puts) stringdelimiter(")> +reserved(end) + + +comment(# @@PLEAC@@_17.12) +ident(require) string + +reserved(class) class(Preforker) + ident(attr_reader) operator(()symbol(:child_count)operator(\)) + + reserved(def) method(initialize)operator(()ident(prefork)operator(,) ident(max_clients_per_child)operator(,) ident(port)operator(,) ident(client_handler)operator(\)) + instance_variable(@prefork) operator(=) ident(prefork) + instance_variable(@max_clients_per_child) operator(=) ident(max_clients_per_child) + instance_variable(@port) operator(=) ident(port) + instance_variable(@child_count) operator(=) integer(0) + + instance_variable(@reaper) operator(=) ident(proc) operator({) + ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) + ident(pid) operator(=) constant(Process)operator(.)ident(wait) + instance_variable(@child_count) operator(-=) integer(1) + operator(}) + + instance_variable(@huntsman) operator(=) ident(proc) operator({) + ident(trap)operator(()stringoperator(,) stringoperator(\)) + ident(trap)operator(()stringoperator(,) stringoperator(\)) + constant(Process)operator(.)ident(kill)operator(()stringoperator(,) integer(0)operator(\)) + ident(exit) + operator(}) + + instance_variable(@client_handler)operator(=)ident(client_handler) + reserved(end) + + reserved(def) method(child_handler) + ident(trap)operator(()stringoperator(,) stringoperator(\)) + instance_variable(@client_handler)operator(.)ident(setUp) + comment(# wish: sigprocmask UNblock SIGINT) + instance_variable(@max_clients_per_child)operator(.)ident(times) operator({) + ident(client) operator(=) instance_variable(@server)operator(.)ident(accept) reserved(or) reserved(break) + instance_variable(@client_handler)operator(.)ident(handle_request)operator(()ident(client)operator(\)) + ident(client)operator(.)ident(close) + operator(}) + instance_variable(@client_handler)operator(.)ident(tearDown) + reserved(end) + + reserved(def) method(make_new_child) + comment(# wish: sigprocmask block SIGINT) + instance_variable(@child_count) operator(+=) integer(1) + ident(pid) operator(=) ident(fork) reserved(do) + ident(child_handler) + reserved(end) + comment(# wish: sigprocmask UNblock SIGINT) + reserved(end) + + reserved(def) method(run) + instance_variable(@server) operator(=) constant(TCPserver)operator(.)ident(open)operator(()instance_variable(@port)operator(\)) + ident(trap)operator(()stringoperator(,) instance_variable(@reaper)operator(\)) + ident(trap)operator(()stringoperator(,) instance_variable(@huntsman)operator(\)) + ident(loop) operator({) + operator(()instance_variable(@prefork) operator(-) instance_variable(@child_count)operator(\))operator(.)ident(times) operator({) operator(|)ident(i)operator(|) + ident(make_new_child) + operator(}) + ident(sleep) operator(.)integer(1) + operator(}) + reserved(end) +reserved(end) + +comment(#-----------------------------) +comment(#!/usr/bin/ruby) + +ident(require) string + +reserved(class) class(ClientHandler) + reserved(def) method(setUp) + reserved(end) + + reserved(def) method(tearDown) + reserved(end) + + reserved(def) method(handle_request)operator(()ident(client)operator(\)) + comment(# do stuff) + reserved(end) +reserved(end) + +ident(server) operator(=) constant(Preforker)operator(.)ident(new)operator(()integer(1)operator(,) integer(100)operator(,) integer(3102)operator(,) constant(ClientHandler)operator(.)ident(new)operator(\)) +ident(server)operator(.)ident(run) + + +comment(# @@PLEAC@@_18.2) +ident(require) string + +reserved(begin) + ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) + ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) + ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) + ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) + ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(print) string operator(+) global_variable($!) +reserved(ensure) + ident(ftp)operator(.)ident(close)operator(()operator(\)) reserved(if) ident(ftp) +reserved(end) + +comment(# A better solution for a local use could be :) +constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) reserved(do) operator(|)ident(ftp)operator(|) + ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,)ident(password)operator(\)) + ident(ftp)operator(.)ident(chdir)operator(()ident(directory)operator(\)) + ident(ftp)operator(.)ident(get)operator(()ident(filename)operator(\)) + ident(ftp)operator(.)ident(put)operator(()ident(filename)operator(\)) +reserved(end) + +comment(# If you have only one file to get, there is a simple solution :) +ident(require) string +ident(open)operator(()stringoperator(\)) reserved(do) operator(|)ident(fh)operator(|) + comment(# read from filehandle fh) +reserved(end) +comment(#--------------------------------------------) +comment(# to wait a defined time for the connection, ) +comment(# use the timeout module) +ident(require) string +reserved(begin) + ident(timeout)operator(()integer(30)operator(\))operator({) + ident(ftp) operator(=) constant(Net)operator(::)constant(FTP)operator(::)ident(new)operator(()stringoperator(\)) + ident(ftp)operator(.)ident(debug_mode) operator(=) pre_constant(true) + operator(}) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(puts) string +reserved(rescue) constant(Timeout)operator(::)constant(Error) + global_variable($stderr)operator(.)ident(puts) string +reserved(end) + +reserved(begin) + ident(ftp)operator(.)ident(login)operator(()operator(\)) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(print) string +reserved(end) + +reserved(begin) + ident(ftp)operator(.)ident(login)operator(()ident(username)operator(\)) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(print) string +reserved(end) + +reserved(begin) + ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(print) string +reserved(end) + +reserved(begin) + ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(,) ident(account)operator(\)) +reserved(rescue) constant(Net)operator(::)constant(FTPError) + global_variable($stderr)operator(.)ident(print) string +reserved(end) +comment(#-----------------------------) +ident(ftp)operator(.)ident(put)operator(()ident(localfile)operator(,) ident(remotefile)operator(\)) +comment(#-----------------------------) +comment(# Sending data from STDIN is not directly supported ) +comment(# by the ftp library module. A possible way to do it is to use the ) +comment(# storlines method directly to send raw commands to the ftp server.) +comment(#-----------------------------) +ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(,) ident(localfile)operator(\)) +comment(#-----------------------------) +ident(ftp)operator(.)ident(get)operator(()ident(remotefile)operator(\)) operator({) operator(|)ident(data)operator(|) ident(puts) ident(data) operator(}) +comment(#-----------------------------) +ident(ftp)operator(.)ident(chdir)operator(()stringoperator(\)) +ident(print) stringoperator(,) ident(ftp)operator(.)ident(pwd)operator(()operator(\))operator(,) string +comment(#-----------------------------) +ident(ftp)operator(.)ident(mkdir)operator(()stringoperator(\)) +comment(#-----------------------------) +ident(lines) operator(=) ident(ftp)operator(.)ident(ls)operator(()stringoperator(\)) +comment(# => ["drwxr-xr-x 2 matz users 4096 July 17 1998 1.0", ... ]) + +ident(latest) operator(=) ident(ftp)operator(.)ident(dir)operator(()stringoperator(\))operator(.)ident(sort)operator(.)ident(last) + +ident(ftp)operator(.)ident(nlst)operator(()stringoperator(\)) +comment(# => ["/pub/ruby/1.0", ... ]) +comment(#-----------------------------) +ident(ftp)operator(.)ident(quit)operator(()operator(\)) + + +comment(# @@PLEAC@@_18.6) +ident(require) string +ident(t) operator(=) constant(Net)operator(::)constant(Telnet)operator(::)ident(new)operator(() string operator(=)operator(>) integer(10)operator(,) + string operator(=)operator(>) regexpoperator(,) + string operator(=)operator(>) ident(host) operator(\)) +ident(t)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) +ident(files) operator(=) ident(t)operator(.)ident(cmd)operator(()stringoperator(\)) +ident(t)operator(.)ident(print)operator(()stringoperator(\)) +ident(process_string) operator(=) ident(t)operator(.)ident(waitfor)operator(()regexpoperator(\)) +ident(t)operator(.)ident(close) +comment(#-----------------------------) +regexp] )char(\\z)delimiter(/)modifier(n)> +comment(#-----------------------------) +comment(# In case of an error, the telnet module throws an exception.) +comment(# For control of the behavior in case of an error,) +comment(# you just need to catch the exceptions and do your custom) +comment(# error handling.) +comment(#-----------------------------) +reserved(begin) + ident(telnet)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\)) +reserved(rescue) constant(TimeoutError) + ident(fail) string +reserved(end) +comment(#-----------------------------) +ident(telnet)operator(.)ident(waitfor)operator(()stringoperator(\)) +comment(#-----------------------------) +ident(telnet)operator(.)ident(waitfor)operator(()constant(String) operator(=)operator(>) stringoperator(,) constant(Timeout) operator(=)operator(>) integer(30)operator(\)) + + +comment(# @@PLEAC@@_18.7) +ident(require) string + +ident(puts) stringcontent( is alive.)char(\\n)delimiter(")> reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()ident(host)operator(\))operator(;) +comment(#-----------------------------) +comment(# the ping module only use TCP ping, not ICMP even if we are root) +reserved(if) constant(Ping)operator(.)ident(pingecho)operator(()stringoperator(\)) + ident(puts) stringoperator(;) +reserved(else) + ident(puts) stringoperator(;) +reserved(end) + + +comment(# @@PLEAC@@_19.0) +comment(#-----------------------------) +comment(# http://www.perl.com/CPAN/) +comment(# http://www.perl.com:8001/bad/mojo.html) +comment(# ftp://gatekeeper.dec.com/pub/misc/netlib.tar.Z) +comment(# ftp://anonymous@myplace:gatekeeper.dec.com/pub/misc/netlib.tar.Z) +comment(# file:///etc/motd) +comment(#-----------------------------) +comment(# http://mox.perl.com/cgi-bin/program?name=Johann&born=1685) +comment(#-----------------------------) +comment(# http://mox.perl.com/cgi-bin/program) +comment(#-----------------------------) + + +comment(# @@PLEAC@@_19.1) +comment(#!/usr/local/bin/ruby -w) +comment(# hiweb - load CGI class to decode information given by web server) + +ident(require) string + +ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) + +comment(# get a parameter from a form) +ident(value) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) + +comment(# output a document) +ident(cgi)operator(.)ident(out) operator({) + ident(cgi)operator(.)ident(html) operator({) + ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) + ident(cgi)operator(.)ident(body) operator({) ident(cgi)operator(.)ident(p) operator({) string operator(+) ident(cgi)operator(.)ident(tt) operator({) + constant(CGI)operator(.)ident(escapeHTML)operator(()ident(value)operator(\)) operator(}) operator(}) operator(}) + operator(}) +operator(}) + +ident(require) string +ident(cgi) operator(=) constant(CGI)operator(.)ident(new) +ident(who) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) comment(# first param in list) +ident(phone) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(])operator([)integer(0)operator(]) +ident(picks) operator(=) ident(cgi)operator(.)ident(param)operator([)stringoperator(]) comment(# complete list) + +ident(print) ident(cgi)operator(.)ident(header)operator(() string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\)) operator(\)) + + +comment(# @@PLEAC@@_19.3) +comment(#!/usr/local/bin/ruby -w) +comment(# webwhoami - show web user's id) +ident(require) string +ident(print) string +ident(print) string operator(+) constant(Etc)operator(.)ident(getpwuid)operator(.)ident(name) operator(+) string + +comment(# % ruby -wc cgi-script # just check syntax) + +comment(# % ruby -w cgi-script # params from stdin) +comment(# (offline mode: enter name=value pairs on standard input\)) +comment(# name=joe) +comment(# number=10) +comment(# ^D) + +comment(# % ruby -w cgi-script name=joe number=10 # run with mock form input) +comment(# % ruby -d cgi-script name=joe number=10 # ditto, under the debugger) + +comment(# POST method script in csh) +comment(# % (setenv HTTP_METHOD POST; ruby -w cgi-script name=joe number=10\)) +comment(# POST method script in sh) +comment(# % HTTP_METHOD=POST perl -w cgi-script name=joe number=10) + + +comment(# @@PLEAC@@_19.4) +comment(# ruby has several security levels, the level "1" is similar to perls taint mode.) +comment(# It can be switched on by providing the -T command line parameter) +comment(# or by setting $SAFE to 1. Setting $SAFE to 2,3 or 4 restricts possible) +comment(# harmful operations further.) + +comment(#!/usr/bin/ruby -T) +global_variable($SAFE) operator(=) integer(1) +constant(File)operator(.)ident(open)operator(()pre_constant(ARGV)operator([)integer(0)operator(])operator(,) stringoperator(\)) +comment(# ruby warns with:) +comment(# taint1.rb:2:in `initialize': Insecure operation - initialize (SecurityError\)) + +global_variable($SAFE) operator(=) integer(1) +ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) +reserved(unless) regexpoperator(.)ident(match)operator(()ident(file)operator(\)) + ident(raise) stringcontent( has invalid characters)delimiter(")> +reserved(end) +ident(file) operator(=) global_variable($1) +comment(# In ruby, even the back reference from a regular expression stays tainted.) +comment(# you need to explicitly untaint the variable:) +ident(file)operator(.)ident(untaint) +constant(File)operator(.)ident(open)operator(()ident(file)operator(,) stringoperator(\)) + +comment(# Race condition exists like in perl:) +reserved(unless) constant(File)operator(.)ident(exists)operator(()ident(filename)operator(\)) comment(# Wrong because of race condition) + constant(File)operator(.)ident(open)operator(()ident(filename)operator(,) stringoperator(\)) +reserved(end) + + +comment(# @@PLEAC@@_19.8) +ident(url) operator(=) string +ident(print) stringchar(\\r)char(\\n)char(\\r)char(\\n)delimiter(")> +ident(exit) + +comment(#!/usr/bin/ruby) +ident(require) string + +ident(cgi) operator(=) constant(CGI)operator(.)ident(new) +ident(oreo) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) constant(Time)operator(.)ident(now) operator(+) operator(()integer(3) operator(*) integer(30) operator(*) integer(24) operator(*) integer(60) operator(*) integer(60)operator(\))operator(,) + string operator(=)operator(>) stringoperator(\)) + +ident(whither) operator(=) string + +ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) ident(oreo)operator(,) + string operator(=)operator(>) ident(whither)operator(\))operator({)stringoperator(}) + +comment(#!/usr/bin/ruby) +comment(# os_snipe - redirect to a Jargon File entry about current OS) +ident(dir) operator(=) string + +ident(agent) operator(=) constant(ENV)operator([)stringoperator(]) + +ident(page) operator(=) reserved(case) + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(when) ident(agent) operator(=)operator(~) regexpoperator(:) string + reserved(else) string +reserved(end) + +ident(print) stringcontent(/)inlinechar(\\n)char(\\n)delimiter(")> + +ident(require) string +ident(cgi) operator(=) constant(CGI)operator(.)ident(new) +ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) stringoperator(\))operator({)stringoperator(}) +comment(# this produces:) +comment(# Status: 204 No response) +comment(# Content-Type: text/html) +comment(# Content-Length: 0) +comment(# ) + + +comment(# @@PLEAC@@_19.10) +ident(preference_value) operator(=) ident(cgi)operator(.)ident(cookies)operator([)stringoperator(])operator([)integer(0)operator(]) + +ident(packed_cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(()string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) stringoperator(,) + string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) + constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) + +ident(cgi)operator(.)ident(header)operator(()string operator(=)operator(>) operator([)ident(packed_cookie)operator(])operator(\)) + +comment(#!/usr/local/bin/ruby -w) +comment(# ic_cookies - sample CGI script that uses a cookie) +ident(require) string + +ident(cgi) operator(=) constant(CGI)operator(.)ident(new)operator(()stringoperator(\)) + +ident(cookname) operator(=) string +ident(favorite) operator(=) ident(cgi)operator(.)ident(params)operator([)stringoperator(])operator([)integer(0)operator(]) +ident(tasty) operator(=) ident(cgi)operator(.)ident(cookies)operator([)ident(cookname)operator(])operator([)integer(0)operator(]) operator(||) string + +reserved(unless) ident(favorite) + ident(cgi)operator(.)ident(out) operator({) + ident(cgi)operator(.)ident(html) operator({) + ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) + ident(cgi)operator(.)ident(body) operator({) + ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) + ident(cgi)operator(.)ident(hr) operator(+) + ident(cgi)operator(.)ident(form) operator({) + ident(cgi)operator(.)ident(p) operator({) string operator(+) + ident(cgi)operator(.)ident(text_field)operator(()stringoperator(,) ident(tasty) operator(\)) operator(}) + operator(}) operator(+) + ident(cgi)operator(.)ident(hr) + operator(}) + operator(}) + operator(}) +reserved(else) + ident(cookie) operator(=) constant(CGI)operator(::)constant(Cookie)operator(.)ident(new)operator(() string operator(=)operator(>) ident(cookname)operator(,) + string operator(=)operator(>) ident(favorite)operator(,) + string operator(=)operator(>) constant(Time)operator(.)ident(local)operator(()constant(Time)operator(.)ident(now)operator(.)ident(year) operator(+) integer(2)operator(,) +constant(Time)operator(.)ident(now)operator(.)ident(mon)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(day)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(hour)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(min)operator(,) constant(Time)operator(.)ident(now)operator(.)ident(sec)operator(\)) operator(\)) + ident(cgi)operator(.)ident(out)operator(()string operator(=)operator(>) operator([)ident(cookie)operator(])operator(\)) operator({) + ident(cgi)operator(.)ident(html) operator({) + ident(cgi)operator(.)ident(head) operator({) ident(cgi)operator(.)ident(title) operator({) string operator(}) operator(}) operator(+) + ident(cgi)operator(.)ident(body) operator({) + ident(cgi)operator(.)ident(h1) operator({) string operator(}) operator(+) + ident(cgi)operator(.)ident(p) operator({) stringcontent('.)delimiter(")> operator(}) + operator(}) + operator(}) + operator(}) +reserved(end) + + +comment(# @@PLEAC@@_20.9) +reserved(def) method(templatefile)operator(()ident(filename)operator(,) ident(fillings)operator(\)) + ident(aFile) operator(=) constant(File)operator(.)ident(new)operator(()ident(filename)operator(,) stringoperator(\)) + ident(text) operator(=) ident(aFile)operator(.)ident(read)operator(()operator(\)) + ident(aFile)operator(.)ident(close)operator(()operator(\)) + ident(pattern) operator(=) constant(Regexp)operator(.)ident(new)operator(()stringoperator(\)) + ident(text)operator(.)ident(gsub!)operator(()ident(pattern)operator(\)) operator({) + ident(fillings)operator([)global_variable($1)operator(]) operator(||) string + operator(}) + ident(text) +reserved(end) + +ident(fields) operator(=) operator({) + string operator(=)operator(>) ident(whats_his_name)operator(,) + string operator(=)operator(>) ident(login_count)operator(,) + string operator(=)operator(>) ident(minutes_used) +operator(}) +ident(puts) ident(templatefile)operator(()stringoperator(,) ident(fields)operator(\)) + +comment(# @@INCOMPLETE@@) +comment(# An example using databases is missing) + + diff --git a/test/ruby/quotes.out.raydebug b/test/ruby/quotes.out.raydebug index 8c19169..61fff05 100644 --- a/test/ruby/quotes.out.raydebug +++ b/test/ruby/quotes.out.raydebug @@ -1,3 +1,3 @@ -ident(puts) stringoperator(*)integer(5)delimiter(})>delimiter(})>operator(*)integer(7)delimiter(})>content(, immer wieder)char(\\n)delimiter(})>operator(*)integer(5) - -ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) +ident(puts) stringoperator(*)integer(5)delimiter(})>delimiter(})>operator(*)integer(7)delimiter(})>content(, immer wieder)char(\\n)delimiter(})>operator(*)integer(5) + +ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) diff --git a/test/ruby/sidebarize.out.raydebug b/test/ruby/sidebarize.out.raydebug index f9c3662..fb7e255 100644 --- a/test/ruby/sidebarize.out.raydebug +++ b/test/ruby/sidebarize.out.raydebug @@ -1,145 +1,145 @@ -comment(#!/usr/bin/env ruby) -comment(# Sidebarize is a quite simple converter, like a lot others.) -comment(# But in one way Sidebarize is special: it converts) -comment(# feeds into HTML-pages suitable for sidebars in Gecko-browsers.) - -comment(# import support for all kinds of feeds) -ident(require) string -ident(require) string -ident(require) string -comment(# import support for encodings) -ident(require) string -comment(# import support for CGI) -ident(require) string -comment(# import support for getting files from URLs) -ident(require) string -ident(require) string - -constant(Version) operator(=) string - -constant(Header) operator(=) string - - - %s Sidebar - - - - - -

%s

)delimiter(\))> - -constant(Footer) operator(=) string - - generated by Sidebarize %s -

- -)delimiter(\))> - -constant(Entry) operator(=) string - - %s - )delimiter(\))> - -reserved(class) class(FeedConverter) - reserved(def) method(initialize) - instance_variable(@xml_source) operator(=) string - instance_variable(@feed_data) operator(=) operator([)operator(]) - instance_variable(@feed_version) operator(=) string - instance_variable(@feed_description) operator(=) string - reserved(end) - - reserved(def) method(from_file)operator(()ident(filename)operator(\)) - ident(f) operator(=) constant(File)operator(::)ident(open)operator(()ident(filename)operator(\)) - instance_variable(@xml_source) operator(=) ident(f)operator(.)ident(read) - ident(f)operator(.)ident(close) - reserved(end) - - reserved(def) method(from_url)operator(()ident(url)operator(\)) - instance_variable(@xml_source) operator(=) constant(Net)operator(::)constant(HTTP)operator(.)ident(get)operator(()constant(URI)operator(.)ident(parse)operator(()ident(url)operator(\))operator(\)) - reserved(end) - - reserved(def) method(parse) - ident(feed) operator(=) constant(RSS)operator(::)constant(Parser)operator(.)ident(parse)operator(()instance_variable(@xml_source)operator(\)) - instance_variable(@feed_description) operator(=) ident(feed)operator(.)ident(channel)operator(.)ident(description) - instance_variable(@feed_name) operator(=) ident(feed)operator(.)ident(channel)operator(.)ident(title) - - - ident(feed)operator(.)ident(items)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) - ident(item_data) operator(=) operator({)operator(}) - ident(item_data)operator([)stringoperator(]) operator(=) ident(item)operator(.)ident(title) - ident(item_data)operator([)stringoperator(]) operator(=) ident(item)operator(.)ident(link) - instance_variable(@feed_data) operator(<<) ident(item_data) - reserved(end) - reserved(end) - - comment(# Output HTML from the internal data structure) - reserved(def) method(to_html) - comment(# header) - ident(puts) constant(Header) operator(%) operator([)ident(convert_entity)operator(()instance_variable(@feed_name)operator(\))operator(,) ident(convert_entity)operator(()instance_variable(@feed_description)operator(\))operator(]) - - comment(# the entries) - instance_variable(@feed_data)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) - ident(puts) constant(Entry) operator(%) operator([)ident(item)operator([)stringoperator(])operator(,) ident(convert_entity)operator(()ident(item)operator([)stringoperator(])operator(\))operator(]) - reserved(end) - - comment(# footer) - ident(print) constant(Footer) operator(%) constant(Version) - reserved(end) -reserved(end) - -comment(# Converts entities) -comment(# uses code by murphy extended with iconv conversion) -reserved(def) method(convert_entity)operator(()ident(text)operator(\)) - ident(text) operator(=) constant(Iconv)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(.)ident(iconv)operator(()ident(text)operator(\)) - - ident(feed) operator(=) ident(text)operator(.)ident(inspect)operator([)integer(1)operator(...)integer(-1)operator(]) - - ident(feed)operator(.)ident(gsub!)operator(()regexpoperator(\)) reserved(do) - reserved(if) global_variable($2) - global_variable($&) - reserved(else) - string operator(%) global_variable($1)operator(.)ident(to_i)operator(()integer(8)operator(\))operator(.)ident(to_s)operator(()integer(10)operator(\)) - reserved(end) - reserved(end) - - ident(feed)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) - - reserved(return) ident(feed) -reserved(end) - -comment(# Starter) -reserved(def) method(main) - ident(fc) operator(=) constant(FeedConverter)operator(.)ident(new) - ident(cgi) operator(=) constant(CGI)operator(.)ident(new) - reserved(if) ident(cgi)operator(.)ident(has_key?) string - comment(# yeah, the user pointed us to an URL) - ident(fc)operator(.)ident(from_url)operator(()ident(cgi)operator([)stringoperator(])operator(\)) - comment(#fc.from_file('sd.xml'\)) - comment(#fc.from_file('sbarize_design.html'\)) - - reserved(begin) - comment(# try to parse it and to generate HTML) - ident(fc)operator(.)ident(parse) - - ident(puts) string - ident(puts) - ident(fc)operator(.)ident(to_html) - reserved(rescue) - comment(# parsing failed so show an error message) - ident(puts) string - ident(puts) - ident(puts) constant(Header) operator(%) operator([)stringoperator(,) stringoperator(]) - ident(puts) constant(Footer) operator(%) constant(Version) - reserved(end) - reserved(else) - comment(# no, we've got no URL, generate error message) - ident(puts) string - ident(puts) - ident(puts) constant(Header) operator(%) operator([)stringoperator(,) stringoperator(]) - ident(puts) constant(Footer) operator(%) constant(Version) - reserved(end) -reserved(end) - +comment(#!/usr/bin/env ruby) +comment(# Sidebarize is a quite simple converter, like a lot others.) +comment(# But in one way Sidebarize is special: it converts) +comment(# feeds into HTML-pages suitable for sidebars in Gecko-browsers.) + +comment(# import support for all kinds of feeds) +ident(require) string +ident(require) string +ident(require) string +comment(# import support for encodings) +ident(require) string +comment(# import support for CGI) +ident(require) string +comment(# import support for getting files from URLs) +ident(require) string +ident(require) string + +constant(Version) operator(=) string + +constant(Header) operator(=) string + + + %s Sidebar + + + + + +

%s

)delimiter(\))> + +constant(Footer) operator(=) string + + generated by Sidebarize %s +

+ +)delimiter(\))> + +constant(Entry) operator(=) string + + %s + )delimiter(\))> + +reserved(class) class(FeedConverter) + reserved(def) method(initialize) + instance_variable(@xml_source) operator(=) string + instance_variable(@feed_data) operator(=) operator([)operator(]) + instance_variable(@feed_version) operator(=) string + instance_variable(@feed_description) operator(=) string + reserved(end) + + reserved(def) method(from_file)operator(()ident(filename)operator(\)) + ident(f) operator(=) constant(File)operator(::)ident(open)operator(()ident(filename)operator(\)) + instance_variable(@xml_source) operator(=) ident(f)operator(.)ident(read) + ident(f)operator(.)ident(close) + reserved(end) + + reserved(def) method(from_url)operator(()ident(url)operator(\)) + instance_variable(@xml_source) operator(=) constant(Net)operator(::)constant(HTTP)operator(.)ident(get)operator(()constant(URI)operator(.)ident(parse)operator(()ident(url)operator(\))operator(\)) + reserved(end) + + reserved(def) method(parse) + ident(feed) operator(=) constant(RSS)operator(::)constant(Parser)operator(.)ident(parse)operator(()instance_variable(@xml_source)operator(\)) + instance_variable(@feed_description) operator(=) ident(feed)operator(.)ident(channel)operator(.)ident(description) + instance_variable(@feed_name) operator(=) ident(feed)operator(.)ident(channel)operator(.)ident(title) + + + ident(feed)operator(.)ident(items)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) + ident(item_data) operator(=) operator({)operator(}) + ident(item_data)operator([)stringoperator(]) operator(=) ident(item)operator(.)ident(title) + ident(item_data)operator([)stringoperator(]) operator(=) ident(item)operator(.)ident(link) + instance_variable(@feed_data) operator(<<) ident(item_data) + reserved(end) + reserved(end) + + comment(# Output HTML from the internal data structure) + reserved(def) method(to_html) + comment(# header) + ident(puts) constant(Header) operator(%) operator([)ident(convert_entity)operator(()instance_variable(@feed_name)operator(\))operator(,) ident(convert_entity)operator(()instance_variable(@feed_description)operator(\))operator(]) + + comment(# the entries) + instance_variable(@feed_data)operator(.)ident(each) reserved(do) operator(|)ident(item)operator(|) + ident(puts) constant(Entry) operator(%) operator([)ident(item)operator([)stringoperator(])operator(,) ident(convert_entity)operator(()ident(item)operator([)stringoperator(])operator(\))operator(]) + reserved(end) + + comment(# footer) + ident(print) constant(Footer) operator(%) constant(Version) + reserved(end) +reserved(end) + +comment(# Converts entities) +comment(# uses code by murphy extended with iconv conversion) +reserved(def) method(convert_entity)operator(()ident(text)operator(\)) + ident(text) operator(=) constant(Iconv)operator(.)ident(new)operator(()stringoperator(,) stringoperator(\))operator(.)ident(iconv)operator(()ident(text)operator(\)) + + ident(feed) operator(=) ident(text)operator(.)ident(inspect)operator([)integer(1)operator(...)integer(-1)operator(]) + + ident(feed)operator(.)ident(gsub!)operator(()regexpoperator(\)) reserved(do) + reserved(if) global_variable($2) + global_variable($&) + reserved(else) + string operator(%) global_variable($1)operator(.)ident(to_i)operator(()integer(8)operator(\))operator(.)ident(to_s)operator(()integer(10)operator(\)) + reserved(end) + reserved(end) + + ident(feed)operator(.)ident(gsub!)operator(()stringoperator(,) stringoperator(\)) + + reserved(return) ident(feed) +reserved(end) + +comment(# Starter) +reserved(def) method(main) + ident(fc) operator(=) constant(FeedConverter)operator(.)ident(new) + ident(cgi) operator(=) constant(CGI)operator(.)ident(new) + reserved(if) ident(cgi)operator(.)ident(has_key?) string + comment(# yeah, the user pointed us to an URL) + ident(fc)operator(.)ident(from_url)operator(()ident(cgi)operator([)stringoperator(])operator(\)) + comment(#fc.from_file('sd.xml'\)) + comment(#fc.from_file('sbarize_design.html'\)) + + reserved(begin) + comment(# try to parse it and to generate HTML) + ident(fc)operator(.)ident(parse) + + ident(puts) string + ident(puts) + ident(fc)operator(.)ident(to_html) + reserved(rescue) + comment(# parsing failed so show an error message) + ident(puts) string + ident(puts) + ident(puts) constant(Header) operator(%) operator([)stringoperator(,) stringoperator(]) + ident(puts) constant(Footer) operator(%) constant(Version) + reserved(end) + reserved(else) + comment(# no, we've got no URL, generate error message) + ident(puts) string + ident(puts) + ident(puts) constant(Header) operator(%) operator([)stringoperator(,) stringoperator(]) + ident(puts) constant(Footer) operator(%) constant(Version) + reserved(end) +reserved(end) + ident(main) reserved(if) pre_constant(__FILE__) operator(==) global_variable($0) \ No newline at end of file diff --git a/test/ruby/simple.out.raydebug b/test/ruby/simple.out.raydebug index 7c11552..b423e9f 100644 --- a/test/ruby/simple.out.raydebug +++ b/test/ruby/simple.out.raydebug @@ -1,2 +1,2 @@ -ident(puts) string -ident(p) integer(2) operator(*) integer(19) +ident(puts) string +ident(p) integer(2) operator(*) integer(19) diff --git a/test/ruby/strange.out.raydebug b/test/ruby/strange.out.raydebug index bcf053d..b2f7d50 100644 --- a/test/ruby/strange.out.raydebug +++ b/test/ruby/strange.out.raydebug @@ -1,341 +1,341 @@ -ident(a)operator(.)ident(each)operator({)operator(|)ident(el)operator(|)ident(anz)operator([)ident(el)operator(])operator(=)ident(anz)operator([)ident(el)operator(])operator(?)ident(anz)operator([)ident(el)operator(])integer(+1)operator(:)integer(1)operator(}) -reserved(while) ident(x)operator(<)integer(10000) -comment(#a bis f dienen dazu die Nachbarschaft festzulegen. Man stelle sich die #Zahl von 1 bis 64 im Binärcode vor 1 bedeutet an 0 aus) - ident(b)operator(=)operator(()ident(p)operator([)ident(x)operator(])operator(%)integer(32)operator(\))operator(/)integer(16)operator(<)integer(1) operator(?) integer(0) operator(:) integer(1) - - operator(()ident(x)integer(-102)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-102)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(a)operator(+)operator(()ident(x)integer(-101)operator(>)operator(=)integer(0)operator(?)ident(n)operator([)ident(x)integer(-101)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(e)operator(+)ident(n)operator([)ident(x)integer(-100)operator(])operator(.)ident(to_i)operator(+)operator(()ident(x)integer(-99)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-99)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(f)operator(+)operator(()ident(x)integer(-98)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-98)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(a)operator(+) - ident(n)operator([)ident(x)integer(+199)operator(])operator(.)ident(to_i)operator(*)ident(b)operator(+)ident(n)operator([)ident(x)integer(+200)operator(])operator(.)ident(to_i)operator(*)ident(d)operator(+)ident(n)operator([)ident(x)integer(+201)operator(])operator(.)ident(to_i)operator(*)ident(b) - -comment(#und die Ausgabe folgt) -ident(g)operator(=)string -ident(x)operator(=)integer(0) - -comment(=begin -class Hello - @hi #class-instance-variable - self <delimiter(")> - ident(x)operator(+=)integer(1) -reserved(end) - -ident(puts)string -ident(sleep)operator(()integer(10)operator(\)) - -float(1E1)constant(E1) -ident(puts) integer(30)operator(.)ident(send)operator(()symbol(:/)operator(,) integer(5)operator(\)) comment(# prints 6) - -string -shell -string -regexp -symbol -symbol -string -string -string -string -string -symbol -regexp -shell - -comment(#%W[ but #@0illegal_values look strange.]) - -operator(%)constant(Quark) ident(dazu) - -operator(%) ident(abc) comment(# FIXME) - -symboloperator({)ident(constructs)operator(}) -symbolglobal_variable($constructs) -symbolclass_variable(@@constructs) - -regexpinteger(00) -shellident(x00) - -operator(~)regexp)delimiter(#)modifier(i)> operator(..) operator(~)regexp)delimiter(#)modifier(i)>operator(;) - -ident(a) operator(=) stringstring - -ident(a) operator(=) stringstring - -ident(b)operator(=)operator(()ident(p)operator([)ident(x)operator(]) operator(%)integer(32)operator(\))operator(/)integer(16)operator(<)integer(1) operator(?) integer(0) operator(:) integer(1) - -comment(#<<"") -stringstringcontent( -)escape(#)instance_variable(@bla)content( -#die suppe!!! -)char(\\xff)content(fff - - -super <<-EOE % [ - EOE - -< -constant(X) -symbol -string -string -symbol -symbol - -string - -stringdelimiter(})>content( rocks)delimiter(])> delimiter(})>content( ! )delimiter(])> - -stringdelimiter(})>content( break)delimiter(")> -ident(the) ident(code)operator(.) -ident(may) - -comment(# this is a known bug.) -ident(p) stringstringdelimiter(})>content( -code. -that)delimiter( -this)> -ident(that) - -comment(##################################################################) -reserved(class) class(NP) -reserved(def) method(initialize) ident(a)operator(=)instance_variable(@p)operator(=)operator([)operator(])operator(,) ident(b)operator(=)instance_variable(@b)operator(=)operator([)operator(])operator(;) reserved(end) -reserved(def) method(+@)operator(;)instance_variable(@b)operator(<<)integer(1)operator(;)ident(b2c) reserved(end)operator(;)reserved(def)method(-@)operator(;)instance_variable(@b)operator(<<)integer(0)operator(;)ident(b2c) reserved(end) -reserved(def) method(b2c)operator(;)reserved(if) instance_variable(@b)operator(.)ident(size)operator(==)integer(8)operator(;)ident(c)operator(=)integer(0)operator(;)instance_variable(@b)operator(.)ident(each)operator({)operator(|)ident(b)operator(|)ident(c)operator(<<)operator(=)integer(1)operator(;)ident(c)operator(|=)ident(b)operator(})operator(;)ident(send)operator(() - stringoperator(.)ident(reverse)operator(,)operator(()instance_variable(@p)operator(.)ident(join)operator(\))operator(\))reserved(if) ident(c)operator(==)integer(0)operator(;)instance_variable(@p)operator(<<)ident(c)operator(.)ident(chr)operator(;)instance_variable(@b)operator(=)operator([)operator(]) reserved(end) - pre_constant(self) reserved(end) reserved(end) operator(;) reserved(begin) ident(_) operator(=) constant(NP)operator(.)ident(new) reserved(end) -ident(c) -comment(# ^ This is a bug :() - -comment(# The Programming Language `NegaPosi') -operator(+)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)ident(_) -operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)ident(_) -operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)ident(_) -operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)ident(_) -operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-) ident(_) -comment(##################################################################) - - -comment(# date: 03/18/2004) -comment(# title: primes less than 1000 ( 2005 Obfuscated Ruby Contest \)) -comment(# author: Jim Lawless) -comment(# email: jimbo at radiks dotski net) -comment(# comments: This program will display all positive prime integers) -comment(# less than 1000. Program licens is the same as the Ruby) -comment(# license ( http://www.ruby-lang.org/en/LICENSE.txt \)) - - global_variable($e)operator(=)string - -reserved(def) method(a)operator(()operator(\)) - global_variable($a)operator(=)global_variable($a)integer(+1) -reserved(end) - -reserved(def) method(b)operator(()operator(\)) - global_variable($a)operator(=)global_variable($a)integer(+5) -reserved(end) - -reserved(def) method(c)operator(()operator(\)) - global_variable($e)operator(=)global_variable($e)operator(+)global_variable($a)operator(.)ident(chr) -reserved(end) - -reserved(def) method(d)operator(()operator(\)) - global_variable($a)operator(=)integer(10) -reserved(end) - -reserved(def) method(e)operator(()operator(\)) - global_variable($a)operator(=)global_variable($a)integer(+16) -reserved(end) - -ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;) -ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) -ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) -ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(eval) global_variable($e) - -global_variable($_)operator(=)string" ","bHQ=)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck((?n-1\).chr\)[0]=> -:<,"Z3Q=)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck("m"\)[0]=>:>,"YW1w)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck((?l+1\).chr\)[0]=>:&)nesting_delimiter(})content(, -[[/^)char(\\\\)content(s+<)char(\\\\)content(/div>.+/m,""],[/^)char(\\\\)content(s+/,""],[/)char(\\n)content(/,")char(\\n)char(\\n)content("],[/
/,")char(\\n)content("], -[/
/,"-="*40],[/<[^>]+>/,""],[/^ruby/,""],[/)char(\\n)nesting_delimiter({)content(3,)nesting_delimiter(})content(/,")char(\\n)char(\\n)content("]];p)char(\\165)content(ts" -)char(\\#)nesting_delimiter({)content(l[0..-3])nesting_delimiter(})content(ing...)char(\\n)char(\\n)content(";send(Kernel.methods.find_all)nesting_delimiter({)content(|x|x[0]==?e)nesting_delimiter(})content([-1], -"re)char(\\#)nesting_delimiter({)content(q[5...8].downcase)nesting_delimiter(})content(re '111112101110-117114105'.scan(/-|)char(\\\\)char(\\\\)content(d)nesting_delimiter({)content(3)nesting_delimiter(})content(/\). -inject(''\))nesting_delimiter({)content(|m,v|v.length>1?m+v.to_i.chr: m+v)nesting_delimiter(})content("\);o)inlineoperator(.)ident(sort)operator(.)ident(join)operator(.)ident(downcase) -delimiter(})>content(n("http://www.)char(\\#)nesting_delimiter({)content(n)nesting_delimiter(})content("\))nesting_delimiter({)content(|w|$F=w.read.sc)char(\\x61)content(n(/li>.+?"([^"]+\)..([^<]+\)/\))nesting_delimiter(})content(;)char(\\160)content(uts)char(\\ -)content(")char(\\#)nesting_delimiter({)content(q)nesting_delimiter(})char(\\n)char(\\n)content(";$F.)char(\\145)char(\\141)content(ch)nesting_delimiter({)content(|e|i=e[0][/)char(\\\\)content(d+/];s="%2s. %s"%[i,e[1]];i.to_i%2==0 ? -)char(\\160)content(ut)char(\\x73)content((s\) : )inlineoperator([)integer(-1)operator(])delimiter(})>content(rint("%-38s "%s\))nesting_delimiter(})content(;p)char(\\x72)char(\\x69)char(\\x6e)content(t")char(\\n)content(? ";e)char(\\x76)content(al( -['puts")char(\\n)char(\\#)nesting_delimiter({)content(l[0..3])nesting_delimiter(})content(ing...)char(\\n)char(\\n)content("','$c=gets.chomp.to_i'].sort.join(";"\)\);)inlinecontent(pen("http://www.)char(\\#)nesting_delimiter({)content(n)nesting_delimiter(})content("+$F[$c-1][0]\))nesting_delimiter({)content(|n|$_=n.read[/^)char(\\\\)content(s+operator(..)stringoperator(\))operator(.) -ident(to_a)operator([)integer(10)integer(-5)operator(*)integer(2)operator(])delimiter(})>content(.e)char(\\141)content(ch)nesting_delimiter({)content(|(z,f\)|)char(\\x67)content(sub!(z,f\))nesting_delimiter(})content(;)char(\\147)content(sub!(/&()char(\\\\)content(w+\);/\))nesting_delimiter({)content(|y|p. -ke)char(\\171)char(\\077)content(($1\)?p[$1]:y)nesting_delimiter(})content(;while$_=~/([^)char(\\n)content(])nesting_delimiter({)content(81,)nesting_delimiter(})content(\)/:z=$1.dup;f=$1.dup;f[f.rindex( -" ",80\),1]=")char(\\n)content(";f.s)char(\\165)content(b!(/)char(\\n)content([ )char(\\t)content(]+/,")char(\\n)content("\);s)char(\\165)content(b!(/)char(\\#)nesting_delimiter({)content(R)char(\\x65)content(g)char(\\x65)content(xp. -)char(\\x65)content(scap)char(\\x65)content((z\))nesting_delimiter(})content(/,f\)end)nesting_delimiter(})content(;while)char(\\040)char(\\163)content(ub!(/^(?:[^)char(\\n)content(]*)char(\\n)content(\))nesting_delimiter({)content(20)nesting_delimiter(})content(/, ""\):puts")char(\\#)content($& ---)char(\\x4d)content(O)char(\\x52)content(E--";g=$_;g)inlinedelimiter(})>content(ts;;)inlineoperator([)integer(0)operator(..)integer(4)operator(])operator(.)ident(delete)operator(()stringoperator(\))delimiter(})>char(\\040)content(if$_[0]==?q -$_=g;end;$_.d)inlineoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(join)operator(.)ident(downcase) -delimiter(})>content(lay)delimiter(})>operator(;)ident(eval)global_variable($_) - - ident(d)operator(=)operator([)integer(30644250780)operator(,)integer(9003106878)operator(,) - integer(30636278846)operator(,)integer(66641217692)operator(,)integer(4501790980)operator(,) - integer(671_24_603036)operator(,)integer(131_61973916)operator(,)integer(66_606629_920)operator(,) - integer(30642677916)operator(,)integer(30643069058)operator(])operator(;)ident(a)operator(,)ident(s)operator(=)operator([)operator(])operator(,)global_variable($*)operator([)integer(0)operator(]) - ident(s)operator(.)ident(each_byte)operator({)operator(|)ident(b)operator(|)ident(a)operator(<<)operator(()stringoperator(%)ident(d)operator([)ident(b)operator(.) - ident(chr)operator(.)ident(to_i)operator(])operator(\))operator(.)ident(scan)operator(()regexpoperator(\))operator(}) - ident(a)operator(.)ident(transpose)operator(.)ident(each)operator({) operator(|)ident(a)operator(|) - ident(a)operator(.)ident(join)operator(.)ident(each_byte)operator({)\ - operator(|)ident(i)operator(|)ident(print) ident(i)operator(==)integer(49)operator(?)\ - operator(()global_variable($*)operator([)integer(1)operator(])operator(||)stringoperator(\))\ - operator(:)integer(32)operator(.)ident(chr)operator(}) - ident(puts) - operator(}) - -comment(#! /usr/bin/env ruby) -comment(# License: If Ruby is licensed to the general public in a certain way, this is also licensed in that way.) -ident(require)stringoperator(;)ident(eval)operator(()constant(Zlib)operator(::)constant(Inflate)operator(.)ident(inflate)operator(()string[T)char(\\353)content(U)char(\\265)char(\\276)content(L)char(\\257)char(\\353)char(\\325)char(\\235)content(-')char(\\277)char(\\226)char(\\233)content(ui)char(\\323)content(Uy1)char(\\251)char(\\027)char(\\027)char(\\341)char(\\253)char(\\371)char(\\346)content(r)char(\\e)char(\\245)content(u)char(\\366)char(\\216)char(\\205)content(f)char(\\263)char(\\367)char(\\357)char(\\336)content(&)char(\\353)char(\\362)content(S)char(\\010)content(zr=)char(\\277)char(\\331)content(5w)char(\\315)content(]r[)char(\\237)content(o)char(\\333)char(\\344)content(c])char(\\255)content(#>)char(\\343)content(O)char(\\025)char(\\352)char(\\037)char(\\334)char(\\177)char(\\341)char(\\367)char(\\364)char(\\271)char(\\t)char(\\003)char(\\245)char(\\337)content(|)char(\\027)char(\\304)char(\\364)content(aM@:)char(\\363)char(\\260)char(\\316)content(>)char(\\237)char(\\232)char(\\323)content(()char(\\326)char(\\252)content(()char(\\327)char(\\253)char(\\t)char(\\275)char(\\323)char(\\332)content(h)char(\\253)char(\\224)content(V)char(\\306)content(d)char(\\247)char(\\037)char(\\362)char(\\371)char(\\311)content(})char(\\321)char(\\314)content(f)char(\\356)char(\\363)content(C)char(\\016)char(\\311)char(\\342)char(\\365)char(\\361)content(ij)char(\\026)char(\\037)char(\\313)char(\\345)char(\\355)char(\\357)content(7)char(\\363)content(e)char(\\231)char(\\224)char(\\363)char(\\345)char(\\325)content(y)char(\\315)char(\\204)content(])char(\\263)content(l)char(\\362)content(0)char(\\177)char(\\317)char(\\241)char(\\024)content(M)char(\\376)char(\\263)char(\\235)content(o)char(\\267)content(Et)char(\\222)content(/)char(\\223)content(%)char(\\037)char(\\213)char(\\374)content(D)char(\\323)char(\\373)content(M)char(\\321)content(4Kv-)char(\\373)content(<)char(\\361)char(\\026)char(\\233)content(&)char(\\\\)char(\\304)char(\\253)content(,)char(\\354)char(\\270)char(\\263)char(\\314)content(\))char(\\232)char(\\374)content(8)char(\\311)char(\\247)content(]z)char(\\216)content(v)char(\\313)content(6)char(\\235)char(\\306)char(\\323)char(\\243)char(\\035)char(\\262)char(\\263)char(\\214)char(\\332)char(\\f)char(\\024)char(\\342)char(\\257)char(\\327)char(\\345)char(\\264)char(\\230)char(\\205)char(\\313)content(o36)char(\\312)content(2)char(\\254)content(e2)char(\\260)char(\\236)char(\\261)content(0)char(\\202)char(\\354)char(\\037)char(\\260)char(\\256)content( (f=/)char(\\313)content(:Z)char(\\024)char(\\245)char(\\313)char(\\244)content(Zoo)char(\\347)char(\\353)content(ey~])char(\\336)content(^)char(\\325)char(\\253)content(-)char(\\a)char(\\273)content(k)char(\\252)content(fqv6)char(\\235)char(\\333)content(j)char(\\276)char(\\355)char(\\236)content(tV)char(\\252)char(\\230)char(\\377)content(F)char(\\276)char(\\n)char(\\333)char(\\277)char(\\257)char(\\241)char(\\345)char(\\206)char(\\262)char(\\323)char(\\306)content(G)char(\\273)char(\\352)char(\\340)char(\\203)content(t)char(\\332)char(\\246)char(\\244)content(1`')char(\\316)char(\\316)char(\\266)char(\\245)char(\\275)content(H)char(\\003)content(2)char(\\377)content(l)char(\\253)char(\\017)content(,=42E)char(\\002)char(\\360)char(\\236)char(\\246)char(\\345)content(_s;Y)char(\\274)content(^)char(\\305)char(\\367)content(Q)char(\\233)char(\\036)char(\\233)char(\\276)char(\\016)char(\\312)char(\\245)content(0=)char(\\256)content(=)char(\\305)content(U)char(\\202)char(\\230)char(\\254)char(\\")char(\\222)char(\\265)char(\\004)char(\\217)char(\\237)content(~)char(\\373)char(\\345)char(\\017)char(\\")content(h)char(\\243)char(\\210)char(\\307)content(j)char(\\235)char(\\251)char(\\205)content(V8)char(\\353)char(\\304)content(X)char(\\372)content(!1CGc-)char(\\251)char(\\240)char(\\337)char(\\020)char(\\317)char(\\361)content(#)char(\\036)char(\\023)char(\\n)char(\\255)content(6)char(\\254)content(Cg3)char(\\002)content(})char(\\265)char(\\356)content(s)char(\\235)char(\\202)content(K[K)char(\\022)char(\\020)content( )char(\\243)char(\\206)char(\\216)char(\\241)content(p3)char(\\332)content(55)char(\\350)char(\\232)char(\\036)char(\\030)content(q$)char(\\233)char(\\344)content(!)char(\\363)char(\\204)content(^},$)char(\\023)content(Xg)char(\\235)content(:)char(\\364)content(r1)char(\\")content(1)char(\\344)char(\\277)char(\\261)char(\\207)char(\\031)content(()char(\\301)content(DE)char(\\260)char(\\344)char(\\026)content(Y)char(\\177)char(\\345)char(\\036)char(\\221)char(\\204)content(mP)char(\\263)char(\\266)content(Mk)char(\\305)char(\\366)char(\\210)content(%3)char(\\220)char(\\302)content(S)char(\\322)char(\\306)content(IR)char(\\316)char(\\377)content(!)char(\\203)content( S)char(\\336)char(\\310)char(\\216)char(\\215)char(\\203)char(\\315)char(\\002)content(-)char(\\211)content( 5D2)char(\\257)char(\\210)char(\\302)char(\\321)content(p)char(\\234)char(\\364)char(\\205)char(\\222)content(Jj)char(\\220)char(\\022)content(E)char(\\321)content(h)char(\\347)char(\\223)content(RQ*94K)char(\\022)char(\\243)char(\\314)content(H`4{LV)char(\\003)char(\\021)content(N)char(\\f)char(\\333)char(\\364)content(I)char(\\347)content(l)char(\\327)content(UR)char(\\305)content(t)char(\\340)char(\\332)content(i>)char(\\241)content(x=Mu4R)char(\\245)char(\\373)char(\\223)char(\\244)char(\\251)content(NB)char(\\211)char(\\247)char(\\236)char(\\346)content(5)char(\\253)content(^bx)char(\\332)content(Yc)char(\\263)char(\\252)content(M)char(\\220)content(b)char(\\253)char(\\220)char(\\310)char(\\004)char(\\331)char(\\242)char(\\020)content(,`)char(\\005)content(T)char(\\021)content(Y)char(\\251)content(P@)char(\\020)char(\\365)content(Ax)char(\\310)content(z)char(\\364)char(\\264)char(\\240)char(\\265)content(vj2)char(\\037)content(?0)char(\\v)char(\\")content(en)char(\\244)char(\\374)char(\\251)char(\\032)char(\\225)char(\\253)content(v)char(\\346)char(\\253)char(\\371)content(2)char(\\215)char(\\032)char(\\322)content((o)char(\\206)content(~A)char(\\006)char(\\010)char(\\f)char(\\324)char(\\223)content(57)char(\\026)char(\\")char(\\316)char(\\024)char(\\365)char(\\021)char(\\360)content(@)char(\\277)content(:)char(\\363)content(.$)char(\\f)char(\\342)char(\\016)content($)char(\\200)char(\\v)char(\\341)char(\\302)char(\\230)char(\\020)char(\\340)char(\\341)char(\\201)content(K)char(\\017)char(\\270)content(+i)char(\\326)content(-)char(\\312)char(\\313)content(j)char(\\235)char(\\n)content([)char(\\376)content(({)char(\\330)content(u)char(\\254)char(\\266)char(\\334)char(\\034)char(\\031)char(\\367)content(%:CK)char(\\210)content({)char(\\311)content(h)char(\\a)content(QH)char(\\333)content(Q)char(\\023)char(\\250)char(\\210)content(;e)char(\\360)char(\\322)char(\\362)char(\\213)char(\\202)char(\\247)char(\\216)char(\\266)char(\\340)content(C&(p)char(\\274)content(HT7)char(\\336)content(&B)char(\\352)char(\\300)char(\\036)content(z)char(\\206)char(\\204)char(\\375)content( )char(\\032)content(z)char(\\304)char(\\233)char(\\217)char(\\034)char(\\267)content(AK)char(\\207)content(R)char(\\363)char(\\213)char(\\324)content(u)char(\\334)char(\\203)char(\\272)content(h)char(\\234)content( )char(\\304)content(&)char(\\364)content(S)char(\\302)content(]|)char(\\024)char(\\233)content(b)char(\\000)char(\\023)content(E)char(\\034)char(\\005)char(\\300)content(!)char(\\330)char(\\227)content(4)char(\\026)char(\\205)char(\\316)char(\\363)char(\\203)char(\\364)char(\\")char(\\316)char(\\245)content(!)char(\\242)char(\\360)content(Y?4)char(\\204)content(b)char(\\023)content(.)char(\\200)content(9)char(\\036)content(X)char(\\300)char(\\213)content(p)char(\\200)content(])char(\\304)char(\\324)char(\\200)content($^)char(\\204)char(\\025)char(\\222)content(D)char(\\325)content(X )char(\\363)char(\\324)char(\\004)char(\\223)char(\\205)char(\\207)char(\\241)content(M)char(\\245)char(\\352)char(\\341)content((s)char(\\341)content(5)char(\\260)content(w)char(\\226)char(\\313)content(=)char(\\242)content(2 )char(\\200)char(\\177)char(\\344)char(\\355)char(\\211)char(\\335)content(0)char(\\004)char(\\341)char(\\217)char(\\207)char(\\215)content(r%x)char(\\030)char(\\302)char(\\304)char(\\230)char(\\335)content({#)char(\\250)content(#o)char(\\204)content(h)char(\\327)content(;)char(\\220)char(\\242)char(\\275)content(B%j&)char(\\343)content(e)char(\\005)char(\\226)content(/)char(\\r)char(\\200)char(\\035)char(\\035)char(\\206)content(K)char(\\243)char(\\027)char(\\216)content(Z)char(\\230)char(\\323)content(.)char(\\335)char(\\356)content(^!)char(\\v)content(F)char(\\002)content(K)char(\\366)char(\\246)content(kG)char(\\321)char(\\364)content(E)char(\\301)char(\\362)char(\\250)char(\\275)content(a)char(\\f)char(\\031)char(\\207)content(i%)char(\\216)char(\\342)content(&ie)char(\\205)char(\\260)char(\\324)content(})char(\\272)char(\\252)content(ho)char(\\222)char(\\306)char(\\370)char(\\362)content(!}6)char(\\364)content(C)char(\\003)char(\\271)content(7)char(\\206)content('!.)char(\\315)char(\\036)content(mhMm)char(\\370)char(\\252)char(\\241)char(\\365)char(\\221)content(g)char(\\275)char(\\326)content(A)char(\\302)char(\\254)char(\\270)content(X,)char(\\371)char(\\353)char(\\232)content(:)char(\\222)char(\\321)char(\\253)char(\\025)char(\\217)content(v%)char(\\222)char(\\023)content(!)char(\\243)content(r)char(\\272)char(\\364)content(()char(\\376)char(\\177)char(\\236)char(\\374)char(\\233)char(\\363)char(\\304)content(8)char(\\330)content(b)char(\\241)content(xdTp)char(\\325)char(\\321)char(\\377)char(\\342)content(8F)char(\\234)char(\\214)char(\\263)char(\\357)char(\\255)content(f)char(\\324)char(\\306)char(\\226)char(\\257)char(\\022)char(\\")char(\\000)char(\\354)char(\\003)char(\\024)content(C)char(\\207)char(\\n)content(a)char(\\353)char(\\240)content(&O)char(\\305)char(\\376)char(\\004)content(ncy)char(\\350)char(\\f)char(\\276)char(\\357)content(+Q|)char(\\201)content(bBi)char(\\206)char(\\277)char(\\345)content(u)char(\\251)char(\\273)char(\\310)char(\\367)char(\\242)char(\\303)content(*)char(\\204)content(d)char(\\n)char(\\271)content(})char(\\016)char(\\234)content(5r8)char(\\034)char(\\201)content([)char(\\343)content(:>)char(\\364)content(*)char(\\242)char(\\266)char(\\025)content(+HZ)char(\\263)content(e)char(\\212)char(\\024)content(7q)char(\\357)char(\\310)content(X)char(\\267)content([)char(\\333)content((9_o}P)char(\\201)char(\\324)content(>)char(\\266)char(\\364)char(\\000)char(\\217)content(hh)char(\\352)char(\\225)content(a)char(\\213)content(q)char(\\260)char(\\031)char(\\334)char(\\022)content(sg)char(\\360)char(\\e)char(\\206)char(\\234)content(B=)char(\\246)char(\\242)content(1)char(\\341)content(e)char(\\364)char(\\270)char(\\321)char(\\224)char(\\347)char(\\005)content(6L)char(\\267)char(\\227)content(\))char(\\244)char(\\210)char(\\307)char(\\027)char(\\257)content(<)char(\\343)char(\\257)char(\\000)char(\\303)char(\\264)content(u{)char(\\235)char(\\326)char(\\352)content(i)char(\\303)content(^)char(\\332)char(\\200)char(\\n)char(\\236)char(\\243)content(a)char(\\277)char(\\034)content(J#~S)char(\\335)content('2)char(\\371)char(\\001)content(q)char(\\374)content(5$)char(\\356)char(\\027)content(^)char(\\371)char(\\325)char(\\344)char(\\331)char(\\036)char(\\362)char(\\004)char(\\267)char(\\330)char(\\251)content(<)char(\\212)char(\\237)char(\\257)char(\\345)content(kr)char(\\371)char(\\302)content(d)char(\\362)content(r)char(\\376)char(\\344)content(d)char(\\252)content(C)char(\\311)char(\\374)content(R6)char(\\017)content(e)char(\\375)char(\\005)char(\\271)content(yAV)char(\\363)content(/)char(\\257)char(\\345)char(\\261)content(()char(\\340)content(hW)char(\\020)char(\\222)char(\\a)char(\\027)content(k\)60)char(\\354)char(\\217)char(\\363)char(\\350)content(1)char(\\263)content(rt)char(\\036)content(4)char(\\025)char(\\025)content(|)char(\\265)char(\\031)char(\\355)char(\\276)content(d)char(\\357)char(\\315)content(9)char(\\367)char(\\225)char(\\025)char(\\223)content(U)char(\\273)content(n)char(\\027)char(\\324)char(\\321)content(H)char(\\031)char(\\030)char(\\036)char(\\357)char(\\356)char(\\377)char(\\010)char(\\266)char(\\337)char(\\374)char(\\003)char(\\337)content(5Q)char(\\335)delimiter(")>operator(\))operator(\)) -comment(#include "ruby.h" /*) - regexpcontent( *)delimiter(/)> - -comment(#define GUN1 42:) -comment(#define GUN2 43:) -comment(#define bo do) -comment(#define when(gun\) /**/) -comment(#define DATA "p 'Hello embedded world'") -comment(#define DIRTY(argc,argv\)\\) -ident(argc)operator(,)ident(argv)operator(,)ident(char)operator(=)ident(eval)operator(()\ -stringchar(\\n)content([3,2,1])delimiter(")>\ -operator(\))operator(;)ident(sun)operator(=)constant(O)operator(.)ident(new)\ -reserved(if)operator(()integer(0)operator(\)) - -ident(int) -ident(sun)operator([)operator(])operator(=)operator({)integer(12)operator(,)integer(9)operator(,)integer(16)operator(,)integer(9)operator(,)integer(2)operator(,)integer(1)operator(,)integer(7)operator(,)integer(1)operator(,)integer(3)operator(,)integer(9)operator(,)integer(27)operator(,)integer(4)operator(,) integer(13)operator(,)integer(2)operator(,)integer(11)operator(,)integer(5)operator(,)integer(4)operator(,)integer(1)operator(,)integer(25)operator(,) -integer(5)operator(,)integer(0)operator(,)integer(1)operator(,)integer(14)operator(,)integer(9)operator(,)integer(15)operator(,)integer(4)operator(,)integer(26)operator(,)integer(9)operator(,)integer(23)operator(,)integer(2)operator(,)integer(17)operator(,)integer(6)operator(,)integer(31)operator(,) integer(6)operator(,)integer(10)operator(,)integer(8)operator(,)integer(22)operator(,)integer(9)operator(,)integer(21)operator(,)integer(1)operator(,) -integer(24)operator(,)integer(8)operator(,)integer(20)operator(,)integer(8)operator(,)integer(18)operator(,)integer(9)operator(,)integer(29)operator(,)integer(5)operator(,)integer(9)operator(,)integer(5)operator(,)integer(1)operator(,)integer(1)operator(,)integer(28)operator(,)integer(8)operator(,)integer(8)operator(,)integer(1)operator(,)integer(30)operator(,) integer(9)operator(,)integer(6)operator(,)integer(8)operator(,) integer(5)operator(,)integer(1)operator(,) -integer(19)operator(,)integer(9)operator(,)integer(36)operator(,)integer(19)operator(,)integer(43)operator(,) integer(9)operator(,)integer(34)operator(,)integer(11)operator(,)integer(50)operator(,)integer(19)operator(,)integer(48)operator(,)integer(18)operator(,)integer(49)operator(,)integer(9)operator(,) integer(35)operator(,)integer(8)operator(,)integer(42)operator(,)integer(18)operator(,) -integer(51)operator(,)integer(8)operator(,)integer(44)operator(,)integer(11)operator(,)integer(32)operator(,) integer(11)operator(,)integer(47)operator(,)integer(9)operator(,)integer(37)operator(,)integer(1)operator(,)integer(39)operator(,)integer(9)operator(,)integer(38)operator(,)integer(19)operator(,) integer(45)operator(,)integer(8)operator(,)integer(40)operator(,)integer(12)operator(,) -integer(41)operator(,)integer(9)operator(,)integer(46)operator(,)integer(12)operator(,)integer(33)operator(,)integer(1)operator(,)integer(57)operator(,)integer(1)operator(,)integer(85)operator(,)integer(5)operator(,)integer(88)operator(,)integer(28)operator(,)integer(83)operator(,)integer(4)operator(,)integer(87)operator(,) integer(6)operator(,)integer(62)operator(,)integer(28)operator(,)integer(89)operator(,) -integer(9)operator(,)integer(80)operator(,)integer(28)operator(,)integer(60)operator(,)integer(21)operator(,)integer(52)operator(,)integer(21)operator(,)integer(72)operator(,)integer(29)operator(,)integer(54)operator(,)integer(21)operator(,)integer(75)operator(,)integer(8)operator(,)integer(70)operator(,)integer(29)operator(,)integer(58)operator(,)integer(28)operator(,)integer(65)operator(,) -integer(9)operator(,)integer(91)operator(,)integer(8)operator(,)integer(74)operator(,)integer(29)operator(,)integer(79)operator(,)integer(2)operator(,)integer(77)operator(,)integer(1)operator(,)integer(53)operator(,)integer(1)operator(,)integer(81)operator(,)integer(5)operator(,) integer(69)operator(,)integer(2)operator(,)integer(64)operator(,)integer(21)operator(,) integer(86)operator(,)integer(29)operator(,) -integer(67)operator(,)integer(9)operator(,)integer(59)operator(,)integer(1)operator(,)integer(61)operator(,)integer(5)operator(,)integer(73)operator(,)integer(6)operator(,)integer(76)operator(,)integer(28)operator(,)integer(56)operator(,)integer(21)operator(,)integer(68)operator(,)integer(29)operator(,)integer(78)operator(,)integer(29)operator(,)integer(63)operator(,)integer(5)operator(,)integer(66)operator(,) -integer(28)operator(,)integer(90)operator(,)integer(29)operator(,) integer(71)operator(,)integer(4)operator(,)integer(55)operator(,)integer(9)operator(,)integer(84)operator(,)integer(28)operator(,)integer(82)operator(,)integer(29)operator(,)integer(101)operator(,)integer(5)operator(,) integer(103)operator(,)integer(9)operator(,) integer(98)operator(,)integer(35)operator(,) -integer(97)operator(,)integer(1)operator(,)integer(94)operator(,)integer(35)operator(,)integer(93)operator(,)integer(1)operator(,)integer(100)operator(,)integer(35)operator(,)integer(92)operator(,)integer(31)operator(,)integer(99)operator(,)integer(5)operator(,)integer(96)operator(,)integer(39)operator(,)integer(95)operator(,)integer(5)operator(,)integer(102)operator(,)integer(35)operator(})operator(;) - -ident(void) ident(run)operator(()ident(int) ident(gun)operator(=)integer(0)operator(\)) operator({) regexp operator([)ident(gun)operator(])operator(=)operator([)symbol(:GUN1)operator(,)symbol(:GUN2)operator(]) - ident(printf)operator(()stringoperator(,) ident(gun)operator(\))operator(;) - ident(switch)operator(()ident(gun)operator(\)) operator({) - reserved(case) constant(GUN1) reserved(when)operator(()integer(2)operator(\)) - ident(printf)operator(()stringoperator(\))operator(;) - reserved(break)operator(;) regexp reserved(end) - reserved(case) constant(GUN2) reserved(when)operator(()integer(3)operator(\)) - ident(printf)operator(()stringoperator(\))operator(;) - reserved(break)operator(;) regexp reserved(end) - operator(}) -operator(}) - -ident(int) ident(main)operator(()ident(int) ident(argc)operator(,) ident(char)operator(**) ident(argv)operator(\)) operator({) - ident(printf)operator(()stringoperator(,) ident(argc)operator(\))operator(;) - ident(int) ident(fun)operator(=)integer(5)operator(;) - ident(bo) operator({) - ident(fun) operator(-=) integer(1)operator(;) regexpoperator(.)ident(id) operator(-) ident(gun) operator(=) ident(fun) - ident(run)operator(()ident(fun)operator(\))operator(;) - operator(}) reserved(while)operator(()ident(fun)operator(>)integer(0)operator(\))operator(;) - ident(ruby_init)operator(()operator(\))operator(;) - ident(rb_eval_string)operator(()pre_constant(DATA)operator(\))operator(;) - reserved(return) integer(0)operator(;) -operator(}) - -comment(#if 0 // nobody reads un-defined code) -reserved(def) method(goto)operator(*)ident(s)operator(;)global_variable($s)operator(=)operator([)operator(])operator(;)constant(Y)operator(.)ident(times)operator({)ident(s)operator(=)operator([)operator(])operator(;)constant(X)operator(.)ident(times)operator({)ident(s)operator(<<)operator([)integer(0)operator(])operator(*)integer(3)operator(})operator(;)global_variable($s)operator(<<) ident(s)operator(})reserved(end)operator(;)constant(A)operator(=)float(0.5) -ident(include) constant(Math)operator(;)reserved(def) method(u) ident(g)operator(,)ident(h)operator(,)ident(i)operator(,)ident(j)operator(,)ident(k)operator(,)ident(l)operator(;)ident(f)operator(,)operator(*)ident(m)operator(=)operator(()operator(()ident(j)operator(-)ident(h)operator(\))operator(.)ident(abs)operator(>)operator(()ident(k)operator(-)ident(i)operator(\))operator(.)ident(abs)operator(\))operator(?)operator([)ident(proc)operator({) -operator(|)ident(n)operator(,)ident(o)operator(|) ident(g)operator([)ident(o)operator(]) operator([)ident(n) operator(])operator(=)ident(l) operator(})operator(,)operator([)ident(h) operator(,)ident(i) operator(])operator(,)operator([)ident(j)operator(,)ident(k)operator(])operator(])operator(:)operator([)ident(proc)operator({) -operator(|)ident(p)operator(,)ident(q)operator(|) ident(g)operator([) ident(p)operator(])operator([) ident(q)operator(]) operator(=)ident(l)operator(}) operator(,)operator([) ident(i)operator(,)ident(h) operator(])operator(,) operator([)ident(k)operator(,)ident(j)operator(])operator(])operator(;)ident(b)operator(,)ident(a)operator(=)ident(m)operator(.)ident(sort) -ident(c)operator(,)ident(d)operator(=)ident(a) operator([)integer(1) operator(])operator(-)ident(b) operator([)integer(1) operator(])operator(,)ident(a) operator([)integer(0) operator(])operator(-)ident(b) operator([)integer(0) operator(])operator(;)ident(d)operator(.)ident(times)operator({)operator(|)ident(e)operator(|)ident(f)operator(.) -ident(call)operator(() ident(e)operator(+)ident(b)operator([) integer(0)operator(]) operator(,)ident(c)operator(*) ident(e)operator(/)ident(d)operator(+)ident(b) operator([)integer(1)operator(])operator(\))operator(})operator(;)reserved(end)operator(;)constant(V)operator(=)integer(0)operator(;)reserved(def) method(bo)operator(&)ident(u) -global_variable($u)operator(||=) constant(V)operator(;) operator(;)global_variable($u) operator(+=) integer(1)operator(+)constant(V) operator(;)operator(;) reserved(return) ident(u)operator(.)ident(call) reserved(if)global_variable($u)operator(>)integer(1)operator(;)ident(q)operator(=)float(128.0) -operator(;)ident(x)operator(=)operator(()constant(V) operator(..) integer(255) operator(\))operator(.) ident(map) operator({)operator(|) ident(y)operator(|)ident(f1)operator(,)ident(z) operator(=)ident(sin)operator(()ident(y)operator(.)ident(to_f)operator(*)constant(PI)operator(/)ident(q)operator(\))operator(,) -ident(sin)operator(()operator(() ident(y)operator(.) ident(to_f) operator(+) integer(200) operator(\))operator(*)constant(PI)operator(/)operator(() ident(q)operator(\))operator(\))operator(;)operator([)operator(()ident(f1)operator(*)float(30.0)float(+110.0)operator(\))operator(.) -ident(to_i)operator(,)operator(()operator(()ident(f1)operator(+)ident(z)operator(\))operator(*)float(10.0)float(+40.0)operator(\))operator(.)ident(to_i)operator(,)operator(()ident(z)operator(*)float(20.0)float(+120.0)operator(\))operator(.)ident(to_i)operator(])operator(})operator(;)constant(Y)operator(.)ident(times)operator({)operator(|)ident(i)operator(|)constant(X)operator(.) -ident(times)operator({)operator(|)ident(j)operator(|)ident(i1)operator(=)operator(()operator(()ident(i)operator(*)float(0.3)integer(+150)operator(\))operator(*)operator(()ident(j)operator(*)float(1.1)integer(+50)operator(\))operator(/)float(50.0)operator(\))operator(.)ident(to_i)operator(;)ident(i2)operator(=)operator(()operator(()ident(i)operator(*)float(0.8)integer(+510)operator(\))operator(*)operator(() -ident(j)operator(*)float(0.9)integer(+1060)operator(\))operator(/)float(51.0)operator(\))operator(.)ident(to_i)operator(;)global_variable($s)operator([)ident(i)operator(])operator([)ident(j)operator(])operator(=)ident(x)operator([)operator(()ident(i1)operator(*)ident(i2)operator(\))operator(%)integer(255)operator(])operator(.)ident(clone)operator(})operator(})operator(;)global_variable($a)operator(=)operator(()integer(0)operator(..)integer(25)operator(\))operator(.) -ident(inject)operator(()operator([)operator(])operator(\))operator({)operator(|)ident(a)operator(,)ident(i)operator(|)ident(a)operator(<<)operator(()constant(V)operator(..)integer(3)operator(\))operator(.)ident(inject)operator(()operator([)operator(])operator(\))operator({)operator(|)ident(r)operator(,)ident(j)operator(|)ident(r)operator(<<)global_variable($c)operator([)ident(i)operator(*)integer(4)operator(+)ident(j)operator(])operator(})operator(})operator(;)ident(u)operator(.)ident(call)operator(;)reserved(end) -constant(I)operator(=)constant(LocalJumpError)operator(;)reserved(def) method(run)operator(*)ident(a)operator(,)operator(&)ident(b)operator(;)reserved(return) reserved(if) ident(a)operator(.)ident(size)operator(==)constant(V)operator(;)reserved(if) ident(a)operator([)constant(V)operator(])operator(==)integer(666)operator(;)global_variable($b)operator(=)ident(b) -reserved(elsif)global_variable($b)operator(;)global_variable($b)operator(.)ident(call)operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(def) method(main) ident(s)operator(,)operator(&)ident(u)operator(;)global_variable($m)operator(=)constant(V)operator(;)ident(u)operator(.)ident(call) reserved(rescue) constant(I)operator(;)reserved(end) -reserved(def) method(rb_eval_string)operator(()operator(*)ident(a)operator(\))operator(;)reserved(end) comment(# you promised not to look here) -reserved(def) method(ruby_init)operator(;)ident(q)operator(=)float(2.0)operator(;)ident(l)operator(=)operator(()operator(()constant(X)operator(**)ident(q)operator(\))operator(*)constant(A)operator(+)operator(()constant(Y)operator(**)ident(q)operator(\))operator(*)constant(A)operator(\))operator(**)constant(A)operator(;)constant(V)operator(.)ident(upto)operator(()constant(Y)integer(-4)operator(\))operator({)operator(|)ident(s)operator(|)constant(V)operator(.) -ident(upto)operator(()constant(X)integer(-4)operator(\))operator({)operator(|)ident(q)operator(|)ident(d)operator(=)operator(()operator(()ident(q)operator(-)constant(X)operator(/)constant(A)operator(\))operator(**)ident(q)operator(+)operator(()ident(s)operator(-)constant(Y)operator(/)constant(A)operator(\))operator(**)ident(q)operator(\))operator(**)constant(A)operator(;)ident(e)operator(=)operator(()ident(cos)operator(()ident(d)operator(*)constant(PI)operator(/)operator(()ident(l)operator(/)ident(q)operator(\))operator(\))operator(/)ident(q) -operator(+)constant(A)operator(\))operator(*)float(3.0)float(+1.0)operator(;)ident(v)operator(=)integer(2)operator(;)ident(f)operator(=)ident(v)operator(/)ident(e)operator(;)ident(a)operator(,)ident(p)operator(,)ident(b)operator(=)global_variable($s)operator([)ident(s)operator(])operator(,)global_variable($s)operator([)ident(s)integer(+1)operator(])operator(,)global_variable($s)operator([)ident(s)operator(+)ident(v)operator(])operator(;)ident(r)operator(=)ident(a)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(*)ident(e)operator(+) -ident(p)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(+)ident(a)operator([)ident(q)integer(+1)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(+)ident(a)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(+)ident(v)operator(/)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(p)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(+) -ident(v)operator(])operator([)constant(V)operator(])operator(*)ident(f)operator(;)ident(g)operator(=)operator([)ident(a)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(,)ident(b)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(,)ident(a)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(,)ident(b)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(])operator(;)ident(h)operator(=)operator(()ident(g)operator(.)ident(max)operator(-)ident(g)operator(.)ident(min) -operator(\))operator(*)ident(f)operator(;)global_variable($s)operator([)ident(s)operator(])operator([)ident(q)operator(])operator([)constant(V)operator(])operator(=)operator([)operator([)operator(()ident(r)operator(/)operator(()ident(e)operator(+)ident(f)float(+6.0)operator(\))operator(+)constant(A)operator(+)operator(()ident(h)operator(*)float(0.4)operator(\))operator(\))operator(.)ident(to_i)operator(,)integer(255)operator(])operator(.)ident(min)operator(,)constant(V)operator(])operator(.)ident(max) -operator(})operator(})operator(;)constant(File)operator(.)ident(open)operator(()stringoperator(,)stringoperator(\))operator({)operator(|)ident(f)operator(|)ident(f)operator(.)ident(write)operator(()comment(# secret.greetings :-\)) -stringcontent( )inlinechar(\\n)content(255)char(\\n)delimiter(")>operator(+)global_variable($s)operator(.)ident(map)operator({)operator(|)ident(a)operator(|)ident(a)operator(.)ident(map)operator({)operator(|)ident(b)operator(|)ident(b)operator(.)ident(join)string -operator(})operator(.)ident(join)operator(()stringoperator(\))operator(+)stringoperator(})operator(.)ident(join)operator(\))operator(})operator(;)reserved(end)operator(;)reserved(def) method(switch) ident(i)operator(,)operator(&)ident(b)operator(;)ident(b)operator(.)ident(call)operator(;)reserved(return) reserved(unless) -reserved(defined?)operator(()global_variable($m)operator(\))operator(;)ident(b)operator(=)operator(()constant(X)operator(*)float(0.01)operator(\))operator(.)ident(to_i)operator(;)ident(d)operator(=)float(1.0)operator(/)float(40.0)operator(;)ident(e)operator(=)float(0.09)operator(;)ident(c)operator(=)operator(()constant(Y)operator(*)float(0.01)operator(\))operator(.)ident(to_i) -ident(a)operator(=)global_variable($a)operator(.)ident(map)operator({)operator(|)operator(()ident(f)operator(,)ident(g)operator(,)ident(h)operator(,)ident(j)operator(\))operator(|)operator([)ident(f)operator(*)ident(d)operator(,)ident(g)operator(*)ident(e)operator(,)ident(h)operator(*)ident(d)operator(,)ident(j)operator(*)ident(e)operator(])operator(})operator(;)ident(a)operator(.)ident(each)operator({)operator(|)operator(()ident(k)operator(,)ident(l)operator(,)ident(m)operator(,)ident(n)operator(\))operator(|)ident(u)operator(()global_variable($s)operator(,)operator(()ident(k)operator(*)constant(X) -operator(\))operator(.)ident(to_i)operator(+)ident(b)operator(+)ident(i)operator(,)operator(()ident(l)operator(*)constant(Y)operator(\))operator(.)ident(to_i)operator(+)ident(c)operator(+)ident(i)operator(,)operator(()ident(m)operator(*)constant(X)operator(\))operator(.)ident(to_i)operator(+)ident(b)operator(+)ident(i)operator(,)operator(()ident(n)operator(*)constant(Y)operator(\))operator(.)ident(to_i)operator(+)ident(c)operator(+)ident(i)operator(,)operator([)constant(Z)operator(])operator(*)integer(3)operator(\))operator(}) -ident(a)operator(.)ident(each)operator({)operator(|)operator(()ident(o)operator(,)ident(q)operator(,)ident(r)operator(,)ident(s)operator(\))operator(|)ident(u)operator(()global_variable($s)operator(,)operator(()ident(o)operator(*)operator(()constant(X)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(q)operator(*)operator(()constant(Y)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(r)operator(*)operator(()constant(X)operator(-) -constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(s)operator(*)operator(()constant(Y)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator([)operator(()integer(1)operator(<<)integer(8)operator(\))integer(-1)operator(])operator(*)integer(3)operator(\))operator(})operator(;)reserved(end)operator(;)constant(Q)operator(=)constant(Object)operator(;)reserved(class) -class(Regexp)operator(;)reserved(def) method([]=)operator(()ident(v)operator(,)ident(is)operator(\))operator(;)ident(is)operator(.)ident(each)operator({)operator(|)ident(s)operator(|)constant(Q)operator(.)ident(send)operator(()symbol(:remove_const)operator(,)ident(s)operator(\))reserved(if) constant(Q)operator(.) -ident(const_defined?) ident(s)operator(;)constant(Q)operator(.)ident(const_set)operator(()ident(s)operator(,)ident(v)operator(\))operator(})operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(def) method(int)operator(*)ident(ptr)operator(;)integer(666) -reserved(end)operator(;)reserved(class) class(O)operator(;)reserved(def) method([]=)operator(()ident(a)operator(,)ident(b)operator(=)pre_constant(nil)operator(\))operator(;)global_variable($c)operator(=)ident(a)operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(alias)symbol(:void)symbol(:goto) -comment(#endif // pretend as if you havn't seen anything) -operator(=)reserved(end) - +ident(a)operator(.)ident(each)operator({)operator(|)ident(el)operator(|)ident(anz)operator([)ident(el)operator(])operator(=)ident(anz)operator([)ident(el)operator(])operator(?)ident(anz)operator([)ident(el)operator(])integer(+1)operator(:)integer(1)operator(}) +reserved(while) ident(x)operator(<)integer(10000) +comment(#a bis f dienen dazu die Nachbarschaft festzulegen. Man stelle sich die #Zahl von 1 bis 64 im Binärcode vor 1 bedeutet an 0 aus) + ident(b)operator(=)operator(()ident(p)operator([)ident(x)operator(])operator(%)integer(32)operator(\))operator(/)integer(16)operator(<)integer(1) operator(?) integer(0) operator(:) integer(1) + + operator(()ident(x)integer(-102)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-102)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(a)operator(+)operator(()ident(x)integer(-101)operator(>)operator(=)integer(0)operator(?)ident(n)operator([)ident(x)integer(-101)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(e)operator(+)ident(n)operator([)ident(x)integer(-100)operator(])operator(.)ident(to_i)operator(+)operator(()ident(x)integer(-99)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-99)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(f)operator(+)operator(()ident(x)integer(-98)operator(>)operator(=)integer(0)operator(?) ident(n)operator([)ident(x)integer(-98)operator(])operator(.)ident(to_i) operator(:) integer(0)operator(\))operator(*)ident(a)operator(+) + ident(n)operator([)ident(x)integer(+199)operator(])operator(.)ident(to_i)operator(*)ident(b)operator(+)ident(n)operator([)ident(x)integer(+200)operator(])operator(.)ident(to_i)operator(*)ident(d)operator(+)ident(n)operator([)ident(x)integer(+201)operator(])operator(.)ident(to_i)operator(*)ident(b) + +comment(#und die Ausgabe folgt) +ident(g)operator(=)string +ident(x)operator(=)integer(0) + +comment(=begin +class Hello + @hi #class-instance-variable + self <delimiter(")> + ident(x)operator(+=)integer(1) +reserved(end) + +ident(puts)string +ident(sleep)operator(()integer(10)operator(\)) + +float(1E1)constant(E1) +ident(puts) integer(30)operator(.)ident(send)operator(()symbol(:/)operator(,) integer(5)operator(\)) comment(# prints 6) + +string +shell +string +regexp +symbol +symbol +string +string +string +string +string +symbol +regexp +shell + +comment(#%W[ but #@0illegal_values look strange.]) + +operator(%)constant(Quark) ident(dazu) + +operator(%) ident(abc) comment(# FIXME) + +symboloperator({)ident(constructs)operator(}) +symbolglobal_variable($constructs) +symbolclass_variable(@@constructs) + +regexpinteger(00) +shellident(x00) + +operator(~)regexp)delimiter(#)modifier(i)> operator(..) operator(~)regexp)delimiter(#)modifier(i)>operator(;) + +ident(a) operator(=) stringstring + +ident(a) operator(=) stringstring + +ident(b)operator(=)operator(()ident(p)operator([)ident(x)operator(]) operator(%)integer(32)operator(\))operator(/)integer(16)operator(<)integer(1) operator(?) integer(0) operator(:) integer(1) + +comment(#<<"") +stringstringcontent( +)escape(#)instance_variable(@bla)content( +#die suppe!!! +)char(\\xff)content(fff + + +super <<-EOE % [ + EOE + +< +constant(X) +symbol +string +string +symbol +symbol + +string + +stringdelimiter(})>content( rocks)delimiter(])> delimiter(})>content( ! )delimiter(])> + +stringdelimiter(})>content( break)delimiter(")> +ident(the) ident(code)operator(.) +ident(may) + +comment(# this is a known bug.) +ident(p) stringstringdelimiter(})>content( +code. +that)delimiter( +this)> +ident(that) + +comment(##################################################################) +reserved(class) class(NP) +reserved(def) method(initialize) ident(a)operator(=)instance_variable(@p)operator(=)operator([)operator(])operator(,) ident(b)operator(=)instance_variable(@b)operator(=)operator([)operator(])operator(;) reserved(end) +reserved(def) method(+@)operator(;)instance_variable(@b)operator(<<)integer(1)operator(;)ident(b2c) reserved(end)operator(;)reserved(def)method(-@)operator(;)instance_variable(@b)operator(<<)integer(0)operator(;)ident(b2c) reserved(end) +reserved(def) method(b2c)operator(;)reserved(if) instance_variable(@b)operator(.)ident(size)operator(==)integer(8)operator(;)ident(c)operator(=)integer(0)operator(;)instance_variable(@b)operator(.)ident(each)operator({)operator(|)ident(b)operator(|)ident(c)operator(<<)operator(=)integer(1)operator(;)ident(c)operator(|=)ident(b)operator(})operator(;)ident(send)operator(() + stringoperator(.)ident(reverse)operator(,)operator(()instance_variable(@p)operator(.)ident(join)operator(\))operator(\))reserved(if) ident(c)operator(==)integer(0)operator(;)instance_variable(@p)operator(<<)ident(c)operator(.)ident(chr)operator(;)instance_variable(@b)operator(=)operator([)operator(]) reserved(end) + pre_constant(self) reserved(end) reserved(end) operator(;) reserved(begin) ident(_) operator(=) constant(NP)operator(.)ident(new) reserved(end) +ident(c) +comment(# ^ This is a bug :() + +comment(# The Programming Language `NegaPosi') +operator(+)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)ident(_) +operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)ident(_) +operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)ident(_) +operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(-)operator(+)operator(-)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(+)operator(+)operator(-)operator(+)operator(+)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-)operator(+)operator(+)operator(-)ident(_) +operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(-)operator(+)operator(-)operator(+)operator(-)operator(-)operator(-)operator(-) ident(_) +comment(##################################################################) + + +comment(# date: 03/18/2004) +comment(# title: primes less than 1000 ( 2005 Obfuscated Ruby Contest \)) +comment(# author: Jim Lawless) +comment(# email: jimbo at radiks dotski net) +comment(# comments: This program will display all positive prime integers) +comment(# less than 1000. Program licens is the same as the Ruby) +comment(# license ( http://www.ruby-lang.org/en/LICENSE.txt \)) + + global_variable($e)operator(=)string + +reserved(def) method(a)operator(()operator(\)) + global_variable($a)operator(=)global_variable($a)integer(+1) +reserved(end) + +reserved(def) method(b)operator(()operator(\)) + global_variable($a)operator(=)global_variable($a)integer(+5) +reserved(end) + +reserved(def) method(c)operator(()operator(\)) + global_variable($e)operator(=)global_variable($e)operator(+)global_variable($a)operator(.)ident(chr) +reserved(end) + +reserved(def) method(d)operator(()operator(\)) + global_variable($a)operator(=)integer(10) +reserved(end) + +reserved(def) method(e)operator(()operator(\)) + global_variable($a)operator(=)global_variable($a)integer(+16) +reserved(end) + +ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;) +ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;) +ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;) +ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(d)operator(;)ident(e)operator(;)ident(b)operator(;)ident(a)operator(;)ident(c)operator(;)ident(eval) global_variable($e) + +global_variable($_)operator(=)string" ","bHQ=)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck((?n-1\).chr\)[0]=> +:<,"Z3Q=)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck("m"\)[0]=>:>,"YW1w)char(\\n)content(".)char(\\x75)content(np)char(\\x61)content(ck((?l+1\).chr\)[0]=>:&)nesting_delimiter(})content(, +[[/^)char(\\\\)content(s+<)char(\\\\)content(/div>.+/m,""],[/^)char(\\\\)content(s+/,""],[/)char(\\n)content(/,")char(\\n)char(\\n)content("],[/
/,")char(\\n)content("], +[/
/,"-="*40],[/<[^>]+>/,""],[/^ruby/,""],[/)char(\\n)nesting_delimiter({)content(3,)nesting_delimiter(})content(/,")char(\\n)char(\\n)content("]];p)char(\\165)content(ts" +)char(\\#)nesting_delimiter({)content(l[0..-3])nesting_delimiter(})content(ing...)char(\\n)char(\\n)content(";send(Kernel.methods.find_all)nesting_delimiter({)content(|x|x[0]==?e)nesting_delimiter(})content([-1], +"re)char(\\#)nesting_delimiter({)content(q[5...8].downcase)nesting_delimiter(})content(re '111112101110-117114105'.scan(/-|)char(\\\\)char(\\\\)content(d)nesting_delimiter({)content(3)nesting_delimiter(})content(/\). +inject(''\))nesting_delimiter({)content(|m,v|v.length>1?m+v.to_i.chr: m+v)nesting_delimiter(})content("\);o)inlineoperator(.)ident(sort)operator(.)ident(join)operator(.)ident(downcase) +delimiter(})>content(n("http://www.)char(\\#)nesting_delimiter({)content(n)nesting_delimiter(})content("\))nesting_delimiter({)content(|w|$F=w.read.sc)char(\\x61)content(n(/li>.+?"([^"]+\)..([^<]+\)/\))nesting_delimiter(})content(;)char(\\160)content(uts)char(\\ +)content(")char(\\#)nesting_delimiter({)content(q)nesting_delimiter(})char(\\n)char(\\n)content(";$F.)char(\\145)char(\\141)content(ch)nesting_delimiter({)content(|e|i=e[0][/)char(\\\\)content(d+/];s="%2s. %s"%[i,e[1]];i.to_i%2==0 ? +)char(\\160)content(ut)char(\\x73)content((s\) : )inlineoperator([)integer(-1)operator(])delimiter(})>content(rint("%-38s "%s\))nesting_delimiter(})content(;p)char(\\x72)char(\\x69)char(\\x6e)content(t")char(\\n)content(? ";e)char(\\x76)content(al( +['puts")char(\\n)char(\\#)nesting_delimiter({)content(l[0..3])nesting_delimiter(})content(ing...)char(\\n)char(\\n)content("','$c=gets.chomp.to_i'].sort.join(";"\)\);)inlinecontent(pen("http://www.)char(\\#)nesting_delimiter({)content(n)nesting_delimiter(})content("+$F[$c-1][0]\))nesting_delimiter({)content(|n|$_=n.read[/^)char(\\\\)content(s+operator(..)stringoperator(\))operator(.) +ident(to_a)operator([)integer(10)integer(-5)operator(*)integer(2)operator(])delimiter(})>content(.e)char(\\141)content(ch)nesting_delimiter({)content(|(z,f\)|)char(\\x67)content(sub!(z,f\))nesting_delimiter(})content(;)char(\\147)content(sub!(/&()char(\\\\)content(w+\);/\))nesting_delimiter({)content(|y|p. +ke)char(\\171)char(\\077)content(($1\)?p[$1]:y)nesting_delimiter(})content(;while$_=~/([^)char(\\n)content(])nesting_delimiter({)content(81,)nesting_delimiter(})content(\)/:z=$1.dup;f=$1.dup;f[f.rindex( +" ",80\),1]=")char(\\n)content(";f.s)char(\\165)content(b!(/)char(\\n)content([ )char(\\t)content(]+/,")char(\\n)content("\);s)char(\\165)content(b!(/)char(\\#)nesting_delimiter({)content(R)char(\\x65)content(g)char(\\x65)content(xp. +)char(\\x65)content(scap)char(\\x65)content((z\))nesting_delimiter(})content(/,f\)end)nesting_delimiter(})content(;while)char(\\040)char(\\163)content(ub!(/^(?:[^)char(\\n)content(]*)char(\\n)content(\))nesting_delimiter({)content(20)nesting_delimiter(})content(/, ""\):puts")char(\\#)content($& +--)char(\\x4d)content(O)char(\\x52)content(E--";g=$_;g)inlinedelimiter(})>content(ts;;)inlineoperator([)integer(0)operator(..)integer(4)operator(])operator(.)ident(delete)operator(()stringoperator(\))delimiter(})>char(\\040)content(if$_[0]==?q +$_=g;end;$_.d)inlineoperator(.)ident(scan)operator(()regexpoperator(\))operator(.)ident(join)operator(.)ident(downcase) +delimiter(})>content(lay)delimiter(})>operator(;)ident(eval)global_variable($_) + + ident(d)operator(=)operator([)integer(30644250780)operator(,)integer(9003106878)operator(,) + integer(30636278846)operator(,)integer(66641217692)operator(,)integer(4501790980)operator(,) + integer(671_24_603036)operator(,)integer(131_61973916)operator(,)integer(66_606629_920)operator(,) + integer(30642677916)operator(,)integer(30643069058)operator(])operator(;)ident(a)operator(,)ident(s)operator(=)operator([)operator(])operator(,)global_variable($*)operator([)integer(0)operator(]) + ident(s)operator(.)ident(each_byte)operator({)operator(|)ident(b)operator(|)ident(a)operator(<<)operator(()stringoperator(%)ident(d)operator([)ident(b)operator(.) + ident(chr)operator(.)ident(to_i)operator(])operator(\))operator(.)ident(scan)operator(()regexpoperator(\))operator(}) + ident(a)operator(.)ident(transpose)operator(.)ident(each)operator({) operator(|)ident(a)operator(|) + ident(a)operator(.)ident(join)operator(.)ident(each_byte)operator({)\ + operator(|)ident(i)operator(|)ident(print) ident(i)operator(==)integer(49)operator(?)\ + operator(()global_variable($*)operator([)integer(1)operator(])operator(||)stringoperator(\))\ + operator(:)integer(32)operator(.)ident(chr)operator(}) + ident(puts) + operator(}) + +comment(#! /usr/bin/env ruby) +comment(# License: If Ruby is licensed to the general public in a certain way, this is also licensed in that way.) +ident(require)stringoperator(;)ident(eval)operator(()constant(Zlib)operator(::)constant(Inflate)operator(.)ident(inflate)operator(()string[T)char(\\353)content(U)char(\\265)char(\\276)content(L)char(\\257)char(\\353)char(\\325)char(\\235)content(-')char(\\277)char(\\226)char(\\233)content(ui)char(\\323)content(Uy1)char(\\251)char(\\027)char(\\027)char(\\341)char(\\253)char(\\371)char(\\346)content(r)char(\\e)char(\\245)content(u)char(\\366)char(\\216)char(\\205)content(f)char(\\263)char(\\367)char(\\357)char(\\336)content(&)char(\\353)char(\\362)content(S)char(\\010)content(zr=)char(\\277)char(\\331)content(5w)char(\\315)content(]r[)char(\\237)content(o)char(\\333)char(\\344)content(c])char(\\255)content(#>)char(\\343)content(O)char(\\025)char(\\352)char(\\037)char(\\334)char(\\177)char(\\341)char(\\367)char(\\364)char(\\271)char(\\t)char(\\003)char(\\245)char(\\337)content(|)char(\\027)char(\\304)char(\\364)content(aM@:)char(\\363)char(\\260)char(\\316)content(>)char(\\237)char(\\232)char(\\323)content(()char(\\326)char(\\252)content(()char(\\327)char(\\253)char(\\t)char(\\275)char(\\323)char(\\332)content(h)char(\\253)char(\\224)content(V)char(\\306)content(d)char(\\247)char(\\037)char(\\362)char(\\371)char(\\311)content(})char(\\321)char(\\314)content(f)char(\\356)char(\\363)content(C)char(\\016)char(\\311)char(\\342)char(\\365)char(\\361)content(ij)char(\\026)char(\\037)char(\\313)char(\\345)char(\\355)char(\\357)content(7)char(\\363)content(e)char(\\231)char(\\224)char(\\363)char(\\345)char(\\325)content(y)char(\\315)char(\\204)content(])char(\\263)content(l)char(\\362)content(0)char(\\177)char(\\317)char(\\241)char(\\024)content(M)char(\\376)char(\\263)char(\\235)content(o)char(\\267)content(Et)char(\\222)content(/)char(\\223)content(%)char(\\037)char(\\213)char(\\374)content(D)char(\\323)char(\\373)content(M)char(\\321)content(4Kv-)char(\\373)content(<)char(\\361)char(\\026)char(\\233)content(&)char(\\\\)char(\\304)char(\\253)content(,)char(\\354)char(\\270)char(\\263)char(\\314)content(\))char(\\232)char(\\374)content(8)char(\\311)char(\\247)content(]z)char(\\216)content(v)char(\\313)content(6)char(\\235)char(\\306)char(\\323)char(\\243)char(\\035)char(\\262)char(\\263)char(\\214)char(\\332)char(\\f)char(\\024)char(\\342)char(\\257)char(\\327)char(\\345)char(\\264)char(\\230)char(\\205)char(\\313)content(o36)char(\\312)content(2)char(\\254)content(e2)char(\\260)char(\\236)char(\\261)content(0)char(\\202)char(\\354)char(\\037)char(\\260)char(\\256)content( (f=/)char(\\313)content(:Z)char(\\024)char(\\245)char(\\313)char(\\244)content(Zoo)char(\\347)char(\\353)content(ey~])char(\\336)content(^)char(\\325)char(\\253)content(-)char(\\a)char(\\273)content(k)char(\\252)content(fqv6)char(\\235)char(\\333)content(j)char(\\276)char(\\355)char(\\236)content(tV)char(\\252)char(\\230)char(\\377)content(F)char(\\276)char(\\n)char(\\333)char(\\277)char(\\257)char(\\241)char(\\345)char(\\206)char(\\262)char(\\323)char(\\306)content(G)char(\\273)char(\\352)char(\\340)char(\\203)content(t)char(\\332)char(\\246)char(\\244)content(1`')char(\\316)char(\\316)char(\\266)char(\\245)char(\\275)content(H)char(\\003)content(2)char(\\377)content(l)char(\\253)char(\\017)content(,=42E)char(\\002)char(\\360)char(\\236)char(\\246)char(\\345)content(_s;Y)char(\\274)content(^)char(\\305)char(\\367)content(Q)char(\\233)char(\\036)char(\\233)char(\\276)char(\\016)char(\\312)char(\\245)content(0=)char(\\256)content(=)char(\\305)content(U)char(\\202)char(\\230)char(\\254)char(\\")char(\\222)char(\\265)char(\\004)char(\\217)char(\\237)content(~)char(\\373)char(\\345)char(\\017)char(\\")content(h)char(\\243)char(\\210)char(\\307)content(j)char(\\235)char(\\251)char(\\205)content(V8)char(\\353)char(\\304)content(X)char(\\372)content(!1CGc-)char(\\251)char(\\240)char(\\337)char(\\020)char(\\317)char(\\361)content(#)char(\\036)char(\\023)char(\\n)char(\\255)content(6)char(\\254)content(Cg3)char(\\002)content(})char(\\265)char(\\356)content(s)char(\\235)char(\\202)content(K[K)char(\\022)char(\\020)content( )char(\\243)char(\\206)char(\\216)char(\\241)content(p3)char(\\332)content(55)char(\\350)char(\\232)char(\\036)char(\\030)content(q$)char(\\233)char(\\344)content(!)char(\\363)char(\\204)content(^},$)char(\\023)content(Xg)char(\\235)content(:)char(\\364)content(r1)char(\\")content(1)char(\\344)char(\\277)char(\\261)char(\\207)char(\\031)content(()char(\\301)content(DE)char(\\260)char(\\344)char(\\026)content(Y)char(\\177)char(\\345)char(\\036)char(\\221)char(\\204)content(mP)char(\\263)char(\\266)content(Mk)char(\\305)char(\\366)char(\\210)content(%3)char(\\220)char(\\302)content(S)char(\\322)char(\\306)content(IR)char(\\316)char(\\377)content(!)char(\\203)content( S)char(\\336)char(\\310)char(\\216)char(\\215)char(\\203)char(\\315)char(\\002)content(-)char(\\211)content( 5D2)char(\\257)char(\\210)char(\\302)char(\\321)content(p)char(\\234)char(\\364)char(\\205)char(\\222)content(Jj)char(\\220)char(\\022)content(E)char(\\321)content(h)char(\\347)char(\\223)content(RQ*94K)char(\\022)char(\\243)char(\\314)content(H`4{LV)char(\\003)char(\\021)content(N)char(\\f)char(\\333)char(\\364)content(I)char(\\347)content(l)char(\\327)content(UR)char(\\305)content(t)char(\\340)char(\\332)content(i>)char(\\241)content(x=Mu4R)char(\\245)char(\\373)char(\\223)char(\\244)char(\\251)content(NB)char(\\211)char(\\247)char(\\236)char(\\346)content(5)char(\\253)content(^bx)char(\\332)content(Yc)char(\\263)char(\\252)content(M)char(\\220)content(b)char(\\253)char(\\220)char(\\310)char(\\004)char(\\331)char(\\242)char(\\020)content(,`)char(\\005)content(T)char(\\021)content(Y)char(\\251)content(P@)char(\\020)char(\\365)content(Ax)char(\\310)content(z)char(\\364)char(\\264)char(\\240)char(\\265)content(vj2)char(\\037)content(?0)char(\\v)char(\\")content(en)char(\\244)char(\\374)char(\\251)char(\\032)char(\\225)char(\\253)content(v)char(\\346)char(\\253)char(\\371)content(2)char(\\215)char(\\032)char(\\322)content((o)char(\\206)content(~A)char(\\006)char(\\010)char(\\f)char(\\324)char(\\223)content(57)char(\\026)char(\\")char(\\316)char(\\024)char(\\365)char(\\021)char(\\360)content(@)char(\\277)content(:)char(\\363)content(.$)char(\\f)char(\\342)char(\\016)content($)char(\\200)char(\\v)char(\\341)char(\\302)char(\\230)char(\\020)char(\\340)char(\\341)char(\\201)content(K)char(\\017)char(\\270)content(+i)char(\\326)content(-)char(\\312)char(\\313)content(j)char(\\235)char(\\n)content([)char(\\376)content(({)char(\\330)content(u)char(\\254)char(\\266)char(\\334)char(\\034)char(\\031)char(\\367)content(%:CK)char(\\210)content({)char(\\311)content(h)char(\\a)content(QH)char(\\333)content(Q)char(\\023)char(\\250)char(\\210)content(;e)char(\\360)char(\\322)char(\\362)char(\\213)char(\\202)char(\\247)char(\\216)char(\\266)char(\\340)content(C&(p)char(\\274)content(HT7)char(\\336)content(&B)char(\\352)char(\\300)char(\\036)content(z)char(\\206)char(\\204)char(\\375)content( )char(\\032)content(z)char(\\304)char(\\233)char(\\217)char(\\034)char(\\267)content(AK)char(\\207)content(R)char(\\363)char(\\213)char(\\324)content(u)char(\\334)char(\\203)char(\\272)content(h)char(\\234)content( )char(\\304)content(&)char(\\364)content(S)char(\\302)content(]|)char(\\024)char(\\233)content(b)char(\\000)char(\\023)content(E)char(\\034)char(\\005)char(\\300)content(!)char(\\330)char(\\227)content(4)char(\\026)char(\\205)char(\\316)char(\\363)char(\\203)char(\\364)char(\\")char(\\316)char(\\245)content(!)char(\\242)char(\\360)content(Y?4)char(\\204)content(b)char(\\023)content(.)char(\\200)content(9)char(\\036)content(X)char(\\300)char(\\213)content(p)char(\\200)content(])char(\\304)char(\\324)char(\\200)content($^)char(\\204)char(\\025)char(\\222)content(D)char(\\325)content(X )char(\\363)char(\\324)char(\\004)char(\\223)char(\\205)char(\\207)char(\\241)content(M)char(\\245)char(\\352)char(\\341)content((s)char(\\341)content(5)char(\\260)content(w)char(\\226)char(\\313)content(=)char(\\242)content(2 )char(\\200)char(\\177)char(\\344)char(\\355)char(\\211)char(\\335)content(0)char(\\004)char(\\341)char(\\217)char(\\207)char(\\215)content(r%x)char(\\030)char(\\302)char(\\304)char(\\230)char(\\335)content({#)char(\\250)content(#o)char(\\204)content(h)char(\\327)content(;)char(\\220)char(\\242)char(\\275)content(B%j&)char(\\343)content(e)char(\\005)char(\\226)content(/)char(\\r)char(\\200)char(\\035)char(\\035)char(\\206)content(K)char(\\243)char(\\027)char(\\216)content(Z)char(\\230)char(\\323)content(.)char(\\335)char(\\356)content(^!)char(\\v)content(F)char(\\002)content(K)char(\\366)char(\\246)content(kG)char(\\321)char(\\364)content(E)char(\\301)char(\\362)char(\\250)char(\\275)content(a)char(\\f)char(\\031)char(\\207)content(i%)char(\\216)char(\\342)content(&ie)char(\\205)char(\\260)char(\\324)content(})char(\\272)char(\\252)content(ho)char(\\222)char(\\306)char(\\370)char(\\362)content(!}6)char(\\364)content(C)char(\\003)char(\\271)content(7)char(\\206)content('!.)char(\\315)char(\\036)content(mhMm)char(\\370)char(\\252)char(\\241)char(\\365)char(\\221)content(g)char(\\275)char(\\326)content(A)char(\\302)char(\\254)char(\\270)content(X,)char(\\371)char(\\353)char(\\232)content(:)char(\\222)char(\\321)char(\\253)char(\\025)char(\\217)content(v%)char(\\222)char(\\023)content(!)char(\\243)content(r)char(\\272)char(\\364)content(()char(\\376)char(\\177)char(\\236)char(\\374)char(\\233)char(\\363)char(\\304)content(8)char(\\330)content(b)char(\\241)content(xdTp)char(\\325)char(\\321)char(\\377)char(\\342)content(8F)char(\\234)char(\\214)char(\\263)char(\\357)char(\\255)content(f)char(\\324)char(\\306)char(\\226)char(\\257)char(\\022)char(\\")char(\\000)char(\\354)char(\\003)char(\\024)content(C)char(\\207)char(\\n)content(a)char(\\353)char(\\240)content(&O)char(\\305)char(\\376)char(\\004)content(ncy)char(\\350)char(\\f)char(\\276)char(\\357)content(+Q|)char(\\201)content(bBi)char(\\206)char(\\277)char(\\345)content(u)char(\\251)char(\\273)char(\\310)char(\\367)char(\\242)char(\\303)content(*)char(\\204)content(d)char(\\n)char(\\271)content(})char(\\016)char(\\234)content(5r8)char(\\034)char(\\201)content([)char(\\343)content(:>)char(\\364)content(*)char(\\242)char(\\266)char(\\025)content(+HZ)char(\\263)content(e)char(\\212)char(\\024)content(7q)char(\\357)char(\\310)content(X)char(\\267)content([)char(\\333)content((9_o}P)char(\\201)char(\\324)content(>)char(\\266)char(\\364)char(\\000)char(\\217)content(hh)char(\\352)char(\\225)content(a)char(\\213)content(q)char(\\260)char(\\031)char(\\334)char(\\022)content(sg)char(\\360)char(\\e)char(\\206)char(\\234)content(B=)char(\\246)char(\\242)content(1)char(\\341)content(e)char(\\364)char(\\270)char(\\321)char(\\224)char(\\347)char(\\005)content(6L)char(\\267)char(\\227)content(\))char(\\244)char(\\210)char(\\307)char(\\027)char(\\257)content(<)char(\\343)char(\\257)char(\\000)char(\\303)char(\\264)content(u{)char(\\235)char(\\326)char(\\352)content(i)char(\\303)content(^)char(\\332)char(\\200)char(\\n)char(\\236)char(\\243)content(a)char(\\277)char(\\034)content(J#~S)char(\\335)content('2)char(\\371)char(\\001)content(q)char(\\374)content(5$)char(\\356)char(\\027)content(^)char(\\371)char(\\325)char(\\344)char(\\331)char(\\036)char(\\362)char(\\004)char(\\267)char(\\330)char(\\251)content(<)char(\\212)char(\\237)char(\\257)char(\\345)content(kr)char(\\371)char(\\302)content(d)char(\\362)content(r)char(\\376)char(\\344)content(d)char(\\252)content(C)char(\\311)char(\\374)content(R6)char(\\017)content(e)char(\\375)char(\\005)char(\\271)content(yAV)char(\\363)content(/)char(\\257)char(\\345)char(\\261)content(()char(\\340)content(hW)char(\\020)char(\\222)char(\\a)char(\\027)content(k\)60)char(\\354)char(\\217)char(\\363)char(\\350)content(1)char(\\263)content(rt)char(\\036)content(4)char(\\025)char(\\025)content(|)char(\\265)char(\\031)char(\\355)char(\\276)content(d)char(\\357)char(\\315)content(9)char(\\367)char(\\225)char(\\025)char(\\223)content(U)char(\\273)content(n)char(\\027)char(\\324)char(\\321)content(H)char(\\031)char(\\030)char(\\036)char(\\357)char(\\356)char(\\377)char(\\010)char(\\266)char(\\337)char(\\374)char(\\003)char(\\337)content(5Q)char(\\335)delimiter(")>operator(\))operator(\)) +comment(#include "ruby.h" /*) + regexpcontent( *)delimiter(/)> + +comment(#define GUN1 42:) +comment(#define GUN2 43:) +comment(#define bo do) +comment(#define when(gun\) /**/) +comment(#define DATA "p 'Hello embedded world'") +comment(#define DIRTY(argc,argv\)\\) +ident(argc)operator(,)ident(argv)operator(,)ident(char)operator(=)ident(eval)operator(()\ +stringchar(\\n)content([3,2,1])delimiter(")>\ +operator(\))operator(;)ident(sun)operator(=)constant(O)operator(.)ident(new)\ +reserved(if)operator(()integer(0)operator(\)) + +ident(int) +ident(sun)operator([)operator(])operator(=)operator({)integer(12)operator(,)integer(9)operator(,)integer(16)operator(,)integer(9)operator(,)integer(2)operator(,)integer(1)operator(,)integer(7)operator(,)integer(1)operator(,)integer(3)operator(,)integer(9)operator(,)integer(27)operator(,)integer(4)operator(,) integer(13)operator(,)integer(2)operator(,)integer(11)operator(,)integer(5)operator(,)integer(4)operator(,)integer(1)operator(,)integer(25)operator(,) +integer(5)operator(,)integer(0)operator(,)integer(1)operator(,)integer(14)operator(,)integer(9)operator(,)integer(15)operator(,)integer(4)operator(,)integer(26)operator(,)integer(9)operator(,)integer(23)operator(,)integer(2)operator(,)integer(17)operator(,)integer(6)operator(,)integer(31)operator(,) integer(6)operator(,)integer(10)operator(,)integer(8)operator(,)integer(22)operator(,)integer(9)operator(,)integer(21)operator(,)integer(1)operator(,) +integer(24)operator(,)integer(8)operator(,)integer(20)operator(,)integer(8)operator(,)integer(18)operator(,)integer(9)operator(,)integer(29)operator(,)integer(5)operator(,)integer(9)operator(,)integer(5)operator(,)integer(1)operator(,)integer(1)operator(,)integer(28)operator(,)integer(8)operator(,)integer(8)operator(,)integer(1)operator(,)integer(30)operator(,) integer(9)operator(,)integer(6)operator(,)integer(8)operator(,) integer(5)operator(,)integer(1)operator(,) +integer(19)operator(,)integer(9)operator(,)integer(36)operator(,)integer(19)operator(,)integer(43)operator(,) integer(9)operator(,)integer(34)operator(,)integer(11)operator(,)integer(50)operator(,)integer(19)operator(,)integer(48)operator(,)integer(18)operator(,)integer(49)operator(,)integer(9)operator(,) integer(35)operator(,)integer(8)operator(,)integer(42)operator(,)integer(18)operator(,) +integer(51)operator(,)integer(8)operator(,)integer(44)operator(,)integer(11)operator(,)integer(32)operator(,) integer(11)operator(,)integer(47)operator(,)integer(9)operator(,)integer(37)operator(,)integer(1)operator(,)integer(39)operator(,)integer(9)operator(,)integer(38)operator(,)integer(19)operator(,) integer(45)operator(,)integer(8)operator(,)integer(40)operator(,)integer(12)operator(,) +integer(41)operator(,)integer(9)operator(,)integer(46)operator(,)integer(12)operator(,)integer(33)operator(,)integer(1)operator(,)integer(57)operator(,)integer(1)operator(,)integer(85)operator(,)integer(5)operator(,)integer(88)operator(,)integer(28)operator(,)integer(83)operator(,)integer(4)operator(,)integer(87)operator(,) integer(6)operator(,)integer(62)operator(,)integer(28)operator(,)integer(89)operator(,) +integer(9)operator(,)integer(80)operator(,)integer(28)operator(,)integer(60)operator(,)integer(21)operator(,)integer(52)operator(,)integer(21)operator(,)integer(72)operator(,)integer(29)operator(,)integer(54)operator(,)integer(21)operator(,)integer(75)operator(,)integer(8)operator(,)integer(70)operator(,)integer(29)operator(,)integer(58)operator(,)integer(28)operator(,)integer(65)operator(,) +integer(9)operator(,)integer(91)operator(,)integer(8)operator(,)integer(74)operator(,)integer(29)operator(,)integer(79)operator(,)integer(2)operator(,)integer(77)operator(,)integer(1)operator(,)integer(53)operator(,)integer(1)operator(,)integer(81)operator(,)integer(5)operator(,) integer(69)operator(,)integer(2)operator(,)integer(64)operator(,)integer(21)operator(,) integer(86)operator(,)integer(29)operator(,) +integer(67)operator(,)integer(9)operator(,)integer(59)operator(,)integer(1)operator(,)integer(61)operator(,)integer(5)operator(,)integer(73)operator(,)integer(6)operator(,)integer(76)operator(,)integer(28)operator(,)integer(56)operator(,)integer(21)operator(,)integer(68)operator(,)integer(29)operator(,)integer(78)operator(,)integer(29)operator(,)integer(63)operator(,)integer(5)operator(,)integer(66)operator(,) +integer(28)operator(,)integer(90)operator(,)integer(29)operator(,) integer(71)operator(,)integer(4)operator(,)integer(55)operator(,)integer(9)operator(,)integer(84)operator(,)integer(28)operator(,)integer(82)operator(,)integer(29)operator(,)integer(101)operator(,)integer(5)operator(,) integer(103)operator(,)integer(9)operator(,) integer(98)operator(,)integer(35)operator(,) +integer(97)operator(,)integer(1)operator(,)integer(94)operator(,)integer(35)operator(,)integer(93)operator(,)integer(1)operator(,)integer(100)operator(,)integer(35)operator(,)integer(92)operator(,)integer(31)operator(,)integer(99)operator(,)integer(5)operator(,)integer(96)operator(,)integer(39)operator(,)integer(95)operator(,)integer(5)operator(,)integer(102)operator(,)integer(35)operator(})operator(;) + +ident(void) ident(run)operator(()ident(int) ident(gun)operator(=)integer(0)operator(\)) operator({) regexp operator([)ident(gun)operator(])operator(=)operator([)symbol(:GUN1)operator(,)symbol(:GUN2)operator(]) + ident(printf)operator(()stringoperator(,) ident(gun)operator(\))operator(;) + ident(switch)operator(()ident(gun)operator(\)) operator({) + reserved(case) constant(GUN1) reserved(when)operator(()integer(2)operator(\)) + ident(printf)operator(()stringoperator(\))operator(;) + reserved(break)operator(;) regexp reserved(end) + reserved(case) constant(GUN2) reserved(when)operator(()integer(3)operator(\)) + ident(printf)operator(()stringoperator(\))operator(;) + reserved(break)operator(;) regexp reserved(end) + operator(}) +operator(}) + +ident(int) ident(main)operator(()ident(int) ident(argc)operator(,) ident(char)operator(**) ident(argv)operator(\)) operator({) + ident(printf)operator(()stringoperator(,) ident(argc)operator(\))operator(;) + ident(int) ident(fun)operator(=)integer(5)operator(;) + ident(bo) operator({) + ident(fun) operator(-=) integer(1)operator(;) regexpoperator(.)ident(id) operator(-) ident(gun) operator(=) ident(fun) + ident(run)operator(()ident(fun)operator(\))operator(;) + operator(}) reserved(while)operator(()ident(fun)operator(>)integer(0)operator(\))operator(;) + ident(ruby_init)operator(()operator(\))operator(;) + ident(rb_eval_string)operator(()pre_constant(DATA)operator(\))operator(;) + reserved(return) integer(0)operator(;) +operator(}) + +comment(#if 0 // nobody reads un-defined code) +reserved(def) method(goto)operator(*)ident(s)operator(;)global_variable($s)operator(=)operator([)operator(])operator(;)constant(Y)operator(.)ident(times)operator({)ident(s)operator(=)operator([)operator(])operator(;)constant(X)operator(.)ident(times)operator({)ident(s)operator(<<)operator([)integer(0)operator(])operator(*)integer(3)operator(})operator(;)global_variable($s)operator(<<) ident(s)operator(})reserved(end)operator(;)constant(A)operator(=)float(0.5) +ident(include) constant(Math)operator(;)reserved(def) method(u) ident(g)operator(,)ident(h)operator(,)ident(i)operator(,)ident(j)operator(,)ident(k)operator(,)ident(l)operator(;)ident(f)operator(,)operator(*)ident(m)operator(=)operator(()operator(()ident(j)operator(-)ident(h)operator(\))operator(.)ident(abs)operator(>)operator(()ident(k)operator(-)ident(i)operator(\))operator(.)ident(abs)operator(\))operator(?)operator([)ident(proc)operator({) +operator(|)ident(n)operator(,)ident(o)operator(|) ident(g)operator([)ident(o)operator(]) operator([)ident(n) operator(])operator(=)ident(l) operator(})operator(,)operator([)ident(h) operator(,)ident(i) operator(])operator(,)operator([)ident(j)operator(,)ident(k)operator(])operator(])operator(:)operator([)ident(proc)operator({) +operator(|)ident(p)operator(,)ident(q)operator(|) ident(g)operator([) ident(p)operator(])operator([) ident(q)operator(]) operator(=)ident(l)operator(}) operator(,)operator([) ident(i)operator(,)ident(h) operator(])operator(,) operator([)ident(k)operator(,)ident(j)operator(])operator(])operator(;)ident(b)operator(,)ident(a)operator(=)ident(m)operator(.)ident(sort) +ident(c)operator(,)ident(d)operator(=)ident(a) operator([)integer(1) operator(])operator(-)ident(b) operator([)integer(1) operator(])operator(,)ident(a) operator([)integer(0) operator(])operator(-)ident(b) operator([)integer(0) operator(])operator(;)ident(d)operator(.)ident(times)operator({)operator(|)ident(e)operator(|)ident(f)operator(.) +ident(call)operator(() ident(e)operator(+)ident(b)operator([) integer(0)operator(]) operator(,)ident(c)operator(*) ident(e)operator(/)ident(d)operator(+)ident(b) operator([)integer(1)operator(])operator(\))operator(})operator(;)reserved(end)operator(;)constant(V)operator(=)integer(0)operator(;)reserved(def) method(bo)operator(&)ident(u) +global_variable($u)operator(||=) constant(V)operator(;) operator(;)global_variable($u) operator(+=) integer(1)operator(+)constant(V) operator(;)operator(;) reserved(return) ident(u)operator(.)ident(call) reserved(if)global_variable($u)operator(>)integer(1)operator(;)ident(q)operator(=)float(128.0) +operator(;)ident(x)operator(=)operator(()constant(V) operator(..) integer(255) operator(\))operator(.) ident(map) operator({)operator(|) ident(y)operator(|)ident(f1)operator(,)ident(z) operator(=)ident(sin)operator(()ident(y)operator(.)ident(to_f)operator(*)constant(PI)operator(/)ident(q)operator(\))operator(,) +ident(sin)operator(()operator(() ident(y)operator(.) ident(to_f) operator(+) integer(200) operator(\))operator(*)constant(PI)operator(/)operator(() ident(q)operator(\))operator(\))operator(;)operator([)operator(()ident(f1)operator(*)float(30.0)float(+110.0)operator(\))operator(.) +ident(to_i)operator(,)operator(()operator(()ident(f1)operator(+)ident(z)operator(\))operator(*)float(10.0)float(+40.0)operator(\))operator(.)ident(to_i)operator(,)operator(()ident(z)operator(*)float(20.0)float(+120.0)operator(\))operator(.)ident(to_i)operator(])operator(})operator(;)constant(Y)operator(.)ident(times)operator({)operator(|)ident(i)operator(|)constant(X)operator(.) +ident(times)operator({)operator(|)ident(j)operator(|)ident(i1)operator(=)operator(()operator(()ident(i)operator(*)float(0.3)integer(+150)operator(\))operator(*)operator(()ident(j)operator(*)float(1.1)integer(+50)operator(\))operator(/)float(50.0)operator(\))operator(.)ident(to_i)operator(;)ident(i2)operator(=)operator(()operator(()ident(i)operator(*)float(0.8)integer(+510)operator(\))operator(*)operator(() +ident(j)operator(*)float(0.9)integer(+1060)operator(\))operator(/)float(51.0)operator(\))operator(.)ident(to_i)operator(;)global_variable($s)operator([)ident(i)operator(])operator([)ident(j)operator(])operator(=)ident(x)operator([)operator(()ident(i1)operator(*)ident(i2)operator(\))operator(%)integer(255)operator(])operator(.)ident(clone)operator(})operator(})operator(;)global_variable($a)operator(=)operator(()integer(0)operator(..)integer(25)operator(\))operator(.) +ident(inject)operator(()operator([)operator(])operator(\))operator({)operator(|)ident(a)operator(,)ident(i)operator(|)ident(a)operator(<<)operator(()constant(V)operator(..)integer(3)operator(\))operator(.)ident(inject)operator(()operator([)operator(])operator(\))operator({)operator(|)ident(r)operator(,)ident(j)operator(|)ident(r)operator(<<)global_variable($c)operator([)ident(i)operator(*)integer(4)operator(+)ident(j)operator(])operator(})operator(})operator(;)ident(u)operator(.)ident(call)operator(;)reserved(end) +constant(I)operator(=)constant(LocalJumpError)operator(;)reserved(def) method(run)operator(*)ident(a)operator(,)operator(&)ident(b)operator(;)reserved(return) reserved(if) ident(a)operator(.)ident(size)operator(==)constant(V)operator(;)reserved(if) ident(a)operator([)constant(V)operator(])operator(==)integer(666)operator(;)global_variable($b)operator(=)ident(b) +reserved(elsif)global_variable($b)operator(;)global_variable($b)operator(.)ident(call)operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(def) method(main) ident(s)operator(,)operator(&)ident(u)operator(;)global_variable($m)operator(=)constant(V)operator(;)ident(u)operator(.)ident(call) reserved(rescue) constant(I)operator(;)reserved(end) +reserved(def) method(rb_eval_string)operator(()operator(*)ident(a)operator(\))operator(;)reserved(end) comment(# you promised not to look here) +reserved(def) method(ruby_init)operator(;)ident(q)operator(=)float(2.0)operator(;)ident(l)operator(=)operator(()operator(()constant(X)operator(**)ident(q)operator(\))operator(*)constant(A)operator(+)operator(()constant(Y)operator(**)ident(q)operator(\))operator(*)constant(A)operator(\))operator(**)constant(A)operator(;)constant(V)operator(.)ident(upto)operator(()constant(Y)integer(-4)operator(\))operator({)operator(|)ident(s)operator(|)constant(V)operator(.) +ident(upto)operator(()constant(X)integer(-4)operator(\))operator({)operator(|)ident(q)operator(|)ident(d)operator(=)operator(()operator(()ident(q)operator(-)constant(X)operator(/)constant(A)operator(\))operator(**)ident(q)operator(+)operator(()ident(s)operator(-)constant(Y)operator(/)constant(A)operator(\))operator(**)ident(q)operator(\))operator(**)constant(A)operator(;)ident(e)operator(=)operator(()ident(cos)operator(()ident(d)operator(*)constant(PI)operator(/)operator(()ident(l)operator(/)ident(q)operator(\))operator(\))operator(/)ident(q) +operator(+)constant(A)operator(\))operator(*)float(3.0)float(+1.0)operator(;)ident(v)operator(=)integer(2)operator(;)ident(f)operator(=)ident(v)operator(/)ident(e)operator(;)ident(a)operator(,)ident(p)operator(,)ident(b)operator(=)global_variable($s)operator([)ident(s)operator(])operator(,)global_variable($s)operator([)ident(s)integer(+1)operator(])operator(,)global_variable($s)operator([)ident(s)operator(+)ident(v)operator(])operator(;)ident(r)operator(=)ident(a)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(*)ident(e)operator(+) +ident(p)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(+)ident(a)operator([)ident(q)integer(+1)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(+)ident(a)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(+)ident(v)operator(/)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(p)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(+)ident(b)operator([)ident(q)operator(+) +ident(v)operator(])operator([)constant(V)operator(])operator(*)ident(f)operator(;)ident(g)operator(=)operator([)ident(a)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(,)ident(b)operator([)ident(q)operator(])operator([)constant(V)operator(])operator(,)ident(a)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(,)ident(b)operator([)ident(q)operator(+)ident(v)operator(])operator([)constant(V)operator(])operator(])operator(;)ident(h)operator(=)operator(()ident(g)operator(.)ident(max)operator(-)ident(g)operator(.)ident(min) +operator(\))operator(*)ident(f)operator(;)global_variable($s)operator([)ident(s)operator(])operator([)ident(q)operator(])operator([)constant(V)operator(])operator(=)operator([)operator([)operator(()ident(r)operator(/)operator(()ident(e)operator(+)ident(f)float(+6.0)operator(\))operator(+)constant(A)operator(+)operator(()ident(h)operator(*)float(0.4)operator(\))operator(\))operator(.)ident(to_i)operator(,)integer(255)operator(])operator(.)ident(min)operator(,)constant(V)operator(])operator(.)ident(max) +operator(})operator(})operator(;)constant(File)operator(.)ident(open)operator(()stringoperator(,)stringoperator(\))operator({)operator(|)ident(f)operator(|)ident(f)operator(.)ident(write)operator(()comment(# secret.greetings :-\)) +stringcontent( )inlinechar(\\n)content(255)char(\\n)delimiter(")>operator(+)global_variable($s)operator(.)ident(map)operator({)operator(|)ident(a)operator(|)ident(a)operator(.)ident(map)operator({)operator(|)ident(b)operator(|)ident(b)operator(.)ident(join)string +operator(})operator(.)ident(join)operator(()stringoperator(\))operator(+)stringoperator(})operator(.)ident(join)operator(\))operator(})operator(;)reserved(end)operator(;)reserved(def) method(switch) ident(i)operator(,)operator(&)ident(b)operator(;)ident(b)operator(.)ident(call)operator(;)reserved(return) reserved(unless) +reserved(defined?)operator(()global_variable($m)operator(\))operator(;)ident(b)operator(=)operator(()constant(X)operator(*)float(0.01)operator(\))operator(.)ident(to_i)operator(;)ident(d)operator(=)float(1.0)operator(/)float(40.0)operator(;)ident(e)operator(=)float(0.09)operator(;)ident(c)operator(=)operator(()constant(Y)operator(*)float(0.01)operator(\))operator(.)ident(to_i) +ident(a)operator(=)global_variable($a)operator(.)ident(map)operator({)operator(|)operator(()ident(f)operator(,)ident(g)operator(,)ident(h)operator(,)ident(j)operator(\))operator(|)operator([)ident(f)operator(*)ident(d)operator(,)ident(g)operator(*)ident(e)operator(,)ident(h)operator(*)ident(d)operator(,)ident(j)operator(*)ident(e)operator(])operator(})operator(;)ident(a)operator(.)ident(each)operator({)operator(|)operator(()ident(k)operator(,)ident(l)operator(,)ident(m)operator(,)ident(n)operator(\))operator(|)ident(u)operator(()global_variable($s)operator(,)operator(()ident(k)operator(*)constant(X) +operator(\))operator(.)ident(to_i)operator(+)ident(b)operator(+)ident(i)operator(,)operator(()ident(l)operator(*)constant(Y)operator(\))operator(.)ident(to_i)operator(+)ident(c)operator(+)ident(i)operator(,)operator(()ident(m)operator(*)constant(X)operator(\))operator(.)ident(to_i)operator(+)ident(b)operator(+)ident(i)operator(,)operator(()ident(n)operator(*)constant(Y)operator(\))operator(.)ident(to_i)operator(+)ident(c)operator(+)ident(i)operator(,)operator([)constant(Z)operator(])operator(*)integer(3)operator(\))operator(}) +ident(a)operator(.)ident(each)operator({)operator(|)operator(()ident(o)operator(,)ident(q)operator(,)ident(r)operator(,)ident(s)operator(\))operator(|)ident(u)operator(()global_variable($s)operator(,)operator(()ident(o)operator(*)operator(()constant(X)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(q)operator(*)operator(()constant(Y)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(r)operator(*)operator(()constant(X)operator(-) +constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator(()ident(s)operator(*)operator(()constant(Y)operator(-)constant(Z)operator(\))operator(\))operator(.)ident(to_i)operator(+)ident(i)operator(,)operator([)operator(()integer(1)operator(<<)integer(8)operator(\))integer(-1)operator(])operator(*)integer(3)operator(\))operator(})operator(;)reserved(end)operator(;)constant(Q)operator(=)constant(Object)operator(;)reserved(class) +class(Regexp)operator(;)reserved(def) method([]=)operator(()ident(v)operator(,)ident(is)operator(\))operator(;)ident(is)operator(.)ident(each)operator({)operator(|)ident(s)operator(|)constant(Q)operator(.)ident(send)operator(()symbol(:remove_const)operator(,)ident(s)operator(\))reserved(if) constant(Q)operator(.) +ident(const_defined?) ident(s)operator(;)constant(Q)operator(.)ident(const_set)operator(()ident(s)operator(,)ident(v)operator(\))operator(})operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(def) method(int)operator(*)ident(ptr)operator(;)integer(666) +reserved(end)operator(;)reserved(class) class(O)operator(;)reserved(def) method([]=)operator(()ident(a)operator(,)ident(b)operator(=)pre_constant(nil)operator(\))operator(;)global_variable($c)operator(=)ident(a)operator(;)reserved(end)operator(;)reserved(end)operator(;)reserved(alias)symbol(:void)symbol(:goto) +comment(#endif // pretend as if you havn't seen anything) +operator(=)reserved(end) + diff --git a/test/ruby/suite.rb b/test/ruby/suite.rb index 751b364..c56b3bd 100644 --- a/test/ruby/suite.rb +++ b/test/ruby/suite.rb @@ -1,9 +1,3 @@ -class RubyTest < CodeRaySuite - - @file = __FILE__ - LANG = :ruby - EXTENSION = 'rb' - -end - -$suite << RubyTest.suite if $suite +class Ruby < CodeRay::TestCase + extension :rb +end diff --git a/test/ruby/test-fitter.out.raydebug b/test/ruby/test-fitter.out.raydebug index 0c56759..da35d8d 100644 --- a/test/ruby/test-fitter.out.raydebug +++ b/test/ruby/test-fitter.out.raydebug @@ -1,46 +1,46 @@ -ident(require) string -ident(require) string - -constant(N) operator(=) integer(100_000) - -reserved(def) method(test) ident(s) - ident(puts) ident(s) - constant(Benchmark)operator(.)ident(bm) integer(10) reserved(do) operator(|)ident(bm)operator(|) - ident(bm)operator(.)ident(report) string reserved(do) - constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) regexp operator(}) - reserved(end) - - ident(bm)operator(.)ident(report) string reserved(do) - constant(N)operator(.)ident(times) operator({) ident(s)operator(.)ident(fits?) regexp operator(}) - reserved(end) - - ident(bm)operator(.)ident(report) string reserved(do) - constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) regexpoperator(.)ident(f) operator(}) - reserved(end) - - ident(re) operator(=) regexpoperator(.)ident(f) - - ident(bm)operator(.)ident(report) string reserved(do) - constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) ident(re) operator(}) - reserved(end) - reserved(end) - ident(puts) -reserved(end) - -ident(a)operator(.)ident(fits?) operator(/) ident(bla) regexpDestroy my HTML! -harmlessline -EOL - -test <Destroy my HTML! -harmlessline -EOL - +ident(require) string +ident(require) string + +constant(N) operator(=) integer(100_000) + +reserved(def) method(test) ident(s) + ident(puts) ident(s) + constant(Benchmark)operator(.)ident(bm) integer(10) reserved(do) operator(|)ident(bm)operator(|) + ident(bm)operator(.)ident(report) string reserved(do) + constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) regexp operator(}) + reserved(end) + + ident(bm)operator(.)ident(report) string reserved(do) + constant(N)operator(.)ident(times) operator({) ident(s)operator(.)ident(fits?) regexp operator(}) + reserved(end) + + ident(bm)operator(.)ident(report) string reserved(do) + constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) regexpoperator(.)ident(f) operator(}) + reserved(end) + + ident(re) operator(=) regexpoperator(.)ident(f) + + ident(bm)operator(.)ident(report) string reserved(do) + constant(N)operator(.)ident(times) operator({) ident(s) operator(=)operator(~) ident(re) operator(}) + reserved(end) + reserved(end) + ident(puts) +reserved(end) + +ident(a)operator(.)ident(fits?) operator(/) ident(bla) regexpDestroy my HTML! +harmlessline +EOL + +test <Destroy my HTML! +harmlessline +EOL + )> \ No newline at end of file diff --git a/test/ruby/tk-calc.out.raydebug b/test/ruby/tk-calc.out.raydebug index 09460c9..4bd4db0 100644 --- a/test/ruby/tk-calc.out.raydebug +++ b/test/ruby/tk-calc.out.raydebug @@ -1,5 +1,5 @@ -ident(require) stringoperator(;)constant(TkRoot)operator(.)ident(new)operator(;)ident(r)operator(,)ident(c)operator(,)ident(b)operator(=)integer(1)operator(,)integer(1)operator(,)stringoperator(;)ident(d)operator(=)constant(TkEntry)operator(.)ident(new)operator({) -ident(grid)operator(()stringoperator(=)operator(>)integer(0)operator(,)stringoperator(=)operator(>)integer(1)operator(,)stringoperator(=)operator(>)integer(4)operator(\))operator(})operator(;)ident(b)operator(.)ident(each_index)operator({)operator(|)ident(i)operator(|)constant(TkButton)operator(.)ident(new)operator({)ident(text) ident(b)operator([)ident(i)operator(]) -ident(command) ident(proc)operator({)ident(d)operator(.)ident(insert)operator(()stringoperator(,)ident(b)operator([)ident(i)operator(])operator(\))operator(})operator(;)ident(grid)operator(()stringoperator(=)operator(>)ident(r)operator(,)stringoperator(=)operator(>)ident(c)operator(\))operator(})operator(;)ident(c)operator(+=)integer(1)operator(;)reserved(if) ident(i)operator(&&)operator(()ident(i)integer(+1)operator(\))operator(%)comment(##) -integer(4)operator(==)integer(0)reserved(then) ident(r)operator(+=)integer(1)operator(;)ident(c)operator(=)integer(1) reserved(end)operator(})operator(;)constant(TkButton)operator(.)ident(new)operator({)ident(text)stringoperator(;)ident(command) ident(proc)operator({)ident(t)operator(=)ident(d)operator(.)ident(get)operator(;)ident(d)operator(.)ident(delete)operator(()integer(0)operator(,)stringoperator(\)) -ident(d)operator(.)ident(insert)operator(()stringoperator(,)ident(eval)operator(()ident(t)operator(\))operator(\))operator(})operator(;)ident(grid)operator(()stringoperator(=)operator(>)ident(r)operator(,)stringoperator(=)operator(>)ident(c)operator(\))operator(})operator(;)constant(Tk)operator(.)ident(mainloop)comment(### by mawe :\) ###) +ident(require) stringoperator(;)constant(TkRoot)operator(.)ident(new)operator(;)ident(r)operator(,)ident(c)operator(,)ident(b)operator(=)integer(1)operator(,)integer(1)operator(,)stringoperator(;)ident(d)operator(=)constant(TkEntry)operator(.)ident(new)operator({) +ident(grid)operator(()stringoperator(=)operator(>)integer(0)operator(,)stringoperator(=)operator(>)integer(1)operator(,)stringoperator(=)operator(>)integer(4)operator(\))operator(})operator(;)ident(b)operator(.)ident(each_index)operator({)operator(|)ident(i)operator(|)constant(TkButton)operator(.)ident(new)operator({)ident(text) ident(b)operator([)ident(i)operator(]) +ident(command) ident(proc)operator({)ident(d)operator(.)ident(insert)operator(()stringoperator(,)ident(b)operator([)ident(i)operator(])operator(\))operator(})operator(;)ident(grid)operator(()stringoperator(=)operator(>)ident(r)operator(,)stringoperator(=)operator(>)ident(c)operator(\))operator(})operator(;)ident(c)operator(+=)integer(1)operator(;)reserved(if) ident(i)operator(&&)operator(()ident(i)integer(+1)operator(\))operator(%)comment(##) +integer(4)operator(==)integer(0)reserved(then) ident(r)operator(+=)integer(1)operator(;)ident(c)operator(=)integer(1) reserved(end)operator(})operator(;)constant(TkButton)operator(.)ident(new)operator({)ident(text)stringoperator(;)ident(command) ident(proc)operator({)ident(t)operator(=)ident(d)operator(.)ident(get)operator(;)ident(d)operator(.)ident(delete)operator(()integer(0)operator(,)stringoperator(\)) +ident(d)operator(.)ident(insert)operator(()stringoperator(,)ident(eval)operator(()ident(t)operator(\))operator(\))operator(})operator(;)ident(grid)operator(()stringoperator(=)operator(>)ident(r)operator(,)stringoperator(=)operator(>)ident(c)operator(\))operator(})operator(;)constant(Tk)operator(.)ident(mainloop)comment(### by mawe :\) ###) diff --git a/test/ruby/undef.out.raydebug b/test/ruby/undef.out.raydebug index 4c19712..e306858 100644 --- a/test/ruby/undef.out.raydebug +++ b/test/ruby/undef.out.raydebug @@ -1,18 +1,18 @@ -reserved(undef) method(/) -reserved(undef) operator(,) -reserved(undef) method(-)operator(-) - -reserved(undef) -comment(# bla) -method([]=) - -reserved(undef) method(undef) -reserved(undef) method(/)operator(,)method(/)operator(,)symbol(:/) - -reserved(undef) method(&)operator(,)method(&)operator(&) - -symbol(:simple) -symbol -symbolescape(#)class_variable(@@cv)delimiter(")> - -reserved(undef) symboloperator(,) method(/)operator(,) symbolescape(#)class_variable(@@cv)delimiter(")> +reserved(undef) method(/) +reserved(undef) operator(,) +reserved(undef) method(-)operator(-) + +reserved(undef) +comment(# bla) +method([]=) + +reserved(undef) method(undef) +reserved(undef) method(/)operator(,)method(/)operator(,)symbol(:/) + +reserved(undef) method(&)operator(,)method(&)operator(&) + +symbol(:simple) +symbol +symbolescape(#)class_variable(@@cv)delimiter(")> + +reserved(undef) symboloperator(,) method(/)operator(,) symbolescape(#)class_variable(@@cv)delimiter(")> diff --git a/test/suite.rb b/test/suite.rb index b7afa79..dbc49e1 100644 --- a/test/suite.rb +++ b/test/suite.rb @@ -1,112 +1,3 @@ -$mydir = File.dirname(__FILE__) -$:.unshift $mydir + '/../lib/' +require 'test/coderay_suite' -$VERBOSE = true - -require 'coderay' -CodeRay::Encoders[:tokens] -CodeRay::Encoders[:html] - -require 'test/unit' -include Test::Unit - -class CodeRaySuite < TestCase - - def self.dir &block - @dir ||= File.dirname(@file) - if block - Dir.chdir @dir, &block - end - @dir - end - - def dir &block - self.class.dir(&block) - end - - def extension - 'in.' + self.class::EXTENSION - end - - def lang - self.class::LANG - end - - def test_ALL - puts - puts " >> Running #{self.class.name} <<" - puts - scanner = CodeRay::Scanners[lang].new - tokenizer = CodeRay::Encoders[:debug].new - highlighter = CodeRay::Encoders[:html].new( - :tab_width => 2, - :line_numbers => :table, - :wrap => :page, - :hint => :debug, - :css => :class - ) - - dir do - for input in Dir["*.#{extension}"] - puts "testing #{input}..." - name = File.basename(input, ".#{extension}") - output = name + '.out.' + tokenizer.file_extension - code = File.open(input, 'rb') { |f| break f.read } - - scanner.string = code - tokens = scanner.tokens - result = tokenizer.encode_tokens tokens - highlighted = highlighter.encode_tokens tokens - - File.open(name + '.html', 'w') do |f| f.write highlighted end - - if File.exist? output - expected = File.read output - ok = expected == result - computed = output.sub('.out.', '.computed.') - unless ok - File.open(computed, 'w') { |f| f.write result } - print `gvimdiff #{output} #{computed}` if ENV['diff'] - end - assert(ok, "Scan error: #{computed} != #{output}") unless ENV['diff'] - else - File.open(output, 'w') do |f| f.write result end - puts "New test: #{output}" - end - - end - end - end - -end - -require 'test/unit/testsuite' -$suite = TestSuite.new - -def load_suite name - begin - suite = File.join($mydir, name, 'suite.rb') - require suite - rescue LoadError - $stderr.puts <<-ERR - -!! Suite #{suite} not found - - ERR - false - end -end - -if subsuite = ARGV.find { |a| break $1 if a[/^([^-].*)/] } || ENV['scannerlang'] - load_suite(subsuite) or exit -else - Dir[File.join($mydir, '*', '')].each { |suite| load_suite File.basename(suite) } -end - -if ARGV.include? '-f' - require 'test/unit/ui/fox/testrunner' - UI::Fox::TestRunner.run $suite -else - require 'test/unit/ui/console/testrunner' - UI::Console::TestRunner.run $suite -end +CodeRay::TestSuite.run diff --git a/test/xhtml/suite.rb b/test/xhtml/suite.rb deleted file mode 100644 index 63c13e3..0000000 --- a/test/xhtml/suite.rb +++ /dev/null @@ -1,9 +0,0 @@ -class NitroHTMLTest < CodeRaySuite - - @file = __FILE__ - LANG = :xhtml - EXTENSION = 'xhtml' - -end - -$suite << NitroHTMLTest.suite if $suite diff --git a/test/xhtml/tags.in.xhtml b/test/xhtml/tags.in.xhtml deleted file mode 100644 index 398031c..0000000 --- a/test/xhtml/tags.in.xhtml +++ /dev/null @@ -1,87 +0,0 @@ - -
- -

Questions with Tags: #{@tags.join(" ")}

- - 0 ?> - - Too many results for that Tag, please reduce the number by using one of the following Tags: - #{cloud_of(@qtags)} - -
- -

#{q.question}

-

- - #{excerpt} -

-

#{q.answers.size.to_i} answers

- -
-
- #{@qpager.navigation} -
- -
-

no question with this/these tag(s) found

-

Ask a question here.

-
- - - 0 ?> -

Tips with Tags: #{@tags.join(" ")}

- - Too many results for that Tag, please reduce the number by using one of the following Tags: - #{cloud_of(@ttags)} - -
- -

#{t.title}

-

- - #{excerpt} -

- -
-
- #{@tpager.navigation} -
- - - 0 ?> -

Tutorials with Tags: #{@tags.join(" ")}

- - Too many results for that Tag, please reduce the number by using one of the following Tags: - #{cloud_of(@tuttags)} - -
- -

#{t.title}

-

- - #{excerpt} -

- -
-
- #{@tpager.navigation} -
- - - - -
- - - #{t.name} - -
- -
- - -
- - diff --git a/test/xhtml/tags.out.raydebug b/test/xhtml/tags.out.raydebug deleted file mode 100644 index a165d17..0000000 --- a/test/xhtml/tags.out.raydebug +++ /dev/null @@ -1,87 +0,0 @@ -tag(tag(>) - tag(tag(>) - inline)> - tag(

)plain(Questions with Tags: )inlineoperator(\))delimiter(})>tag(

) - - inline) integer(0) delimiter(?>)> - inline)> - plain(Too many results for that Tag, please reduce the number by using one of the following Tags: - )inline - inline)> - tag(tag(>) - inline)> - tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) - tag(

) - inline)> - inline - tag(

) - tag(tag(>)inline plain(answers)tag(

) - inline)> - tag() - tag(tag(>) - inline - tag() - inline)> - tag(tag(>) - tag(

)plain(no question with this/these tag(s\) found)tag(

) - tag(

)tag(tag(>)plain(Ask a question here.)tag()tag(

) - tag() - inline)> - - inline) integer(0) delimiter(?>)> - tag(

)plain(Tips with Tags: )inlineoperator(\))delimiter(})>tag(

) - inline)> - plain(Too many results for that Tag, please reduce the number by using one of the following Tags: - )inline - inline)> - tag(tag(>) - inline)> - tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) - tag(

) - inline)> - inline - tag(

) - inline)> - tag() - tag(tag(>) - inline - tag() - inline)> - - inline) integer(0) delimiter(?>)> - tag(

)plain(Tutorials with Tags: )inlineoperator(\))delimiter(})>tag(

) - inline)> - plain(Too many results for that Tag, please reduce the number by using one of the following Tags: - )inline - inline)> - tag(tag(>) - inline)> - tag(

)tag(delimiter(")>tag(>)inlinetag()tag(

) - tag(

) - inline)> - inline - tag(

) - inline)> - tag() - tag(tag(>) - inline - tag() - inline)> - - - inline)> - tag(tag(>) - inline)> - inline)> - tag(delimiter(")> attribute_name(style)operator(=)stringcontent(em;)delimiter(")>tag(>)inlinetag() - inline)> - tag() comment() - inline)> - tag() comment() - - tag( tag(/>) -tag() - -comment() diff --git a/test/xml/kate.html b/test/xml/kate.html index 15b6c2f..1cb4044 100644 --- a/test/xml/kate.html +++ b/test/xml/kate.html @@ -1,15 +1,15 @@ + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - - CodeRay HTML Encoder Example - + - - - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Eiffel" version="1.02" kateversion="2.1" section="Sources" extensions="*.e" mimetype="text/x-eiffel-src">
-        <highlighting>
-                <list name="keywords">
-                        <item> indexing </item>
-                        <item> class </item>
-                        <item> inherit </item>
-                        <item> creation </item>
-                        <item> feature </item>
-                        <item> rename </item>
-                        <item> redefine </item>
-                        <item> undefine </item>
-                        <item> select </item>
-                        <item> export </item>
-                        <item> local </item>
-                        <item> deferred </item>
-                        <item> do </item>
-                        <item> is </item>
-                        <item> once </item>
-                        <item> alias </item>
-                        <item> external </item>
-                        <item> rescue </item>
-                        <item> debug </item>
-                        <item> if </item>
-                        <item> inspect </item>
-                        <item> from </item>
-                        <item> else </item>
-                        <item> elseif </item>
-                        <item> when </item>
-                        <item> until </item>
-                        <item> loop </item>
-                        <item> then </item>
-                        <item> obsolete </item>
-                        <item> end </item>
-                </list>
-                <list name="assertions">
-                        <item> check </item>
-                        <item> ensure </item>
-                        <item> require </item>
-                        <item> variant </item>
-                        <item> invariant </item>
-                </list>
-                <contexts>
-                        <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
-                                <keyword attribute="Keyword" context="#stay" String="keywords"/>
-                                <Float attribute="Float" context="#stay"/>
-                                <Int attribute="Decimal" context="#stay"/>
-                                <RegExpr attribute="Char" context="#stay" String="'.'"/>
-                                <DetectChar attribute="String" context="String" char="&quot;"/>
-                                <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
-                                <keyword attribute="Assertions" context="#stay" String="assertions"/>
-                        </context>
-                        <context attribute="String" lineEndContext="#pop" name="String">
-                                <DetectChar attribute="String" context="#pop" char="&quot;"/>
-                        </context>
-                        <context attribute="Comment" name="Comment" lineEndContext="#pop"/>
-                </contexts>
-                <itemDatas>
-                        <itemData name="Normal Text" defStyleNum="dsNormal" />
-                        <itemData name="Keyword"     defStyleNum="dsKeyword" />
-                        <itemData name="Decimal"     defStyleNum="dsDecVal" />
-                        <itemData name="Float"       defStyleNum="dsFloat" />
-                        <itemData name="Char"        defStyleNum="dsChar" />
-                        <itemData name="String"      defStyleNum="dsString" />
-                        <itemData name="Comment"     defStyleNum="dsComment" />
-                        <itemData name="Assertions"  defStyleNum="dsOthers" />
-                </itemDatas>
-  </highlighting>
-  <general>
-    <comments>
-      <comment name="singleLine" start="--" />
-    </comments>
-    <keywords casesensitive="1" />
-  </general>
-</language>
-
+
+
 1 <?xml version="1.0" encoding="UTF-8"?>
+ 2 <!DOCTYPE language SYSTEM "language.dtd">
+ 3 <language name="Eiffel" version="1.02" kateversion="2.1" section="Sources" extensions="*.e" mimetype="text/x-eiffel-src">
+ 4         <highlighting>
+ 5                 <list name="keywords">
+ 6                         <item> indexing </item>
+ 7                         <item> class </item>
+ 8                         <item> inherit </item>
+ 9                         <item> creation </item>
+10                         <item> feature </item>
+11                         <item> rename </item>
+12                         <item> redefine </item>
+13                         <item> undefine </item>
+14                         <item> select </item>
+15                         <item> export </item>
+16                         <item> local </item>
+17                         <item> deferred </item>
+18                         <item> do </item>
+19                         <item> is </item>
+20                         <item> once </item>
+21                         <item> alias </item>
+22                         <item> external </item>
+23                         <item> rescue </item>
+24                         <item> debug </item>
+25                         <item> if </item>
+26                         <item> inspect </item>
+27                         <item> from </item>
+28                         <item> else </item>
+29                         <item> elseif </item>
+30                         <item> when </item>
+31                         <item> until </item>
+32                         <item> loop </item>
+33                         <item> then </item>
+34                         <item> obsolete </item>
+35                         <item> end </item>
+36                 </list>
+37                 <list name="assertions">
+38                         <item> check </item>
+39                         <item> ensure </item>
+40                         <item> require </item>
+41                         <item> variant </item>
+42                         <item> invariant </item>
+43                 </list>
+44                 <contexts>
+45                         <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+46                                 <keyword attribute="Keyword" context="#stay" String="keywords"/>
+47                                 <Float attribute="Float" context="#stay"/>
+48                                 <Int attribute="Decimal" context="#stay"/>
+49                                 <RegExpr attribute="Char" context="#stay" String="'.'"/>
+50                                 <DetectChar attribute="String" context="String" char="&quot;"/>
+51                                 <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
+52                                 <keyword attribute="Assertions" context="#stay" String="assertions"/>
+53                         </context>
+54                         <context attribute="String" lineEndContext="#pop" name="String">
+55                                 <DetectChar attribute="String" context="#pop" char="&quot;"/>
+56                         </context>
+57                         <context attribute="Comment" name="Comment" lineEndContext="#pop"/>
+58                 </contexts>
+59                 <itemDatas>
+60                         <itemData name="Normal Text" defStyleNum="dsNormal" />
+61                         <itemData name="Keyword"     defStyleNum="dsKeyword" />
+62                         <itemData name="Decimal"     defStyleNum="dsDecVal" />
+63                         <itemData name="Float"       defStyleNum="dsFloat" />
+64                         <itemData name="Char"        defStyleNum="dsChar" />
+65                         <itemData name="String"      defStyleNum="dsString" />
+66                         <itemData name="Comment"     defStyleNum="dsComment" />
+67                         <itemData name="Assertions"  defStyleNum="dsOthers" />
+68                 </itemDatas>
+69   </highlighting>
+70   <general>
+71     <comments>
+72       <comment name="singleLine" start="--" />
+73     </comments>
+74     <keywords casesensitive="1" />
+75   </general>
+76 </language>
+77 
+
diff --git a/test/xml/kate.out.raydebug b/test/xml/kate.out.raydebug index 728b3a1..01eec5a 100644 --- a/test/xml/kate.out.raydebug +++ b/test/xml/kate.out.raydebug @@ -1,76 +1,76 @@ -preprocessor() -preprocessor() -tag( attribute_name(version)operator(=)string attribute_name(kateversion)operator(=)string attribute_name(section)operator(=)string attribute_name(extensions)operator(=)string attribute_name(mimetype)operator(=)stringtag(>) - tag() - tag(tag(>) - tag() plain(indexing )tag() - tag() plain(class )tag() - tag() plain(inherit )tag() - tag() plain(creation )tag() - tag() plain(feature )tag() - tag() plain(rename )tag() - tag() plain(redefine )tag() - tag() plain(undefine )tag() - tag() plain(select )tag() - tag() plain(export )tag() - tag() plain(local )tag() - tag() plain(deferred )tag() - tag() plain(do )tag() - tag() plain(is )tag() - tag() plain(once )tag() - tag() plain(alias )tag() - tag() plain(external )tag() - tag() plain(rescue )tag() - tag() plain(debug )tag() - tag() plain(if )tag() - tag() plain(inspect )tag() - tag() plain(from )tag() - tag() plain(else )tag() - tag() plain(elseif )tag() - tag() plain(when )tag() - tag() plain(until )tag() - tag() plain(loop )tag() - tag() plain(then )tag() - tag() plain(obsolete )tag() - tag() plain(end )tag() - tag() - tag(tag(>) - tag() plain(check )tag() - tag() plain(ensure )tag() - tag() plain(require )tag() - tag() plain(variant )tag() - tag() plain(invariant )tag() - tag() - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)string attribute_name(char1)operator(=)stringtag(/>) - tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) - tag() - tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) - tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) - tag() - tag( attribute_name(name)operator(=)string attribute_name(lineEndContext)operator(=)stringtag(/>) - tag() - tag() - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag( attribute_name(defStyleNum)operator(=)string tag(/>) - tag() - tag() - tag() - tag() - tag( attribute_name(start)operator(=)string tag(/>) - tag() - tag( tag(/>) - tag() -tag() +preprocessor() +preprocessor() +tag( attribute_name(version)operator(=)string attribute_name(kateversion)operator(=)string attribute_name(section)operator(=)string attribute_name(extensions)operator(=)string attribute_name(mimetype)operator(=)stringtag(>) + tag() + tag(tag(>) + tag() plain(indexing )tag() + tag() plain(class )tag() + tag() plain(inherit )tag() + tag() plain(creation )tag() + tag() plain(feature )tag() + tag() plain(rename )tag() + tag() plain(redefine )tag() + tag() plain(undefine )tag() + tag() plain(select )tag() + tag() plain(export )tag() + tag() plain(local )tag() + tag() plain(deferred )tag() + tag() plain(do )tag() + tag() plain(is )tag() + tag() plain(once )tag() + tag() plain(alias )tag() + tag() plain(external )tag() + tag() plain(rescue )tag() + tag() plain(debug )tag() + tag() plain(if )tag() + tag() plain(inspect )tag() + tag() plain(from )tag() + tag() plain(else )tag() + tag() plain(elseif )tag() + tag() plain(when )tag() + tag() plain(until )tag() + tag() plain(loop )tag() + tag() plain(then )tag() + tag() plain(obsolete )tag() + tag() plain(end )tag() + tag() + tag(tag(>) + tag() plain(check )tag() + tag() plain(ensure )tag() + tag() plain(require )tag() + tag() plain(variant )tag() + tag() plain(invariant )tag() + tag() + tag() + tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) + tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)string attribute_name(char1)operator(=)stringtag(/>) + tag( attribute_name(context)operator(=)string attribute_name(String)operator(=)stringtag(/>) + tag() + tag( attribute_name(lineEndContext)operator(=)string attribute_name(name)operator(=)stringtag(>) + tag( attribute_name(context)operator(=)string attribute_name(char)operator(=)stringtag(/>) + tag() + tag( attribute_name(name)operator(=)string attribute_name(lineEndContext)operator(=)stringtag(/>) + tag() + tag() + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag( attribute_name(defStyleNum)operator(=)string tag(/>) + tag() + tag() + tag() + tag() + tag( attribute_name(start)operator(=)string tag(/>) + tag() + tag( tag(/>) + tag() +tag() diff --git a/test/xml/suite.rb b/test/xml/suite.rb index 8d2b9f0..b135c31 100644 --- a/test/xml/suite.rb +++ b/test/xml/suite.rb @@ -1,9 +1,2 @@ -class XMLTest < CodeRaySuite - - @file = __FILE__ - LANG = :xml - EXTENSION = 'xml' - -end - -$suite << XMLTest.suite if $suite +class XML < CodeRay::TestCase +end -- cgit v1.2.1