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



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


goTo0
[ TelService ]
[1__CODES
(@@8  
    ( proc :TelService  :0 {::: @@1 :CallSession :::} )
    ( proc :CallSession :4
    : {:::
    :    stepThru1
    :    ( cTerm2 :~2 :~3 [PerEvntActnList] )
    :    [ 
    :    : goTo0 
    :    : [ TelService ] 
    :    : [ ~1 ]
    :    : ( cTerm2 :~2 :~3 [NxtStateMap] )
    :    ] 
    : :::}
    )
    ( term [cTerm2 :onhook [dialDigit:4] [PerEvntActnList]] [say(concat:hello[,][ ]:World)] )
    ( term [cTerm2 :offhook :dialDigit6 [PerEvntActnList]] [say(concat:lets[ ]:talk)] )
    ( term [cTerm2 :talking [dialDigit:8] [PerEvntActnList]] [say(concat:seeya[,][ ]:bye)] )
    ( term [cTerm2 :onhook [dialDigit:4] [NxtStateMap]] :offhook )
    ( term [cTerm2 :offhook :dialDigit6 [NxtStateMap]] :talking )
    ( term [cTerm2 :talking [dialDigit:8] [NxtStateMap]] :disconnect )
) ]
[2__CURSTATE :onhook ]
[3__EVENT [dialDigit:4] ]
 
:dialDigit6
[dialDigit:8]
  



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

goTo0[TelService][1__CODES(@@8(proc[TelService][0][<:::@@1[CallSession]:::>])(proc[CallSession][4][<:::stepThru1(cTerm2[~2][~3][PerEvntActnList])[goTo0[TelService][~1](cTerm2[~2][~3][NxtStateMap])]:::>])(term[cTerm2[onhook][dialDigit[4]][PerEvntActnList]][say(concat[hello][,][%][World])])(term[cTerm2[offhook][dialDigit6][PerEvntActnList]][say(concat[lets][%][talk])])(term[cTerm2[talking][dialDigit[8]][PerEvntActnList]][say(concat[seeya][,][%][bye])])(term[cTerm2[onhook][dialDigit[4]][NxtStateMap]][offhook])(term[cTerm2[offhook][dialDigit6][NxtStateMap]][talking])(term[cTerm2[talking][dialDigit[8]][NxtStateMap]][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:     goTo0 
        |  ARG0:   [ TelService ]
        |  ARG1:   [ 1__CODES [ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :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:   <--------SAME AS IN ABOVE DESCEND. 
        |  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: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #3:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     stepThru1
        |  ARG0:   ( say(concat :hello[,][ ] :World) )
        |  ARG1:   [ goTo0 :TelService[ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)](cTerm2 :onhook[dialDigit :4] :NxtStateMap) ]
        |  ARG2:   [ dialDigit6 ]
        |  ARG3:   [ dialDigit :8 ]




==========================================================================>
( TREE DESCEND #4: )
. . . . . .  
             ( ****** LEVEL3 ACTION #1:  say  )    hello, World
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #4:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  stepThru1
        |  ARG0:   [ nil ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 




==========================================================================>
( TREE DESCEND #5: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #5:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     goTo0
        |  ARG0:   [ TelService ]
        |  ARG1:   [ 1__CODES [ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)] ]
        |  ARG2:   ( 2__CURSTATE :offhook )
        |  ARG3:   [ 3__EVENT :dialDigit6 ]
        |  ARG4:   [ dialDigit :8 ]




==========================================================================>
( TREE DESCEND #6: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #6:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  goTo0
        |  ARG0:   .........NO UPDATES.
        |  ARG1:   .........NO UPDATES.
        |  ARG2:   [ 2__CURSTATE :offhook ]
        |          
        |          mmmmmmmmmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :offhook )
        |          
        |  ARG3:   .........NO UPDATES.
        |  ARG4:   .........NO UPDATES.




==========================================================================>
( TREE DESCEND #7: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #7:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
        |  ARG0:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG4:   <--------SAME AS IN ABOVE DESCEND. 




==========================================================================>
( TREE DESCEND #8: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #8:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     stepThru1
        |  ARG0:   ( say(concat :lets[ ] :talk) )
        |  ARG1:   [ goTo0 :TelService[ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)](cTerm2 :offhook :dialDigit6 :NxtStateMap) ]
        |  ARG2:   [ dialDigit :8 ]




==========================================================================>
( TREE DESCEND #9: )
. . . . . .  
             ( ****** LEVEL3 ACTION #2:  say  )    lets talk
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #9:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  stepThru1
        |  ARG0:   [ nil ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 




==========================================================================>
( TREE DESCEND #10: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #10:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     goTo0
        |  ARG0:   [ TelService ]
        |  ARG1:   [ 1__CODES [ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)] ]
        |  ARG2:   ( 2__CURSTATE :talking )
        |  ARG3:   [ 3__EVENT [dialDigit :8] ]




==========================================================================>
( TREE DESCEND #11: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #11:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  goTo0
        |  ARG0:   .........NO UPDATES.
        |  ARG1:   .........NO UPDATES.
        |  ARG2:   [ 2__CURSTATE :talking ]
        |          
        |          mmmmmmmmmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :talking )
        |          
        |  ARG3:   .........NO UPDATES.




==========================================================================>
( TREE DESCEND #12: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #12:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     CallSession
        |  ARG0:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG2:   <--------SAME AS IN ABOVE DESCEND. 
        |  ARG3:   <--------SAME AS IN ABOVE DESCEND. 




==========================================================================>
( TREE DESCEND #13: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #13:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     stepThru1
        |  ARG0:   ( say(concat :seeya[,][ ] :bye) )
        |  ARG1:   [ goTo0 :TelService[ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)](cTerm2 :talking[dialDigit :8] :NxtStateMap) ]




==========================================================================>
( TREE DESCEND #14: )
. . . . . .  
             ( ****** LEVEL3 ACTION #3:  say  )    seeya, bye
  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #14:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  stepThru1
        |  ARG0:   [ nil ]
        |  ARG1:   <--------SAME AS IN ABOVE DESCEND. 




==========================================================================>
( TREE DESCEND #15: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #15:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     goTo0
        |  ARG0:   [ TelService ]
        |  ARG1:   [ 1__CODES [ @@8 (proc :TelService :0 {:::  @@1 :CallSession  :::})(proc :CallSession :4 {:::  stepThru1 (cTerm2 :~2 :~3 :PerEvntActnList)[goTo0 :TelService :~1(cTerm2 :~2 :~3 :NxtStateMap)]  :::})(term [cTerm2 :onhook[dialDigit :4] :PerEvntActnList][say(concat :hello[,][ ] :World)])(term [cTerm2 :offhook :dialDigit6 :PerEvntActnList][say(concat :lets[ ] :talk)])(term [cTerm2 :talking[dialDigit :8] :PerEvntActnList][say(concat :seeya[,][ ] :bye)])(term [cTerm2 :onhook[dialDigit :4] :NxtStateMap] :offhook)(term [cTerm2 :offhook :dialDigit6 :NxtStateMap] :talking)(term [cTerm2 :talking[dialDigit :8] :NxtStateMap] :disconnect)] ]
        |  ARG2:   ( 2__CURSTATE :disconnect )




==========================================================================>
( TREE DESCEND #16: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #16:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  goTo0
        |  ARG0:   .........NO UPDATES.
        |  ARG1:   .........NO UPDATES.
        |  ARG2:   [ 2__CURSTATE :disconnect ]
        |          
        |          mmmmmmmmmmmmmmmmmmmmmmmmmm  UPDATED !  mmmmmmmmmmmmmmm  WAS:
        |          ( 2__CURSTATE :disconnect )
        |          




==========================================================================>
( TREE DESCEND #17: )
. . . . . .  
.m.LEVEL1  AT ENTRY OF OUTERMOST RW ATTEMPT IN CURRENT DESCEND #17:
        |  """""""""""""""""""""""""""""""""""""""""""""""""""""""
        |  OP:     <--------SAME AS IN ABOVE DESCEND:  goTo0
        |  ARG0:   .........NO UPDATES.
        |  ARG1:   .........NO UPDATES.
        |  ARG2:   .........NO UPDATES.



CODES NOW NOT REWRITABLE !
END OF CODES EXECUTION