1 | static Pair<S, LS> ai_groupUsingProductionsAndReturnGroups(S s, AI_BottomUpParser1 p) {
|
2 | p.splitSplittables = false; |
3 | p.parse(javaTokNPunctuation(s)); |
4 | new LS groups; |
5 | for (AI_BottomUpParser1.Word g : p.groups()) {
|
6 | int i = g.wordFrom*2+1, j = g.wordTo*2-1; |
7 | S pre = get(p.cnc, i-1), post = get(p.cnc, j+1); |
8 | //print("pre=" + pre + ", post=" + post);
|
9 | groups.add(joinSubList(p.cnc, i, j+1)); |
10 | if (endsWith(pre, "{") && startsWith(post, "}"))
|
11 | continue; |
12 | tokPrepend(p.cnc, i, "{");
|
13 | tokAppend(p.cnc, j, "}"); |
14 | } |
15 | ret pair(join(p.cnc), groups); |
16 | } |
Began life as a copy of #1018199
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1021311 |
| Snippet name: | ai_groupUsingProductionsAndReturnGroups |
| Eternal ID of this version: | #1021311/4 |
| Text MD5: | 4f0905a07cfbb25b627e1e2da4e9b7dd |
| 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-08 15:39:02 |
| Source code size: | 591 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 488 / 520 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |