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



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


goTo0
[ TelService ]
[1__CODES
  ( @@4  
    ( proc :TelService  :0 [ <::: @@3 :Stmt0 :Stmt1 :Stmt2 :::> ] )
    ( proc :Stmt0 :4
    : [ <:::
    :    : if  ( {~3} :equals :dialDigit8 ) 
    :    : [ goTo2 :~0 :~1 :~2 [dialDigit:6]  ] 
    :    : [ goTo1 :~0 :~1 :~2 :~3  ] 
    : :::>]
    )
    ( proc :Stmt1 :4
    : [ <:::
    :    : if  ( {~3} :equals :dialDigit8 ) 
    :    : [ goTo2 :~0 :~1 :~2 :~3  ] 
    :    : [ goTo0 :~0 :~1 :~2 :dialDigit8  ] 
    : :::>]
    )
    ( proc :Stmt2 :4
    : [ <:::
    :    ~3
    : :::>]
    )
  ) ]
[2__CURSTATE :onhook ]
[3__EVENT [dialDigit:4] ]
  



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

goTo0[TelService][1__CODES(@@4(proc[TelService][0][<:::@@3[Stmt0][Stmt1][Stmt2]:::>])(proc[Stmt0][4][<:::if(@@1(~3)[equals][dialDigit8])[goTo2[~0][~1][~2][dialDigit[6]]][goTo1[~0][~1][~2][~3]]:::>])(proc[Stmt1][4][<:::if(@@1(~3)[equals][dialDigit8])[goTo2[~0][~1][~2][~3]][goTo0[~0][~1][~2][dialDigit8]]:::>])(proc[Stmt2][4][<:::~3:::>]))][2__CURSTATE[onhook]][3__EVENT[dialDigit[4]]]  






CODES EXECUTION:
(RECURSIVE LEFTMOST-INNERMOST APPLICATIVE REWRITE, TILL CODES NOT REWRITABLE)





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

           goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))][2__CURSTATE :onhook][3__EVENT [dialDigit :4]]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  2__CURSTATE
        |||  :onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  3__EVENT
        |||  [dialDigit :4]

.m.LEVEL1  (type OP5 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  goTo0
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :4]]
        |  
        |  =============>
        |  Stmt0
        |  
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :4]]
  
  



  

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

           Stmt0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))][2__CURSTATE :onhook][3__EVENT [dialDigit :4]]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  2__CURSTATE
        |||  :onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  3__EVENT
        |||  [dialDigit :4]

.m.LEVEL1  (type OP2 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  Stmt0
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :4]]
        |  
        |  =============>
        |  if( @@1 (dialDigit :4) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]][goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]]
  
  



  

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

           if( @@1 (dialDigit :4) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]][goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]]

.mmmmmmm.LEVEL7  (type NUM w 0 args)  0SKIP.1:  4

.mmmmm.LEVEL5  (type OP2 w 1 args)  NOT REWRITABLE:
        |||||  dialDigit
        |||||  :4
  
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  equals
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  dialDigit8

.mmm.LEVEL3  (type OP5 w 3 args)  RW SUCCESS:
        |||  @@1
        |||  [dialDigit :4]
        |||  :equals
        |||  :dialDigit8
        |||  
        |||  ====>   1
  
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo2
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  [dialDigit :6]
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo1
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  [dialDigit :4]

.m.LEVEL1  (type OP5 w 3 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  if
        |  :1
        |  [goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]]
        |  [goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]]
        |  
        |  =============>
        |  goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]
  
  



  

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

           goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  dialDigit
        |||  :4

.m.LEVEL1  (type OP5 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  goTo1
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  :onhook
        |  [dialDigit :4]
        |  
        |  =============>
        |  Stmt1
        |  
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :4]]
  
  



  

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

           Stmt1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))][2__CURSTATE :onhook][3__EVENT [dialDigit :4]]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  2__CURSTATE
        |||  :onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  3__EVENT
        |||  [dialDigit :4]

.m.LEVEL1  (type OP2 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  Stmt1
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :4]]
        |  
        |  =============>
        |  if( @@1 (dialDigit :4) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]][goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]
  
  



  

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

           if( @@1 (dialDigit :4) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]][goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]

.mmmmmmm.LEVEL7  (type NUM w 0 args)  0SKIP.1:  4

.mmmmm.LEVEL5  (type OP2 w 1 args)  NOT REWRITABLE:
        |||||  dialDigit
        |||||  :4
  
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  equals
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  dialDigit8

.mmm.LEVEL3  (type OP5 w 3 args)  RW SUCCESS:
        |||  @@1
        |||  [dialDigit :4]
        |||  :equals
        |||  :dialDigit8
        |||  
        |||  ====>   1
  
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo2
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  [dialDigit :4]
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo0
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  :dialDigit8

.m.LEVEL1  (type OP5 w 3 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  if
        |  :1
        |  [goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :4]]
        |  [goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]
        |  
        |  =============>
        |  goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8
  
  



  

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

           goTo0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  onhook
.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  dialDigit8

.m.LEVEL1  (type OP5 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  goTo0
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  :onhook
        |  :dialDigit8
        |  
        |  =============>
        |  Stmt0
        |  
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT :dialDigit8]
  
  



  

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

           Stmt0 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))][2__CURSTATE :onhook][3__EVENT :dialDigit8]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  2__CURSTATE
        |||  :onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  3__EVENT
        |||  :dialDigit8

.m.LEVEL1  (type OP2 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  Stmt0
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT :dialDigit8]
        |  
        |  =============>
        |  if( @@1 (dialDigit8) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]][goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]
  
  



  

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

           if( @@1 (dialDigit8) :equals :dialDigit8)[goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]][goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]


.mmmmm.LEVEL5  (type OP2 w 0 args)  NOT REWRITABLE:  dialDigit8
  
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  equals
.mmmmm.LEVEL5  (type OP2 w 0 args)  0SKIP.1:  dialDigit8

.mmm.LEVEL3  (type OP5 w 3 args)  RW SUCCESS:
        |||  @@1
        |||  :dialDigit8
        |||  :equals
        |||  :dialDigit8
        |||  
        |||  ====>   0
  
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo2
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  [dialDigit :6]
.mmm.LEVEL3  (type OP5 w 4 args)  2SKIP.1:  
        |||  goTo1
        |||  :TelService
        |||  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |||  :onhook
        |||  :dialDigit8

.m.LEVEL1  (type OP5 w 3 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  if
        |  :0
        |  [goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]]
        |  [goTo1 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook :dialDigit8]
        |  
        |  =============>
        |  goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]
  
  



  

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

           goTo2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))] :onhook[dialDigit :6]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  dialDigit
        |||  :6

.m.LEVEL1  (type OP5 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  goTo2
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  :onhook
        |  [dialDigit :6]
        |  
        |  =============>
        |  Stmt2
        |  
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :6]]
  
  



  

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

           Stmt2 :TelService[1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))][2__CURSTATE :onhook][3__EVENT [dialDigit :6]]

.mmm.LEVEL3  (type OP2 w 0 args)  0SKIP.1:  TelService
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :TelService
        |||||||  :0
        |||||||   {  @@3 :Stmt0 :Stmt1 :Stmt2  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt0
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt1
        |||||||  :4
        |||||||   {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  }
.mmmmmmm.LEVEL7  (type OP5 w 3 args)  2SKIP.1:  
        |||||||  proc
        |||||||  :Stmt2
        |||||||  :4
        |||||||   {  ~3  }
.mmmmm.LEVEL5  (type OP5 w 4 args)  2SKIP.1:  
        |||||  @@4
        |||||  (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })
        |||||  (proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })
        |||||  (proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })
        |||||  (proc :Stmt2 :4 {  ~3  })
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  1__CODES
        |||  ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  2__CURSTATE
        |||  :onhook
.mmm.LEVEL3  (type OP2 w 1 args)  2SKIP.1:  
        |||  3__EVENT
        |||  [dialDigit :6]

.m.LEVEL1  (type OP2 w 4 args)  EXPANDING RW - NEED NEW DESCEND NOW:
        |  Stmt2
        |  :TelService
        |  [1__CODES ( @@4 (proc :TelService :0 {  @@3 :Stmt0 :Stmt1 :Stmt2  })(proc :Stmt0 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2[dialDigit :6]][goTo1 :~0 :~1 :~2 :~3]  })(proc :Stmt1 :4 {  if( @@1 (~3) :equals :dialDigit8)[goTo2 :~0 :~1 :~2 :~3][goTo0 :~0 :~1 :~2 :dialDigit8]  })(proc :Stmt2 :4 {  ~3  }))]
        |  [2__CURSTATE :onhook]
        |  [3__EVENT [dialDigit :6]]
        |  
        |  =============>
        |  dialDigit :6
  
  



  

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

           dialDigit :6

.mmm.LEVEL3  (type NUM w 0 args)  0SKIP.1:  6

.m.LEVEL1  (type OP2 w 1 args)  NOT REWRITABLE:
        |  dialDigit
        |  :6
  
  



CODES NOW NOT REWRITABLE !
END OF CODES EXECUTION