home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sharew / exoten / rec / rconvert.cnv < prev    next >
Encoding:
Text File  |  1990-07-11  |  15.8 KB  |  525 lines

  1. [RCONVERT.CNV]
  2. [G. Cisneros, 4.9.86, 11.7.90]
  3. [[Convert compiler for Convert]]
  4.  
  5. [process header, find first left brace or parenthesis]
  6. (()()(0 1)(
  7.     (<:w:>(and,<:K:>,<0>)<1>,<<
  8.     >>(IF,(2),<0>,[<2>.CNV],(O,[<2>.REC](^MJ)),<<
  9.         >><=>,[Exclude LIB],<<
  10.             >>(,(%Ow,MEM:incl)(%W,MEM:incl,LB)),<<
  11.         >><=>,[Include <2>]<>,(%W,MEM:incl,<2>),)<1>):
  12.     (<:w:>(and,<0>,(or,{,<(>)<-->),(O,{)(if,(E,<0>),},(xh),));
  13.     (,(L,<=>)):
  14. )) a
  15.  
  16. [find a program to compile]
  17. ((
  18.     ((or,(^Z),<:K:>)) z
  19. )()(0 1)(
  20.     (<:S:>,<0>):
  21.     ((^Z),<=>(xx,No main));
  22.     (<(>(^Z),(xf));
  23.     ({<0>,(O,(T,{))(G,{<0>)):
  24.     ((^])<0>,<0>);
  25.     ((^[)<:w:>(and,<[1]>,<0>)<1>,<<
  26.         >>(if,<0><1>,<:z:>,(,(T, Main))(^]Z),<<
  27.         >><0>,<:n:>,(O,(T,<0>)(^MJ)),<<
  28.         >><=>,},(^])},<<
  29.         >>(xd))<1>):
  30.     ((^[)<:w:><0>,(^[)(L,<0>)):
  31.     ((and,<[1]>,(nor,{,<(>,[),<0>)<1>,(xb,Expected {<,> [<,> <(>)<1>):
  32.     (<(><:W:><(><0>,(O,{)(%t,patt: )(0,<0>)):
  33.     (<(><:W:>(and,<[1]>,(nor,[,<(>),<0>)<1>,(xc)<(><1>):
  34.     (<0>,(L,<0>)):
  35. )) E
  36.  
  37. [programs/definitions in braces]
  38. (()(
  39.     ((if,<=>,(^Z),<=>(xa))) u
  40. )(0 1)(
  41.     ({<:W:>{<0>,(O,(T,{))(u,(G,{<0>)));
  42.     ({<:W:><(><0>,(u,(E,<(><0>))):
  43.     (}<:w:>(and,<[1]>,<0>)<1>,(O,(T,}))<<
  44.         >>(if,<0><1>,<:z:>,<0>,<<
  45.         >><0>,<:n:>,(O,(T,<0>)(^MJ)),<<
  46.         >><=>,},<=>,(xd))<1>);
  47.     (,(L,<=>)):
  48. )) G
  49.  
  50. [pattern definitions]
  51. ((
  52.     ((^Z)) z
  53. )(
  54.     {((0,<=>)) E
  55.      ((%W,,(^M))(xa)}*<)><(><0>) 2
  56.      ((G,<=>))} g
  57. )(0 1 2)(
  58.     (<:S:>,<0>):
  59.     ((^[)<0>,<0>);
  60.     ((^Z),(xf));
  61.     ({<0>,(O,(T,{))(g,{<0>)):
  62.     ((and,(or,<)>,),<2>)<:W:>(and,<[1]>,(nor,[,<(>),<0>)<1>,(xc)<2><1>):
  63.     (<)><:W:><(><0>,(%t,skel: )(2,<0>));
  64.     ((QUO/(<:@:>)/)<:w:>}<0>,<<
  65.         >>(O,(QUO/(@@;)/))}<0>);
  66.     ((and,<:Fq:>,<(><0><)>)<:w:>(and,<[1]>,<1>)<2>,<<
  67.         >>(O,<(>(if,(b,<0>(if,<11>,S,,(QUO/<:%:>/))),<-->(^_),<<
  68.                 >>(xx,Ill (<)=(>)));<)>)<<
  69.         >>(if,<1>,<:n:>,(O,(T,<=>)(^MJ)),<<
  70.         >><=>,},(^[)},(xd))<2>):
  71.     (<0>,(L,<0>)):
  72. )) 0
  73.  
  74. [skeleton definitions]
  75. (()(
  76.     {((2,<=>)) E
  77.      ((%W,,(^M))(xa)}*<)><(><0>) 4
  78.      ((G,<=>))} g
  79. )(0 1 2)(
  80.     (<:S:>,<0>):
  81.     ((^[)<0>,<0>);
  82.     ((^Z),(xf));
  83.     ({<0>,(O,(T,{))(g,{<0>)):
  84.     ((and,(or,<)>,),<2>)<:W:>(and,<[1]>,(nor,[,<(>),<0>)<1>,(xc)<2><1>):
  85.     (<)><:W:><(><0>,(%t,vble: )(4,<0>));
  86.     ((QUO/((@))/)<:w:>}<0>,<<
  87.         >>(O,(QUO/(@@;)/))}<0>);
  88.     ((and,<:Fq:>,<(><0><)>)<:w:>(and,<[1]>,<1>)<2>,<<
  89.         >>(O,<(>(C,JZD(^[)<0>);<)>)<<
  90.         >>(if,<1>,<:n:>,(O,(T,<=>)(^MJ)),<<
  91.         >><=>,},(^[)},(xd))<2>):
  92.     (<0>,(L,<0>)):
  93. )) 2
  94.  
  95. [var list]
  96. (()()(0 7 1)(
  97.     ((and,<:V:>,<7>)<)><:W:><(><0>,(,(T,<7>))(%t,rule: )(7o)(5,<0>));
  98.     (<7><)><:W:><(><0>,(xe)<)><(><0>):
  99.     (<7><)><:W:>(and,<[1]>,(nor,<(>,[),<0>)<1>,(xc)<7><)><1>):
  100.     (<0>,(L,<0>)):
  101. )) 4
  102.  
  103. [rule set]
  104. (()()(0 1 2 3)(
  105.     (<:S:>,<0>):
  106.     ((or,(^Z),<)><:W:>(^Z)),(xf));
  107.     ((and,<[1]>,(nor,<(>,<)>,[),<0>)<1>,(xb,Expected <(><,> <)><,> [)<1>):
  108.     (<)><:W:>(and,<[1]>,(nor,<)>,[),<0>)<1>,<)>(xb,Expected <)><,> [)<1>):
  109.     (<)><:W:><)><0>,(O,Z;<)>(7m)})(^[)<0>);
  110.     ((and,<:Fq:>,<(>(and,<:Fk:>,<2>)<,>(and,<:Fk:>,<1>)<)>)<<
  111.     >><:w:>(and,<[1]>,<0>)<3>,<<
  112.         >>(O,(7n)(nf,<2>,<>,<<
  113.             >>(if,J(b,<2>),<-->(^_),(I,64)x<'><<
  114.             >>(WHILE,(0 1),<=>,<0>(^_)<1>,<0>64x[,<1>)x<">)<<
  115.             >>)(C,JZD(^[)<1>))<<
  116.         >>(if,<0>,(or,:,;),(O,(T,<=>)(^MJ)),<<
  117.         >><=>(xb,Expected :<,> ;)(O,_(^MJ)))<3>):
  118.     ((and,<:Fq:>,<0>)<:w:>(or,:,;,)<1>,(xb,Bad rule)(O,_)<1>):
  119.     (<0>,(L,<0>)):
  120. )) 5
  121.  
  122. {
  123. [pattern compilation]
  124.  
  125. [IVL]
  126. (()()(0 1 2 10)(
  127.     ((and,<[1]>,<0>)(REC/BQU<1x]>ABQU<2x]>A/)<)><10>,<<
  128.         >>(k,<(>QUO<0><1><0><)>)(k,<(>QUO<0><2><0><)>)Mz(e));
  129.     (<0>,(xb,IVL stx err));
  130. )) U
  131.  
  132. [LAM]
  133. (()()(7 10)(
  134.     (<,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><,><10>,<<
  135.         >>(7b){<(>(7a)(7c);<)>~<(>(b,<10>)@~;@~<)>});
  136. )) L
  137.  
  138. [skel on pattern side]
  139. (()()(0 10)(
  140.     (<:l:><>,<0><'><'>);
  141.     (<:l:>(and,<:FK:><>,<10>),<0>(k,<10>));
  142.     (,(C,<=>)JQD);
  143. )) s
  144.  
  145. [compile a pattern]
  146. ((
  147.     ((<)(>)(ITR,(<)(>))) B
  148. )(
  149.     ((nf,<1>,<>,J)) j
  150. )(1 10)(
  151.     (<>,);
  152.     (<1>(^[)<10>,<1>(nf,<10>,<>,(b,<=>)));
  153.     (<:FZ:><:Fz:><10>,<10>):
  154.     ((<)[(and,<:Fi:>,<1>)](>)<10>,<1><(>a;L<)>z(e)):
  155.     ((<)[(and,(itr,(or,<:Fq:>,<[1]>))](>),<1>](>))<10>,<<
  156.         >>(s,j(<)(^[)<1>)(>)<(>Oa;L<)>z(e)):
  157.     ((<):(and,(or,%,@,~),<1>):(>)<>,(if,<1>,~,x8,@<1>));
  158.     ((<):(and,<:n:>(itr,<:n:>):(>),<1>:(>))<10>,<<
  159.         >>(if,<11>,S,(i,<1>)(e),<<
  160.         >>(IF,(10),<10>,<10>(<):%:(>)<>,<<
  161.         >>x9{<(>(b,<10>(<):~:(>));<)>%<(>(i,<1>)x};x}<)>},<<
  162.         >><=>,<10>,{<(>(b,<10>);<)>%<(>(i,<1>);<)>})(I,::)(^[))):
  163.     ((<)(and,(or,--,<:v:>),<1>)(>)<:FZ:><:Fz:><10>,<<
  164.         >>(<)<1>(>)<10>):
  165.     ((<)--(>)(or,(<)(>)(ITR,(<)(>)),<>)<10>,Zz(e)):
  166.     ((<)--(>)(and,(or,<:FK:>,),<1>)<10>,<<
  167.         >>(if,<10>,<>,(k,<1>)Fz,<<
  168.         >><(>l<(>(nf,<1>,<>,(k,<1>)(QUO/(Fz;ZzqL)/))<<
  169.         >>qL(b,<10>)L;Y<)>L;x{A(nf,<1>,<>,B):<)>));
  170.     ((and,<:FK:>,<1>)<10>,(k,<1>)Ez(e)):
  171.     (<:B:><10>,<(>A<)>(e)):
  172.     ((<)(and,<:v:>,<1>)(>)(and,<10>,(or,(<)(>)<-->,)),<<
  173.         >><1>x](e)):
  174.     ((<)(and,<:v:>,<1>)(>)<10>,<<
  175.         >>{<(>(b,<10>);<)>#<(>(IF,(2),<10>,(and,<:FK:>,<2>),<<
  176.                     >>(k,<2>)<1>x(>),<1>x(<));<)>});
  177.     ((QUO/<()>/)<10>,<'><(><'>Ezx*(I,<(><)>)(e)):
  178.     (<(>DEF(and,(ITR,<,><:Fk:><,><:n:>)<,><:Fk:>,<1>)<)><10>,<<
  179.         >>{(WHILE,(10 1 2),<1>,(and,<,><:Fk:><,><:n:>,<<
  180.                 >><,><10><,><:n:>,<,><10><,><1>)<2>,<<
  181.         >><(>(b,<10>(if,<11>,S,,(<):%:(>)));<)><1>,<2>,<<
  182.         >><,><10>,<(>(b,<10>);<)>,)}(e)):
  183.     (<(>ITR<,>(and,<:Fk:>,<1>)<)><10>,<<
  184.         >><(>Z(<)(b,<1>)(>):J(>);<)>(e)):
  185.     (<(>itr<,>(and,<:Fk:>,<1>)<)><10>,<<
  186.         >><(>lqL(b,<10>)LL;Yx{(b,<1>):<)>);
  187.     (<(>(or,OR,or)<)><10>,<(><)>(e)):
  188.     (<(>(or,AND,and)<)><10>,<10>):
  189.     (<(>(or,AND,and,OR,or)<,>(and,<:Fk:>,<1>)<)><10>,<1><10>):
  190.     (<(>and<:F*:>,<<
  191.         >>(IF,(10 1),<1>,<:F+:>,<<
  192.             >>Z(<)<(>(b,<10>)jJ(>)(<)<<
  193.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>(<)(>))(j),<1>)<<
  194.             >>(QUO/;>)>/))(e)):
  195.     (<(>or<:F*:>,<<
  196.         >>Z(<)<(><<
  197.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>);(j),<1>)<<
  198.             >>(QUO/>)>/)(e)):
  199.     (<(>AND<:F*:>,<<
  200.         >>(IF,(10 1 2),<<
  201.         >>(IF,(0 1),<10>,<0>(<):%:(>)<1>,<0>(<):~:(>)<1>)(^[)<1>,<<
  202.                 >><2>(^[)<:F+:>,<<
  203.             >>Z(<)<(>(if,<2>,<-->(<):~:(>),x9,)<<
  204.             >>(b,<10><<
  205.             >><(>REC(^])<(>ljJ(>)(<)<<
  206.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>(<)(>))(j),<1>)<<
  207.             >>(nf,<2>,<>,(QUO/qLJ>Z<Y/)(b,<=>))<<
  208.             >>(QUO/>L;x{J>Z<)/)(^])<)>)<<
  209.             >>(if,<2>,<-->(<):~:(>),x};x},;)(>)<)>));
  210.     (<(>OR<:F*:><10>,<<
  211.         >>Z(<)<(><<
  212.             >>(WHILE,(10 1),<1>,<:F+:>,l(b,<10>);x{(j),<1>)<<
  213.             >>(QUO/>)L>/));
  214.     (<(>OR<:F*:>,<<
  215.         >>(IF,(10),<10>,(<):%:(>)<>,<<
  216.             >>Z(<)<(><<
  217.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  218.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  219.             >>(QUO/>)L>/),<<
  220.             >><=>,<10>(<):%:(>),<<
  221.                 >>x9{<(>(b,<10>(<):~:(>));<)>%<(>Z(<)<(><<
  222.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  223.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  224.             >>(QUO/>)L>x};x})}/)(I,::),<<
  225.             >><=>,<10>,{<(>(b,<10>);<)>%<(>Z(<)<(><<
  226.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  227.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  228.             >>(QUO/>)L>;)}/)));
  229.     (<(>NOT<,>(and,<:Fk:>,<1>)<)><10>,<<
  230.         >><(>Z(<)(b,<1>)(QUO/J>)/)<<
  231.         >>(IF,(10),J(>)(e),J(>)(^[)(or,<:B:>,<>)<10>,(>)Zz(e))):
  232.     (<(>nor<:F*:>,<(>NOT<,><(>or<1><)><)><10>):
  233.     (<(>^<)><10>,0%31%Mz(e)):
  234.     (<(>IVL<1>,(U,<1>)):
  235.     (<(>ivl<:F*:>,<<
  236.         >><(>(WHILE,(0 10 1),<1>,<,>(and,<:Fk:>,<0>)<:F+:>,<<
  237.         >>(s,(s,j(<)(^[)<0>)(e))(>)Mz;,<1>,<<
  238.         >><:F+:>,(nf,<10>,<>,(s,j(<)(e))(>)<'><'>Mz;),)<)>(e)):
  239.     (<(>REC(REC/ABQU<1x]>A/)<)><10>,<1>(e)):
  240.     (<(>LAM<:F*:>,(L,<1>)(e)):
  241.     (<(>PWS<)><10>,x+Zqtj(e)):
  242.     (<(>PWS<,>(and,<:FK:>,<1>)<)><10>,x+(k,<1>)TLZqtj(e)):
  243.     (<(>HLT<)><10>,RL(e)):
  244.     (<(>HLT<,>(and,<:FK:>,<1>)<)><10>,x+(k,<1>)TLRL(e)):
  245.     (<(>NOP(or,<,><:Fk:>,)<)><10>,(e)):
  246.     (<(>PVR<,>(and,<:Fk:>,<1>)<)><10>,<<
  247.         >>(if,<1>,<:v:>,(I,v )<1>x_,(xg,Not a var))(e)):
  248.     (<(><)><1>,<1>):
  249.     ((and,<:Fq:>,<1>)<10>,(s,j(<)(^[)<1>)(>)Ez(e)):
  250.     (<1>,(xg,Ill patt));
  251. )) } b
  252.  
  253. {
  254. [skeleton compilation]
  255.  
  256. [%R]
  257. ((
  258.     (<,>(and,<:Fk:>,<1>)) 1
  259.     (<,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:>) u
  260. )(
  261.     ((if,<10>,<>,x~,)) j
  262.     ((C,JZD(^[)<1>)) J
  263.     ((IF,(0),(c,z(<)(e)),z(<)<0>,<0>)) p
  264. )(7 1 10)(
  265.     (<,>(and,<10>,(or,CTR,STK,ARR):<-->),(p)xR(I,R ));
  266.     (<:u:>(or,<,>,)(and,<:Fk:><>,<10>),<<
  267.         >>{<(>Jx|;<)>~<(>(p)xRA;;<)>}x~);
  268.     (<:u:><:F+:>,{<(>J(IF,(10 1),<1>,<:F+:>,<<
  269.             >>(if,<10>,<>,x|,(b,<=>));<)>~<(>)<<
  270.             >>(p)(7b)xRA<<
  271.         >>(IF,(10 1),<1>,<:F+:>,<<
  272.             >>(nf,<10>,<>,BD)<<
  273.         >>(IF,(1),<1>,<,><:Fk:><:1:>,(J),(j));<<
  274.         >>(IF,(1),<1>,<:1:>,(J),(j)));<)>}(7a)(7c));
  275.     (<,><1>,<,><(><)><,><1>(%t,Warning: <(><)> added to %R)):
  276.     (<1>,(xg,Ill %R));
  277. )) r
  278.  
  279. [tail arg in conditionals]
  280. (()()(1 3 10)(
  281.     (<>,);
  282.     (<,>(and,<:Fk:>,<3>)<:F+:>,<<
  283.         >>(7n)J(2)(b,<3>)(3)(C,JZD(e));Z);
  284.     (<1>,(j));
  285. )) J
  286.  
  287. [tail arg in iteratives]
  288. (()()(1 10)(
  289.     (<>,);
  290.     (<:F+:>(and,<1>,<>),(C,JZD(e)));
  291.     (<1>,(j));
  292. )) U
  293.  
  294. [compile a skeleton]
  295. ((
  296.     ((or,<-->j(<)<>,<-->z(<)<>,<-->JQD<>,<-->JZD<>)) t
  297. )(
  298.     ((if,<0>,<:t:>,,z(<))) 0
  299.     ((if,<0>,<:t:>,,(>))) 1
  300.     ((if,<2>,(or,N,U),<(>,)) 2
  301.     ((if,<2>,(or,N,U),<)>,)) 3
  302.     ((xg,Illegal <2>)) j
  303. )(0 1 2 10)(
  304.     (<:l:><>,<0>);
  305.     (<:l:><:FZ:><:Fz:><10>,<0>(e)):
  306.     (<:l:>(and,<:FK:>,<1>)<10>,<0>(k,<1>)I(e)):
  307.     (<:l:>(<)(and,<:v:>,<1>)(>)<10>,<0><1>x[(e)):
  308.     (<:l:>(<)=(>)<10>,<0>(^_)(e)):
  309.     (<:l:><(>(and,(or,IF,NF),<2>)<:F*:>,<<
  310.         >>(IF,(7 1 10),<1>,<<
  311.         >><,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><:F+:>,<<
  312.         >>(c,<0>(0)(e))(7b)(nf,<7>,<>,{<(>(7a);<)>~<(>)<(><<
  313.         >>(WHILE,(1 3 4 10),<<
  314.             >><1>,<,>(and,<:Fk:>,<3>)<,>(and,<:Fk:>,<4>)<:F+:>,<<
  315.             >>(7n)J(2)(b,<3>)<<
  316.             >>(3)(C,JZD(^[)<4>);(C,JZD(e)),<1>,<<
  317.             >>(J,<=>))<<
  318.         >>;<)><<
  319.         >>(7n)(nf,<7>,<>,(7c);<)>}),<<
  320.         >>(xx,Ill <2>))(1)(e)):
  321.     (<:l:><(>(and,(or,WHILE,UNTIL),<2>)<:F*:>,<<
  322.         >><0>(IF,(7 1 10),<1>,<<
  323.         >><,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><:F+:>,<<
  324.         >>(c,z(<)(e))(7b)(nf,<7>,<>,{<(>(7a);<)>~<(>)<<
  325.         >>(WHILE,(1 3 4 10),<<
  326.             >><1>,<,>(and,<:Fk:>,<3>)<,>(and,<:Fk:>,<4>)<:F+:>,<<
  327.             >><(>(7n)J(2)(b,<3>)(3)<<
  328.             >>(h,(c,JZD(^[)<4>)(>)(c,z(<)(e))):;<)>,<1>,<<
  329.             >>(U,<=>))<<
  330.         >>Z(>)<<
  331.         >>(7n)(nf,<7>,<>,(7c);<)>}),<<
  332.         >>(xx,Ill <2>))(e)):
  333.     (<:l:><(>(and,(or,if,nf,while,until),<1>)<,><10>,<<
  334.         >><0>(^[)<(>(&u,<1>)<,><(><)><,><10>):
  335.     (<:l:><(>REC(REC/ABQU<1x]>A/)<)><10>,<0><1>(e)):
  336.     (<:l:><(>%R<:F*:>,<0>(0)(r,<1>)(1)(e)):
  337.     (<:l:><(>%r<:F*:>,<0>(0)(r,<,><(><)><1>)(1)(e)):
  338.     (<:l:><(><)><10>,<0>(e)):
  339.     (<:l:><(>(and,(or,(or,%,#,&)(ITR,<:N:>),<<
  340.             >><:n:>(ITR,<:n:>),),<2>)<:F*:>,<<
  341.         >>(IF,(10 1),<1>,<:F+:>,(c,<0>(0)(e)<<
  342.             >>(WHILE,(10 1),<1>,<:F+:>,(<)<,>(>)<10>,<1>)),<<
  343.         >><0>(0))<<
  344.         >>(i,<2>)(1)(e)):
  345.     (<:l:><1>,(xg,Ill skel)<0>);
  346. )) c
  347.  
  348. [skeleton cleanup]
  349. (()()(0 1)(
  350.     (JZD(^_)<0>,JZ<0>):
  351.     (JZ(and,(ITR,QI),<0>)(^_)<1>,JZ<0>QI<1>):
  352.     (JZDz(<)(^_)<0>,JZ(<)<0>):
  353.     (JZ(and,(ITR,QI),<0>)z(<)(^_)<1>,JZ<0>QI(<)<1>):
  354.     (JZ(and,(ITR,QI)(<)(ITR,QI),<0>)(^_)<1>,JZ<0>QI<1>):
  355.     (JZ<0>(^_)<1>,(I,64)x<'><0>64x[<<
  356.         >>(WHILE,(0 1),<1>,<0>(^_)<1>,<0>64x[,<1>)x<">);
  357. )) h
  358.  
  359. [skeleton main]
  360. (()()()(
  361.     (,(h,(c,<=>)));
  362. )) } C
  363.  
  364. [compile a constant]
  365. (()()(0)(
  366.     (<(>DEC<,><0><)>,<0>%);
  367.     (<(>HEX<,><0><)>,(nf,<0>,<[3]>,(&Hd,<=>)%,<<
  368.             >><=>,<[5]>,(&Hd,<=>)<,>,<'><0><'>H));
  369.     (<(>QUO(REC/ABQU<0x]>A/)<)>,<<
  370.         >>(IF,(7 8),<<
  371.         >>(WHILE,(1 2 3),<0>,<1>(and,(or,<'>,<">),<2>)<3>,<<
  372.         >>(nf,<1>,<>,<'><1><'>(^^))(&d,<2>)%(^^),<3>,<<
  373.         >>(and,<1>,<[1]><-->),<'><1><'>(^^),),<<
  374.         >><7>(^^)<8>(^^)<>,<<
  375.             >><7>(WHILE,(0 1),<8>,<0>(^^)<1>,<0>|,<1>)|,<<
  376.         >><=>,<7>(^^),<7>,<=>,<>,<'><'>));
  377.     (<(>^<0><)>,<(>HEX<,>(WHILE,(0 1),<0>,<0>(and,<[1]><>,<1>),<<
  378.             >>(IF,(0),(&Dh,(#-,(&d,<1>)-64)),<[2]><0>,<0>),<<
  379.             >><0>)<)>):
  380.     ((<)(and,(or,<'>,<">),<0>)(>),(&d,<0>)%);
  381.     (<0>,(if,<0>,<-->MEM:,(I,m ),)<<
  382.         >>(if,<0>,<-->CTR:,(I,c ),)<<
  383.         >>(if,<0>,<-->NUL:,(I,n ),)<<
  384.         >>(if,<0>,<-->STK:,(I,s ),)<<
  385.         >>(if,<0>,<-->ARR:,(I,a ),)<<
  386.         >><'>(WHILE,(0 1 2),<0>,<0>(or,<(><1><)>,(<)<1>(>))<2>,<<
  387.         >><0><1>,<2>)<'>);
  388. )) k
  389.  
  390. [insertion of sub call]
  391. (()(
  392.     ((WHILE,(0 1),<0>,<0>(and,<[1]><>,<1>),<<
  393.         >>(if,<1>,(or,<'>,<">),(&d,<1>)%,<'><1><'>),<0>)) X
  394. )(0 1)(
  395.     (<>,JZD);
  396.     ((and,(or,#,&),<1>)<0>,(Z)<'>&<'>(X)x<1>);
  397.     (%(and,<[1]>,<1>)<0>,(Z)(X)x<1>);
  398.     ((and,<[1]>,<1>)<0>,(X)@<1>);
  399. )) i
  400.  
  401. [insertion in the Include string]
  402. (()()(0)(
  403.     (<0>,(Y));
  404. )) I
  405.  
  406. [main program]
  407. ((
  408.     ((ITR,(or, ,(^I),(^M),(^J)))) w            [whitespace]
  409.     ([(ITR,(or,<:K:>,(and,<[1]>,(nor,[,]))))]) K    [comment]
  410.     (<:w:>(ITR,<:K:><:w:>)) W            [gen. whitespace]
  411.     ((and,<:W:>,<[1]><-->)<0>) S            [nonnull whitespace]
  412.     ((IVL/!/~/)) A                    [printable ASCII]
  413.     ((and,<:A:>,(nor,@,},%,#,&,~,<(>,<)>,<,>))) n    [subr name]
  414.     ((and,<:A:>,(nor,@,},<(>,<)>,<,>))) N        [lib subr name]
  415.     ((IVL/0/9/)) d                    [digit]
  416.     ((or,30,(OR,1,2,)<:d:>)) v            [var number]
  417.     ((or,<:v:>(ITR, <:v:>),)) V            [var list]
  418.     (<0>(^[)) l                    [left portion]
  419.  
  420.     {((or,<(>(nor,QUO,REC,IVL)(ITR,(or,<:0:>,<:1:>,<:Z:>,<<
  421.         >>(and,<[1]>,(nor,<(>,<)>)),<:q:>))<)>,<<
  422.      >><:Q:>,<:T:>,<:R:>)) q            [nest]
  423.      ((ITR,(or,<:0:>,<:1:>,<:4:>,<:Z:>,<<
  424.      >>(and,<[1]>,(nor,<(>,<)>,<,>)),<:q:>))) k    [to comma or rpar]
  425.      ((and,<,><:k:>,<,><10>)<1><>) +        [next item to 10]
  426.      ((and,(ITR,<,><:k:>),<1>)<)><10><>) *        [arg list to 1]
  427.      ((QUO/<(>/)) 0     ((QUO/<)>/)) 1            [round paren]
  428.      ((QUO/(<)/)) 2     ((QUO/(>)/)) 3            [angle brack]
  429.      ((QUO/<'>/)) '     ((QUO/<">/)) "            [quotes]
  430.      ((QUO/<,>/)) 4                    [comma]
  431.      (<(>QUO(REC/ABQzFz')'Ez/)) Q            [QUOte]
  432.      (<(>REC(REC/ABQzFz')'Ez/)) R            [REC]
  433.      ((<)(<)<-->(>)(>)) Z                [null]
  434.      ((ITR,<:Z:>)) z                [conc nulls]
  435.      ((REC/'(IVL'EzABQzFQzFz')'Ez/)) T        [lex InterVaL]
  436.      ((DEF,(IVL/@/_/),k,<(>^<:k:>(ITR,<:k:>)<)>)) C [ctrl chars]
  437.      (<:d:>(ITR,<:d:>)) i                [integer]
  438.      ((QUO/(DEC,/)<:i:><)>) E            [DECimal]
  439.      ((DEF,(or,<:d:>,(IVL/A/F/)),j,<<
  440.      >>(QUO/(HEX,/)<:j:>(ITR,<:j:>)<)>)) H        [HEXadecimal]
  441.      ((and,<:A:>,<<
  442.      >>(nor,<(>,<)>,(<),(>),<,>,<'>,<">))) a    [restr const]
  443.      ((or,<:a:>,(^I),(^J),(^M), )) c        [other const]
  444.      ((or,<:0:>,<:1:>,<:2:>,<:3:>,<:4:>,<:c:>)) e    [quotable const]
  445.      ((or,<:e:>(ITR,<:e:>),<:':>,<:":>,<<
  446.      >><:C:>,<:E:>,<:H:>,<:Q:>,<:Z:>)) K        [constant]
  447.      (<:@:>) } F
  448. )(
  449.     ((if,<=>(%r,<8>.<9>),<-->(^ZMJZ),<<
  450.         >>(xf),<=>(^MJ))) L            [read a line]
  451.     (<=>(%W,TTY:,<=>)) T                [trace]
  452.     ((%W,<8>.REC,<=>)) O                [write]
  453.  
  454.     {((nf,<7>,<>,<'><'><7>x<)>)) a            [var undef sub]
  455.      ((nf,<7>,<>,<<
  456.      >>(WHILE,(0 1),<=> ,<0> <1>,<0>x<(>,<1>))) b    [var init]
  457.      ((nf,<7>,<>,<<
  458.      >>(WHILE,(0 1),0x:<7> ,<0>x:<:v:> <1>,,<<
  459.         >>(#p,<0>)x:<1>))) c            [var discont]
  460.      ((O,(nf,<7>,<>,<(>(a);<)>~(^MJ)<(>(b))<(>)) o    [var init]
  461.      ((nf,<7>,<>,@~)) n                [var reinit]
  462.      ((nf,<7>,<>,(n)(c);<)>)) m            [var discont]
  463.      ((@))} 7
  464.  
  465.     ((^[)<10>) e                    [comp tail]
  466.  
  467.     ((WHILE,(0 2),<1> <0>,(and,<[2]>,<0>)<2>,(Y),<<
  468.         >><1><2>,)) Z                [make incl pair]
  469.     ((,(%Or,MEM:incl))(%r,MEM:incl,<<
  470.         >>(itr,<[2]>)<0>,,(%W,MEM:incl,<0>))) Y [write incl pair]
  471.  
  472.     {((%t,<=>)(,(%r,CTR:err))) x                [diagnostics]
  473.      ((x,Unbal {)) a
  474.      ((x,<=>: <0>)) b
  475.      ((b,Expected <(><,> [)) c
  476.      ((b,Ill subr name)) d
  477.      ((x,Ill var list: <7>)) e
  478.      ((x,Premature EOF)(%M)) f
  479.      ((x,<=>: <1>)) g
  480.      ((x,Excess })) h
  481.      ((@))} x
  482. )(8 9 11)(
  483.     (<8>.REC,Cannot compile a .REC file);
  484.     (<8>.<9>/<11>,(nf,(%Or,<8>.<9>),Not Found,(%Ow,<8>.REC)<<
  485.         >>(%Ow,MEM:incl,512)(%Ow,CTR:err)<<
  486.         >>(a,(L))<<
  487.         >>(if,(%r,CTR:err) error<(>s<)>,0 ,<=><<
  488.         >>(%Or,MEM:incl)<<
  489.         >>(O,(IF,(0 1),(%r,MEM:incl,<-->),(and,<0>,LB<1>),<<
  490.             >>}(^MJ)[<1>],<<
  491.             >>(REC*"~
  492. {(-1='Not Found'I;) v
  493. ((' 'FZD;Z;)0%IJ;) u
  494. (x+'Terminated'TLxE_) M
  495. ((B13%ED;;)J(10%FD:;)J(26%FBAZD;;)Z;) ~
  496. (13%Fz;26%F((2b);J6666,EA;zBj;)z;) |
  497. (512eqm29$rn|63K0(=)(a;L)LzZD(B26%ED:;)Y;DLL) y
  498. (J(2573FDZQmD;''m;)l30$SJ('L/'FDZ<(' 'FjJ;;)QD>
  499. ((B;;)' 'ED;;);'';)mZ
  500. "I*)<<
  501.     >>(if,<11>,S,,1024@0<'>}<'>$S)<<
  502.     >>(REC*"188cmpw'M'$r(f:;)wnpG66-,127$Sx@
  503. 'vuM~|y'I<z(BQD@s:;)>0,31$S
  504. nI<(A1b':'(E)'\'(E);'CNVLIB.REC'I;;)0%IJQD>
  505. 30$ryGI<@ppGm(pL61K-1(=);LLL@o:lyG' Not Found'|T_)
  506. 29$SnLLLLJZD>
  507. "I*)<<
  508.     >>(k,<(>QUO(^Z)<0>(^Z)<)>)<<
  509.     >>(REC*"m(32$r0=0''CLpLr32$S;;)LZz;) x
  510. (';'FDJ<((A);1b'\'E;'\'I;)JQD>lyG|;) o
  511. ('PATH='(F)JZD;(0%U;zZ;)QJZD(''=;';'=;I';'I;)J;) p
  512. (pG$r&\pG+127$r+S;) s
  513. (Z>zZ<(J@|J><z@~J;@y:Z26%I:)26%EnL0pG29$rpGm62knS;
  514. J('['ED']'FDJ<Z((2b)>JZD;QDlyw&FwJZD>;w:):Z;)
  515. >J<'[!]'FDBQD\pG+127$r+mJq32$rC
  516. mpGlyG-'w'$r'x'$r-
  517. (NLnLq'x'$rC&'x'$SnS;32$SnnS;)D::) w
  518. (@x<<@w>JZD>;)} %
  519. (@%@~xTxE;) }"I*))(^MJ)))));
  520.     (<8>/<11>,<8>.CNV/<11>):
  521.     (<8>.<9>,<8>.<9>/S):
  522.     (<8>,<8>.CNV/S):
  523. ))
  524. [end]
  525.