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






HIGH LEVEL DESCEND-BY-DESCEND VIEW OF RW PROGRESS:



RW PROCESS STARTING:




==========================================================================>
( TREE DESCEND #1: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #1:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     jumpTo 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmm      mmmmmmmmmmmm    curIdx2 1      GOTOARGNAMES  1__CODES
mmmmmmmmmm      mmmmmmmmmmmm    curIdx2 2      GOTOARGNAMES  2__CURSTATE
mmmmmmmmmm      mmmmmmmmmmmm    curIdx2 3      GOTOARGNAMES  3__EVENT
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ @@2 :0 :TelService ]
        |  ARG1:   [ 1__CODES ( @@12 (proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4)(proc :CallSession :4[<:::jumpTo(stepThru1 (PerEvntActnList[ @@2 :~2 :~3])<:0:TelService>) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService)(term [pairElem1<:0:TelService>] :TelService)(term [jumpTo<:0:TelService>][CallSession :TelService])(term [jumpTo<:1:TelService>][Instruct1 :TelService])(term [jumpTo<:2:TelService>][Instruct2 :TelService])(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
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 CallSession    tempStmt0 CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ @@2 :0 :TelService ]
        |          
        |  ARG1:   [ 1__CODES [ @@12 (proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4)(proc :CallSession :4[<:::jumpTo(stepThru1 (PerEvntActnList[ @@2 :~2 :~3])<:0:TelService>) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService)(term [pairElem1<:0:TelService>] :TelService)(term [jumpTo<:0:TelService>][CallSession :TelService])(term [jumpTo<:1:TelService>][Instruct1 :TelService])(term [jumpTo<:2:TelService>][Instruct2 :TelService])(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)] ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 1__CODES ( @@12 (proc :TelService :0[<:::@@3 :CallSession :Instruct1 :Instruct2:::>] :4)(proc :CallSession :4[<:::jumpTo(stepThru1 (PerEvntActnList[ @@2 :~2 :~3])<:0:TelService>) :~1(NxtStateMap[ @@2 :~2 :~3]):::>] :TelService)(term [pairElem1<:0:TelService>] :TelService)(term [jumpTo<:0:TelService>][CallSession :TelService])(term [jumpTo<:1:TelService>][Instruct1 :TelService])(term [jumpTo<:2:TelService>][Instruct2 :TelService])(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:   .........NO UPDATES:  2__CURSTATE
        |  ARG3:   .........NO UPDATES:  3__EVENT
        |  ARG4:   .........NO UPDATES. 
        |  ARG5:   .........NO UPDATES. 




==========================================================================>
( TREE DESCEND #3: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #3:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 stepThru1(say(concat[hello][,][%][World]))[@@2[0][TelService]]     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( stepThru1 (say(concat :hello[,][ ] :World))<:0:TelService> )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE [NxtStateMap[ @@2 :onhook[dialDigit :4]]] )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 2__CURSTATE :onhook ]
        |          
        |  ARG3:   [ 3__EVENT :dialDigit6 ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 3__EVENT [dialDigit :4] ]
        |          
        |  ARG4:   [ dialDigit :8 ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ dialDigit6 ]
        |          




==========================================================================>
( TREE DESCEND #4: )
. . . . . .  
               ( ****** LEVEL5 ACTION #1:  say  )    hello, World
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #4:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( @@2 :0 :TelService )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( stepThru1 (say(concat :hello[,][ ] :World))<:0:TelService> )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE
        |  ARG3:   .........NO UPDATES:  3__EVENT
        |  ARG4:   .........NO UPDATES. 




==========================================================================>
( TREE DESCEND #5: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #5:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ @@2 :0 :TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( @@2 :0 :TelService )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE :offhook )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE [NxtStateMap[ @@2 :onhook[dialDigit :4]]] )
        |          
        |  ARG3:   .........NO UPDATES:  3__EVENT
        |  ARG4:   .........NO UPDATES. 




==========================================================================>
( TREE DESCEND #6: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #6:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   .........NO UPDATES. 
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   [ 2__CURSTATE :offhook ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :offhook )
        |          
        |  ARG3:   .........NO UPDATES:  3__EVENT
        |  ARG4:   .........NO UPDATES. 




==========================================================================>
( TREE DESCEND #7: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #7:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 CallSession    tempStmt0 CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ @@2 :0 :TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE
        |  ARG3:   .........NO UPDATES:  3__EVENT
        |  ARG4:   .........NO UPDATES. 




==========================================================================>
( TREE DESCEND #8: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #8:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 stepThru1(say(concat[lets][%][talk]))[@@2[0][TelService]]     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( stepThru1 (say(concat :lets[ ] :talk))<:0:TelService> )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE [NxtStateMap< :offhook :dialDigit6 >] )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 2__CURSTATE :offhook ]
        |          
        |  ARG3:   [ 3__EVENT [dialDigit :8] ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 3__EVENT :dialDigit6 ]
        |          




==========================================================================>
( TREE DESCEND #9: )
. . . . . .  
               ( ****** LEVEL5 ACTION #2:  say  )    lets talk
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #9:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( @@2 :0 :TelService )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( stepThru1 (say(concat :lets[ ] :talk))<:0:TelService> )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE
        |  ARG3:   .........NO UPDATES:  3__EVENT




==========================================================================>
( TREE DESCEND #10: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #10:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ @@2 :0 :TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( @@2 :0 :TelService )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE :talking )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE [NxtStateMap< :offhook :dialDigit6 >] )
        |          
        |  ARG3:   .........NO UPDATES:  3__EVENT




==========================================================================>
( TREE DESCEND #11: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #11:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   .........NO UPDATES. 
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   [ 2__CURSTATE :talking ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :talking )
        |          
        |  ARG3:   .........NO UPDATES:  3__EVENT




==========================================================================>
( TREE DESCEND #12: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #12:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 CallSession    tempStmt0 CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ @@2 :0 :TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE
        |  ARG3:   .........NO UPDATES:  3__EVENT




==========================================================================>
( TREE DESCEND #13: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #13:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 stepThru1(say(concat[seeya][,][%][bye]))[@@2[0][TelService]]     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( stepThru1 (say(concat :seeya[,][ ] :bye))<:0:TelService> )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE [NxtStateMap[ @@2 :talking[dialDigit :8]]] )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ 2__CURSTATE :talking ]
        |          




==========================================================================>
( TREE DESCEND #14: )
. . . . . .  
               ( ****** LEVEL5 ACTION #3:  say  )    seeya, bye
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #14:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   ( @@2 :0 :TelService )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( stepThru1 (say(concat :seeya[,][ ] :bye))<:0:TelService> )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE




==========================================================================>
( TREE DESCEND #15: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #15:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ @@2 :0 :TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( @@2 :0 :TelService )
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   ( 2__CURSTATE :disconnect )
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE [NxtStateMap[ @@2 :talking[dialDigit :8]]] )
        |          




==========================================================================>
( TREE DESCEND #16: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #16:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 jumpTo    tempStmt0 jumpTo
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   .........NO UPDATES. 
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   [ 2__CURSTATE :disconnect ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :disconnect )
        |          




==========================================================================>
( TREE DESCEND #17: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #17:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm1   @OPstr1 CallSession    tempStmt0 CallSession
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm2   tp2 TelService     temp6  0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 0 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 1    GOTOARGNAMES  1__CODES
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 2    GOTOARGNAMES  2__CURSTATE
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm3   curIdx 3    GOTOARGNAMES  3__EVENT
        |  ARG0:   [ TelService ]
        |          mmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          [ @@2 :0 :TelService ]
        |          
        |  ARG1:   .........NO UPDATES:  1__CODES
        |  ARG2:   .........NO UPDATES:  2__CURSTATE



CODES NOW NOT REWRITABLE !
END OF CODES EXECUTION