/out/lib/haxe/Stack.class.php

https://github.com/jasononeil/ufront-tutorial-Q-A · PHP · 222 lines · 221 code · 1 blank · 0 comment · 45 complexity · 2ea50a1208eede57f8c9e43eb2bff7d5 MD5 · raw file

  1. <?php
  2. class haxe_Stack {
  3. public function __construct(){}
  4. static function callStack() {
  5. return haxe_Stack::makeStack("%s");
  6. }
  7. static function exceptionStack() {
  8. return haxe_Stack::makeStack("%e");
  9. }
  10. static function toString($stack) {
  11. $b = new StringBuf();
  12. {
  13. $_g = 0;
  14. while($_g < $stack->length) {
  15. $s = $stack[$_g];
  16. ++$_g;
  17. {
  18. $x = "\x0ACalled from ";
  19. if(is_null($x)) {
  20. $x = "null";
  21. } else {
  22. if(is_bool($x)) {
  23. $x = (($x) ? "true" : "false");
  24. }
  25. }
  26. $b->b .= $x;
  27. unset($x);
  28. }
  29. haxe_Stack::itemToString($b, $s);
  30. unset($s);
  31. }
  32. }
  33. return $b->b;
  34. }
  35. static function itemToString($b, $s) {
  36. $»t = ($s);
  37. switch($»t->index) {
  38. case 0:
  39. {
  40. $x = "a C function";
  41. if(is_null($x)) {
  42. $x = "null";
  43. } else {
  44. if(is_bool($x)) {
  45. $x = (($x) ? "true" : "false");
  46. }
  47. }
  48. $b->b .= $x;
  49. }break;
  50. case 1:
  51. $m = $»t->params[0];
  52. {
  53. {
  54. $x = "module ";
  55. if(is_null($x)) {
  56. $x = "null";
  57. } else {
  58. if(is_bool($x)) {
  59. $x = (($x) ? "true" : "false");
  60. }
  61. }
  62. $b->b .= $x;
  63. }
  64. {
  65. $x = $m;
  66. if(is_null($x)) {
  67. $x = "null";
  68. } else {
  69. if(is_bool($x)) {
  70. $x = (($x) ? "true" : "false");
  71. }
  72. }
  73. $b->b .= $x;
  74. }
  75. }break;
  76. case 2:
  77. $line = $»t->params[2]; $file = $»t->params[1]; $s1 = $»t->params[0];
  78. {
  79. if($s1 !== null) {
  80. haxe_Stack::itemToString($b, $s1);
  81. {
  82. $x = " (";
  83. if(is_null($x)) {
  84. $x = "null";
  85. } else {
  86. if(is_bool($x)) {
  87. $x = (($x) ? "true" : "false");
  88. }
  89. }
  90. $b->b .= $x;
  91. }
  92. }
  93. {
  94. $x = $file;
  95. if(is_null($x)) {
  96. $x = "null";
  97. } else {
  98. if(is_bool($x)) {
  99. $x = (($x) ? "true" : "false");
  100. }
  101. }
  102. $b->b .= $x;
  103. }
  104. {
  105. $x = " line ";
  106. if(is_null($x)) {
  107. $x = "null";
  108. } else {
  109. if(is_bool($x)) {
  110. $x = (($x) ? "true" : "false");
  111. }
  112. }
  113. $b->b .= $x;
  114. }
  115. {
  116. $x = $line;
  117. if(is_null($x)) {
  118. $x = "null";
  119. } else {
  120. if(is_bool($x)) {
  121. $x = (($x) ? "true" : "false");
  122. }
  123. }
  124. $b->b .= $x;
  125. }
  126. if($s1 !== null) {
  127. $x = ")";
  128. if(is_null($x)) {
  129. $x = "null";
  130. } else {
  131. if(is_bool($x)) {
  132. $x = (($x) ? "true" : "false");
  133. }
  134. }
  135. $b->b .= $x;
  136. }
  137. }break;
  138. case 3:
  139. $meth = $»t->params[1]; $cname = $»t->params[0];
  140. {
  141. {
  142. $x = $cname;
  143. if(is_null($x)) {
  144. $x = "null";
  145. } else {
  146. if(is_bool($x)) {
  147. $x = (($x) ? "true" : "false");
  148. }
  149. }
  150. $b->b .= $x;
  151. }
  152. {
  153. $x = ".";
  154. if(is_null($x)) {
  155. $x = "null";
  156. } else {
  157. if(is_bool($x)) {
  158. $x = (($x) ? "true" : "false");
  159. }
  160. }
  161. $b->b .= $x;
  162. }
  163. {
  164. $x = $meth;
  165. if(is_null($x)) {
  166. $x = "null";
  167. } else {
  168. if(is_bool($x)) {
  169. $x = (($x) ? "true" : "false");
  170. }
  171. }
  172. $b->b .= $x;
  173. }
  174. }break;
  175. case 4:
  176. $n = $»t->params[0];
  177. {
  178. {
  179. $x = "local function #";
  180. if(is_null($x)) {
  181. $x = "null";
  182. } else {
  183. if(is_bool($x)) {
  184. $x = (($x) ? "true" : "false");
  185. }
  186. }
  187. $b->b .= $x;
  188. }
  189. {
  190. $x = $n;
  191. if(is_null($x)) {
  192. $x = "null";
  193. } else {
  194. if(is_bool($x)) {
  195. $x = (($x) ? "true" : "false");
  196. }
  197. }
  198. $b->b .= $x;
  199. }
  200. }break;
  201. }
  202. }
  203. static function makeStack($s) {
  204. if(!isset($GLOBALS[$s])) {
  205. return new _hx_array(array());
  206. }
  207. $a = $GLOBALS[$s];
  208. $m = new _hx_array(array());
  209. {
  210. $_g1 = 0; $_g = $a->length - ((($s === "%s") ? 2 : 0));
  211. while($_g1 < $_g) {
  212. $i = $_g1++;
  213. $d = _hx_explode("::", $a[$i]);
  214. $m->unshift(haxe_StackItem::Method($d[0], $d[1]));
  215. unset($i,$d);
  216. }
  217. }
  218. return $m;
  219. }
  220. function __toString() { return 'haxe.Stack'; }
  221. }