1 | static L<Pair<O>> ai_matchParseTrees_v2(PTElement a, PTElement b) { |
2 | new L<Pair<O>> out; |
3 | ai_matchParseTrees_v2_collect(a, b, out); |
4 | ret out; |
5 | } |
6 | |
7 | svoid ai_matchParseTrees_v2_collect(PTElement a, PTElement b, L<Pair<O>> out) { |
8 | PTElement a2 = ai_parseTree_descendToComposite(a); |
9 | PTElement b2 = ai_parseTree_descendToComposite(b); |
10 | |
11 | PTElement aa = or(a2, a), bb = or(b2, b); |
12 | |
13 | if (a2 != null && b2 != null) { |
14 | // The actual match is between the productions. |
15 | // We add the tree nodes too for reference. |
16 | addPair(out, |
17 | pairWithToStringFromA(a2/ChoosePart.reconstruction.production, a2), |
18 | pairWithToStringFromA(b2/ChoosePart.reconstruction.production, b2)); |
19 | ai_matchParseTrees_v2_collect(first(a2.children), first(b2.children), out); |
20 | ai_matchParseTrees_v2_collect(second(a2.children), second(b2.children), out); |
21 | } else |
22 | addPair(out, aa, bb); |
23 | } |
Began life as a copy of #1017424
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017429 |
Snippet name: | ai_matchParseTrees_v2 |
Eternal ID of this version: | #1017429/6 |
Text MD5: | 260d22a881b7c75467df85b80f999ebf |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-20 15:34:20 |
Source code size: | 904 bytes / 23 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 328 / 379 |
Version history: | 5 change(s) |
Referenced in: | [show references] |