Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 80.25 KB | None | 0 0
  1. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
  2. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  3. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  4. assertEquals(expecting,found);
  5. }
  6. OldName: testRootTokenInStarLoop
  7. avg: 33.33333333333333
  8. name of old: testActionInStarLoop
  9. Outcome: false
  10. NewCode: {
  11. return 0;
  12. }
  13. NewName: getChildIndex
  14. OldCode: {
  15. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
  16. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  17. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  18. assertEquals(expecting,found);
  19. }
  20. OldName: testActionInStarLoop
  21. avg: 33.33333333333333
  22. name of new: setChildIndex
  23. name of old: TestASTConstruction
  24. Outcome: false
  25. NewCode: {
  26. }
  27. NewName: setChildIndex
  28. OldCode: {
  29. }
  30. OldName: TestASTConstruction
  31. avg: 100.0
  32. name of old: testA
  33. Outcome: false
  34. NewCode: {
  35. }
  36. NewName: setChildIndex
  37. OldCode: {
  38. Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
  39. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  40. String found=g.getRule("a").tree.toStringTree();
  41. assertEquals(expecting,found);
  42. }
  43. OldName: testA
  44. avg: 50.0
  45. name of old: testNakeRulePlusInLexer
  46. Outcome: false
  47. NewCode: {
  48. }
  49. NewName: setChildIndex
  50. OldCode: {
  51. Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
  52. String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  53. String found=g.getRule("A").tree.toStringTree();
  54. assertEquals(expecting,found);
  55. }
  56. OldName: testNakeRulePlusInLexer
  57. avg: 50.0
  58. name of old: testRulePlus
  59. Outcome: false
  60. NewCode: {
  61. }
  62. NewName: setChildIndex
  63. OldCode: {
  64. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
  65. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  66. String found=g.getRule("a").tree.toStringTree();
  67. assertEquals(expecting,found);
  68. }
  69. OldName: testRulePlus
  70. avg: 50.0
  71. name of old: testNakedRulePlus
  72. Outcome: false
  73. NewCode: {
  74. }
  75. NewName: setChildIndex
  76. OldCode: {
  77. Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
  78. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  79. String found=g.getRule("a").tree.toStringTree();
  80. assertEquals(expecting,found);
  81. }
  82. OldName: testNakedRulePlus
  83. avg: 50.0
  84. name of old: testRuleOptional
  85. Outcome: false
  86. NewCode: {
  87. }
  88. NewName: setChildIndex
  89. OldCode: {
  90. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
  91. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  92. String found=g.getRule("a").tree.toStringTree();
  93. assertEquals(expecting,found);
  94. }
  95. OldName: testRuleOptional
  96. avg: 50.0
  97. name of old: testNakedRuleOptional
  98. Outcome: false
  99. NewCode: {
  100. }
  101. NewName: setChildIndex
  102. OldCode: {
  103. Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
  104. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  105. String found=g.getRule("a").tree.toStringTree();
  106. assertEquals(expecting,found);
  107. }
  108. OldName: testNakedRuleOptional
  109. avg: 50.0
  110. name of old: testRuleStar
  111. Outcome: false
  112. NewCode: {
  113. }
  114. NewName: setChildIndex
  115. OldCode: {
  116. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
  117. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  118. String found=g.getRule("a").tree.toStringTree();
  119. assertEquals(expecting,found);
  120. }
  121. OldName: testRuleStar
  122. avg: 50.0
  123. name of old: testNakedRuleStar
  124. Outcome: false
  125. NewCode: {
  126. }
  127. NewName: setChildIndex
  128. OldCode: {
  129. Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
  130. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  131. String found=g.getRule("a").tree.toStringTree();
  132. assertEquals(expecting,found);
  133. }
  134. OldName: testNakedRuleStar
  135. avg: 50.0
  136. name of old: testCharStar
  137. Outcome: false
  138. NewCode: {
  139. }
  140. NewName: setChildIndex
  141. OldCode: {
  142. Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
  143. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  144. String found=g.getRule("a").tree.toStringTree();
  145. assertEquals(expecting,found);
  146. }
  147. OldName: testCharStar
  148. avg: 50.0
  149. name of old: testCharStarInLexer
  150. Outcome: false
  151. NewCode: {
  152. }
  153. NewName: setChildIndex
  154. OldCode: {
  155. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
  156. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  157. String found=g.getRule("B").tree.toStringTree();
  158. assertEquals(expecting,found);
  159. }
  160. OldName: testCharStarInLexer
  161. avg: 50.0
  162. name of old: testStringStar
  163. Outcome: false
  164. NewCode: {
  165. }
  166. NewName: setChildIndex
  167. OldCode: {
  168. Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
  169. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  170. String found=g.getRule("a").tree.toStringTree();
  171. assertEquals(expecting,found);
  172. }
  173. OldName: testStringStar
  174. avg: 50.0
  175. name of old: testStringStarInLexer
  176. Outcome: false
  177. NewCode: {
  178. }
  179. NewName: setChildIndex
  180. OldCode: {
  181. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
  182. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  183. String found=g.getRule("B").tree.toStringTree();
  184. assertEquals(expecting,found);
  185. }
  186. OldName: testStringStarInLexer
  187. avg: 50.0
  188. name of old: testCharPlus
  189. Outcome: false
  190. NewCode: {
  191. }
  192. NewName: setChildIndex
  193. OldCode: {
  194. Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
  195. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  196. String found=g.getRule("a").tree.toStringTree();
  197. assertEquals(expecting,found);
  198. }
  199. OldName: testCharPlus
  200. avg: 50.0
  201. name of old: testCharPlusInLexer
  202. Outcome: false
  203. NewCode: {
  204. }
  205. NewName: setChildIndex
  206. OldCode: {
  207. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
  208. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  209. String found=g.getRule("B").tree.toStringTree();
  210. assertEquals(expecting,found);
  211. }
  212. OldName: testCharPlusInLexer
  213. avg: 50.0
  214. name of old: testCharOptional
  215. Outcome: false
  216. NewCode: {
  217. }
  218. NewName: setChildIndex
  219. OldCode: {
  220. Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
  221. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  222. String found=g.getRule("a").tree.toStringTree();
  223. assertEquals(expecting,found);
  224. }
  225. OldName: testCharOptional
  226. avg: 50.0
  227. name of old: testCharOptionalInLexer
  228. Outcome: false
  229. NewCode: {
  230. }
  231. NewName: setChildIndex
  232. OldCode: {
  233. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
  234. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  235. String found=g.getRule("B").tree.toStringTree();
  236. assertEquals(expecting,found);
  237. }
  238. OldName: testCharOptionalInLexer
  239. avg: 50.0
  240. name of old: testCharRangePlus
  241. Outcome: false
  242. NewCode: {
  243. }
  244. NewName: setChildIndex
  245. OldCode: {
  246. Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
  247. String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  248. String found=g.getRule("ID").tree.toStringTree();
  249. assertEquals(expecting,found);
  250. }
  251. OldName: testCharRangePlus
  252. avg: 50.0
  253. name of old: testLabel
  254. Outcome: false
  255. NewCode: {
  256. }
  257. NewName: setChildIndex
  258. OldCode: {
  259. Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
  260. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  261. String found=g.getRule("a").tree.toStringTree();
  262. assertEquals(expecting,found);
  263. }
  264. OldName: testLabel
  265. avg: 50.0
  266. name of old: testLabelOfOptional
  267. Outcome: false
  268. NewCode: {
  269. }
  270. NewName: setChildIndex
  271. OldCode: {
  272. Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
  273. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  274. String found=g.getRule("a").tree.toStringTree();
  275. assertEquals(expecting,found);
  276. }
  277. OldName: testLabelOfOptional
  278. avg: 50.0
  279. name of old: testLabelOfClosure
  280. Outcome: false
  281. NewCode: {
  282. }
  283. NewName: setChildIndex
  284. OldCode: {
  285. Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
  286. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  287. String found=g.getRule("a").tree.toStringTree();
  288. assertEquals(expecting,found);
  289. }
  290. OldName: testLabelOfClosure
  291. avg: 50.0
  292. name of old: testRuleLabel
  293. Outcome: false
  294. NewCode: {
  295. }
  296. NewName: setChildIndex
  297. OldCode: {
  298. Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
  299. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  300. String found=g.getRule("a").tree.toStringTree();
  301. assertEquals(expecting,found);
  302. }
  303. OldName: testRuleLabel
  304. avg: 50.0
  305. name of old: testSetLabel
  306. Outcome: false
  307. NewCode: {
  308. }
  309. NewName: setChildIndex
  310. OldCode: {
  311. Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
  312. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  313. String found=g.getRule("a").tree.toStringTree();
  314. assertEquals(expecting,found);
  315. }
  316. OldName: testSetLabel
  317. avg: 50.0
  318. name of old: testNotSetLabel
  319. Outcome: false
  320. NewCode: {
  321. }
  322. NewName: setChildIndex
  323. OldCode: {
  324. Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
  325. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  326. String found=g.getRule("a").tree.toStringTree();
  327. assertEquals(expecting,found);
  328. }
  329. OldName: testNotSetLabel
  330. avg: 50.0
  331. name of old: testNotSetListLabel
  332. Outcome: false
  333. NewCode: {
  334. }
  335. NewName: setChildIndex
  336. OldCode: {
  337. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
  338. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  339. String found=g.getRule("a").tree.toStringTree();
  340. assertEquals(expecting,found);
  341. }
  342. OldName: testNotSetListLabel
  343. avg: 50.0
  344. name of old: testNotSetListLabelInLoop
  345. Outcome: false
  346. NewCode: {
  347. }
  348. NewName: setChildIndex
  349. OldCode: {
  350. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
  351. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  352. String found=g.getRule("a").tree.toStringTree();
  353. assertEquals(expecting,found);
  354. }
  355. OldName: testNotSetListLabelInLoop
  356. avg: 50.0
  357. name of old: testRuleLabelOfPositiveClosure
  358. Outcome: false
  359. NewCode: {
  360. }
  361. NewName: setChildIndex
  362. OldCode: {
  363. Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
  364. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  365. String found=g.getRule("a").tree.toStringTree();
  366. assertEquals(expecting,found);
  367. }
  368. OldName: testRuleLabelOfPositiveClosure
  369. avg: 50.0
  370. name of old: testListLabelOfClosure
  371. Outcome: false
  372. NewCode: {
  373. }
  374. NewName: setChildIndex
  375. OldCode: {
  376. Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
  377. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  378. String found=g.getRule("a").tree.toStringTree();
  379. assertEquals(expecting,found);
  380. }
  381. OldName: testListLabelOfClosure
  382. avg: 50.0
  383. name of old: testListLabelOfClosure2
  384. Outcome: false
  385. NewCode: {
  386. }
  387. NewName: setChildIndex
  388. OldCode: {
  389. Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
  390. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  391. String found=g.getRule("a").tree.toStringTree();
  392. assertEquals(expecting,found);
  393. }
  394. OldName: testListLabelOfClosure2
  395. avg: 50.0
  396. name of old: testRuleListLabelOfPositiveClosure
  397. Outcome: false
  398. NewCode: {
  399. }
  400. NewName: setChildIndex
  401. OldCode: {
  402. Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
  403. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  404. String found=g.getRule("a").tree.toStringTree();
  405. assertEquals(expecting,found);
  406. }
  407. OldName: testRuleListLabelOfPositiveClosure
  408. avg: 50.0
  409. name of old: testRootTokenInStarLoop
  410. Outcome: false
  411. NewCode: {
  412. }
  413. NewName: setChildIndex
  414. OldCode: {
  415. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
  416. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  417. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  418. assertEquals(expecting,found);
  419. }
  420. OldName: testRootTokenInStarLoop
  421. avg: 50.0
  422. name of old: testActionInStarLoop
  423. Outcome: false
  424. NewCode: {
  425. }
  426. NewName: setChildIndex
  427. OldCode: {
  428. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
  429. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  430. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  431. assertEquals(expecting,found);
  432. }
  433. OldName: testActionInStarLoop
  434. avg: 50.0
  435. name of new: getParent
  436. name of old: TestASTConstruction
  437. Outcome: false
  438. NewCode: {
  439. return null;
  440. }
  441. NewName: getParent
  442. OldCode: {
  443. }
  444. OldName: TestASTConstruction
  445. avg: 33.33333333333333
  446. name of old: testA
  447. Outcome: false
  448. NewCode: {
  449. return null;
  450. }
  451. NewName: getParent
  452. OldCode: {
  453. Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
  454. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  455. String found=g.getRule("a").tree.toStringTree();
  456. assertEquals(expecting,found);
  457. }
  458. OldName: testA
  459. avg: 33.33333333333333
  460. name of old: testNakeRulePlusInLexer
  461. Outcome: false
  462. NewCode: {
  463. return null;
  464. }
  465. NewName: getParent
  466. OldCode: {
  467. Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
  468. String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  469. String found=g.getRule("A").tree.toStringTree();
  470. assertEquals(expecting,found);
  471. }
  472. OldName: testNakeRulePlusInLexer
  473. avg: 33.33333333333333
  474. name of old: testRulePlus
  475. Outcome: false
  476. NewCode: {
  477. return null;
  478. }
  479. NewName: getParent
  480. OldCode: {
  481. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
  482. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  483. String found=g.getRule("a").tree.toStringTree();
  484. assertEquals(expecting,found);
  485. }
  486. OldName: testRulePlus
  487. avg: 33.33333333333333
  488. name of old: testNakedRulePlus
  489. Outcome: false
  490. NewCode: {
  491. return null;
  492. }
  493. NewName: getParent
  494. OldCode: {
  495. Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
  496. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  497. String found=g.getRule("a").tree.toStringTree();
  498. assertEquals(expecting,found);
  499. }
  500. OldName: testNakedRulePlus
  501. avg: 33.33333333333333
  502. name of old: testRuleOptional
  503. Outcome: false
  504. NewCode: {
  505. return null;
  506. }
  507. NewName: getParent
  508. OldCode: {
  509. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
  510. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  511. String found=g.getRule("a").tree.toStringTree();
  512. assertEquals(expecting,found);
  513. }
  514. OldName: testRuleOptional
  515. avg: 33.33333333333333
  516. name of old: testNakedRuleOptional
  517. Outcome: false
  518. NewCode: {
  519. return null;
  520. }
  521. NewName: getParent
  522. OldCode: {
  523. Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
  524. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  525. String found=g.getRule("a").tree.toStringTree();
  526. assertEquals(expecting,found);
  527. }
  528. OldName: testNakedRuleOptional
  529. avg: 33.33333333333333
  530. name of old: testRuleStar
  531. Outcome: false
  532. NewCode: {
  533. return null;
  534. }
  535. NewName: getParent
  536. OldCode: {
  537. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
  538. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  539. String found=g.getRule("a").tree.toStringTree();
  540. assertEquals(expecting,found);
  541. }
  542. OldName: testRuleStar
  543. avg: 33.33333333333333
  544. name of old: testNakedRuleStar
  545. Outcome: false
  546. NewCode: {
  547. return null;
  548. }
  549. NewName: getParent
  550. OldCode: {
  551. Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
  552. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  553. String found=g.getRule("a").tree.toStringTree();
  554. assertEquals(expecting,found);
  555. }
  556. OldName: testNakedRuleStar
  557. avg: 33.33333333333333
  558. name of old: testCharStar
  559. Outcome: false
  560. NewCode: {
  561. return null;
  562. }
  563. NewName: getParent
  564. OldCode: {
  565. Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
  566. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  567. String found=g.getRule("a").tree.toStringTree();
  568. assertEquals(expecting,found);
  569. }
  570. OldName: testCharStar
  571. avg: 33.33333333333333
  572. name of old: testCharStarInLexer
  573. Outcome: false
  574. NewCode: {
  575. return null;
  576. }
  577. NewName: getParent
  578. OldCode: {
  579. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
  580. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  581. String found=g.getRule("B").tree.toStringTree();
  582. assertEquals(expecting,found);
  583. }
  584. OldName: testCharStarInLexer
  585. avg: 33.33333333333333
  586. name of old: testStringStar
  587. Outcome: false
  588. NewCode: {
  589. return null;
  590. }
  591. NewName: getParent
  592. OldCode: {
  593. Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
  594. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  595. String found=g.getRule("a").tree.toStringTree();
  596. assertEquals(expecting,found);
  597. }
  598. OldName: testStringStar
  599. avg: 33.33333333333333
  600. name of old: testStringStarInLexer
  601. Outcome: false
  602. NewCode: {
  603. return null;
  604. }
  605. NewName: getParent
  606. OldCode: {
  607. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
  608. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  609. String found=g.getRule("B").tree.toStringTree();
  610. assertEquals(expecting,found);
  611. }
  612. OldName: testStringStarInLexer
  613. avg: 33.33333333333333
  614. name of old: testCharPlus
  615. Outcome: false
  616. NewCode: {
  617. return null;
  618. }
  619. NewName: getParent
  620. OldCode: {
  621. Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
  622. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  623. String found=g.getRule("a").tree.toStringTree();
  624. assertEquals(expecting,found);
  625. }
  626. OldName: testCharPlus
  627. avg: 33.33333333333333
  628. name of old: testCharPlusInLexer
  629. Outcome: false
  630. NewCode: {
  631. return null;
  632. }
  633. NewName: getParent
  634. OldCode: {
  635. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
  636. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  637. String found=g.getRule("B").tree.toStringTree();
  638. assertEquals(expecting,found);
  639. }
  640. OldName: testCharPlusInLexer
  641. avg: 33.33333333333333
  642. name of old: testCharOptional
  643. Outcome: false
  644. NewCode: {
  645. return null;
  646. }
  647. NewName: getParent
  648. OldCode: {
  649. Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
  650. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  651. String found=g.getRule("a").tree.toStringTree();
  652. assertEquals(expecting,found);
  653. }
  654. OldName: testCharOptional
  655. avg: 33.33333333333333
  656. name of old: testCharOptionalInLexer
  657. Outcome: false
  658. NewCode: {
  659. return null;
  660. }
  661. NewName: getParent
  662. OldCode: {
  663. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
  664. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  665. String found=g.getRule("B").tree.toStringTree();
  666. assertEquals(expecting,found);
  667. }
  668. OldName: testCharOptionalInLexer
  669. avg: 33.33333333333333
  670. name of old: testCharRangePlus
  671. Outcome: false
  672. NewCode: {
  673. return null;
  674. }
  675. NewName: getParent
  676. OldCode: {
  677. Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
  678. String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  679. String found=g.getRule("ID").tree.toStringTree();
  680. assertEquals(expecting,found);
  681. }
  682. OldName: testCharRangePlus
  683. avg: 33.33333333333333
  684. name of old: testLabel
  685. Outcome: false
  686. NewCode: {
  687. return null;
  688. }
  689. NewName: getParent
  690. OldCode: {
  691. Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
  692. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  693. String found=g.getRule("a").tree.toStringTree();
  694. assertEquals(expecting,found);
  695. }
  696. OldName: testLabel
  697. avg: 33.33333333333333
  698. name of old: testLabelOfOptional
  699. Outcome: false
  700. NewCode: {
  701. return null;
  702. }
  703. NewName: getParent
  704. OldCode: {
  705. Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
  706. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  707. String found=g.getRule("a").tree.toStringTree();
  708. assertEquals(expecting,found);
  709. }
  710. OldName: testLabelOfOptional
  711. avg: 33.33333333333333
  712. name of old: testLabelOfClosure
  713. Outcome: false
  714. NewCode: {
  715. return null;
  716. }
  717. NewName: getParent
  718. OldCode: {
  719. Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
  720. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  721. String found=g.getRule("a").tree.toStringTree();
  722. assertEquals(expecting,found);
  723. }
  724. OldName: testLabelOfClosure
  725. avg: 33.33333333333333
  726. name of old: testRuleLabel
  727. Outcome: false
  728. NewCode: {
  729. return null;
  730. }
  731. NewName: getParent
  732. OldCode: {
  733. Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
  734. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  735. String found=g.getRule("a").tree.toStringTree();
  736. assertEquals(expecting,found);
  737. }
  738. OldName: testRuleLabel
  739. avg: 33.33333333333333
  740. name of old: testSetLabel
  741. Outcome: false
  742. NewCode: {
  743. return null;
  744. }
  745. NewName: getParent
  746. OldCode: {
  747. Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
  748. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  749. String found=g.getRule("a").tree.toStringTree();
  750. assertEquals(expecting,found);
  751. }
  752. OldName: testSetLabel
  753. avg: 33.33333333333333
  754. name of old: testNotSetLabel
  755. Outcome: false
  756. NewCode: {
  757. return null;
  758. }
  759. NewName: getParent
  760. OldCode: {
  761. Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
  762. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  763. String found=g.getRule("a").tree.toStringTree();
  764. assertEquals(expecting,found);
  765. }
  766. OldName: testNotSetLabel
  767. avg: 33.33333333333333
  768. name of old: testNotSetListLabel
  769. Outcome: false
  770. NewCode: {
  771. return null;
  772. }
  773. NewName: getParent
  774. OldCode: {
  775. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
  776. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  777. String found=g.getRule("a").tree.toStringTree();
  778. assertEquals(expecting,found);
  779. }
  780. OldName: testNotSetListLabel
  781. avg: 33.33333333333333
  782. name of old: testNotSetListLabelInLoop
  783. Outcome: false
  784. NewCode: {
  785. return null;
  786. }
  787. NewName: getParent
  788. OldCode: {
  789. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
  790. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  791. String found=g.getRule("a").tree.toStringTree();
  792. assertEquals(expecting,found);
  793. }
  794. OldName: testNotSetListLabelInLoop
  795. avg: 33.33333333333333
  796. name of old: testRuleLabelOfPositiveClosure
  797. Outcome: false
  798. NewCode: {
  799. return null;
  800. }
  801. NewName: getParent
  802. OldCode: {
  803. Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
  804. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  805. String found=g.getRule("a").tree.toStringTree();
  806. assertEquals(expecting,found);
  807. }
  808. OldName: testRuleLabelOfPositiveClosure
  809. avg: 33.33333333333333
  810. name of old: testListLabelOfClosure
  811. Outcome: false
  812. NewCode: {
  813. return null;
  814. }
  815. NewName: getParent
  816. OldCode: {
  817. Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
  818. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  819. String found=g.getRule("a").tree.toStringTree();
  820. assertEquals(expecting,found);
  821. }
  822. OldName: testListLabelOfClosure
  823. avg: 33.33333333333333
  824. name of old: testListLabelOfClosure2
  825. Outcome: false
  826. NewCode: {
  827. return null;
  828. }
  829. NewName: getParent
  830. OldCode: {
  831. Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
  832. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  833. String found=g.getRule("a").tree.toStringTree();
  834. assertEquals(expecting,found);
  835. }
  836. OldName: testListLabelOfClosure2
  837. avg: 33.33333333333333
  838. name of old: testRuleListLabelOfPositiveClosure
  839. Outcome: false
  840. NewCode: {
  841. return null;
  842. }
  843. NewName: getParent
  844. OldCode: {
  845. Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
  846. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  847. String found=g.getRule("a").tree.toStringTree();
  848. assertEquals(expecting,found);
  849. }
  850. OldName: testRuleListLabelOfPositiveClosure
  851. avg: 33.33333333333333
  852. name of old: testRootTokenInStarLoop
  853. Outcome: false
  854. NewCode: {
  855. return null;
  856. }
  857. NewName: getParent
  858. OldCode: {
  859. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
  860. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  861. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  862. assertEquals(expecting,found);
  863. }
  864. OldName: testRootTokenInStarLoop
  865. avg: 33.33333333333333
  866. name of old: testActionInStarLoop
  867. Outcome: false
  868. NewCode: {
  869. return null;
  870. }
  871. NewName: getParent
  872. OldCode: {
  873. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
  874. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  875. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  876. assertEquals(expecting,found);
  877. }
  878. OldName: testActionInStarLoop
  879. avg: 33.33333333333333
  880. name of new: setParent
  881. name of old: TestASTConstruction
  882. Outcome: false
  883. NewCode: {
  884. }
  885. NewName: setParent
  886. OldCode: {
  887. }
  888. OldName: TestASTConstruction
  889. avg: 100.0
  890. name of old: testA
  891. Outcome: false
  892. NewCode: {
  893. }
  894. NewName: setParent
  895. OldCode: {
  896. Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
  897. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  898. String found=g.getRule("a").tree.toStringTree();
  899. assertEquals(expecting,found);
  900. }
  901. OldName: testA
  902. avg: 50.0
  903. name of old: testNakeRulePlusInLexer
  904. Outcome: false
  905. NewCode: {
  906. }
  907. NewName: setParent
  908. OldCode: {
  909. Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
  910. String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  911. String found=g.getRule("A").tree.toStringTree();
  912. assertEquals(expecting,found);
  913. }
  914. OldName: testNakeRulePlusInLexer
  915. avg: 50.0
  916. name of old: testRulePlus
  917. Outcome: false
  918. NewCode: {
  919. }
  920. NewName: setParent
  921. OldCode: {
  922. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
  923. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  924. String found=g.getRule("a").tree.toStringTree();
  925. assertEquals(expecting,found);
  926. }
  927. OldName: testRulePlus
  928. avg: 50.0
  929. name of old: testNakedRulePlus
  930. Outcome: false
  931. NewCode: {
  932. }
  933. NewName: setParent
  934. OldCode: {
  935. Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
  936. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  937. String found=g.getRule("a").tree.toStringTree();
  938. assertEquals(expecting,found);
  939. }
  940. OldName: testNakedRulePlus
  941. avg: 50.0
  942. name of old: testRuleOptional
  943. Outcome: false
  944. NewCode: {
  945. }
  946. NewName: setParent
  947. OldCode: {
  948. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
  949. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  950. String found=g.getRule("a").tree.toStringTree();
  951. assertEquals(expecting,found);
  952. }
  953. OldName: testRuleOptional
  954. avg: 50.0
  955. name of old: testNakedRuleOptional
  956. Outcome: false
  957. NewCode: {
  958. }
  959. NewName: setParent
  960. OldCode: {
  961. Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
  962. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  963. String found=g.getRule("a").tree.toStringTree();
  964. assertEquals(expecting,found);
  965. }
  966. OldName: testNakedRuleOptional
  967. avg: 50.0
  968. name of old: testRuleStar
  969. Outcome: false
  970. NewCode: {
  971. }
  972. NewName: setParent
  973. OldCode: {
  974. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
  975. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  976. String found=g.getRule("a").tree.toStringTree();
  977. assertEquals(expecting,found);
  978. }
  979. OldName: testRuleStar
  980. avg: 50.0
  981. name of old: testNakedRuleStar
  982. Outcome: false
  983. NewCode: {
  984. }
  985. NewName: setParent
  986. OldCode: {
  987. Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
  988. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  989. String found=g.getRule("a").tree.toStringTree();
  990. assertEquals(expecting,found);
  991. }
  992. OldName: testNakedRuleStar
  993. avg: 50.0
  994. name of old: testCharStar
  995. Outcome: false
  996. NewCode: {
  997. }
  998. NewName: setParent
  999. OldCode: {
  1000. Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
  1001. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1002. String found=g.getRule("a").tree.toStringTree();
  1003. assertEquals(expecting,found);
  1004. }
  1005. OldName: testCharStar
  1006. avg: 50.0
  1007. name of old: testCharStarInLexer
  1008. Outcome: false
  1009. NewCode: {
  1010. }
  1011. NewName: setParent
  1012. OldCode: {
  1013. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
  1014. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1015. String found=g.getRule("B").tree.toStringTree();
  1016. assertEquals(expecting,found);
  1017. }
  1018. OldName: testCharStarInLexer
  1019. avg: 50.0
  1020. name of old: testStringStar
  1021. Outcome: false
  1022. NewCode: {
  1023. }
  1024. NewName: setParent
  1025. OldCode: {
  1026. Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
  1027. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1028. String found=g.getRule("a").tree.toStringTree();
  1029. assertEquals(expecting,found);
  1030. }
  1031. OldName: testStringStar
  1032. avg: 50.0
  1033. name of old: testStringStarInLexer
  1034. Outcome: false
  1035. NewCode: {
  1036. }
  1037. NewName: setParent
  1038. OldCode: {
  1039. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
  1040. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1041. String found=g.getRule("B").tree.toStringTree();
  1042. assertEquals(expecting,found);
  1043. }
  1044. OldName: testStringStarInLexer
  1045. avg: 50.0
  1046. name of old: testCharPlus
  1047. Outcome: false
  1048. NewCode: {
  1049. }
  1050. NewName: setParent
  1051. OldCode: {
  1052. Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
  1053. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1054. String found=g.getRule("a").tree.toStringTree();
  1055. assertEquals(expecting,found);
  1056. }
  1057. OldName: testCharPlus
  1058. avg: 50.0
  1059. name of old: testCharPlusInLexer
  1060. Outcome: false
  1061. NewCode: {
  1062. }
  1063. NewName: setParent
  1064. OldCode: {
  1065. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
  1066. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1067. String found=g.getRule("B").tree.toStringTree();
  1068. assertEquals(expecting,found);
  1069. }
  1070. OldName: testCharPlusInLexer
  1071. avg: 50.0
  1072. name of old: testCharOptional
  1073. Outcome: false
  1074. NewCode: {
  1075. }
  1076. NewName: setParent
  1077. OldCode: {
  1078. Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
  1079. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1080. String found=g.getRule("a").tree.toStringTree();
  1081. assertEquals(expecting,found);
  1082. }
  1083. OldName: testCharOptional
  1084. avg: 50.0
  1085. name of old: testCharOptionalInLexer
  1086. Outcome: false
  1087. NewCode: {
  1088. }
  1089. NewName: setParent
  1090. OldCode: {
  1091. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
  1092. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1093. String found=g.getRule("B").tree.toStringTree();
  1094. assertEquals(expecting,found);
  1095. }
  1096. OldName: testCharOptionalInLexer
  1097. avg: 50.0
  1098. name of old: testCharRangePlus
  1099. Outcome: false
  1100. NewCode: {
  1101. }
  1102. NewName: setParent
  1103. OldCode: {
  1104. Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
  1105. String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1106. String found=g.getRule("ID").tree.toStringTree();
  1107. assertEquals(expecting,found);
  1108. }
  1109. OldName: testCharRangePlus
  1110. avg: 50.0
  1111. name of old: testLabel
  1112. Outcome: false
  1113. NewCode: {
  1114. }
  1115. NewName: setParent
  1116. OldCode: {
  1117. Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
  1118. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1119. String found=g.getRule("a").tree.toStringTree();
  1120. assertEquals(expecting,found);
  1121. }
  1122. OldName: testLabel
  1123. avg: 50.0
  1124. name of old: testLabelOfOptional
  1125. Outcome: false
  1126. NewCode: {
  1127. }
  1128. NewName: setParent
  1129. OldCode: {
  1130. Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
  1131. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1132. String found=g.getRule("a").tree.toStringTree();
  1133. assertEquals(expecting,found);
  1134. }
  1135. OldName: testLabelOfOptional
  1136. avg: 50.0
  1137. name of old: testLabelOfClosure
  1138. Outcome: false
  1139. NewCode: {
  1140. }
  1141. NewName: setParent
  1142. OldCode: {
  1143. Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
  1144. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1145. String found=g.getRule("a").tree.toStringTree();
  1146. assertEquals(expecting,found);
  1147. }
  1148. OldName: testLabelOfClosure
  1149. avg: 50.0
  1150. name of old: testRuleLabel
  1151. Outcome: false
  1152. NewCode: {
  1153. }
  1154. NewName: setParent
  1155. OldCode: {
  1156. Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
  1157. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1158. String found=g.getRule("a").tree.toStringTree();
  1159. assertEquals(expecting,found);
  1160. }
  1161. OldName: testRuleLabel
  1162. avg: 50.0
  1163. name of old: testSetLabel
  1164. Outcome: false
  1165. NewCode: {
  1166. }
  1167. NewName: setParent
  1168. OldCode: {
  1169. Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
  1170. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1171. String found=g.getRule("a").tree.toStringTree();
  1172. assertEquals(expecting,found);
  1173. }
  1174. OldName: testSetLabel
  1175. avg: 50.0
  1176. name of old: testNotSetLabel
  1177. Outcome: false
  1178. NewCode: {
  1179. }
  1180. NewName: setParent
  1181. OldCode: {
  1182. Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
  1183. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1184. String found=g.getRule("a").tree.toStringTree();
  1185. assertEquals(expecting,found);
  1186. }
  1187. OldName: testNotSetLabel
  1188. avg: 50.0
  1189. name of old: testNotSetListLabel
  1190. Outcome: false
  1191. NewCode: {
  1192. }
  1193. NewName: setParent
  1194. OldCode: {
  1195. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
  1196. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1197. String found=g.getRule("a").tree.toStringTree();
  1198. assertEquals(expecting,found);
  1199. }
  1200. OldName: testNotSetListLabel
  1201. avg: 50.0
  1202. name of old: testNotSetListLabelInLoop
  1203. Outcome: false
  1204. NewCode: {
  1205. }
  1206. NewName: setParent
  1207. OldCode: {
  1208. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
  1209. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1210. String found=g.getRule("a").tree.toStringTree();
  1211. assertEquals(expecting,found);
  1212. }
  1213. OldName: testNotSetListLabelInLoop
  1214. avg: 50.0
  1215. name of old: testRuleLabelOfPositiveClosure
  1216. Outcome: false
  1217. NewCode: {
  1218. }
  1219. NewName: setParent
  1220. OldCode: {
  1221. Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
  1222. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1223. String found=g.getRule("a").tree.toStringTree();
  1224. assertEquals(expecting,found);
  1225. }
  1226. OldName: testRuleLabelOfPositiveClosure
  1227. avg: 50.0
  1228. name of old: testListLabelOfClosure
  1229. Outcome: false
  1230. NewCode: {
  1231. }
  1232. NewName: setParent
  1233. OldCode: {
  1234. Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
  1235. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1236. String found=g.getRule("a").tree.toStringTree();
  1237. assertEquals(expecting,found);
  1238. }
  1239. OldName: testListLabelOfClosure
  1240. avg: 50.0
  1241. name of old: testListLabelOfClosure2
  1242. Outcome: false
  1243. NewCode: {
  1244. }
  1245. NewName: setParent
  1246. OldCode: {
  1247. Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
  1248. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1249. String found=g.getRule("a").tree.toStringTree();
  1250. assertEquals(expecting,found);
  1251. }
  1252. OldName: testListLabelOfClosure2
  1253. avg: 50.0
  1254. name of old: testRuleListLabelOfPositiveClosure
  1255. Outcome: false
  1256. NewCode: {
  1257. }
  1258. NewName: setParent
  1259. OldCode: {
  1260. Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
  1261. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1262. String found=g.getRule("a").tree.toStringTree();
  1263. assertEquals(expecting,found);
  1264. }
  1265. OldName: testRuleListLabelOfPositiveClosure
  1266. avg: 50.0
  1267. name of old: testRootTokenInStarLoop
  1268. Outcome: false
  1269. NewCode: {
  1270. }
  1271. NewName: setParent
  1272. OldCode: {
  1273. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
  1274. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1275. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  1276. assertEquals(expecting,found);
  1277. }
  1278. OldName: testRootTokenInStarLoop
  1279. avg: 50.0
  1280. name of old: testActionInStarLoop
  1281. Outcome: false
  1282. NewCode: {
  1283. }
  1284. NewName: setParent
  1285. OldCode: {
  1286. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
  1287. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1288. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  1289. assertEquals(expecting,found);
  1290. }
  1291. OldName: testActionInStarLoop
  1292. avg: 50.0
  1293. name of new: toStringTree
  1294. name of old: TestASTConstruction
  1295. Outcome: false
  1296. NewCode: {
  1297. if (children == null || children.size() == 0) {
  1298. return this.toString();
  1299. }
  1300. StringBuffer buf=new StringBuffer();
  1301. if (!isNil()) {
  1302. buf.append("(");
  1303. buf.append(this.toString());
  1304. buf.append(' ');
  1305. }
  1306. for (int i=0; children != null && i < children.size(); i++) {
  1307. BaseTree t=(BaseTree)children.get(i);
  1308. if (i > 0) {
  1309. buf.append(' ');
  1310. }
  1311. buf.append(t.toStringTree());
  1312. }
  1313. if (!isNil()) {
  1314. buf.append(")");
  1315. }
  1316. return buf.toString();
  1317. }
  1318. NewName: toStringTree
  1319. OldCode: {
  1320. }
  1321. OldName: TestASTConstruction
  1322. avg: 4.545454545454546
  1323. name of old: testA
  1324. Outcome: false
  1325. NewCode: {
  1326. if (children == null || children.size() == 0) {
  1327. return this.toString();
  1328. }
  1329. StringBuffer buf=new StringBuffer();
  1330. if (!isNil()) {
  1331. buf.append("(");
  1332. buf.append(this.toString());
  1333. buf.append(' ');
  1334. }
  1335. for (int i=0; children != null && i < children.size(); i++) {
  1336. BaseTree t=(BaseTree)children.get(i);
  1337. if (i > 0) {
  1338. buf.append(' ');
  1339. }
  1340. buf.append(t.toStringTree());
  1341. }
  1342. if (!isNil()) {
  1343. buf.append(")");
  1344. }
  1345. return buf.toString();
  1346. }
  1347. NewName: toStringTree
  1348. OldCode: {
  1349. Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
  1350. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1351. String found=g.getRule("a").tree.toStringTree();
  1352. assertEquals(expecting,found);
  1353. }
  1354. OldName: testA
  1355. avg: 4.545454545454546
  1356. name of old: testNakeRulePlusInLexer
  1357. Outcome: false
  1358. NewCode: {
  1359. if (children == null || children.size() == 0) {
  1360. return this.toString();
  1361. }
  1362. StringBuffer buf=new StringBuffer();
  1363. if (!isNil()) {
  1364. buf.append("(");
  1365. buf.append(this.toString());
  1366. buf.append(' ');
  1367. }
  1368. for (int i=0; children != null && i < children.size(); i++) {
  1369. BaseTree t=(BaseTree)children.get(i);
  1370. if (i > 0) {
  1371. buf.append(' ');
  1372. }
  1373. buf.append(t.toStringTree());
  1374. }
  1375. if (!isNil()) {
  1376. buf.append(")");
  1377. }
  1378. return buf.toString();
  1379. }
  1380. NewName: toStringTree
  1381. OldCode: {
  1382. Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
  1383. String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1384. String found=g.getRule("A").tree.toStringTree();
  1385. assertEquals(expecting,found);
  1386. }
  1387. OldName: testNakeRulePlusInLexer
  1388. avg: 4.545454545454546
  1389. name of old: testRulePlus
  1390. Outcome: false
  1391. NewCode: {
  1392. if (children == null || children.size() == 0) {
  1393. return this.toString();
  1394. }
  1395. StringBuffer buf=new StringBuffer();
  1396. if (!isNil()) {
  1397. buf.append("(");
  1398. buf.append(this.toString());
  1399. buf.append(' ');
  1400. }
  1401. for (int i=0; children != null && i < children.size(); i++) {
  1402. BaseTree t=(BaseTree)children.get(i);
  1403. if (i > 0) {
  1404. buf.append(' ');
  1405. }
  1406. buf.append(t.toStringTree());
  1407. }
  1408. if (!isNil()) {
  1409. buf.append(")");
  1410. }
  1411. return buf.toString();
  1412. }
  1413. NewName: toStringTree
  1414. OldCode: {
  1415. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
  1416. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1417. String found=g.getRule("a").tree.toStringTree();
  1418. assertEquals(expecting,found);
  1419. }
  1420. OldName: testRulePlus
  1421. avg: 4.545454545454546
  1422. name of old: testNakedRulePlus
  1423. Outcome: false
  1424. NewCode: {
  1425. if (children == null || children.size() == 0) {
  1426. return this.toString();
  1427. }
  1428. StringBuffer buf=new StringBuffer();
  1429. if (!isNil()) {
  1430. buf.append("(");
  1431. buf.append(this.toString());
  1432. buf.append(' ');
  1433. }
  1434. for (int i=0; children != null && i < children.size(); i++) {
  1435. BaseTree t=(BaseTree)children.get(i);
  1436. if (i > 0) {
  1437. buf.append(' ');
  1438. }
  1439. buf.append(t.toStringTree());
  1440. }
  1441. if (!isNil()) {
  1442. buf.append(")");
  1443. }
  1444. return buf.toString();
  1445. }
  1446. NewName: toStringTree
  1447. OldCode: {
  1448. Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
  1449. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1450. String found=g.getRule("a").tree.toStringTree();
  1451. assertEquals(expecting,found);
  1452. }
  1453. OldName: testNakedRulePlus
  1454. avg: 4.545454545454546
  1455. name of old: testRuleOptional
  1456. Outcome: false
  1457. NewCode: {
  1458. if (children == null || children.size() == 0) {
  1459. return this.toString();
  1460. }
  1461. StringBuffer buf=new StringBuffer();
  1462. if (!isNil()) {
  1463. buf.append("(");
  1464. buf.append(this.toString());
  1465. buf.append(' ');
  1466. }
  1467. for (int i=0; children != null && i < children.size(); i++) {
  1468. BaseTree t=(BaseTree)children.get(i);
  1469. if (i > 0) {
  1470. buf.append(' ');
  1471. }
  1472. buf.append(t.toStringTree());
  1473. }
  1474. if (!isNil()) {
  1475. buf.append(")");
  1476. }
  1477. return buf.toString();
  1478. }
  1479. NewName: toStringTree
  1480. OldCode: {
  1481. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
  1482. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1483. String found=g.getRule("a").tree.toStringTree();
  1484. assertEquals(expecting,found);
  1485. }
  1486. OldName: testRuleOptional
  1487. avg: 4.545454545454546
  1488. name of old: testNakedRuleOptional
  1489. Outcome: false
  1490. NewCode: {
  1491. if (children == null || children.size() == 0) {
  1492. return this.toString();
  1493. }
  1494. StringBuffer buf=new StringBuffer();
  1495. if (!isNil()) {
  1496. buf.append("(");
  1497. buf.append(this.toString());
  1498. buf.append(' ');
  1499. }
  1500. for (int i=0; children != null && i < children.size(); i++) {
  1501. BaseTree t=(BaseTree)children.get(i);
  1502. if (i > 0) {
  1503. buf.append(' ');
  1504. }
  1505. buf.append(t.toStringTree());
  1506. }
  1507. if (!isNil()) {
  1508. buf.append(")");
  1509. }
  1510. return buf.toString();
  1511. }
  1512. NewName: toStringTree
  1513. OldCode: {
  1514. Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
  1515. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1516. String found=g.getRule("a").tree.toStringTree();
  1517. assertEquals(expecting,found);
  1518. }
  1519. OldName: testNakedRuleOptional
  1520. avg: 4.545454545454546
  1521. name of old: testRuleStar
  1522. Outcome: false
  1523. NewCode: {
  1524. if (children == null || children.size() == 0) {
  1525. return this.toString();
  1526. }
  1527. StringBuffer buf=new StringBuffer();
  1528. if (!isNil()) {
  1529. buf.append("(");
  1530. buf.append(this.toString());
  1531. buf.append(' ');
  1532. }
  1533. for (int i=0; children != null && i < children.size(); i++) {
  1534. BaseTree t=(BaseTree)children.get(i);
  1535. if (i > 0) {
  1536. buf.append(' ');
  1537. }
  1538. buf.append(t.toStringTree());
  1539. }
  1540. if (!isNil()) {
  1541. buf.append(")");
  1542. }
  1543. return buf.toString();
  1544. }
  1545. NewName: toStringTree
  1546. OldCode: {
  1547. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
  1548. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1549. String found=g.getRule("a").tree.toStringTree();
  1550. assertEquals(expecting,found);
  1551. }
  1552. OldName: testRuleStar
  1553. avg: 4.545454545454546
  1554. name of old: testNakedRuleStar
  1555. Outcome: false
  1556. NewCode: {
  1557. if (children == null || children.size() == 0) {
  1558. return this.toString();
  1559. }
  1560. StringBuffer buf=new StringBuffer();
  1561. if (!isNil()) {
  1562. buf.append("(");
  1563. buf.append(this.toString());
  1564. buf.append(' ');
  1565. }
  1566. for (int i=0; children != null && i < children.size(); i++) {
  1567. BaseTree t=(BaseTree)children.get(i);
  1568. if (i > 0) {
  1569. buf.append(' ');
  1570. }
  1571. buf.append(t.toStringTree());
  1572. }
  1573. if (!isNil()) {
  1574. buf.append(")");
  1575. }
  1576. return buf.toString();
  1577. }
  1578. NewName: toStringTree
  1579. OldCode: {
  1580. Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
  1581. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1582. String found=g.getRule("a").tree.toStringTree();
  1583. assertEquals(expecting,found);
  1584. }
  1585. OldName: testNakedRuleStar
  1586. avg: 4.545454545454546
  1587. name of old: testCharStar
  1588. Outcome: false
  1589. NewCode: {
  1590. if (children == null || children.size() == 0) {
  1591. return this.toString();
  1592. }
  1593. StringBuffer buf=new StringBuffer();
  1594. if (!isNil()) {
  1595. buf.append("(");
  1596. buf.append(this.toString());
  1597. buf.append(' ');
  1598. }
  1599. for (int i=0; children != null && i < children.size(); i++) {
  1600. BaseTree t=(BaseTree)children.get(i);
  1601. if (i > 0) {
  1602. buf.append(' ');
  1603. }
  1604. buf.append(t.toStringTree());
  1605. }
  1606. if (!isNil()) {
  1607. buf.append(")");
  1608. }
  1609. return buf.toString();
  1610. }
  1611. NewName: toStringTree
  1612. OldCode: {
  1613. Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
  1614. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1615. String found=g.getRule("a").tree.toStringTree();
  1616. assertEquals(expecting,found);
  1617. }
  1618. OldName: testCharStar
  1619. avg: 4.545454545454546
  1620. name of old: testCharStarInLexer
  1621. Outcome: false
  1622. NewCode: {
  1623. if (children == null || children.size() == 0) {
  1624. return this.toString();
  1625. }
  1626. StringBuffer buf=new StringBuffer();
  1627. if (!isNil()) {
  1628. buf.append("(");
  1629. buf.append(this.toString());
  1630. buf.append(' ');
  1631. }
  1632. for (int i=0; children != null && i < children.size(); i++) {
  1633. BaseTree t=(BaseTree)children.get(i);
  1634. if (i > 0) {
  1635. buf.append(' ');
  1636. }
  1637. buf.append(t.toStringTree());
  1638. }
  1639. if (!isNil()) {
  1640. buf.append(")");
  1641. }
  1642. return buf.toString();
  1643. }
  1644. NewName: toStringTree
  1645. OldCode: {
  1646. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
  1647. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1648. String found=g.getRule("B").tree.toStringTree();
  1649. assertEquals(expecting,found);
  1650. }
  1651. OldName: testCharStarInLexer
  1652. avg: 4.545454545454546
  1653. name of old: testStringStar
  1654. Outcome: false
  1655. NewCode: {
  1656. if (children == null || children.size() == 0) {
  1657. return this.toString();
  1658. }
  1659. StringBuffer buf=new StringBuffer();
  1660. if (!isNil()) {
  1661. buf.append("(");
  1662. buf.append(this.toString());
  1663. buf.append(' ');
  1664. }
  1665. for (int i=0; children != null && i < children.size(); i++) {
  1666. BaseTree t=(BaseTree)children.get(i);
  1667. if (i > 0) {
  1668. buf.append(' ');
  1669. }
  1670. buf.append(t.toStringTree());
  1671. }
  1672. if (!isNil()) {
  1673. buf.append(")");
  1674. }
  1675. return buf.toString();
  1676. }
  1677. NewName: toStringTree
  1678. OldCode: {
  1679. Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
  1680. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1681. String found=g.getRule("a").tree.toStringTree();
  1682. assertEquals(expecting,found);
  1683. }
  1684. OldName: testStringStar
  1685. avg: 4.545454545454546
  1686. name of old: testStringStarInLexer
  1687. Outcome: false
  1688. NewCode: {
  1689. if (children == null || children.size() == 0) {
  1690. return this.toString();
  1691. }
  1692. StringBuffer buf=new StringBuffer();
  1693. if (!isNil()) {
  1694. buf.append("(");
  1695. buf.append(this.toString());
  1696. buf.append(' ');
  1697. }
  1698. for (int i=0; children != null && i < children.size(); i++) {
  1699. BaseTree t=(BaseTree)children.get(i);
  1700. if (i > 0) {
  1701. buf.append(' ');
  1702. }
  1703. buf.append(t.toStringTree());
  1704. }
  1705. if (!isNil()) {
  1706. buf.append(")");
  1707. }
  1708. return buf.toString();
  1709. }
  1710. NewName: toStringTree
  1711. OldCode: {
  1712. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
  1713. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1714. String found=g.getRule("B").tree.toStringTree();
  1715. assertEquals(expecting,found);
  1716. }
  1717. OldName: testStringStarInLexer
  1718. avg: 4.545454545454546
  1719. name of old: testCharPlus
  1720. Outcome: false
  1721. NewCode: {
  1722. if (children == null || children.size() == 0) {
  1723. return this.toString();
  1724. }
  1725. StringBuffer buf=new StringBuffer();
  1726. if (!isNil()) {
  1727. buf.append("(");
  1728. buf.append(this.toString());
  1729. buf.append(' ');
  1730. }
  1731. for (int i=0; children != null && i < children.size(); i++) {
  1732. BaseTree t=(BaseTree)children.get(i);
  1733. if (i > 0) {
  1734. buf.append(' ');
  1735. }
  1736. buf.append(t.toStringTree());
  1737. }
  1738. if (!isNil()) {
  1739. buf.append(")");
  1740. }
  1741. return buf.toString();
  1742. }
  1743. NewName: toStringTree
  1744. OldCode: {
  1745. Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
  1746. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1747. String found=g.getRule("a").tree.toStringTree();
  1748. assertEquals(expecting,found);
  1749. }
  1750. OldName: testCharPlus
  1751. avg: 4.545454545454546
  1752. name of old: testCharPlusInLexer
  1753. Outcome: false
  1754. NewCode: {
  1755. if (children == null || children.size() == 0) {
  1756. return this.toString();
  1757. }
  1758. StringBuffer buf=new StringBuffer();
  1759. if (!isNil()) {
  1760. buf.append("(");
  1761. buf.append(this.toString());
  1762. buf.append(' ');
  1763. }
  1764. for (int i=0; children != null && i < children.size(); i++) {
  1765. BaseTree t=(BaseTree)children.get(i);
  1766. if (i > 0) {
  1767. buf.append(' ');
  1768. }
  1769. buf.append(t.toStringTree());
  1770. }
  1771. if (!isNil()) {
  1772. buf.append(")");
  1773. }
  1774. return buf.toString();
  1775. }
  1776. NewName: toStringTree
  1777. OldCode: {
  1778. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
  1779. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1780. String found=g.getRule("B").tree.toStringTree();
  1781. assertEquals(expecting,found);
  1782. }
  1783. OldName: testCharPlusInLexer
  1784. avg: 4.545454545454546
  1785. name of old: testCharOptional
  1786. Outcome: false
  1787. NewCode: {
  1788. if (children == null || children.size() == 0) {
  1789. return this.toString();
  1790. }
  1791. StringBuffer buf=new StringBuffer();
  1792. if (!isNil()) {
  1793. buf.append("(");
  1794. buf.append(this.toString());
  1795. buf.append(' ');
  1796. }
  1797. for (int i=0; children != null && i < children.size(); i++) {
  1798. BaseTree t=(BaseTree)children.get(i);
  1799. if (i > 0) {
  1800. buf.append(' ');
  1801. }
  1802. buf.append(t.toStringTree());
  1803. }
  1804. if (!isNil()) {
  1805. buf.append(")");
  1806. }
  1807. return buf.toString();
  1808. }
  1809. NewName: toStringTree
  1810. OldCode: {
  1811. Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
  1812. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1813. String found=g.getRule("a").tree.toStringTree();
  1814. assertEquals(expecting,found);
  1815. }
  1816. OldName: testCharOptional
  1817. avg: 4.545454545454546
  1818. name of old: testCharOptionalInLexer
  1819. Outcome: false
  1820. NewCode: {
  1821. if (children == null || children.size() == 0) {
  1822. return this.toString();
  1823. }
  1824. StringBuffer buf=new StringBuffer();
  1825. if (!isNil()) {
  1826. buf.append("(");
  1827. buf.append(this.toString());
  1828. buf.append(' ');
  1829. }
  1830. for (int i=0; children != null && i < children.size(); i++) {
  1831. BaseTree t=(BaseTree)children.get(i);
  1832. if (i > 0) {
  1833. buf.append(' ');
  1834. }
  1835. buf.append(t.toStringTree());
  1836. }
  1837. if (!isNil()) {
  1838. buf.append(")");
  1839. }
  1840. return buf.toString();
  1841. }
  1842. NewName: toStringTree
  1843. OldCode: {
  1844. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
  1845. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1846. String found=g.getRule("B").tree.toStringTree();
  1847. assertEquals(expecting,found);
  1848. }
  1849. OldName: testCharOptionalInLexer
  1850. avg: 4.545454545454546
  1851. name of old: testCharRangePlus
  1852. Outcome: false
  1853. NewCode: {
  1854. if (children == null || children.size() == 0) {
  1855. return this.toString();
  1856. }
  1857. StringBuffer buf=new StringBuffer();
  1858. if (!isNil()) {
  1859. buf.append("(");
  1860. buf.append(this.toString());
  1861. buf.append(' ');
  1862. }
  1863. for (int i=0; children != null && i < children.size(); i++) {
  1864. BaseTree t=(BaseTree)children.get(i);
  1865. if (i > 0) {
  1866. buf.append(' ');
  1867. }
  1868. buf.append(t.toStringTree());
  1869. }
  1870. if (!isNil()) {
  1871. buf.append(")");
  1872. }
  1873. return buf.toString();
  1874. }
  1875. NewName: toStringTree
  1876. OldCode: {
  1877. Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
  1878. String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1879. String found=g.getRule("ID").tree.toStringTree();
  1880. assertEquals(expecting,found);
  1881. }
  1882. OldName: testCharRangePlus
  1883. avg: 4.545454545454546
  1884. name of old: testLabel
  1885. Outcome: false
  1886. NewCode: {
  1887. if (children == null || children.size() == 0) {
  1888. return this.toString();
  1889. }
  1890. StringBuffer buf=new StringBuffer();
  1891. if (!isNil()) {
  1892. buf.append("(");
  1893. buf.append(this.toString());
  1894. buf.append(' ');
  1895. }
  1896. for (int i=0; children != null && i < children.size(); i++) {
  1897. BaseTree t=(BaseTree)children.get(i);
  1898. if (i > 0) {
  1899. buf.append(' ');
  1900. }
  1901. buf.append(t.toStringTree());
  1902. }
  1903. if (!isNil()) {
  1904. buf.append(")");
  1905. }
  1906. return buf.toString();
  1907. }
  1908. NewName: toStringTree
  1909. OldCode: {
  1910. Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
  1911. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1912. String found=g.getRule("a").tree.toStringTree();
  1913. assertEquals(expecting,found);
  1914. }
  1915. OldName: testLabel
  1916. avg: 4.545454545454546
  1917. name of old: testLabelOfOptional
  1918. Outcome: false
  1919. NewCode: {
  1920. if (children == null || children.size() == 0) {
  1921. return this.toString();
  1922. }
  1923. StringBuffer buf=new StringBuffer();
  1924. if (!isNil()) {
  1925. buf.append("(");
  1926. buf.append(this.toString());
  1927. buf.append(' ');
  1928. }
  1929. for (int i=0; children != null && i < children.size(); i++) {
  1930. BaseTree t=(BaseTree)children.get(i);
  1931. if (i > 0) {
  1932. buf.append(' ');
  1933. }
  1934. buf.append(t.toStringTree());
  1935. }
  1936. if (!isNil()) {
  1937. buf.append(")");
  1938. }
  1939. return buf.toString();
  1940. }
  1941. NewName: toStringTree
  1942. OldCode: {
  1943. Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
  1944. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1945. String found=g.getRule("a").tree.toStringTree();
  1946. assertEquals(expecting,found);
  1947. }
  1948. OldName: testLabelOfOptional
  1949. avg: 4.545454545454546
  1950. name of old: testLabelOfClosure
  1951. Outcome: false
  1952. NewCode: {
  1953. if (children == null || children.size() == 0) {
  1954. return this.toString();
  1955. }
  1956. StringBuffer buf=new StringBuffer();
  1957. if (!isNil()) {
  1958. buf.append("(");
  1959. buf.append(this.toString());
  1960. buf.append(' ');
  1961. }
  1962. for (int i=0; children != null && i < children.size(); i++) {
  1963. BaseTree t=(BaseTree)children.get(i);
  1964. if (i > 0) {
  1965. buf.append(' ');
  1966. }
  1967. buf.append(t.toStringTree());
  1968. }
  1969. if (!isNil()) {
  1970. buf.append(")");
  1971. }
  1972. return buf.toString();
  1973. }
  1974. NewName: toStringTree
  1975. OldCode: {
  1976. Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
  1977. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  1978. String found=g.getRule("a").tree.toStringTree();
  1979. assertEquals(expecting,found);
  1980. }
  1981. OldName: testLabelOfClosure
  1982. avg: 4.545454545454546
  1983. name of old: testRuleLabel
  1984. Outcome: false
  1985. NewCode: {
  1986. if (children == null || children.size() == 0) {
  1987. return this.toString();
  1988. }
  1989. StringBuffer buf=new StringBuffer();
  1990. if (!isNil()) {
  1991. buf.append("(");
  1992. buf.append(this.toString());
  1993. buf.append(' ');
  1994. }
  1995. for (int i=0; children != null && i < children.size(); i++) {
  1996. BaseTree t=(BaseTree)children.get(i);
  1997. if (i > 0) {
  1998. buf.append(' ');
  1999. }
  2000. buf.append(t.toStringTree());
  2001. }
  2002. if (!isNil()) {
  2003. buf.append(")");
  2004. }
  2005. return buf.toString();
  2006. }
  2007. NewName: toStringTree
  2008. OldCode: {
  2009. Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
  2010. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2011. String found=g.getRule("a").tree.toStringTree();
  2012. assertEquals(expecting,found);
  2013. }
  2014. OldName: testRuleLabel
  2015. avg: 4.545454545454546
  2016. name of old: testSetLabel
  2017. Outcome: false
  2018. NewCode: {
  2019. if (children == null || children.size() == 0) {
  2020. return this.toString();
  2021. }
  2022. StringBuffer buf=new StringBuffer();
  2023. if (!isNil()) {
  2024. buf.append("(");
  2025. buf.append(this.toString());
  2026. buf.append(' ');
  2027. }
  2028. for (int i=0; children != null && i < children.size(); i++) {
  2029. BaseTree t=(BaseTree)children.get(i);
  2030. if (i > 0) {
  2031. buf.append(' ');
  2032. }
  2033. buf.append(t.toStringTree());
  2034. }
  2035. if (!isNil()) {
  2036. buf.append(")");
  2037. }
  2038. return buf.toString();
  2039. }
  2040. NewName: toStringTree
  2041. OldCode: {
  2042. Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
  2043. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2044. String found=g.getRule("a").tree.toStringTree();
  2045. assertEquals(expecting,found);
  2046. }
  2047. OldName: testSetLabel
  2048. avg: 4.545454545454546
  2049. name of old: testNotSetLabel
  2050. Outcome: false
  2051. NewCode: {
  2052. if (children == null || children.size() == 0) {
  2053. return this.toString();
  2054. }
  2055. StringBuffer buf=new StringBuffer();
  2056. if (!isNil()) {
  2057. buf.append("(");
  2058. buf.append(this.toString());
  2059. buf.append(' ');
  2060. }
  2061. for (int i=0; children != null && i < children.size(); i++) {
  2062. BaseTree t=(BaseTree)children.get(i);
  2063. if (i > 0) {
  2064. buf.append(' ');
  2065. }
  2066. buf.append(t.toStringTree());
  2067. }
  2068. if (!isNil()) {
  2069. buf.append(")");
  2070. }
  2071. return buf.toString();
  2072. }
  2073. NewName: toStringTree
  2074. OldCode: {
  2075. Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
  2076. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2077. String found=g.getRule("a").tree.toStringTree();
  2078. assertEquals(expecting,found);
  2079. }
  2080. OldName: testNotSetLabel
  2081. avg: 4.545454545454546
  2082. name of old: testNotSetListLabel
  2083. Outcome: false
  2084. NewCode: {
  2085. if (children == null || children.size() == 0) {
  2086. return this.toString();
  2087. }
  2088. StringBuffer buf=new StringBuffer();
  2089. if (!isNil()) {
  2090. buf.append("(");
  2091. buf.append(this.toString());
  2092. buf.append(' ');
  2093. }
  2094. for (int i=0; children != null && i < children.size(); i++) {
  2095. BaseTree t=(BaseTree)children.get(i);
  2096. if (i > 0) {
  2097. buf.append(' ');
  2098. }
  2099. buf.append(t.toStringTree());
  2100. }
  2101. if (!isNil()) {
  2102. buf.append(")");
  2103. }
  2104. return buf.toString();
  2105. }
  2106. NewName: toStringTree
  2107. OldCode: {
  2108. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
  2109. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2110. String found=g.getRule("a").tree.toStringTree();
  2111. assertEquals(expecting,found);
  2112. }
  2113. OldName: testNotSetListLabel
  2114. avg: 4.545454545454546
  2115. name of old: testNotSetListLabelInLoop
  2116. Outcome: false
  2117. NewCode: {
  2118. if (children == null || children.size() == 0) {
  2119. return this.toString();
  2120. }
  2121. StringBuffer buf=new StringBuffer();
  2122. if (!isNil()) {
  2123. buf.append("(");
  2124. buf.append(this.toString());
  2125. buf.append(' ');
  2126. }
  2127. for (int i=0; children != null && i < children.size(); i++) {
  2128. BaseTree t=(BaseTree)children.get(i);
  2129. if (i > 0) {
  2130. buf.append(' ');
  2131. }
  2132. buf.append(t.toStringTree());
  2133. }
  2134. if (!isNil()) {
  2135. buf.append(")");
  2136. }
  2137. return buf.toString();
  2138. }
  2139. NewName: toStringTree
  2140. OldCode: {
  2141. Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
  2142. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2143. String found=g.getRule("a").tree.toStringTree();
  2144. assertEquals(expecting,found);
  2145. }
  2146. OldName: testNotSetListLabelInLoop
  2147. avg: 4.545454545454546
  2148. name of old: testRuleLabelOfPositiveClosure
  2149. Outcome: false
  2150. NewCode: {
  2151. if (children == null || children.size() == 0) {
  2152. return this.toString();
  2153. }
  2154. StringBuffer buf=new StringBuffer();
  2155. if (!isNil()) {
  2156. buf.append("(");
  2157. buf.append(this.toString());
  2158. buf.append(' ');
  2159. }
  2160. for (int i=0; children != null && i < children.size(); i++) {
  2161. BaseTree t=(BaseTree)children.get(i);
  2162. if (i > 0) {
  2163. buf.append(' ');
  2164. }
  2165. buf.append(t.toStringTree());
  2166. }
  2167. if (!isNil()) {
  2168. buf.append(")");
  2169. }
  2170. return buf.toString();
  2171. }
  2172. NewName: toStringTree
  2173. OldCode: {
  2174. Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
  2175. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2176. String found=g.getRule("a").tree.toStringTree();
  2177. assertEquals(expecting,found);
  2178. }
  2179. OldName: testRuleLabelOfPositiveClosure
  2180. avg: 4.545454545454546
  2181. name of old: testListLabelOfClosure
  2182. Outcome: false
  2183. NewCode: {
  2184. if (children == null || children.size() == 0) {
  2185. return this.toString();
  2186. }
  2187. StringBuffer buf=new StringBuffer();
  2188. if (!isNil()) {
  2189. buf.append("(");
  2190. buf.append(this.toString());
  2191. buf.append(' ');
  2192. }
  2193. for (int i=0; children != null && i < children.size(); i++) {
  2194. BaseTree t=(BaseTree)children.get(i);
  2195. if (i > 0) {
  2196. buf.append(' ');
  2197. }
  2198. buf.append(t.toStringTree());
  2199. }
  2200. if (!isNil()) {
  2201. buf.append(")");
  2202. }
  2203. return buf.toString();
  2204. }
  2205. NewName: toStringTree
  2206. OldCode: {
  2207. Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
  2208. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2209. String found=g.getRule("a").tree.toStringTree();
  2210. assertEquals(expecting,found);
  2211. }
  2212. OldName: testListLabelOfClosure
  2213. avg: 4.545454545454546
  2214. name of old: testListLabelOfClosure2
  2215. Outcome: false
  2216. NewCode: {
  2217. if (children == null || children.size() == 0) {
  2218. return this.toString();
  2219. }
  2220. StringBuffer buf=new StringBuffer();
  2221. if (!isNil()) {
  2222. buf.append("(");
  2223. buf.append(this.toString());
  2224. buf.append(' ');
  2225. }
  2226. for (int i=0; children != null && i < children.size(); i++) {
  2227. BaseTree t=(BaseTree)children.get(i);
  2228. if (i > 0) {
  2229. buf.append(' ');
  2230. }
  2231. buf.append(t.toStringTree());
  2232. }
  2233. if (!isNil()) {
  2234. buf.append(")");
  2235. }
  2236. return buf.toString();
  2237. }
  2238. NewName: toStringTree
  2239. OldCode: {
  2240. Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
  2241. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2242. String found=g.getRule("a").tree.toStringTree();
  2243. assertEquals(expecting,found);
  2244. }
  2245. OldName: testListLabelOfClosure2
  2246. avg: 4.545454545454546
  2247. name of old: testRuleListLabelOfPositiveClosure
  2248. Outcome: false
  2249. NewCode: {
  2250. if (children == null || children.size() == 0) {
  2251. return this.toString();
  2252. }
  2253. StringBuffer buf=new StringBuffer();
  2254. if (!isNil()) {
  2255. buf.append("(");
  2256. buf.append(this.toString());
  2257. buf.append(' ');
  2258. }
  2259. for (int i=0; children != null && i < children.size(); i++) {
  2260. BaseTree t=(BaseTree)children.get(i);
  2261. if (i > 0) {
  2262. buf.append(' ');
  2263. }
  2264. buf.append(t.toStringTree());
  2265. }
  2266. if (!isNil()) {
  2267. buf.append(")");
  2268. }
  2269. return buf.toString();
  2270. }
  2271. NewName: toStringTree
  2272. OldCode: {
  2273. Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
  2274. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2275. String found=g.getRule("a").tree.toStringTree();
  2276. assertEquals(expecting,found);
  2277. }
  2278. OldName: testRuleListLabelOfPositiveClosure
  2279. avg: 4.545454545454546
  2280. name of old: testRootTokenInStarLoop
  2281. Outcome: false
  2282. NewCode: {
  2283. if (children == null || children.size() == 0) {
  2284. return this.toString();
  2285. }
  2286. StringBuffer buf=new StringBuffer();
  2287. if (!isNil()) {
  2288. buf.append("(");
  2289. buf.append(this.toString());
  2290. buf.append(' ');
  2291. }
  2292. for (int i=0; children != null && i < children.size(); i++) {
  2293. BaseTree t=(BaseTree)children.get(i);
  2294. if (i > 0) {
  2295. buf.append(' ');
  2296. }
  2297. buf.append(t.toStringTree());
  2298. }
  2299. if (!isNil()) {
  2300. buf.append(")");
  2301. }
  2302. return buf.toString();
  2303. }
  2304. NewName: toStringTree
  2305. OldCode: {
  2306. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
  2307. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2308. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  2309. assertEquals(expecting,found);
  2310. }
  2311. OldName: testRootTokenInStarLoop
  2312. avg: 4.545454545454546
  2313. name of old: testActionInStarLoop
  2314. Outcome: false
  2315. NewCode: {
  2316. if (children == null || children.size() == 0) {
  2317. return this.toString();
  2318. }
  2319. StringBuffer buf=new StringBuffer();
  2320. if (!isNil()) {
  2321. buf.append("(");
  2322. buf.append(this.toString());
  2323. buf.append(' ');
  2324. }
  2325. for (int i=0; children != null && i < children.size(); i++) {
  2326. BaseTree t=(BaseTree)children.get(i);
  2327. if (i > 0) {
  2328. buf.append(' ');
  2329. }
  2330. buf.append(t.toStringTree());
  2331. }
  2332. if (!isNil()) {
  2333. buf.append(")");
  2334. }
  2335. return buf.toString();
  2336. }
  2337. NewName: toStringTree
  2338. OldCode: {
  2339. Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
  2340. String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2341. String found=g.getRule("synpred1_Expr").tree.toStringTree();
  2342. assertEquals(expecting,found);
  2343. }
  2344. OldName: testActionInStarLoop
  2345. avg: 4.545454545454546
  2346. name of new: getLine
  2347. name of old: TestASTConstruction
  2348. Outcome: false
  2349. NewCode: {
  2350. return 0;
  2351. }
  2352. NewName: getLine
  2353. OldCode: {
  2354. }
  2355. OldName: TestASTConstruction
  2356. avg: 33.33333333333333
  2357. name of old: testA
  2358. Outcome: false
  2359. NewCode: {
  2360. return 0;
  2361. }
  2362. NewName: getLine
  2363. OldCode: {
  2364. Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
  2365. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2366. String found=g.getRule("a").tree.toStringTree();
  2367. assertEquals(expecting,found);
  2368. }
  2369. OldName: testA
  2370. avg: 33.33333333333333
  2371. name of old: testNakeRulePlusInLexer
  2372. Outcome: false
  2373. NewCode: {
  2374. return 0;
  2375. }
  2376. NewName: getLine
  2377. OldCode: {
  2378. Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
  2379. String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2380. String found=g.getRule("A").tree.toStringTree();
  2381. assertEquals(expecting,found);
  2382. }
  2383. OldName: testNakeRulePlusInLexer
  2384. avg: 33.33333333333333
  2385. name of old: testRulePlus
  2386. Outcome: false
  2387. NewCode: {
  2388. return 0;
  2389. }
  2390. NewName: getLine
  2391. OldCode: {
  2392. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
  2393. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2394. String found=g.getRule("a").tree.toStringTree();
  2395. assertEquals(expecting,found);
  2396. }
  2397. OldName: testRulePlus
  2398. avg: 33.33333333333333
  2399. name of old: testNakedRulePlus
  2400. Outcome: false
  2401. NewCode: {
  2402. return 0;
  2403. }
  2404. NewName: getLine
  2405. OldCode: {
  2406. Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
  2407. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2408. String found=g.getRule("a").tree.toStringTree();
  2409. assertEquals(expecting,found);
  2410. }
  2411. OldName: testNakedRulePlus
  2412. avg: 33.33333333333333
  2413. name of old: testRuleOptional
  2414. Outcome: false
  2415. NewCode: {
  2416. return 0;
  2417. }
  2418. NewName: getLine
  2419. OldCode: {
  2420. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
  2421. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2422. String found=g.getRule("a").tree.toStringTree();
  2423. assertEquals(expecting,found);
  2424. }
  2425. OldName: testRuleOptional
  2426. avg: 33.33333333333333
  2427. name of old: testNakedRuleOptional
  2428. Outcome: false
  2429. NewCode: {
  2430. return 0;
  2431. }
  2432. NewName: getLine
  2433. OldCode: {
  2434. Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
  2435. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2436. String found=g.getRule("a").tree.toStringTree();
  2437. assertEquals(expecting,found);
  2438. }
  2439. OldName: testNakedRuleOptional
  2440. avg: 33.33333333333333
  2441. name of old: testRuleStar
  2442. Outcome: false
  2443. NewCode: {
  2444. return 0;
  2445. }
  2446. NewName: getLine
  2447. OldCode: {
  2448. Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
  2449. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2450. String found=g.getRule("a").tree.toStringTree();
  2451. assertEquals(expecting,found);
  2452. }
  2453. OldName: testRuleStar
  2454. avg: 33.33333333333333
  2455. name of old: testNakedRuleStar
  2456. Outcome: false
  2457. NewCode: {
  2458. return 0;
  2459. }
  2460. NewName: getLine
  2461. OldCode: {
  2462. Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
  2463. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2464. String found=g.getRule("a").tree.toStringTree();
  2465. assertEquals(expecting,found);
  2466. }
  2467. OldName: testNakedRuleStar
  2468. avg: 33.33333333333333
  2469. name of old: testCharStar
  2470. Outcome: false
  2471. NewCode: {
  2472. return 0;
  2473. }
  2474. NewName: getLine
  2475. OldCode: {
  2476. Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
  2477. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2478. String found=g.getRule("a").tree.toStringTree();
  2479. assertEquals(expecting,found);
  2480. }
  2481. OldName: testCharStar
  2482. avg: 33.33333333333333
  2483. name of old: testCharStarInLexer
  2484. Outcome: false
  2485. NewCode: {
  2486. return 0;
  2487. }
  2488. NewName: getLine
  2489. OldCode: {
  2490. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
  2491. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2492. String found=g.getRule("B").tree.toStringTree();
  2493. assertEquals(expecting,found);
  2494. }
  2495. OldName: testCharStarInLexer
  2496. avg: 33.33333333333333
  2497. name of old: testStringStar
  2498. Outcome: false
  2499. NewCode: {
  2500. return 0;
  2501. }
  2502. NewName: getLine
  2503. OldCode: {
  2504. Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
  2505. String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2506. String found=g.getRule("a").tree.toStringTree();
  2507. assertEquals(expecting,found);
  2508. }
  2509. OldName: testStringStar
  2510. avg: 33.33333333333333
  2511. name of old: testStringStarInLexer
  2512. Outcome: false
  2513. NewCode: {
  2514. return 0;
  2515. }
  2516. NewName: getLine
  2517. OldCode: {
  2518. Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
  2519. String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
  2520. String found=g.getRule("B").tree.toStringTree();
  2521. assertEquals(expecting,found);
  2522. }
  2523. OldName: testStringStarInLexer
  2524. avg: 33.33333333333333
  2525. name of old: testCharPlus
  2526. Outcome: false
  2527. NewCode: {
  2528. return 0;
  2529. }
  2530. NewName: getLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement