1 | sS ai_groupUsingProductions(S s, AI_BottomUpParser1 p) {
|
2 | p.splitSplittables = false; |
3 | p.parse(javaTokNPunctuation(s)); |
4 | for (AI_BottomUpParser1.Word g : p.groups()) {
|
5 | int i = g.wordFrom*2+1, j = g.wordTo*2-1; |
6 | S pre = get(p.cnc, i-1), post = get(p.cnc, j+1); |
7 | //print("pre=" + pre + ", post=" + post);
|
8 | if (endsWith(pre, "{") && startsWith(post, "}"))
|
9 | continue; |
10 | tokPrepend(p.cnc, i, "{");
|
11 | tokAppend(p.cnc, j, "}"); |
12 | } |
13 | ret join(p.cnc); |
14 | } |
Began life as a copy of #1018198
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018199 |
| Snippet name: | ai_groupUsingProductions |
| Eternal ID of this version: | #1018199/10 |
| Text MD5: | 3a7f127fd354cc8e4ff0c13b5563fea9 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-02-06 16:04:43 |
| Source code size: | 483 bytes / 14 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 638 / 687 |
| Version history: | 9 change(s) |
| Referenced in: | [show references] |