fork download
  1. #!/usr/bin/perl6
  2.  
  3. # nnnnnnnnnnnnnnnn
  4.  
  5. my $origRwcode= ''; my $lastRwcode= ''; my $lastRwcodeDef= '';
  6. ## $lastRwc[<::: id ( ~0:x1 (concat:x(~0:x0)) ( ~0 :x1) ) :::>] )';
  7.  
  8. $origRwcode=
  9. 'jumpTo <:0:TelService>
  10. (1__CODES
  11. (@@12
  12. ( proc :TelService :0 [<::: @@3 :CallSession :Instruct1 :Instruct2 :::>] :4 )
  13. ( proc :CallSession :4
  14. : [<:::
  15. : CallSession
  16. : ( stepThru1 (PerEvntActnList<:~2:~3>) :TelService )
  17. : [ ~1 ]
  18. : ( NxtStateMap<:~2:~3> )
  19. : :::>] :TelService
  20. )
  21. ( term [jumpTo <:0 :TelService >] [CallSession:TelService] )
  22. ( term [jumpTo <:1 :TelService >] [Instruct1 :TelService] )
  23. ( term [jumpTo <:2 :TelService >] [Instruct2 :TelService] )
  24. ( proc :jumpTo :1 [<::: id(id(~0:x1(concat:x(~0:x0))(~0:x1) ) ) :::>] )
  25. ( term [PerEvntActnList <:onhook [dialDigit:4]>] [say(concat:hello[,][ ]:World)] )
  26. ( term [PerEvntActnList <:offhook :dialDigit6 >] [say(concat:lets[ ]:talk)] )
  27. ( term [PerEvntActnList <:talking [dialDigit:8]>] [say(concat:seeya[,][ ]:bye)] )
  28. ( term [NxtStateMap <:onhook [dialDigit:4]>] :offhook )
  29. ( term [NxtStateMap <:offhook :dialDigit6 >] :talking )
  30. ( term [NxtStateMap <:talking [dialDigit:8]>] :disconnect )
  31. ) )
  32. [2__CURSTATE :onhook ]
  33. [3__EVENT [dialDigit:4] ]
  34.  
  35. :dialDigit6
  36. [dialDigit:8]
  37. ';
  38. # ( term [jumpTo <:0 :TelService >] [CallSession:TelService] )
  39.  
  40. my $setup= 1; my $tmpBlocName= ''; my $tmpBlocArgTotal= 0;
  41. my $stopredOP= ''; my $stopredWhileMin= 0; my $stopredWhileMax= 0; my @stopredWFEcompArgList= Nil;
  42. my %*TERMS{Any}; my %*TERMSargTotal{Any}; my %*VARS{Any}; my %*VAR{Any}; my %*PROCS{Any}; my %*PROCSparmNum{Any};
  43. my %*stateROM; my %*actionsROM; my %*AssocListArg0; my %*AssocListArg1; my %*PROCSinfo{Any};
  44. my %*GOTOARGNAMES{Any};
  45.  
  46. my @savedsr2WFEcompArgList= Nil; my @savedsr2tempLeftBrace= Nil;
  47. my @savedsr2tempRightBrace= Nil; my $savedsr2rewriteArgListElems= 0;
  48.  
  49. my @tempWFEcompArgList= Nil;my @WFEcompArgListSav= Nil;my @tempLeftBraceSav= Nil;
  50. my @tempRightBraceSav= Nil;my $compareMax= 0;my $rewriteArgListElemsSav= 0;
  51. my @WFEcompArgListPreFx= Nil; my @WFEcompArgListSavPreFx= Nil; my $entryWFE4PreFx= '';
  52.  
  53. my $input= ''; my $tp0= ''; my $tp1= ''; my $tp2= ''; my $symbType= ''; my $output= 1; my $saySuccess= 0;
  54. my $addMultSuccess= 0; my @tempStmt= Nil; my $noSkips= 1; my $wrongArgTypes= 0; my @OPstr= Nil; my $OPsav= Nil; my $OPsav2= Nil;
  55. my @OPvariety= Nil; my @entryTempoeName= Nil; my $tempInt= 9999; my $srMax= -1; my @AssocComp0= Nil;
  56. my @AssocComp1= Nil; my @ARGLISTrankForGivenLevelAlreadyInitialized= Nil; my @ARGLISTrankInGivenARGLISTlevel= Nil;
  57. my $BIStemp2= 0; my $BIStemp22= 0; my @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun= Nil;
  58. my @BISlistOfWFErewritesForGivenARGLISTruleRun= Nil; my @BISlistOfWFEbraceTypesForGivenARGLISTruleRun= Nil;
  59. my $BIStempCurWFEbrace= ''; my @curWFEbraceForGivenActnum= Nil; my @isBaseBISlistOfWFEbraceTypesForGivenARGLISTruleRun= Nil;
  60. my $entryWFE= ''; my $entryWFE2= ''; my $entryWFE2Orig= ''; my $entryWFE4= ''; my $entryWFE6= ''; my $entryWFE66= ''; my $entryWFE7= ''; my $actualTemplate= ''; my $tmplateStr= ''; my $tmplateOP= 0;
  61. my $debug= 0; my $debug2= 1; my $debug4= 0;
  62.  
  63. my $englobingNoRWdegree= 0; my $curBrace= ''; my @listOfCurBraces= Nil;
  64. my @BraceTypeOfComponentWFEatGivenIndexInWFElistOfARGLISTatGivenSrLevel= Nil;
  65. my @currentARGLISTlistOfBraceTypesOfComponentWFEs= Nil;
  66. my @currentARGLISTlistOflistOfOPvarietyOfComponentWFEs= Nil;
  67. my $tempLeftBrace= ''; my $tempRightBrace= ''; my @tempLeftBrace= Nil; my @tempRightBrace= Nil;
  68. my @curbraceL= Nil; my @curbraceIdx= Nil; my $ttp= ''; my $tmplateNumOfParms= 0;
  69. my $b12 = ' '; my $i= '|'; my $l= ':'; my $temp1= 'blank'; my $temp2= 0; my $temp4= 0; my $temp6= 0; my $rewriteWFE= '';
  70. my @curWFEbrace= Nil; my @curWFEopVariety= Nil; my $curIdx= 999; my $curIdx2= 999; my $curIdx4= 999; my $sr= 0; my $srw= -1;
  71. my $rewriteArgListElems= 0; my @tempArgList= Nil; my $rewriteArgList= ''; my @WFEcompArgList= Nil; my @WFEcompArgListTemp= Nil;
  72. my @methodStepOfCallingARGLISTrun= Nil; my @WFEcompArgListOrig= Nil; my @WFEcompArgListTemp2= Nil;
  73. my @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun= Nil; my @listOfWFErewritesForGivenARGLISTruleRun= Nil;
  74. my @listOfWFEbraceTypesForGivenARGLISTruleRun= Nil; my @listOfOPvarietyForGivenARGLISTruleRun= Nil;
  75. my @rewriteArgList= Nil; my $stopreduction= 0; my $needNewDescend= 0; my $rwcode= ''; my $match2= ''; my $lastRunNum= -1;
  76. my $runNum= 0; my $continue= 0; my @tmplateList= Nil; my $parmSubstnResult= ''; my @parm= Nil;
  77.  
  78. sub fillRestOfArgsV1($startCurIdx) {
  79. my $curLocal= $startCurIdx;
  80. $stopredOP= $rewriteWFE; $stopredWhileMin= $curLocal; $stopredWhileMax= $rewriteArgListElems;
  81. while $curLocal < $rewriteArgListElems {
  82. @stopredWFEcompArgList[$curLocal]= @WFEcompArgList[$curLocal];
  83. $rewriteWFE= $rewriteWFE ~ '[' ~ @WFEcompArgList[$curLocal] ~ ']';
  84. $curLocal= 1 + $curLocal;
  85. };
  86.  
  87. $tp1= $rewriteWFE; $tp2= '';
  88. $tp1= $tp1.subst(/^([<[a..zA..Z0..9]> | '_' ]+)$/ , -> $/ { $tp2= $0; } );
  89. if $tp2 ~~ '' {$stopreduction= 1;};
  90. ## $stopreduction= 1;
  91. };
  92.  
  93. sub fillRestOfArgsV2($startCurIdx) {
  94. my $curLocal= $startCurIdx;
  95. $stopredOP= $rewriteWFE; $stopredWhileMin= $curLocal; $stopredWhileMax= $rewriteArgListElems;
  96. while $curLocal < $rewriteArgListElems {
  97. @stopredWFEcompArgList[$curLocal]= @WFEcompArgList[$curLocal];
  98. $rewriteWFE= $rewriteWFE ~ '[' ~ @WFEcompArgList[$curLocal] ~ ']';
  99. $curLocal= 1 + $curLocal;
  100. };
  101. };
  102.  
  103. sub trimBrackets(Str $x) {
  104. my $local= $x;
  105. $local= $local.subst( :g , / '@@1(' (.+?) ')[equals]' / , -> $/ { '{' ~ $0 ~ '}[equals]' } );
  106. $local= $local.subst( :g , /^'['([<[a..zA..Z0..9]> | '_' ]+ | \d+)']' / , -> $/ { 'QWWw:' ~ $0 } );
  107. $local= $local.subst( :g , / '['([<[a..zA..Z0..9]> | '_' ]+ | \d+)']' / , -> $/ { ' :' ~ $0 } );
  108. $local= $local.subst( :g , /^('QWWw:') / , -> $/ { ':' } );
  109. $local= $local.subst( :g , / '[@@2 :'([<[a..zA..Z0..9]> | '_' ]+ | \d+)' :'([<[a..zA..Z0..9]> | '_' ]+ | \d+)']' / , -> $/ { '< :' ~ $0 ~ ' :' ~ $1 ~ ' >' } );
  110. $local= $local.subst( :g , / '[~'(\d+)']' / , -> $/ { ' :~' ~ $0 } );
  111. $local= $local.subst( :g , / '[@@2 :'([<[a..zA..Z0..9]> | '_' ]+ | \d+)' :~'(\d+)']' / , -> $/ { '< :' ~ $0 ~ ' :~' ~ $1 ~ ' >' } );
  112. $local= $local.subst( :g , / '[@@2 :~'(\d+)' :'([<[a..zA..Z0..9]> | '_' ]+ | \d+)']' / , -> $/ { '< :~' ~ $0 ~ ' :' ~ $1 ~ ' >' } );
  113. $local= $local.subst( :g , / '[@@2~'(\d+)' :~'(\d+)']' / , -> $/ { '< ~' ~ $0 ~ ' :~' ~ $1 ~ ' >' } );
  114. $local= $local.subst( :g , / '['(\%+)']' / , -> $/ { { '[' ~ "{' ' x$0.chars}" ~ ']' } } );
  115. $local= $local.subst( :g , /^(\%+)$/ , -> $/ { { "{' ' x$0.chars}" } } );
  116. $local= $local.subst( :g , / (''\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) '[' / , -> $/ { $0 ~ $1 ~ $2 ~ ' [' } );
  117. $local= $local.subst( :g , / (''\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) '(' / , -> $/ { $0 ~ $1 ~ $2 ~ ' (' } );
  118. $local= $local.subst( :g , / (''\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) '<' / , -> $/ { $0 ~ $1 ~ $2 ~ ' <' } );
  119. $local= $local.subst( :g , / '< :'(\d+)' :'([<[a..zA..Z0..9]> | '_' ]+ | \d+)' >' / , -> $/ { '<:' ~ $0 ~ ':' ~ $1 ~ '>' } );
  120. $local= $local.subst( :g , / ('subItem[') / , -> $/ { 'subItem [' } );
  121. $local= $local.subst( :g , / ('subItem(') / , -> $/ { 'subItem (' } );
  122. $local= $local.subst( :g , / ('subItem<') / , -> $/ { 'subItem <' } );
  123. $local= $local.subst( :g , / ('subItem:') / , -> $/ { 'subItem :' } );
  124. $local= $local.subst( :g , / ('subVar[') / , -> $/ { 'subVar [' } );
  125. $local= $local.subst( :g , / ('subVar(') / , -> $/ { 'subVar (' } );
  126. $local= $local.subst( :g , / ('subVar<') / , -> $/ { 'subVar <' } );
  127. $local= $local.subst( :g , / ('subVar:') / , -> $/ { 'subVar :' } );
  128. $local= $local.subst( :g , / ('proc[') / , -> $/ { 'proc [' } );
  129. $local= $local.subst( :g , / ('proc(') / , -> $/ { 'proc (' } );
  130. $local= $local.subst( :g , / ('proc<') / , -> $/ { 'proc <' } );
  131. $local= $local.subst( :g , / ('proc:') / , -> $/ { 'proc :' } );
  132. $local= $local.subst( :g , / ('term[') / , -> $/ { 'term [' } );
  133. $local= $local.subst( :g , / ('term(') / , -> $/ { 'term (' } );
  134. $local= $local.subst( :g , / ('term<') / , -> $/ { 'term <' } );
  135. $local= $local.subst( :g , / ('term:') / , -> $/ { 'term :' } );
  136. $local= $local.subst( :g , / 'stepThru'(\d+)'[' / , -> $/ { 'stepThru' ~ $0 ~ ' [' } );
  137. $local= $local.subst( :g , / 'stepThru'(\d+)'(' / , -> $/ { 'stepThru' ~ $0 ~ ' (' } );
  138. $local= $local.subst( :g , / 'stepThru'(\d+)'<' / , -> $/ { 'stepThru' ~ $0 ~ ' <' } );
  139. $local= $local.subst( :g , / 'stepThru'(\d+)':' / , -> $/ { 'stepThru' ~ $0 ~ ' :' } );
  140. $local= $local.subst( :g , / ('(@@')(\d+) / , -> $/ { '( @@' ~ $1 } );
  141. $local= $local.subst( :g , / ('[@@')(\d+) / , -> $/ { '[ @@' ~ $1 } );
  142. $local= $local.subst( :g , / ('@@')(\d+)('(') / , -> $/ { $0 ~ $1 ~ ' (' } );
  143. $local= $local.subst( :g , / ('@@')(\d+)('[') / , -> $/ { $0 ~ $1 ~ ' [' } );
  144. $local= $local.subst( :g , / ('@@')(\d+)('<') / , -> $/ { $0 ~ $1 ~ ' <' } );
  145. $local= $local.subst( :g , / (':equals') / , -> $/ { '==' } );
  146. $local= $local.subst( :g , / '@@1 (' (.+?) ') ==' / , -> $/ { '{' ~ $0 ~ '} ==' } );
  147. ## $local= $local.subst( :g , / '@@1 (' ('~'\d+) ') ==' / , -> $/ { '{' ~ $0 ~ '} ==' } );
  148. };
  149.  
  150. sub normalizeOrigCodes(Str $x) {
  151. my $local= $x;
  152. $local= $local.subst( :g , / ('==') / , -> $/ { ':equals' } );
  153. $local= $local.subst( :g , / (' : ') / , -> $/ { ' ' } );
  154. $local= $local.subst( :g , / 'Run' / , -> $/ { 'goTo0' } );
  155. $local= $local.subst( :g , / '('<[A..Z]>[<[A..Z0..9]> | '_' ]*','\s* / , -> $/ { '( ' } );
  156. $local= $local.subst( :g , / '['<[A..Z]>[<[A..Z0..9]> | '_' ]*','\s* / , -> $/ { '[ ' } );
  157. $local= $local.subst( :g , / '[' (\s+) ']' / , -> $/ { '[' ~ "{'%' x$0.chars}" ~ ']' } );
  158. $local= $local.subst( :g , / '(' \s* [<[a..zA..Z]>]+ '## ' \s* / , -> $/ { '(' } );
  159. $local= $local.subst( :g , / '[' \s* [<[a..zA..Z]>]+ '## ' \s* / , -> $/ { '[' } );
  160. $local= $local.subst( :g , / '[' ([[<[a..z0..9;,]>]+]+)(\s*) ']' / , -> $/ { '[' ~ $0 ~ "{'#' x$1.chars}" ~ ']' } );
  161. $local= $local.subst( :g , / (\s+) / , -> $/ { '' } );
  162. $local= $local.subst( :g , / ([<[#]>]+) / , -> $/ { "{' ' x$0.chars}" } );
  163. $local= $local.subst( :g , / ('<:::') / , -> $/ { '&&x&&' } );
  164. $local= $local.subst( :g , / (':::>') / , -> $/ { '&&y&&' } );
  165. $local= $local.subst( :g , / (':~')(\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) / , -> $/ { '[' ~ '~' ~ $1 ~ ']' } );
  166. $local= $local.subst( :g , / (':~')(\d+) / , -> $/ { '[' ~ '~' ~ $1 ~ ']' } );
  167. $local= $local.subst( :g , / ('<') / , -> $/ { '[@@2' } );
  168. $local= $local.subst( :g , / ('>') / , -> $/ { ']' } );
  169. $local= $local.subst( :g , / ('&&x&&') / , -> $/ { '<:::' } );
  170. $local= $local.subst( :g , / ('&&y&&') / , -> $/ { ':::>' } );
  171. $local= $local.subst( :g , / (':::') / , -> $/ { '&&&&' } );
  172. $local= $local.subst( :g , / ':' (\d+) / , -> $/ { '-' ~ $0 } );
  173. $local= $local.subst( :g , / ':' ([<[a..zA..Z0..9]> | '_' ]+ | \d+) / , -> $/ { '-' ~ $0 } );
  174. $local= $local.subst( :g , / ('&&&&') / , -> $/ { ':::' } );
  175. $local= $local.subst( :g , / '-' (\d+) / , -> $/ { '[' ~ $0 ~ ']' } );
  176. $local= $local.subst( :g , / '-' ([<[a..zA..Z0..9]> | '_' ]+ | \d+) / , -> $/ { '[' ~ $0 ~ ']' } );
  177. $local= $local.subst( :g , / ('proc[') ([<[a..zA..Z0..9]> | '_' ]+ | \d+) ('][') (\d+) (']{') (.+?) ('}') / , -> $/ { $0 ~ $1 ~ $2 ~ $3 ~ '][<:::' ~ $5 ~ ':::>]' } );
  178. $local= $local.subst( :g , / '{' (.+?) '}' / , -> $/ { '@@1(' ~ $0 ~ ')' } );
  179. ## $local= $local.subst( :g , / '{' ('~'\d+) '}' / , -> $/ { '@@1(' ~ $0 ~ ')' } );
  180. };
  181.  
  182. $lastRwcodeDef= 'stepBy'; ## = 'stepBy( jumpTo::=1= [<::: stmt:~0 :::>] )';
  183. ## $lastRwcodeDef='stepBy( jumpTo::=1= [<::: id ( ~0:x1 (concat:x(~0:x0)) ( ~0 :x1) ) :::>] )';
  184.  
  185. $lastRwcode= normalizeOrigCodes($lastRwcodeDef);
  186.  
  187. say "\n\n\n\nOriginal Codes: ";
  188. say "---------------\n\n$origRwcode ";
  189. say "\n\n\nNormalized Codes: ";
  190. say "-----------------\n\n{normalizeOrigCodes($origRwcode)} \n\n";
  191.  
  192. $rwcode= '';
  193.  
  194. grammar Rewrite4
  195. {
  196. rule TOP {
  197. {
  198. if $sr > $srMax {
  199. $srMax= $sr;
  200. };
  201. $englobingNoRWdegree= 0;
  202. $sr++;
  203. }
  204. <WFE>
  205. {$sr--;}
  206. };
  207. rule WFE {
  208. {
  209. $srw++;
  210. if $sr > $srMax {
  211. $srMax= $sr;
  212. };
  213. if $sr == 1 {
  214. @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 3]= -1;
  215. }
  216. else {
  217. if @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1] == -1 {
  218. @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 3]= -1;
  219. };
  220. $BIStemp2= @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1] + 1;
  221. $BIStemp22= @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1] + 1;
  222. @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1]= $BIStemp2;
  223. };
  224. if $sr > 2 {
  225. if $runNum > 0 {
  226. if @curWFEbrace[$sr - 1] === '[' {
  227. if $englobingNoRWdegree == 0 {
  228. $englobingNoRWdegree= 1;
  229. @isBaseBISlistOfWFEbraceTypesForGivenARGLISTruleRun[$sr + 1][$BIStemp2]= 1;
  230. }
  231. else {
  232. @isBaseBISlistOfWFEbraceTypesForGivenARGLISTruleRun[$sr + 1][$BIStemp2]= 0;
  233. $englobingNoRWdegree++;
  234. };
  235. }
  236. else {
  237. @isBaseBISlistOfWFEbraceTypesForGivenARGLISTruleRun[$sr + 1][$BIStemp2]= 0;
  238. };
  239. };
  240. };
  241.  
  242. @OPvariety[$sr]= 'na';
  243. $sr++;
  244. $tmplateOP= 0;
  245. }
  246. <OP> <ARGLIST>
  247. {$sr--;}
  248. };
  249. rule ARGLIST {
  250. {
  251. if $sr > $srMax {
  252. $srMax= $sr;
  253. };
  254. @curbraceIdx[$sr]= 0;
  255. $sr++;
  256. }
  257. [<ARG>]*
  258. {$sr--;}
  259. };
  260. rule ARG {
  261. [(['('|'[']){@curWFEbrace[$sr - 1]= $0.Str;}<.eol>* <WFE>[')'|']']]
  262. };
  263.  
  264. proto token OP {*}
  265. token OP:sym<NUM> { <NUM> }
  266. token NUM {
  267. \d+
  268. };
  269. token OP:sym<OP3> { <OP3> }
  270. token OP3 {
  271. <:alpha>\w*
  272. # <[a..zA..Z]>[<[a..z0..9]>]*
  273. };
  274. token OP:sym<OP5> { <OP5> }
  275. token OP5 {
  276. 'stepBy'|'id'|'term'|'proc'|'subItem'|'subVar'|'maps'|'isVector'|'isSubstnTemplate'|'isPointy'|'concat'|'string'|'selfRepeat'|'cTerm'\d+|'@@'\d+|'add'|'sub'|'mult'|'IF'|\w+'::='\d+'='|'goTo'\d+|'say'|'dcl'|'stepThru'\d+
  277. };
  278. token OP:sym<OP2> { <OP2> }
  279. token OP2 {
  280. [[[<[a..zA..Z0..9]> | '_' ]+]]|'defTerm'|'defProc'|'ERROR'|'nil'|'hellotwelve'|'two'|'four'|'six'|'offhook'|'('|')'|'['|']'|'$'|'; '|': '|':'|'<<'|'>>'|'vector'|'~'|'+'|'-'|'='|'&'|'!'|'*'|'"'|'/'|"\\"|"\'"|[\%+]|[\.+]|[\,+]|[\;+]
  281. };
  282. token OP:sym<PROC2> { <PROC2> }
  283. token PROC2 {
  284. '%'\d+ [<ARG>]+
  285. };
  286. token OP:sym<PROC> { <PROC> }
  287. token PROC {
  288. ['<' \s* [<OP><ARGLIST>] \s* [[';'] \s* [<OP><ARGLIST>] \s*]* '>']
  289. };
  290. token OP:sym<OP6> { <OP6> }
  291. token OP6 {
  292. '<:::' \s* ['.'|'@@'|'__'|'@'|'('|'='|','|'['|')'|']'|'~'|\d|\w|\n|\s]+ \s* ':::>'
  293. };
  294. token eol { [ <[#;]> \N* ]? \n };
  295. };
  296.  
  297. class RewriteAction4 {
  298.  
  299. method TOP($/) {
  300. $/.make($rewriteWFE);
  301. $stopreduction= 0;
  302. $needNewDescend= 0;
  303. };
  304.  
  305. method WFE($/) {
  306. $stopredOP= ''; $stopredWhileMin= 0; $stopredWhileMax= 0;
  307. $wrongArgTypes= 0;
  308. $saySuccess= 0;
  309. $addMultSuccess= 0;
  310. @OPstr[$sr]= $<OP>.Str;
  311. if $runNum > 0 {
  312. if $lastRunNum < $runNum {
  313. $lastRunNum= $runNum;
  314. say " " if $debug; say " " if $debug; say " " if $debug;
  315.  
  316. if $runNum == 1 {$entryWFE2= normalizeOrigCodes($origRwcode);} else {$entryWFE2= $rwcode;};
  317. say "\n\n\n " if (($debug4 == 1) and (not($debug2 == 1)));
  318. say "\n\n" if (($debug4 == 1) and ($debug2 == 1));
  319.  
  320. say "\n\n\n\n==========================================================================>" if (($debug2 == 1) and ($debug4 == 0));
  321. say "\( TREE DESCEND #{$runNum}: \)" if (($debug2 == 1) and ($debug4 == 0));
  322. say ". . . . . . " if (($debug2 == 1) and ($debug4 == 0));
  323.  
  324. if $runNum == 1 {
  325. say '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""' if $debug4;
  326. say "\( STARTING TREE DESCEED #1: \)\n\n {trimBrackets($entryWFE2)}\n" if ($debug4 == 1) and ($debug2 == 0);
  327. say "\( STARTING TREE DESCNND #1: \)\n" if ($debug4 == 1) and ($debug2 == 1);
  328. }
  329. else {
  330. say "\n==========================================================================>" if $debug4;
  331. say "\( TREE DESCEND #{$runNum}: \)\n\n {trimBrackets($entryWFE2)}\n" if ($debug4 == 1) and ($debug2 == 0);
  332. say "\( TREE DESCEND #{$runNum}: \)\n" if ($debug4 == 1) and ($debug2 == 1);
  333. };
  334. };
  335. if $rewriteArgListElems == 0 { $temp1= $<OP>.Str; }
  336. else { $temp1= "{ if $sr == 1 {"\n "}}" ~ $<OP>.Str ~ @rewriteArgList[$sr + 1]; };
  337.  
  338. if $englobingNoRWdegree > 0 { $noSkips= 0; } else { $noSkips= 1; };
  339. say " " if $debug;
  340. };
  341.  
  342. if $stopreduction == 1 {}
  343. elsif $englobingNoRWdegree > 0 {
  344. say " " if $debug;
  345. if $sr > 1 {
  346. if $rewriteArgListElems == 0 {
  347. say ".{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) 0SKIP\.$englobingNoRWdegree: {trimBrackets($temp1)}" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  348. };
  349. }
  350. else {
  351. say ".{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) 1SKIPnestg$englobingNoRWdegree:" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  352. };
  353. };
  354. if $sr > 2 {
  355. $BIStemp2= @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1];
  356. };
  357. if $rewriteArgListElems == 0 {
  358. $rewriteWFE= $<OP>.Str;
  359. if ($runNum > 0) and ($stopreduction == 0) and ($englobingNoRWdegree == 0) {
  360. };
  361. $entryWFE= $<OP>.Str;
  362. if $sr > 2 {
  363. @listOfCurBraces[$sr-1][@curbraceIdx[$sr-1]]= @curWFEbrace[$sr - 1];
  364. if @curbraceIdx[$sr-1] == 0 {
  365. $curBrace= @curWFEbrace[$sr - 1];
  366. }
  367. else {
  368. if @curWFEbrace[$sr - 1] === '[' { $curBrace= '['; } else { $curBrace= '('; };
  369. };
  370. };
  371. if $runNum > 0 { if $stopreduction == 1 { $wrongArgTypes= 1; }; };
  372. }
  373. else {
  374. $rewriteWFE= $<OP>.Str ~ @rewriteArgList[$sr + 1];
  375.  
  376. $entryWFE= $rewriteWFE;
  377. if $sr > 2 {
  378. @listOfCurBraces[$sr-1][@curbraceIdx[$sr-1]]= @curWFEbrace[$sr - 1];
  379. if @curbraceIdx[$sr-1] == 0 { $curBrace= @curWFEbrace[$sr - 1]; }
  380. else {
  381. if @curWFEbrace[$sr - 1] === '[' { $curBrace= '['; }
  382. else { $curBrace= '('; };
  383. };
  384. };
  385.  
  386. if $runNum == 0 {}
  387. elsif $englobingNoRWdegree > 0 {
  388. $curIdx= 0;
  389. $stopredOP= $<OP>.Str; $stopredWhileMin= $curIdx; $stopredWhileMax= $rewriteArgListElems;
  390. while $curIdx < $rewriteArgListElems {
  391. if @currentARGLISTlistOfBraceTypesOfComponentWFEs[$curIdx] === '['
  392. { $tempLeftBrace= '['; $tempRightBrace= ']'; }
  393. else { $tempLeftBrace= '('; $tempRightBrace= ')'; };
  394. @stopredWFEcompArgList[$curIdx]= $tempLeftBrace ~ @WFEcompArgList[$curIdx] ~ $tempRightBrace;
  395. $curIdx++;
  396. };
  397.  
  398. # say ".{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) 22SKIP\.$englobingNoRWdegree: {trimBrackets($entryWFE)}" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  399. say ".{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) 2SKIP\.$englobingNoRWdegree: " if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  400. say " {'|' x$sr} {trimBrackets($stopredOP)}" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  401. # say " {'|' x$sr} $stopredOP" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  402. $curIdx= $stopredWhileMin;
  403. while $curIdx < $stopredWhileMax {
  404. $entryWFE2= "{@stopredWFEcompArgList[$curIdx]}";
  405. say " {'|' x$sr} {trimBrackets($entryWFE2)}" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  406. # say " {'|' x$sr} $entryWFE2" if (($englobingNoRWdegree == 1) and ($needNewDescend == 0) and ($debug4 == 1) and (not($debug2 == 1)));
  407. $curIdx= $curIdx + 1;
  408. };
  409. }
  410. else {
  411. $rewriteWFE= $<OP>.Str ~ @rewriteArgList[$sr + 1];
  412. if $stopreduction == 1 {} else {
  413. if @OPvariety[$sr] === 'NUM' { $rewriteWFE= $<OP>.Str; }
  414. elsif @OPvariety[$sr] === 'PROC' { $stopreduction= 1; }
  415. elsif @OPvariety[$sr] === 'OP5' {
  416.  
  417. if ($<OP>.Str === 'IF') and ($rewriteArgListElems > 2) {
  418. if @WFEcompArgList[0] === '0' {$rewriteWFE= @WFEcompArgList[1]; }
  419. else {$rewriteWFE= @WFEcompArgList[2]; };
  420. fillRestOfArgsV1(3); }
  421.  
  422. elsif ($<OP>.Str === 'stepBy') and ($rewriteArgListElems > 0) {
  423. $rewriteWFE= @WFEcompArgList[$rewriteArgListElems - 1];
  424. $stopreduction= 1;
  425. $stopredOP= $rewriteWFE; $stopredWhileMin= 0; $stopredWhileMax= 0; }
  426.  
  427. elsif ($<OP>.Str === 'id') and ($rewriteArgListElems > 0) {
  428. $rewriteWFE= @WFEcompArgList[0];
  429. fillRestOfArgsV1(1); }
  430.  
  431. elsif ($<OP>.Str === 'say') and ($runNum > 0) {
  432. say " " if (($debug2 == 0) and ($debug4 == 1));
  433. say " {' ' x$sr} {'****** LEVEL'}$sr I\\O {'ACTION '}\#$output\: {@WFEcompArgList[0]}";
  434. say " {' ' x$sr} {'############################ '} ";
  435. say " {' ' x$sr} {'############################ '} ";
  436. say " {' ' x$sr} {'############################ '} ";
  437. say " " if (($debug2 == 1) and ($debug4 == 0));
  438. $rewriteWFE= 'nil';
  439. $output++;
  440. $saySuccess= 1;
  441. }
  442.  
  443. elsif (($<OP>.Str === 'concat') or ($<OP>.Str === 'string')) and ($rewriteArgListElems > 0) {
  444. $rewriteWFE= '';
  445. $curIdx= 0;
  446. while $curIdx < $rewriteArgListElems {
  447. $input= @WFEcompArgList[$curIdx];
  448. @tempStmt[0]= '';
  449. $input= $input.subst( :g , /^(\%+)$/ ,
  450. -> $/ { @tempStmt[0]= 'ok'; "{' ' x$0.chars}" } );
  451. if @tempStmt[0] ~~ 'ok' {$rewriteWFE= $rewriteWFE ~ $input;}
  452. else {$rewriteWFE= $rewriteWFE ~ @WFEcompArgList[$curIdx];};
  453. $curIdx= $curIdx + 1;
  454. };
  455. if $<OP>.Str === 'string' { $stopreduction= 1;
  456. $stopredOP= $rewriteWFE; $stopredWhileMin= 0; $stopredWhileMax= 0; }; }
  457.  
  458. elsif $runNum > 0 {
  459.  
  460. $input= $<OP>.Str;
  461. @tempStmt[0]= ''; @tempStmt[1]= ''; @tempStmt[2]= ''; @tempStmt[3]= '';
  462. $tp1= $input.subst( :g , /(\w+)(['::='])(\d+)(['='])/ ,
  463. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1;
  464. @tempStmt[2]= $2; @tempStmt[3]= $3 } );
  465. if (@tempStmt[1] ~~ '::=') and (@tempStmt[3] ~~ '=') {
  466. if %*PROCS{"{@tempStmt[0]}"} === Any {
  467. %*PROCS{"{@tempStmt[0]}"}= @WFEcompArgList[0];
  468. %*PROCSparmNum{"{@tempStmt[0]}"}= @tempStmt[2];
  469. $rewriteWFE= 'nil';
  470. } else {die "duplicated shorthand"; }; };
  471.  
  472. $input= $<OP>.Str;
  473. @tempStmt[0]= ''; @tempStmt[1]= '';
  474. $tp1= $input.subst( :g , /^(['stepThru'])(\d+)/ ,
  475. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1; } );
  476. if (@tempStmt[0] ~~ 'stepThru') and ($rewriteArgListElems > @tempStmt[1].Int) {
  477. $rewriteWFE= @WFEcompArgList[@tempStmt[1].Int];
  478. fillRestOfArgsV1(@tempStmt[1].Int + 1);
  479. };
  480.  
  481. $input= $<OP>.Str;
  482. $tp1= '';
  483. @tempStmt[0]= ''; @tempStmt[1]= '';
  484. $tp1= $input.subst( :g , /^(['@@'])(\d+)/ ,
  485. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1 } );
  486. if (@tempStmt[0] ~~ '@@')
  487. and ((@tempStmt[1] > 0) or (@tempStmt[1] == 0)) {
  488. $tp0= @tempStmt[0];
  489. if $rewriteArgListElems == @tempStmt[1] {}
  490. elsif $rewriteArgListElems < @tempStmt[1] {$rewriteWFE= 'ERROR';}
  491. elsif $rewriteArgListElems > @tempStmt[1] {
  492.  
  493. if (@WFEcompArgList[@tempStmt[1]] ~~ 'setSubVar')
  494. and ((@tempStmt[1] > 0) or (@tempStmt[1] == 0)) {
  495. if @tempStmt[1] == 0 {
  496. # $rewriteWFE= 'assocList1[subVar[' ~ @WFEcompArgList[1] ~ '][' ~ @WFEcompArgList[2] ~ ']]';
  497. if $rewriteArgListElems > 2 {
  498. $rewriteWFE= $tp0 ~ '1[subVar[' ~ @WFEcompArgList[1] ~ '][' ~ @WFEcompArgList[2] ~ ']]';
  499. if $rewriteArgListElems > 3 {
  500. fillRestOfArgsV1(3);
  501. }; }; }
  502. else {
  503. if ( $rewriteArgListElems > (@tempStmt[1] + 2) ) {
  504. @WFEcompArgListTemp[@tempStmt[1] + 1]
  505. = 'subVar[' ~ @WFEcompArgList[@tempStmt[1] + 1] ~ ']';
  506. $rewriteWFE= '';
  507. $input= @WFEcompArgListTemp[@tempStmt[1] + 1]
  508. ~ '[' ~ @WFEcompArgList[@tempStmt[1] + 2] ~ ']';
  509. $tp1= '';
  510. $curIdx= 0;
  511. while $curIdx < @tempStmt[1] {
  512. if ( 'subVar[' ~ %*AssocListArg0{"{@WFEcompArgList[$curIdx]}Arg0"} ~ ']' ~~ @WFEcompArgListTemp[@tempStmt[1] + 1] ) {
  513. if ( ('subVar[' ~ %*AssocListArg0{"{@WFEcompArgList[$curIdx]}Arg0"} ~ ']'
  514. ~ '[' ~ %*AssocListArg1{"{@WFEcompArgList[$curIdx]}Arg1"} ~ ']' )
  515. ~~ @WFEcompArgList[$curIdx] ) {
  516. $rewriteWFE= $rewriteWFE ~ '[' ~ $input ~ ']';
  517. $tp1= 'SUCCESS'; }
  518. else {$rewriteWFE= 'ERRORvvvvvvvvvvvvvvvvvvvvvvvv'; $stopreduction= 1;}; }
  519. else {
  520. $rewriteWFE= $rewriteWFE ~ '[' ~ @WFEcompArgList[$curIdx] ~ ']';
  521. };
  522. $curIdx= $curIdx + 1;
  523. if $curIdx == @tempStmt[1] {
  524. if $tp1 ~~ 'SUCCESS' {$rewriteWFE= $tp0 ~ "{@tempStmt[1]}" ~ $rewriteWFE;}
  525. else {
  526. $rewriteWFE= $tp0 ~ "{@tempStmt[1] + 1}" ~ $rewriteWFE ~ '[' ~ $input ~ ']'; }; }; };
  527. if $rewriteArgListElems > (@tempStmt[1] + 3) {
  528. fillRestOfArgsV1(@tempStmt[1] + 3);
  529. }; }; }; }
  530.  
  531. elsif ((@WFEcompArgList[@tempStmt[1]] ~~ 'getSubVar')
  532. or (@WFEcompArgList[@tempStmt[1]] ~~ 'getSubItem'))
  533. and ((@tempStmt[1] > 0) or (@tempStmt[1] == 0)) {
  534. if ( $rewriteArgListElems < (@tempStmt[1] + 2) ) {}
  535. else {
  536. $rewriteWFE= 'nil';
  537. $curIdx= 0;
  538. while $curIdx < @tempStmt[1] {
  539. if ( %*AssocListArg0{"{@WFEcompArgList[$curIdx]}Arg0"} ~~ @WFEcompArgList[@tempStmt[1] + 1] ) {
  540. $rewriteWFE= %*AssocListArg1{"{@WFEcompArgList[$curIdx]}Arg1"};
  541. if @WFEcompArgList[@tempStmt[1]] ~~ 'getSubVar' {
  542. if ( ('subVar[' ~ @WFEcompArgList[@tempStmt[1] + 1] ~ '][' ~ $rewriteWFE ~ ']') ~~ @WFEcompArgList[$curIdx] ) {}
  543. else {$rewriteWFE= 'ERROR'; die "subVar hash problem"; };
  544. }
  545. else {
  546. if ( ('subItem[' ~ @WFEcompArgList[@tempStmt[1] + 1] ~ '][' ~ $rewriteWFE ~ ']') ~~ @WFEcompArgList[$curIdx] ) {}
  547. else {$rewriteWFE= 'ERROR'; die "subItem hash problem"; };
  548. };
  549. $curIdx= @tempStmt[1];
  550. }
  551. else {$curIdx= $curIdx + 1; };
  552. };
  553. if ( $rewriteWFE ~~ 'nil' ) {}
  554. else {fillRestOfArgsV1(@tempStmt[1] + 2); }; }; }
  555.  
  556. elsif ((@WFEcompArgList[@tempStmt[1]] ~~ 'x0') or
  557. (@WFEcompArgList[@tempStmt[1]] ~~ 'x1') or
  558. (@WFEcompArgList[@tempStmt[1]] ~~ 'x2'))
  559. and (@tempStmt[1] > 0) {
  560. $input= @WFEcompArgList[@tempStmt[1]];
  561. @tempStmt[2]= '';
  562. $tp2= $input.subst( :g , /^['x'](\d+)/ ,
  563. -> $/ { @tempStmt[2]= $0; } );
  564. if @tempStmt[2] < @tempStmt[1] {
  565. $rewriteWFE= @WFEcompArgList[@tempStmt[2]];
  566. fillRestOfArgsV1(@tempStmt[1] + 1); }; }
  567.  
  568. else {
  569.  
  570. };
  571. }
  572.  
  573. else {};
  574. };
  575.  
  576. }
  577. else { die "cccc"; };
  578. }
  579.  
  580. elsif (@OPvariety[$sr] === 'OP2') or (@OPvariety[$sr] === 'OP3') {
  581.  
  582. $input= %*TERMS{"{$<OP>.Str ~ '[' ~ @WFEcompArgList[0] ~ ']'}"};
  583. if $input !=== Any {
  584. $rewriteWFE= $input;
  585. fillRestOfArgsV1(1);
  586. $wrongArgTypes= 1;
  587.  
  588. }
  589. else {
  590. $input= %*PROCS{"{$<OP>.Str}"};
  591. if $input === Any {}
  592.  
  593. elsif $rewriteArgListElems < %*PROCSparmNum{"{$<OP>.Str}"} {} else {
  594. $tp0= '___'; $tp1= $<OP>.Str; @tempStmt[0]= '___';
  595. if %*PROCS{"{@WFEcompArgList[0]}"} === Any {} else {
  596. $input= %*PROCS{"{@WFEcompArgList[0]}"}.Str;
  597. $input= $input.subst( :g ,
  598. / ('@@')\d+ '[' ('CallSession') ']' / ,
  599. -> $/ { @tempStmt[0]= $0; } );
  600. if @tempStmt[0] ~~ '@@' {$tp0= @WFEcompArgList[0];};
  601. };
  602.  
  603. $curIdx2= 0;
  604. while $curIdx2 < $rewriteArgListElems {
  605. @WFEcompArgListTemp[$curIdx2]= @WFEcompArgList[$curIdx2];
  606. $curIdx2= $curIdx2 + 1;
  607. };
  608.  
  609. $curIdx2= 0;
  610. while $curIdx2 < $rewriteArgListElems {
  611. $input= @WFEcompArgListTemp[$curIdx2];
  612. @tempStmt[0]= 'com'; @tempStmt[1]= 'rew';@tempStmt[2]= 'com2'; @tempStmt[3]= 'rew2';
  613. $input= $input.subst( :g ,
  614. / ^(''\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) ['('|'['] (.+) [')'|']']$/ ,
  615. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1; @tempStmt[2]= $2; @tempStmt[3]= $3; } );
  616.  
  617. if (@tempStmt[1] ~~ '__') {
  618. @WFEcompArgListTemp[$curIdx2]= @tempStmt[3];
  619.  
  620. if $tp0 ~~ '___' {} else {
  621. if %*GOTOARGNAMES{"{$tp0 ~ '--' ~ "{$curIdx2}"}"} === Any {
  622. %*GOTOARGNAMES{"{$tp0 ~ '--' ~ "{$curIdx2}"}"}= @tempStmt[0] ~ @tempStmt[1] ~ @tempStmt[2];
  623. };
  624. };
  625. };
  626. $curIdx2= $curIdx2 + 1;
  627. };
  628.  
  629. if %*PROCSparmNum{"{$<OP>.Str}"} == 0 {
  630. $input= %*PROCS{"{$<OP>.Str}"};
  631. $input= $input.subst( :g , / '<:::' / , -> $/ { '' } );
  632. $input= $input.subst( :g , / ':::>' / , -> $/ { '' } );
  633. $rewriteWFE= $input;
  634. fillRestOfArgsV1(0);
  635. }
  636. else {
  637. ## $tmplateOP= 1;
  638. $actualTemplate= $<OP>.Str;
  639. $tmplateNumOfParms= %*PROCSparmNum{"{$<OP>.Str}"};
  640. if $rewriteArgListElems < $tmplateNumOfParms {
  641. $parmSubstnResult= $actualTemplate;
  642. $curIdx= 0;
  643. while $curIdx < $rewriteArgListElems {
  644. $parmSubstnResult= $parmSubstnResult ~ '[' ~ @WFEcompArgList[$curIdx] ~ ']';
  645. $curIdx= $curIdx + 1;
  646. };
  647. $wrongArgTypes= 1;
  648. }
  649. else {
  650. $input= %*PROCS{"{$<OP>.Str}"};
  651. $tp2= $input;
  652. $tmplateStr= $input;
  653. $input= $input.subst( :g , / '<:::' / , -> $/ { '' } );
  654. $input= $input.subst( :g , / ':::>' / , -> $/ { '' } );
  655. if $input === $tp2 {$parmSubstnResult= $tp2; }
  656. else {
  657. $input= $input.subst( :g , / ('~')(\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) / , -> $/ { $0 ~ $1 } );
  658. $tp1= $input.subst( :g , / '~'(\d+) / ,
  659. -> $/ { @WFEcompArgListTemp[$0]; } );
  660. $parmSubstnResult= $tp1;
  661. $wrongArgTypes= 1;
  662. $stopreduction= 1;
  663. };
  664. };
  665.  
  666. $rewriteWFE= $parmSubstnResult;
  667.  
  668. if $parmSubstnResult ~~ $tp2 {fillRestOfArgsV2(0); }
  669. else {fillRestOfArgsV2($tmplateNumOfParms); };
  670.  
  671. $tp1= $rewriteWFE; $input= '';
  672. $tp1= $tp1.subst(/^([<[a..zA..Z0..9]> | '_' ]+)$/ , -> $/ { $input= $0; } );
  673. if $input ~~ '' {} else {$stopreduction= 0;};
  674.  
  675. }; }; }; }
  676. else { die "wrong OP"; }; }; }; };
  677.  
  678. $/.make($rewriteWFE);
  679.  
  680. # as initialized below at call of method OP:
  681. # @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  682. if $sr > 2 {
  683. $temp2= @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr - 1];
  684. @listOfWFErewritesForGivenARGLISTruleRun[$sr - 1][$temp2]= $rewriteWFE;
  685. if $runNum == 0 { @listOfWFEbraceTypesForGivenARGLISTruleRun[$sr - 1][$temp2]= @curWFEbrace[$sr - 1]; }
  686. else {
  687. if $englobingNoRWdegree > 0 { $wrongArgTypes= 1; };
  688. if $stopreduction == 1 { $wrongArgTypes= 1; };
  689. if ($stopreduction == 1) and ($saySuccess == 1) { $wrongArgTypes= 0; };
  690. if $wrongArgTypes == 1 { @listOfWFEbraceTypesForGivenARGLISTruleRun[$sr - 1][$temp2]= @curWFEbrace[$sr - 1]; }
  691. else { @listOfWFEbraceTypesForGivenARGLISTruleRun[$sr - 1][$temp2]= '['; };
  692. };
  693. @listOfOPvarietyForGivenARGLISTruleRun[$sr - 1][$temp2]= @curWFEopVariety[$sr + 1];
  694. if $addMultSuccess == 1 { @listOfOPvarietyForGivenARGLISTruleRun[$sr - 1][$temp2]= 'NUM'; };
  695. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr - 1]= $temp2 + 1;
  696. if $runNum == 0 {
  697. @BISlistOfWFEbraceTypesForGivenARGLISTruleRun[$sr + 1][$BIStemp2]= $curBrace;
  698. @BISlistOfWFErewritesForGivenARGLISTruleRun[$sr + 1][$BIStemp2]= $rewriteWFE;
  699. };
  700. @curbraceIdx[$sr-1]= @curbraceIdx[$sr-1] + 1;
  701. if $curBrace === '[' {
  702. $englobingNoRWdegree--;
  703. if $englobingNoRWdegree == 1 {
  704. $BIStemp2= @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1];
  705. $BIStemp22= @BISelemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr + 1];
  706. if $sr > 2 {
  707. if @isBaseBISlistOfWFEbraceTypesForGivenARGLISTruleRun[$sr + 1][$BIStemp2] == 1 {
  708. $englobingNoRWdegree= 0; }; }; }; }; };
  709.  
  710. if $noSkips == 1 {
  711.  
  712. if (($sr == 1) and ($debug2 == 1) and ($debug4 == 1)) {}
  713. else {
  714.  
  715. if $runNum > 0 {
  716. $entryWFE2= $entryWFE;
  717. $entryWFE4= $/.made;
  718.  
  719. if $entryWFE !=== $/.made {
  720. say " " if $debug;
  721. if $stopreduction == 0 {
  722. say "\n.{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) RW SUCCESS:" if $debug4; }
  723. else {
  724. say "\n.{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) EXPANDING RW - NEED NEW DESCEND NOW:" if $debug4;
  725. $needNewDescend= 1;
  726. };
  727.  
  728. say " {'|' x$sr} {trimBrackets($<OP>.Str)}" if $debug4;
  729. $curIdx= 0;
  730. while $curIdx < $rewriteArgListElems {
  731. $entryWFE2= '[' ~ "{@WFEcompArgList[$curIdx]}" ~ ']';
  732. say " {'|' x$sr} {trimBrackets($entryWFE2)}" if $debug4;
  733. $curIdx++;
  734. };
  735.  
  736. if $stopreduction == 0 {
  737. say " {'|' x$sr} " if $debug4;
  738. say " {'|' x$sr} ====> {trimBrackets($entryWFE4)}" if $debug4;
  739. }
  740. else {
  741. say " {'|' x$sr} " if $debug4;
  742. say " {'|' x$sr} =============>" if $debug4;
  743. say " {'|' x$sr} {trimBrackets($stopredOP)}" if $debug4;
  744. if $stopredWhileMin < $stopredWhileMax {say " {'|' x$sr} " if $debug4;};
  745. $curIdx= $stopredWhileMin;
  746. while $curIdx < $stopredWhileMax {
  747. $entryWFE2= '[' ~ "{@stopredWFEcompArgList[$curIdx]}" ~ ']';
  748. say " {'|' x$sr} {trimBrackets($entryWFE2)}" if $debug4;
  749. $curIdx= $curIdx + 1;
  750. };
  751.  
  752. };
  753. say " " if (($debug2 == 1) or ($debug4 == 1)) and (($debug2 == 0) or ($debug4 == 1));
  754. say " " if $debug;
  755. }
  756. else {
  757. $input= $entryWFE;
  758. $tp1= '';
  759. @tempStmt[0]= ''; @tempStmt[1]= '';
  760. $tp1= $input.subst( :g , /^(['$'])(\w+)/ ,
  761. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1 } );
  762. if $stopreduction == 0 {
  763. say " " if $debug;
  764. if $rewriteArgListElems == 0 {
  765. say "\n.{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) NOT REWRITABLE: {trimBrackets($entryWFE2)}" if $debug4;
  766. }
  767. else {
  768. say "\n.{'m' x$sr}.LEVEL$sr \(type @OPvariety[$sr] w $rewriteArgListElems args\) NOT REWRITABLE:" if $debug4;
  769. say " {'|' x$sr} {trimBrackets($<OP>.Str)}" if $debug4;
  770. $curIdx= 0;
  771. while $curIdx < $rewriteArgListElems {
  772. $entryWFE2= '[' ~ "{@WFEcompArgList[$curIdx]}" ~ ']';
  773. say " {'|' x$sr} {trimBrackets($entryWFE2)}" if $debug4;
  774. $curIdx++; }; };
  775. say " " if $debug4; }; }; }; }; }; $srw--; };
  776.  
  777.  
  778. method OP5($/) {
  779. $/.make($/.Str);
  780. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  781. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'OP5'; @curWFEopVariety[$sr]= 'OP5'; };
  782. method NUM($/) {
  783. $/.make($/.Str);
  784. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  785. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'NUM'; @curWFEopVariety[$sr]= 'NUM'; };
  786. method PROC($/) {
  787. $/.make($/.Str);
  788. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  789. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'PROC'; @curWFEopVariety[$sr]= 'PROC';
  790. @entryTempoeName[$sr - 1]= $/.Str; };
  791. method OP6($/) {
  792. $/.make($/.Str);
  793. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  794. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'OP6'; @curWFEopVariety[$sr]= 'OP6'; };
  795. method OP3($/) {
  796. $/.make($/.Str);
  797. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  798. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'OP3'; @curWFEopVariety[$sr]= 'OP3'; };
  799. method OP2($/) {
  800. $/.make($/.Str);
  801. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  802. @curWFEbrace[$sr]= ''; @OPstr[$sr - 1]= $/.made; @OPvariety[$sr - 1]= 'OP2'; @curWFEopVariety[$sr]= 'OP2'; };
  803. method OP($/) {
  804. $/.make($/.Str);
  805. @elemsTotalOfListOfWFErewritesForGivenARGLISTruleRun[$sr]= 0;
  806. @curWFEbrace[$sr]= ''; };
  807.  
  808. method ARGLIST($/) {
  809. $rewriteArgListElems= $<ARG>.list.elems;
  810.  
  811. if $sr == 2 {
  812. $savedsr2rewriteArgListElems= $rewriteArgListElems;
  813. };
  814.  
  815. if $rewriteArgListElems == 0 {}
  816. else {
  817. @rewriteArgList[$sr]= '';
  818. if $rewriteArgListElems == 0 {} else {
  819. $curIdx= 0;
  820. for $<ARG>.list -> $curItem {
  821. @WFEcompArgList[$curIdx]= @listOfWFErewritesForGivenARGLISTruleRun[$sr][$curIdx];
  822. @currentARGLISTlistOfBraceTypesOfComponentWFEs[$curIdx]=
  823. @listOfWFEbraceTypesForGivenARGLISTruleRun[$sr][$curIdx];
  824. @currentARGLISTlistOflistOfOPvarietyOfComponentWFEs[$curIdx]=
  825. @listOfOPvarietyForGivenARGLISTruleRun[$sr - 1][$curIdx];
  826. if $sr == 2 {
  827. @savedsr2WFEcompArgList[$curIdx]= @WFEcompArgList[$curIdx];
  828. };
  829.  
  830. $curIdx++;
  831. };
  832. $curIdx= 0;
  833. for $<ARG>.list -> $curItem {
  834. if $curIdx > 0 {
  835. if @currentARGLISTlistOfBraceTypesOfComponentWFEs[$rewriteArgListElems - $curIdx] ~~ '['
  836. { @currentARGLISTlistOfBraceTypesOfComponentWFEs[$rewriteArgListElems - $curIdx]= '['; }
  837. else { @currentARGLISTlistOfBraceTypesOfComponentWFEs[$rewriteArgListElems - $curIdx]= '('; };
  838. };
  839. $curIdx++;
  840. };
  841. $curIdx= 0;
  842. for $<ARG>.list -> $curItem {
  843. @BraceTypeOfComponentWFEatGivenIndexInWFElistOfARGLISTatGivenSrLevel[$sr][$curIdx]=
  844. @currentARGLISTlistOfBraceTypesOfComponentWFEs[$curIdx];
  845. $curIdx++;
  846. };
  847. $curIdx= 0;
  848. for $<ARG>.list -> $curItem {
  849. if @currentARGLISTlistOfBraceTypesOfComponentWFEs[$curIdx] ~~ '['
  850. {
  851. $tempLeftBrace= '['; $tempRightBrace= ']';
  852. @tempLeftBrace[$curIdx]= '['; @tempRightBrace[$curIdx]= ']';
  853. }
  854. else {
  855. $tempLeftBrace= '('; $tempRightBrace= ')';
  856. @tempLeftBrace[$curIdx]= '('; @tempRightBrace[$curIdx]= ')';
  857. };
  858. @rewriteArgList[$sr]= @rewriteArgList[$sr] ~ $tempLeftBrace ~ @WFEcompArgList[$curIdx] ~ $tempRightBrace;
  859.  
  860. if $sr == 2 {
  861. @savedsr2tempLeftBrace[$curIdx]= @tempLeftBrace[$curIdx];
  862. @savedsr2tempRightBrace[$curIdx]= @tempRightBrace[$curIdx];
  863. };
  864.  
  865. $curIdx++;
  866. };
  867. };
  868.  
  869. if ($runNum > 0) and ($setup == 0) and (@OPstr[$sr - 1] ~~ 'subItem') and ($rewriteArgListElems == 2) {
  870. %*AssocListArg0{"{'subItem' ~ @rewriteArgList[$sr] ~ 'Arg0'}"}= @WFEcompArgList[0];
  871. %*AssocListArg1{"{'subItem' ~ @rewriteArgList[$sr] ~ 'Arg1'}"}= @WFEcompArgList[1];
  872. };
  873.  
  874. if ($runNum > 0) and ($setup == 0) and (@OPstr[$sr - 1] ~~ 'subVar') and ($rewriteArgListElems == 2) {
  875. %*AssocListArg0{"{'subVar' ~ @rewriteArgList[$sr] ~ 'Arg0'}"}= @WFEcompArgList[0];
  876. %*AssocListArg1{"{'subVar' ~ @rewriteArgList[$sr] ~ 'Arg1'}"}= @WFEcompArgList[1];
  877. };
  878.  
  879. if ($runNum > 0) and ($setup == 0) and (@OPstr[$sr - 1] ~~ 'proc') and ($rewriteArgListElems > 2) and ($rewriteArgListElems < 5) {
  880. $input= @WFEcompArgList[0];
  881. @tempStmt[0]= 'errorNOTtemplate';
  882. $input= $input.subst( :g , /^(\w+)/ , -> $/ { @tempStmt[0]= $0; } );
  883. if @tempStmt[0] === 'errorNOTtemplate' {die "errorNOTtemplate";}
  884. else {
  885. $input= @WFEcompArgList[1];
  886. @tempStmt[1]= 'errorNOTaNUM';
  887. ## $input= $input.subst( :g , /^'@@2[' (\d+) ']' '[' (\s* ['.'|'vector'|'@'|'('|'='|','|'['|')'|']'|\d|\w|\n|\s]+ \s* | '<:::' \s* ['.'|'@@'|'@'|'('|'='|','|'['|')'|']'|'~'|\d|\w|\n|\s]+ \s* ':::>') ']'/ , -> $/ { @tempStmt[2]= $0; @tempStmt[3]= $1; } );
  888. $input= $input.subst( :g , /^(\d+)/ , -> $/ { @tempStmt[1]= $0; } );
  889. if @tempStmt[1] === 'errorNOTaNUM' {die "errorNOTaNUM";}
  890. else {
  891. $input= @WFEcompArgList[2];
  892. @tempStmt[2]= 'errorNOTaTEMPLATE';
  893. $input= $input.subst( :g , /^('<:::' \s* ['.'|'updateArgsTotaling'|'assocList'|'@@'|'@'|'('|'='|','|'['|')'|']'|'~'|\d|\w|\n|\s]+ \s* ':::>')/ , -> $/ { @tempStmt[2]= $0; } );
  894. if @tempStmt[2] === 'errorNOTaTEMPLATE' {die "errorNOTaTEMPLATE";}
  895. else {
  896. if %*PROCS{"{@WFEcompArgList[0]}"} === Any {
  897. %*AssocListArg0{"{'proc' ~ @rewriteArgList[$sr] ~ 'Arg0'}"}= @WFEcompArgList[0];
  898. %*PROCSparmNum{"{@WFEcompArgList[0]}"}= @WFEcompArgList[1];
  899. %*PROCS{"{@WFEcompArgList[0]}"}= @WFEcompArgList[2];
  900. if $rewriteArgListElems == 4
  901. {%*PROCSinfo{"{@WFEcompArgList[0]}"}= @WFEcompArgList[3];};
  902. }
  903. elsif %*PROCS{"{@WFEcompArgList[0]}"} === @WFEcompArgList[2] {}
  904. else {die "errorIsNAMEalreadyUsedForDifferentTemplate";};
  905. };
  906. };
  907. };
  908. };
  909. # ( term [NxtStateMap <:offhook :dialDigit6 >] :talking )
  910.  
  911. if ($runNum > 0) and ($setup == 0) and (@OPstr[$sr - 1] ~~ 'term') and ($rewriteArgListElems == 2) {
  912. $input= @WFEcompArgList[0];
  913. @tempStmt[0]= 'errorNOTmapping';
  914. $input= $input.subst( :g , /^(\w+'[@@'\d+'[').+']'$/ , -> $/ { @tempStmt[0]= $0; } );
  915. # $input= $input.subst( :g , /^(\w+)/ , -> $/ { @tempStmt[0]= $0; } );
  916. # $input= $input.subst( :g , /^('^^'\d+)/ , -> $/ { @tempStmt[0]= $0; } );
  917. if @tempStmt[0] === 'errorNOTmapping' {die "errorNOTmapping";}
  918. else {
  919. if %*TERMS{"{@WFEcompArgList[0]}"} === Any {
  920. # %*AssocListArg0{"{'term' ~ @rewriteArgList[$sr] ~ 'Arg0'}"}= @WFEcompArgList[0];
  921. # %*AssocListArg1{"{'term' ~ @rewriteArgList[$sr] ~ 'Arg1'}"}= @WFEcompArgList[1];
  922. %*TERMS{"{@WFEcompArgList[0]}"}= @WFEcompArgList[1];
  923. # %*TERMSargTotal{"{@WFEcompArgList[0]}"}= @tempStmt[0].Int;
  924. }
  925. elsif %*TERMS{"{@WFEcompArgList[0]}"} === @WFEcompArgList[1] {}
  926. else {die "errorNameWFEalreadyUsedForDifferentTERMSmapping";};
  927. };
  928. };
  929.  
  930. $/.make(@rewriteArgList[$sr]);
  931. @curWFEbrace[$sr]= '';
  932. };
  933. };
  934.  
  935. };
  936.  
  937. if $debug {}
  938. else {
  939.  
  940. $debug= 0;
  941. $debug2= 0;
  942. $debug4= 0;
  943.  
  944. $lastRunNum= -1;
  945. $runNum= 0;
  946.  
  947. $continue= 1;
  948. while $continue > 0 {
  949. $rwcode= $lastRwcode;
  950. $match2= Rewrite4.parse( $rwcode, actions => RewriteAction4.new, );
  951. $lastRwcode= $match2.made;
  952. $lastRunNum= $runNum; $runNum++; $continue++;
  953. if $lastRwcode ~~ $rwcode { if $runNum > 1 { $continue= 0; }; };
  954. };
  955.  
  956. $debug= 0;
  957. $debug2= 1;
  958. $debug4= 1;
  959.  
  960. $lastRwcode= normalizeOrigCodes($origRwcode);
  961.  
  962. $continue= 1;
  963. $setup= 0;
  964.  
  965. $lastRunNum= -1;
  966. $runNum= 0;
  967. say "\n\n\n\nCODES EXECUTION:" if $debug4;
  968. say "\n\n\n\nHIGH LEVEL DESCEND-BY-DESCEND VIEW OF RW PROGRESS:" if $debug2;
  969. say "\(RECURSIVE LEFTMOST-INNERMOST APPLICATIVE REWRITE, TILL CODES NOT REWRITABLE\)\n\n" if $debug4;
  970.  
  971. say "\n\n\nRW PROCESS STARTING:" if (($debug2 == 1) and (not($debug4 == 1)));
  972. ## say " {trimBrackets($lastRwcode)}" if ($debug4 == 1);
  973.  
  974. while $continue > 0 {
  975. $rwcode= $lastRwcode;
  976. $match2= Rewrite4.parse( $rwcode, actions => RewriteAction4.new, );
  977. $lastRwcode= $match2.made;
  978.  
  979. if $runNum == 0 {} elsif $rewriteArgListElems > 0 {
  980. say " " if (($debug2 == 1) and ($debug4 == 1));
  981. say ".m.LEVEL1 AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #$runNum:" if $debug2;
  982. say ' | """""""""""""""""""""""""""""""""""""""""""""""""""""""' if $debug2;
  983. if $runNum < 1 {}
  984. else {
  985. if $runNum == 1 { say " | OP: {trimBrackets(@OPstr[1])} " if $debug2;}
  986. else {
  987. if @OPstr[1] ~~ $OPsav { say " | OP: <--------SAME AS IN ABOVE DESCEND: {trimBrackets($OPsav)}" if $debug2; }
  988. else { say " | OP: {trimBrackets(@OPstr[1])}" if $debug2; };
  989. };
  990. $OPsav2= $OPsav; $OPsav= @OPstr[1]; };
  991.  
  992. if $runNum < 1 {}
  993. else {
  994. $tmpBlocName= ''; $tmpBlocArgTotal= 0;
  995. $input= ''; @tempStmt[0]= ''; @tempStmt[1]= '';
  996.  
  997. if @OPstr[1] ~~ 'jumpTo'
  998. { $input= @WFEcompArgList[0]; }
  999. elsif %*PROCSinfo{"{@OPstr[1]}"} === Any {}
  1000. else { $input= %*PROCSinfo{"{@OPstr[1]}"}.Str; };
  1001.  
  1002. $tp1= $input.subst( :g ,
  1003. / ^('@@2['\d+) '][' ([ <[a..zA..Z0..9]> | '_' ]+) ']'$/ ,
  1004. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1; } );
  1005.  
  1006. if @tempStmt[0] ~~ '' {} else {
  1007. $tmpBlocName= @tempStmt[1].Str;
  1008. $tmpBlocArgTotal= %*PROCSinfo{"{@tempStmt[1]}"}.Int;
  1009. };
  1010.  
  1011. if $tmpBlocName !~~ '' {
  1012.  
  1013. $curIdx2= 0; while $curIdx2 < $rewriteArgListElems {
  1014. @WFEcompArgListOrig[$curIdx2]= @WFEcompArgList[$curIdx2];
  1015. $curIdx2= $curIdx2 + 1; };
  1016.  
  1017. ## $curIdx2= 0; while $curIdx2 < $temp6 {
  1018. $curIdx2= 0; while $curIdx2 < $tmpBlocArgTotal {
  1019. @WFEcompArgListTemp2[$curIdx2]= @WFEcompArgList[$curIdx2];
  1020. $curIdx2= $curIdx2 + 1; };
  1021. ## $curIdx2= 0; while $curIdx2 < $temp6 {[<::: id ( ~0:x1 (concat:x(~0:x0)) ( ~0 :x1) ) :::>]
  1022. $curIdx2= 0; while $curIdx2 < $tmpBlocArgTotal {
  1023. $input= @WFEcompArgListTemp2[$curIdx2];
  1024. @tempStmt[0]= 'com'; @tempStmt[1]= 'rew';@tempStmt[2]= 'com2'; @tempStmt[3]= 'rew2';
  1025. $tp1= $input.subst( :g ,
  1026. / ^(''\d+) ('__') (<[A..Z]>[<[A..Z0..9]> | '_' ]*) ['('|'['] (.+) [')'|']']$/ ,
  1027. -> $/ { @tempStmt[0]= $0; @tempStmt[1]= $1; @tempStmt[2]= $2; @tempStmt[3]= $3; } );
  1028. if (@tempStmt[1] ~~ '__') {
  1029. @WFEcompArgListTemp2[$curIdx2]= @tempStmt[3];
  1030. #### $input= 'TelService' ~ '--' ~ "{$curIdx2}";
  1031. $input= $tmpBlocName ~ '--' ~ "{$curIdx2}";
  1032. if %*GOTOARGNAMES{"{$input}"} === Any {
  1033. %*GOTOARGNAMES{"{$input}"}= @tempStmt[0] ~ @tempStmt[1] ~ @tempStmt[2];
  1034. ##say "mmmmmmmmmm mmmmmmmmmmmm curIdx2 $curIdx2 GOTOARGNAMES {%*GOTOARGNAMES{"{$input}"}}";
  1035. };
  1036. };
  1037. $curIdx2= $curIdx2 + 1; };
  1038.  
  1039. $tp2= '____';
  1040. $input= @WFEcompArgList[0];
  1041. ## $tp1= $input.subst( :g , / '[' ([<[a..zA..Z0..9]> | '_' ]+) ']'$/ ,
  1042. $tp1= $input.subst( :g , / '[' ('TelService') ']'$/ ,
  1043. -> $/ { $tp2= $0; } );
  1044. if $tp2 ~~ '____' {$tp2= @WFEcompArgList[0];};
  1045. ##say "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2 tp2 $tp2 temp6 $temp6";
  1046.  
  1047. ## $curIdx= 0; while $curIdx < $temp6 {
  1048. $curIdx= 0; while $curIdx < $tmpBlocArgTotal {
  1049. ## $input= $tp2 ~ '--' ~ "{$curIdx}";
  1050. #### $input= 'TelService' ~ '--' ~ "{$curIdx}";
  1051. $input= $tmpBlocName ~ '--' ~ "{$curIdx}";
  1052. if %*GOTOARGNAMES{"{$input}"} === Any {
  1053. ##say "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3 curIdx $curIdx ";
  1054. @WFEcompArgList[$curIdx]= @WFEcompArgListTemp2[$curIdx];
  1055. @WFEcompArgListPreFx[$curIdx]= '____'; }
  1056. else {
  1057. ##say "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3 curIdx $curIdx GOTOARGNAMES {%*GOTOARGNAMES{"{$input}"}}";
  1058. @WFEcompArgList[$curIdx]= %*GOTOARGNAMES{"{$input}"}
  1059. ~ '[' ~ @WFEcompArgListTemp2[$curIdx] ~ ']';
  1060. @WFEcompArgListPreFx[$curIdx]= %*GOTOARGNAMES{"{$input}"}; };
  1061. $curIdx++; };
  1062. ## $curIdx= $temp6; while $curIdx < $rewriteArgListElems {
  1063. $curIdx= $tmpBlocArgTotal; while $curIdx < $rewriteArgListElems {
  1064. @WFEcompArgListPreFx[$curIdx]= '____';
  1065. $curIdx++; };
  1066. if $runNum > 1 {
  1067. if $rewriteArgListElemsSav > $rewriteArgListElems { $compareMax= $rewriteArgListElems; }
  1068. else { $compareMax= $rewriteArgListElemsSav; };
  1069. };
  1070. $curIdx= 0; while $curIdx < $rewriteArgListElems {
  1071. $entryWFE2= "{@tempLeftBrace[$curIdx]} {@WFEcompArgList[$curIdx]} {@tempRightBrace[$curIdx]}";
  1072. $entryWFE2Orig= "{@tempLeftBrace[$curIdx]} {@WFEcompArgListOrig[$curIdx]} {@tempRightBrace[$curIdx]}";
  1073. if $runNum == 1 { say " | ARG$curIdx: {trimBrackets($entryWFE2Orig)}" if $debug2; }
  1074. else {
  1075. if $curIdx < $compareMax {
  1076. $entryWFE4= "{@tempLeftBraceSav[$curIdx]} {@WFEcompArgListSav[$curIdx]} {@tempRightBraceSav[$curIdx]}";
  1077. $entryWFE4PreFx= "{@WFEcompArgListSavPreFx[$curIdx]}";
  1078. if $entryWFE2 ~~ $entryWFE4 {
  1079. #### if ($entryWFE2 ~~ $entryWFE4) and ($runNum > 2) {
  1080. if $entryWFE4PreFx ~~ '____' {
  1081. say " | ARG$curIdx: .........NO UPDATES. " if $debug2;
  1082. } else {
  1083. say " | ARG$curIdx: .........NO UPDATES: $entryWFE4PreFx" if $debug2;
  1084. };
  1085. } else {
  1086. say " | ARG$curIdx: {trimBrackets($entryWFE2)}" if $debug2;
  1087. $input= $OPsav2;
  1088. $input= @OPstr[1];
  1089. @tempStmt[0]= 'com';
  1090. ## $tp1= $input.subst( :g , /^('goTo')\d+$/ ,
  1091. ## -> $/ { @tempStmt[0]= $0; } );
  1092. ## if @tempStmt[0] ~~ 'goTo' {
  1093. $tp1= $input.subst( :g , /^(['jumpTo'|'go'|'CallSession'])$/ ,
  1094. -> $/ { @tempStmt[0]= $0; } );
  1095. #### if (@tempStmt[0] ~~ 'jumpTo') or (@tempStmt[0] ~~ 'CallSession') {
  1096. if $tmpBlocName ~~ '' {} else {
  1097. ## say " | " if $debug2;
  1098. say " | {'mmmmmmmmmmmmmmmmmmm'} UPDATED ! {'mmmmm'} WAS:" if $debug2;
  1099. say " | {trimBrackets($entryWFE4)}" if $debug2;
  1100. say " | " if $debug2;
  1101. };
  1102. };
  1103. } else { say " | ARG$curIdx: {trimBrackets($entryWFE2)}" if $debug2; };
  1104. };
  1105. $curIdx= 1 + $curIdx; };
  1106. $curIdx2= 0; while $curIdx2 < $rewriteArgListElems {
  1107. @tempLeftBraceSav[$curIdx2]= @tempLeftBrace[$curIdx2];
  1108. @tempRightBraceSav[$curIdx2]= @tempRightBrace[$curIdx2];
  1109. if $runNum == 1 {@WFEcompArgListSav[$curIdx2]= @WFEcompArgListOrig[$curIdx2]; }
  1110. else {@WFEcompArgListSav[$curIdx2]= @WFEcompArgList[$curIdx2]; };
  1111. @WFEcompArgListSavPreFx[$curIdx2]= @WFEcompArgListPreFx[$curIdx2];
  1112. $curIdx2= 1 + $curIdx2; };
  1113. $rewriteArgListElemsSav= $rewriteArgListElems;
  1114. }
  1115. else {
  1116. if $runNum > 1 {
  1117. if $rewriteArgListElemsSav > $rewriteArgListElems { $compareMax= $rewriteArgListElems; }
  1118. else { $compareMax= $rewriteArgListElemsSav; };
  1119. };
  1120. $curIdx= 0; while $curIdx < $rewriteArgListElems {
  1121. $entryWFE2= "{@tempLeftBrace[$curIdx]} {@WFEcompArgList[$curIdx]} {@tempRightBrace[$curIdx]}";
  1122. if $runNum == 1 { say " | ARG$curIdx: {trimBrackets($entryWFE2)}" if $debug2; }
  1123. else {
  1124. if $curIdx < $compareMax {
  1125. $entryWFE4= "{@tempLeftBraceSav[$curIdx]} {@WFEcompArgListSav[$curIdx]} {@tempRightBraceSav[$curIdx]}";
  1126. if $entryWFE2 ~~ $entryWFE4 {
  1127. say " | ARG$curIdx: <--------SAME AS IN ABOVE DESCEND. " if $debug2;
  1128. } else {
  1129. say " | ARG$curIdx: {trimBrackets($entryWFE2)}" if $debug2;
  1130. };
  1131. } else { say " | ARG$curIdx: {trimBrackets($entryWFE2)}" if $debug2; };
  1132. };
  1133. $curIdx= 1 + $curIdx; };
  1134. $curIdx2= 0; while $curIdx2 < $rewriteArgListElems {
  1135. @tempLeftBraceSav[$curIdx2]= @tempLeftBrace[$curIdx2];
  1136. @tempRightBraceSav[$curIdx2]= @tempRightBrace[$curIdx2];
  1137. if $runNum == 1 {@WFEcompArgListSav[$curIdx2]= @WFEcompArgListOrig[$curIdx2]; }
  1138. else {@WFEcompArgListSav[$curIdx2]= @WFEcompArgList[$curIdx2]; };
  1139. @WFEcompArgListSavPreFx[$curIdx2]= @WFEcompArgListPreFx[$curIdx2];
  1140. $curIdx2= 1 + $curIdx2; };
  1141. $rewriteArgListElemsSav= $rewriteArgListElems;
  1142. };
  1143. };
  1144. say " " if $debug4;
  1145. };
  1146. $lastRunNum= $runNum; $runNum++; $continue++;
  1147. if $lastRwcode ~~ $rwcode { if $runNum > 1 { $continue= 0; }; };
  1148. };
  1149.  
  1150. say "\n\n";
  1151. say 'CODES NOW NOT REWRITABLE !';
  1152. say "END OF CODES EXECUTION";
  1153. };
  1154.  
  1155.  
Success #stdin #stdout 8.1s 190896KB
stdin
Standard input is empty
stdout



Original Codes:  
---------------

jumpTo <:0:TelService>
(1__CODES
  (@@12  
    ( proc :TelService  :0 [<::: @@3 :CallSession :Instruct1 :Instruct2 :::>] :4 )
    ( proc :CallSession :4
    :  [<:::
    :    CallSession 
    :    ( stepThru1 (PerEvntActnList<:~2:~3>) :TelService ) 
    :    [ ~1 ]
    :    ( NxtStateMap<:~2:~3> )
    :  :::>] :TelService
    )
    ( term [jumpTo          <:0       :TelService  >] [CallSession:TelService] ) 
    ( term [jumpTo          <:1       :TelService  >] [Instruct1  :TelService] ) 
    ( term [jumpTo          <:2       :TelService  >] [Instruct2  :TelService] ) 
    ( proc :jumpTo      :1 [<::: id(id(~0:x1(concat:x(~0:x0))(~0:x1) ) ) :::>] )
    ( term [PerEvntActnList <:onhook  [dialDigit:4]>] [say(concat:hello[,][ ]:World)] )
    ( term [PerEvntActnList <:offhook :dialDigit6  >] [say(concat:lets[ ]:talk)]      )
    ( term [PerEvntActnList <:talking [dialDigit:8]>] [say(concat:seeya[,][ ]:bye)]   )
    ( term [NxtStateMap     <:onhook  [dialDigit:4]>] :offhook    )
    ( term [NxtStateMap     <:offhook :dialDigit6  >] :talking    )
    ( term [NxtStateMap     <:talking [dialDigit:8]>] :disconnect )
  ) )
[2__CURSTATE :onhook ]
[3__EVENT [dialDigit:4] ]
 
:dialDigit6
[dialDigit:8]
  



Normalized Codes:  
-----------------

jumpTo[@@2[0][TelService]](1__CODES(@@12(proc[TelService][0][<:::@@3[CallSession][Instruct1][Instruct2]:::>][4])(proc[CallSession][4][<:::CallSession(stepThru1(PerEvntActnList[@@2[~2][~3]])[TelService])[~1](NxtStateMap[@@2[~2][~3]]):::>][TelService])(term[jumpTo[@@2[0][TelService]]][CallSession[TelService]])(term[jumpTo[@@2[1][TelService]]][Instruct1[TelService]])(term[jumpTo[@@2[2][TelService]]][Instruct2[TelService]])(proc[jumpTo][1][<:::id(id(~0[x1](concat[x](~0[x0]))(~0[x1]))):::>])(term[PerEvntActnList[@@2[onhook][dialDigit[4]]]][say(concat[hello][,][%][World])])(term[PerEvntActnList[@@2[offhook][dialDigit6]]][say(concat[lets][%][talk])])(term[PerEvntActnList[@@2[talking][dialDigit[8]]]][say(concat[seeya][,][%][bye])])(term[NxtStateMap[@@2[onhook][dialDigit[4]]]][offhook])(term[NxtStateMap[@@2[offhook][dialDigit6]]][talking])(term[NxtStateMap[@@2[talking][dialDigit[8]]]][disconnect])))[2__CURSTATE[onhook]][3__EVENT[dialDigit[4]]][dialDigit6][dialDigit[8]]  






CODES EXECUTION:




HIGH LEVEL DESCEND-BY-DESCEND VIEW OF RW PROGRESS:
(RECURSIVE LEFTMOST-INNERMOST APPLICATIVE REWRITE, TILL CODES NOT REWRITABLE)





"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
( STARTING TREE DESCNND #1: )


.mmmmmmm.LEVEL7  (type OP5 w 4 args)  NOT REWRITABLE:
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||  [<:::@@3 :CallSession :Instruct1 :Instruct2:::>]
        |||||||  :4
  

.mmmmmmm.LEVEL7  (type OP5 w 4 args)  NOT REWRITABLE:
        |||||||  proc
        |||||||  :CallSession
        |||||||  :4
        |||||||  [<:::CallSession(stepThru1 (PerEvntActnList[ @@2 :~2 :~3]) :TelService) :~1(NxtStateMap[ @@2 :~2 :~3]):::>]
        |||||||  :TelService
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [jumpTo<:0:TelService>]
        |||||||  [CallSession :TelService]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [jumpTo<:1:TelService>]
        |||||||  [Instruct1 :TelService]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [jumpTo<:2:TelService>]
        |||||||  [Instruct2 :TelService]
  

.mmmmmmm.LEVEL7  (type OP5 w 3 args)  NOT REWRITABLE:
        |||||||  proc
        |||||||  :jumpTo
        |||||||  :1
        |||||||  [<:::id(id(~0 :x1(concat :x(~0 :x0))(~0 :x1))):::>]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [PerEvntActnList[ @@2 :onhook[dialDigit :4]]]
        |||||||  [say(concat :hello[,][ ] :World)]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [PerEvntActnList< :offhook :dialDigit6 >]
        |||||||  [say(concat :lets[ ] :talk)]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [PerEvntActnList[ @@2 :talking[dialDigit :8]]]
        |||||||  [say(concat :seeya[,][ ] :bye)]
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [NxtStateMap[ @@2 :onhook[dialDigit :4]]]
        |||||||  :offhook
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [NxtStateMap< :offhook :dialDigit6 >]
        |||||||  :talking
  

.mmmmmmm.LEVEL7  (type OP5 w 2 args)  NOT REWRITABLE:
        |||||||  term
        |||||||  [NxtStateMap[ @@2 :talking[dialDigit :8]]]
        |||||||  :disconnect
  

.mmmmm.LEVEL5  (type OP5 w 12 args)  NOT REWRITABLE:
        |||||  @@12
        |||||  [proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4]
        |||||  [proc :CallSession :4[<:::CallSession(stepThru1 (PerEvntActnList[ @@2 :~2 :~3]) :TelService) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService]
        |||||  [term [jumpTo<:0:TelService>][CallSession :TelService]]
        |||||  [term [jumpTo<:1:TelService>][Instruct1 :TelService]]
        |||||  [term [jumpTo<:2:TelService>][Instruct2 :TelService]]
        |||||  [proc :jumpTo :1[<:::id(id(~0 :x1(concat :x(~0 :x0))(~0 :x1))):::>]]
        |||||  [term [PerEvntActnList[ @@2 :onhook[dialDigit :4]]][say(concat :hello[,][ ] :World)]]
        |||||  [term [PerEvntActnList< :offhook :dialDigit6 >][say(concat :lets[ ] :talk)]]
        |||||  [term [PerEvntActnList[ @@2 :talking[dialDigit :8]]][say(concat :seeya[,][ ] :bye)]]
        |||||  [term [NxtStateMap[ @@2 :onhook[dialDigit :4]]] :offhook]
        |||||  [term [NxtStateMap< :offhook :dialDigit6 >] :talking]
        |||||  [term [NxtStateMap[ @@2 :talking[dialDigit :8]]] :disconnect]
  

.mmm.LEVEL3  (type OP2 w 1 args)  NOT REWRITABLE:
        |||  1__CODES
        |||  [ @@12 [proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4][proc :CallSession :4[<:::CallSession(stepThru1 (PerEvntActnList[ @@2 :~2 :~3]) :TelService) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService][term [jumpTo<:0:TelService>][CallSession :TelService]][term [jumpTo<:1:TelService>][Instruct1 :TelService]][term [jumpTo<:2:TelService>][Instruct2 :TelService]][proc :jumpTo :1[<:::id(id(~0 :x1(concat :x(~0 :x0))(~0 :x1))):::>]][term [PerEvntActnList[ @@2 :onhook[dialDigit :4]]][say(concat :hello[,][ ] :World)]][term [PerEvntActnList< :offhook :dialDigit6 >][say(concat :lets[ ] :talk)]][term [PerEvntActnList[ @@2 :talking[dialDigit :8]]][say(concat :seeya[,][ ] :bye)]][term [NxtStateMap[ @@2 :onhook[dialDigit :4]]] :offhook][term [NxtStateMap< :offhook :dialDigit6 >] :talking][term [NxtStateMap[ @@2 :talking[dialDigit :8]]] :disconnect]]
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #1:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     jumpTo 
        |  ARG0:   [ @@2 :0 :TelService ]
        |  ARG1:   [ 1__CODES [ @@12 [proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4][proc :CallSession :4[<:::CallSession(stepThru1 (PerEvntActnList[ @@2 :~2 :~3]) :TelService) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService][term [jumpTo<:0:TelService>][CallSession :TelService]][term [jumpTo<:1:TelService>][Instruct1 :TelService]][term [jumpTo<:2:TelService>][Instruct2 :TelService]][proc :jumpTo :1[<:::id(id(~0 :x1(concat :x(~0 :x0))(~0 :x1))):::>]][term [PerEvntActnList[ @@2 :onhook[dialDigit :4]]][say(concat :hello[,][ ] :World)]][term [PerEvntActnList< :offhook :dialDigit6 >][say(concat :lets[ ] :talk)]][term [PerEvntActnList[ @@2 :talking[dialDigit :8]]][say(concat :seeya[,][ ] :bye)]][term [NxtStateMap[ @@2 :onhook[dialDigit :4]]] :offhook][term [NxtStateMap< :offhook :dialDigit6 >] :talking][term [NxtStateMap[ @@2 :talking[dialDigit :8]]] :disconnect]] ]
        |  ARG2:   [ 2__CURSTATE :onhook ]
        |  ARG3:   [ 3__EVENT [dialDigit :4] ]
        |  ARG4:   [ dialDigit6 ]
        |  ARG5:   [ dialDigit :8 ]
  




==========================================================================>
( TREE DESCEND #2: )

 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #2:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
        |  ARG0:   [ TelService ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG4:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG5:   <--------SAME AS IN ABOVE DESCEND. 
  




==========================================================================>
( TREE DESCEND #3: )


.mmmmm.LEVEL5  (type OP2 w 1 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |||||  PerEvntActnList
        |||||  [ @@2 :onhook[dialDigit :4]]
        |||||  
        |||||  =============>
        |||||  say(concat :hello[,][ ] :World)
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #3:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   ( stepThru1 (say(concat :hello[,][ ] :World)) :TelService )
        |  ARG1:   [ @@12 [proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4][proc :CallSession :4[<:::CallSession(stepThru1 (PerEvntActnList[ @@2 :~2 :~3]) :TelService) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService][term [jumpTo<:0:TelService>][CallSession :TelService]][term [jumpTo<:1:TelService>][Instruct1 :TelService]][term [jumpTo<:2:TelService>][Instruct2 :TelService]][proc :jumpTo :1[<:::id(id(~0 :x1(concat :x(~0 :x0))(~0 :x1))):::>]][term [PerEvntActnList[ @@2 :onhook[dialDigit :4]]][say(concat :hello[,][ ] :World)]][term [PerEvntActnList< :offhook :dialDigit6 >][say(concat :lets[ ] :talk)]][term [PerEvntActnList[ @@2 :talking[dialDigit :8]]][say(concat :seeya[,][ ] :bye)]][term [NxtStateMap[ @@2 :onhook[dialDigit :4]]] :offhook][term [NxtStateMap< :offhook :dialDigit6 >] :talking][term [NxtStateMap[ @@2 :talking[dialDigit :8]]] :disconnect] ]
        |  ARG2:   ( NxtStateMap[ @@2 :onhook[dialDigit :4]] )
        |  ARG3:   [ dialDigit6 ]
        |  ARG4:   [ dialDigit :8 ]
  




==========================================================================>
( TREE DESCEND #4: )


.mmmmmmm.LEVEL7  (type OP5 w 4 args)  RW SUCCESS:
        |||||||  concat
        |||||||  :hello
        |||||||  [,]
        |||||||  [ ]
        |||||||  :World
        |||||||  
        |||||||  ====>   hello, World
  
               ****** LEVEL5 I\O ACTION #1:    hello, World
               ############################       
               ############################       
               ############################       

.mmmmm.LEVEL5  (type OP5 w 1 args)  RW SUCCESS:
        |||||  say
        |||||  [hello, World]
        |||||  
        |||||  ====>   nil
  

.mmm.LEVEL3  (type OP5 w 2 args)  RW SUCCESS:
        |||  stepThru1
        |||  :nil
        |||  :TelService
        |||  
        |||  ====>   TelService
  

.mmm.LEVEL3  (type OP2 w 1 args)  RW SUCCESS:
        |||  NxtStateMap
        |||  [ @@2 :onhook[dialDigit :4]]
        |||  
        |||  ====>   offhook
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #4:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   [ TelService ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   ( offhook )
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG4:   <--------SAME AS IN ABOVE DESCEND. 
  




==========================================================================>
( TREE DESCEND #5: )


.mmmmm.LEVEL5  (type OP2 w 1 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |||||  PerEvntActnList
        |||||  < :offhook :dialDigit6 >
        |||||  
        |||||  =============>
        |||||  say(concat :lets[ ] :talk)
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #5:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   ( stepThru1 (say(concat :lets[ ] :talk)) :TelService )
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   ( NxtStateMap< :offhook :dialDigit6 > )
        |  ARG3:   [ dialDigit :8 ]
  




==========================================================================>
( TREE DESCEND #6: )


.mmmmmmm.LEVEL7  (type OP5 w 3 args)  RW SUCCESS:
        |||||||  concat
        |||||||  :lets
        |||||||  [ ]
        |||||||  :talk
        |||||||  
        |||||||  ====>   lets talk
  
               ****** LEVEL5 I\O ACTION #2:    lets talk
               ############################       
               ############################       
               ############################       

.mmmmm.LEVEL5  (type OP5 w 1 args)  RW SUCCESS:
        |||||  say
        |||||  [lets talk]
        |||||  
        |||||  ====>   nil
  

.mmm.LEVEL3  (type OP5 w 2 args)  RW SUCCESS:
        |||  stepThru1
        |||  :nil
        |||  :TelService
        |||  
        |||  ====>   TelService
  

.mmm.LEVEL3  (type OP2 w 1 args)  RW SUCCESS:
        |||  NxtStateMap
        |||  < :offhook :dialDigit6 >
        |||  
        |||  ====>   talking
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #6:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   [ TelService ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   ( talking )
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 
  




==========================================================================>
( TREE DESCEND #7: )


.mmmmm.LEVEL5  (type OP2 w 1 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |||||  PerEvntActnList
        |||||  [ @@2 :talking[dialDigit :8]]
        |||||  
        |||||  =============>
        |||||  say(concat :seeya[,][ ] :bye)
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #7:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   ( stepThru1 (say(concat :seeya[,][ ] :bye)) :TelService )
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   ( NxtStateMap[ @@2 :talking[dialDigit :8]] )
  




==========================================================================>
( TREE DESCEND #8: )


.mmmmmmm.LEVEL7  (type OP5 w 4 args)  RW SUCCESS:
        |||||||  concat
        |||||||  :seeya
        |||||||  [,]
        |||||||  [ ]
        |||||||  :bye
        |||||||  
        |||||||  ====>   seeya, bye
  
               ****** LEVEL5 I\O ACTION #3:    seeya, bye
               ############################       
               ############################       
               ############################       

.mmmmm.LEVEL5  (type OP5 w 1 args)  RW SUCCESS:
        |||||  say
        |||||  [seeya, bye]
        |||||  
        |||||  ====>   nil
  

.mmm.LEVEL3  (type OP5 w 2 args)  RW SUCCESS:
        |||  stepThru1
        |||  :nil
        |||  :TelService
        |||  
        |||  ====>   TelService
  

.mmm.LEVEL3  (type OP2 w 1 args)  RW SUCCESS:
        |||  NxtStateMap
        |||  [ @@2 :talking[dialDigit :8]]
        |||  
        |||  ====>   disconnect
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #8:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   [ TelService ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   ( disconnect )
  




==========================================================================>
( TREE DESCEND #9: )


.mmm.LEVEL3  (type OP2 w 0 args)  NOT REWRITABLE:  disconnect
  
 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #9:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   [ disconnect ]
  




==========================================================================>
( TREE DESCEND #10: )

 
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #10:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  CallSession
        |  ARG0:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 
  



CODES NOW NOT REWRITABLE !
END OF CODES EXECUTION