home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / REC.ZIP / RCONVERT.CNV < prev    next >
Encoding:
Text File  |  1986-12-01  |  15.6 KB  |  531 lines

  1. [RCONVERT.CNV]
  2. [G. Cisneros, 4.2.86]
  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>),<<
  12.         >><=>,[[<2>]]<>,(,(%Ow,MEM:som)(%W,MEM:som,<2>)),)<1>):
  13.     (<:w:>(and,<0>,(or,{,<(>)<-->),(O,{)(if,(E,<0>),},(xh),));
  14.     (,(L,<=>)):
  15. )) a
  16.  
  17. [find a program to compile]
  18. ((
  19.     ((or,(^Z),<:K:>)) z
  20. )()(0 1)(
  21.     (<:S:>,<0>):
  22.     ((^Z),<=>(%t,No main));
  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>),(xb,Expected {<,> [<,> <(>));
  32.     (<(><:W:><(><0>,(O,{)(%t,patt: )(0,<0>)):
  33.     (<(><:W:>(and,<[1]>,(nor,[,<(>),<0>),(xc));
  34.     (<0>,(L,<0>)):
  35. )) E
  36.  
  37. [programs/definitions in braces]
  38. (()(
  39.     ((if,<=>,(^Z),(xa),<=>,(^[),(xh))) 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:>,<=>,<<
  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.      ((xa)) 2
  56.      ((G,<=>))} g
  57. )(0 1 2)(
  58.     (<:S:>,<0>):
  59.     ((^[)<0>,<0>);
  60.     ((^Z),(xf));
  61.     ({<0>,(O,(T,{))(g,{<0>)):
  62.     ((or,<)>,)<:W:>(and,<[1]>,(nor,[,<(>),<0>),(xc));
  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.      ((xa)) 4
  78.      ((G,<=>))} g
  79. )(0 1 2)(
  80.     (<:S:>,<0>):
  81.     ((^[)<0>,<0>);
  82.     ((^Z),(xf));
  83.     ({<0>,(O,(T,{))(g,{<0>)):
  84.     ((or,<)>,)<:W:>(and,<[1]>,(nor,[,<(>),<0>),(xc));
  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)(
  97.     (<7><)><:W:><(><0>,<<
  98.         >>(,(T,<7>))(if,<7>,<:V:><>,(%t,rule: )(7o)(5,<0>),(xe)));
  99.     (<7><)><:W:>(and,<[1]>,(nor,<(>,[),<0>),(xc));
  100.     (<0>,(L,<0>));
  101. )) 4
  102.  
  103. [rule set]
  104. (()()(0 1 2 3)(
  105.     (<:S:>,<0>):
  106.     ((^Z),(xf));
  107.     ((and,<[1]>,(nor,<(>,<)>,[),<0>),(xb,Expected <(><,> <)><,> [));
  108.     (<)><:W:>(and,<[1]>,(nor,<)>,[),<0>),(xb,Expected <)><,> [));
  109.     (<)><:W:><)><0>,(O,Z;<)>(7m)})(^[)<0>);
  110.     ((and,<:Fq:>,<(>(and,<:Fk:>,<0>)<,>(and,<:Fk:>,<1>)<)>)<<
  111.     >><:w:>(and,<[1]>,<2>)<3>,<<
  112.         >>(O,(7n)(nf,<0>,<>,<<
  113.             >>(if,J(b,<0>),<-->(^_),(I,64)x<'><<
  114.             >>(WHILE,(0 1),<=>,<0>(^_)<1>,<0>64x[,<1>)x<">)<<
  115.             >>)(C,JZD(^[)<1>))<<
  116.         >>(if,<2>,(or,:,;),(O,(T,<2>)(^MJ)),<<
  117.         >>(xb,Expected :<,> ;))<3>):
  118.     ((and,<:Fq:>,<0>)<:w:><[1]>,(xb,Bad rule));
  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.         >><(><(>(nf,<1>,<>,(k,<1>)(QUO/(Fz;ZzqL)/))<<
  169.         >>qL(b,<10>)L;Y<)>;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.         >><(>Z(<)(b,<10>)(>);J(>)(b,<1>):<)>);
  187.     (<(>(or,OR,or)<)><10>,<(><)>(e)):
  188.     (<(>and<:F*:>,<<
  189.         >>(IF,(10 1),<1>,<:F+:>,<<
  190.             >>Z(<)<(>(b,<10>)jJ(>)(<)<<
  191.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>(<)(>))(j),<1>)<<
  192.             >>(QUO/;>)>/))(e)):
  193.     (<(>or<:F*:>,<<
  194.         >>Z(<)<(><<
  195.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>);(j),<1>)<<
  196.             >>(QUO/>)>/)(e)):
  197.     (<(>AND<,>(and,<:Fk:>,<1>)<)><10>,<1><10>):
  198.     (<(>AND<:F*:>,<<
  199.         >>(IF,(10 1 2),<<
  200.         >>(IF,(0 1),<10>,<0>(<):%:(>)<1>,<0>(<):~:(>)<1>)(^[)<1>,<<
  201.                 >><2>(^[)<:F+:>,<<
  202.             >>Z(<)<(>(if,<2>,<-->(<):~:(>),x9,)<<
  203.             >>(b,<10><<
  204.             >><(>REC(^])<(>ljJ(>)(<)<<
  205.             >>(WHILE,(10 1),<1>,<:F+:>,(b,<10>(<)(>))(j),<1>)<<
  206.             >>(nf,<2>,<>,(QUO/qLJ>Z<Y/)(b,<=>))<<
  207.             >>(QUO/>L;x{J>Z<)/)(^])<)>)<<
  208.             >>(if,<2>,<-->(<):~:(>),x};x},;)(>)<)>));
  209.     (<(>OR<:F*:><10>,<<
  210.         >>Z(<)<(><<
  211.             >>(WHILE,(10 1),<1>,<:F+:>,l(b,<10>);x{(j),<1>)<<
  212.             >>(QUO/>)L>/));
  213.     (<(>OR<:F*:>,<<
  214.         >>(IF,(10),<10>,(<):%:(>)<>,<<
  215.             >>Z(<)<(><<
  216.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  217.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  218.             >>(QUO/>)L>/),<<
  219.             >><=>,<10>(<):%:(>),<<
  220.                 >>x9{<(>(b,<10>(<):~:(>));<)>%<(>Z(<)<(><<
  221.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  222.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  223.             >>(QUO/>)L>x};x})}/)(I,::),<<
  224.             >><=>,<10>,{<(>(b,<10>);<)>%<(>Z(<)<(><<
  225.             >>(WHILE,(10 1),<1>,<:F+:>,<<
  226.                 >>l(b,<10>(<):%:(>));x{(j),<1>)<<
  227.             >>(QUO/>)L>;)}/)));
  228.     (<(>NOT<,>(and,<:Fk:>,<1>)<)><10>,<<
  229.         >><(>Z(<)(b,<1>)(QUO/J>)/)<<
  230.         >>(IF,(10),J(>)(e),J(>)(^[)(or,<:B:>,<>)<10>,(>)Zz(e))):
  231.     (<(>nor<:F*:>,<(>NOT<,><(>or<1><)><)><10>):
  232.     (<(>^<)><10>,0%31%Mz(e)):
  233.     (<(>IVL<1>,(U,<1>)):
  234.     (<(>ivl<:F*:>,<<
  235.         >><(>(WHILE,(0 10 1),<1>,<,>(and,<:Fk:>,<0>)<:F+:>,<<
  236.         >>(s,(s,j(<)(^[)<0>)(e))(>)Mz;,<1>,<<
  237.         >><:F+:>,(nf,<10>,<>,(s,j(<)(e))(>)<'><'>Mz;),)<)>(e)):
  238.     (<(>REC(REC/ABQU<1x]>A/)<)><10>,<1>(e)):
  239.     (<(>LAM<:F*:>,(L,<1>)(e)):
  240.     (<(>PWS<)><10>,x+Zqtj(e)):
  241.     (<(>PWS<,>(and,<:FK:>,<1>)<)><10>,x+(k,<1>)TLZqtj(e)):
  242.     (<(>HLT<)><10>,RL(e)):
  243.     (<(>HLT<,>(and,<:FK:>,<1>)<)><10>,x+(k,<1>)TLRL(e)):
  244.     (<(>NOP(or,<,><:Fk:>,)<)><10>,(e)):
  245.     (<(>PVR<,>(and,<:Fk:>,<1>)<)><10>,<<
  246.         >>(if,<1>,<:v:>,<1>x_,(xg,Not a var))(I,v )(e)):
  247.     (<(><)><1>,<1>):
  248.     ((and,<:Fq:>,<1>)<10>,(s,j(<)(^[)<1>)(>)Ez(e)):
  249.     (<1>,(xg,Ill patt));
  250. )) } b
  251.  
  252. {
  253. [skeleton compilation]
  254.  
  255. [LAM]
  256. (()()(7 10)(
  257.     (<,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><,><10>,<<
  258.         >>(7b)(c,(e))(7a)(7c));
  259. )) L
  260.  
  261. [%R]
  262. ((
  263.     (<,>(and,<:Fk:>,<1>)) u
  264. )(
  265.     ((if,<10>,<>,x~,)) j
  266.     ((C,JZD(^[)<1>)) J
  267.     ((IF,(0),(c,z(<)<=>),z(<)<0>,<0>)) p
  268. )(1 10)(
  269.     (<,>(and,<10>,CTR:<-->),(p,(e))xR);
  270.     ((or,<,>,)(and,<:Fk:><>,<10>),<<
  271.         >>{<(>Jx|;<)>~<(>(p,(e))xRA;;<)>}x~);
  272.     (<:F+:>,{<(>J(IF,(10 1),<1>,<:F+:>,<<
  273.             >>(if,<10>,<>,x|,(b,<=>));<)>~<(>)<<
  274.             >>(p,(e))xRA<<
  275.         >>(IF,(10 1),<1>,<:F+:>,<<
  276.             >>(nf,<10>,<>,BD)<<
  277.         >>(IF,(1),<1>,<,><:Fk:><:u:>,(J),(j));<<
  278.         >>(IF,(1),<1>,<:u:>,(J),(j)));<)>});
  279. )) r
  280.  
  281. [tail arg in conditionals]
  282. (()()(1 3 10)(
  283.     (<>,);
  284.     (<,>(and,<:Fk:>,<3>)<:F+:>,<<
  285.         >>(7n)J(2)(b,<3>)(3)(C,JZD(e));Z);
  286.     (<1>,(j));
  287. )) J
  288.  
  289. [tail arg in iteratives]
  290. (()()(1 10)(
  291.     (<>,);
  292.     (<:F+:>(and,<1>,<>),(C,JZD(e)));
  293.     (<1>,(j));
  294. )) U
  295.  
  296. [compile a skeleton]
  297. ((
  298.     ((or,<-->j(<)<>,<-->z(<)<>,<-->JQD<>,<-->JZD<>)) t
  299. )(
  300.     ((if,<0>,<:t:>,,z(<))) 0
  301.     ((if,<0>,<:t:>,,(>))) 1
  302.     ((if,<2>,(or,N,U),<(>,)) 2
  303.     ((if,<2>,(or,N,U),<)>,)) 3
  304.     ((xg,Illegal <2>)) j
  305. )(0 1 2 10)(
  306.     (<:l:><>,<0>);
  307.     (<:l:><:FZ:><:Fz:><10>,<0>(e)):
  308.     (<:l:>(and,<:FK:>,<1>)<10>,<0>(k,<1>)I(e)):
  309.     (<:l:>(<)(and,<:v:>,<1>)(>)<10>,<0><1>x[(e)):
  310.     (<:l:>(<)=(>)<10>,<0>(^_)(e)):
  311.     (<:l:><(>LAM<:F*:>,<0>(L,<1>)(e)):
  312.     (<:l:><(>(and,(or,IF,NF),<2>)<:F*:>,<<
  313.         >>(IF,(7 1 10),<1>,<<
  314.         >><,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><:F+:>,<<
  315.         >>(c,<0>(0)(e))(7b)(nf,<7>,<>,{<(>(7a);<)>~<(>)<(><<
  316.         >>(WHILE,(1 3 4 10),<<
  317.             >><1>,<,>(and,<:Fk:>,<3>)<,>(and,<:Fk:>,<4>)<:F+:>,<<
  318.             >>(7n)J(2)(b,<3>)<<
  319.             >>(3)(C,JZD(^[)<4>);(C,JZD(e)),<1>,<<
  320.             >>(J,<=>))<<
  321.         >>;<)><<
  322.         >>(7n)(nf,<7>,<>,(7c);<)>}),<<
  323.         >>(xx,Ill <2>))(1)(e)):
  324.     (<:l:><(>(and,(or,WHILE,UNTIL),<2>)<:F*:>,<<
  325.         >><0>(IF,(7 1 10),<1>,<<
  326.         >><,><:Fz:><(>(and,<:V:>,<7>)<)><:Fz:><:F+:>,<<
  327.         >>(c,z(<)(e))(7b)(nf,<7>,<>,{<(>(7a);<)>~<(>)<<
  328.         >>(WHILE,(1 3 4 10),<<
  329.             >><1>,<,>(and,<:Fk:>,<3>)<,>(and,<:Fk:>,<4>)<:F+:>,<<
  330.             >><(>(7n)J(2)(b,<3>)(3)<<
  331.             >>(h,(c,JZD(^[)<4>)(>)(c,z(<)(e))):;<)>,<1>,<<
  332.             >>(U,<=>))<<
  333.         >>Z(>)<<
  334.         >>(7n)(nf,<7>,<>,(7c);<)>}),<<
  335.         >>(xx,Ill <2>))(e)):
  336.     (<:l:><(>(and,(or,if,nf,while,until),<1>)<,><10>,<<
  337.         >><0>(^[)<(>(&u,<1>)<,><(><)><,><10>):
  338.     (<:l:><(>REC(REC/ABQU<1x]>A/)<)><10>,<0><1>(e)):
  339.     (<:l:><(>%R<:F*:>,<0>(0)(r,<1>)(1)(e)):
  340.     (<:l:><(><)><10>,<0>(e)):
  341.     (<:l:><(>(and,(or,(or,%,#,&)(ITR,<:N:>),<<
  342.             >><:n:>(ITR,<:n:>),),<2>)<:F*:>,<<
  343.         >>(IF,(10 1),<1>,<:F+:>,(c,<0>(0)(e)<<
  344.             >>(WHILE,(10 1),<1>,<:F+:>,(<)<,>(>)<10>,<1>)),<<
  345.         >><0>(0))<<
  346.         >>(i,<2>)(1)(e)):
  347.     (<:l:><1>,(xg,Ill skel));
  348. )) c
  349.  
  350. [skeleton cleanup]
  351. (()()(0 1)(
  352.     (JZD(^_)<0>,JZ<0>):
  353.     (JZ(and,(ITR,QI),<0>)(^_)<1>,JZ<0>QI<1>):
  354.     (JZDz(<)(^_)<0>,JZ(<)<0>):
  355.     (JZ(and,(ITR,QI),<0>)z(<)(^_)<1>,JZ<0>QI(<)<1>):
  356.     (JZ(and,(ITR,QI)(<)(ITR,QI),<0>)(^_)<1>,JZ<0>QI<1>):
  357.     (JZ<0>(^_)<1>,(I,64)x<'><0>64x[<<
  358.         >>(WHILE,(0 1),<1>,<0>(^_)<1>,<0>64x[,<1>)x<">);
  359. )) h
  360.  
  361. [skeleton main]
  362. (()()()(
  363.     (,(h,(c,<=>)));
  364. )) } C
  365.  
  366. [compile a constant]
  367. (()()(0)(
  368.     (<(>DEC<,><0><)>,<0>%);
  369.     (<(>HEX<,><0><)>,(nf,<0>,<[3]>,(&Hd,<=>)%,<<
  370.             >><=>,<[5]>,(&Hd,<=>)<,>,<'><0><'>H));
  371.     (<(>QUO(REC/ABQU<0x]>A/)<)>,<<
  372.         >>(IF,(7 8),<<
  373.         >>(WHILE,(1 2 3),<0>,<1>(and,(or,<'>,<">),<2>)<3>,<<
  374.         >>(nf,<1>,<>,<'><1><'>(^^))(&d,<2>)%(^^),<3>,<<
  375.         >>(and,<1>,<[1]><-->),<'><1><'>(^^),),<<
  376.         >><7>(^^)<8>(^^)<>,<<
  377.             >><7>(WHILE,(0 1),<8>,<0>(^^)<1>,<0>|,<1>)|,<<
  378.         >><=>,<7>(^^),<7>,<=>,<>,<'><'>));
  379.     (<(>^<0><)>,<(>HEX<,>(WHILE,(0 1),<0>,<0>(and,<[1]><>,<1>),<<
  380.             >>(IF,(0),(&Dh,(#-,(&d,<1>)-64)),<[2]><0>,<0>),<<
  381.             >><0>)<)>):
  382.     ((<)(and,(or,<'>,<">),<0>)(>),(&d,<0>)%);
  383.     (<0>,(if,<0>,<-->MEM:,(I,m ),)<<
  384.         >>(if,<0>,<-->CTR:,(I,c ),)<<
  385.         >>(if,<0>,<-->NUL:,(I,n ),)<<
  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.         >>(xx,Stx err),<=>(^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,<=>)(%M)) 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)) 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,MEM:som,2048))<<
  486.         >>(%W,MEM:som,rconvert/icuap/1985)<<
  487.         >>(a,(L))<<
  488.         >>(,(%Or,MEM:incl)(%Or,MEM:som))<<
  489.         >>(O,(IF,(0 1),(%R,MEM:incl,<-->),(and,<0>,LB<1>),<<
  490.             >>}(^MJ)[<1>],<<
  491.             >>(REC*"~
  492. {((Jj':'UQD':'ED\64-(0=)%;0,25K^&L%;)
  493. ('.'U<(8a;xb;)Q|D>;Z'.'IJj:)
  494. '.'FJD(3a;xb;)Q|JZDI;) u
  495. (255='Not Found'I;) v
  496. (Zz(d' 'I:;)JZ;) b
  497. (w0%(f:;)w;) -
  498. (cmpx-n;) 0
  499. (128,26k;) 5
  500. (x+"I*)(k,<(>QUO(^Z)(%R,MEM:som,<-->)(^Z)<)>)(REC*"TL;) Q
  501. ((B13%ED;;)J(10%FD:;)Z;) ~
  502. (13%Fz;26%F((2b);J6666,EA;zBj;)z;) |
  503. (|0|0|0|pLpGnpG6-mSpG8+n&S;) 3
  504. (x00x3;) `
  505. (mx0n&mx0nx3;) z
  506. (30$r128eqL26k20K0=L;DLL) y
  507. (('L/'FDZ<(' 'FjJ;;)QD>
  508. ((B;;)' 'ED;;);'';)mZ
  509. "I*)(if,<11>,S,,1024@0<'>}<'>$S)(REC*"188@0pG66-,127$Sx@
  510. 'uvb-05Q~|3`zy'I<z(BQD@s:;)>@i
  511. 33@0pG30$SnI
  512. <@u(A' 'EZD'CNVLIB  REC'I;;)JQD>&S
  513. @5,30$r15K(@vu\64+%':'|&11G|':'|TLqt_;LL;)
  514. "I*)(k,<(>QUO(^Z)<0>(^Z)<)>)(REC*"m0''CLpLr32$SLZz;) x
  515. (Jj(' 'ED:;)(' 'U;Z;)QZI<(AB;'TTY:'I;)31$m
  516. ('TTY:'E4x`;xu130,33xz;)QZD>&pG8+0&SrS;) i
  517. (pG$r&\pG+127$r+S;) s
  518. (Z>zZ<(J@|J><z@~J;@y:Z26%I:)26%ELnL0,30$S;
  519. J('['ED']'FDJ<Z((2b)>JZD;QDlyw&FwJZD>;w:):Z;)
  520. >J<'[!]'FDBQD\pG+127$r+mJq32$rC
  521. mpGlyG-'w'$r'x'$r-
  522. (NLnLq'x'$rC&'x'$SnS;32$SnnS;)D::) w
  523. (@x<<@w>JZD>J'Next: '32$r!|TLxQ
  524. (A;{(Jx|;) ~ (xR;;)}x~;);)} %
  525. (@%@~xTxE;) }"I*))(^MJ))));
  526.     (<8>/<11>,<8>.CNV/<11>):
  527.     (<8>.<9>,<8>.<9>/S):
  528.     (<8>,<8>.CNV/S):
  529. ))
  530. [end]
  531.