Download Jar. Libraryless. Click here for Pure Java version (8439L/60K).
!7 abstract sclass Proposal { toString { ret sfu(this); } } static noToString record TwoSplit(LS a, LS b) extends Proposal {} static noToString record ThreeSplit(LS a, LS b, LS c) extends Proposal {} svoid parse(LS tok) { // drop first and last if (l(tok) >= 3) emit(new ThreeSplit(ll(first(tok)), dropFirstAndLast_noNewList(tok), ll(last(tok)))); for (int i = 1; i < l(tok)-1; i++) emit(new TwoSplit(subList(tok, 0, i), subList(tok, i))); } p-exp { LS tok = javaTokC("[(a|b), (c|d), (e|f)]"); parse(tok); }
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026470 |
Snippet name: | Creator/Critic Parser Spike v1 |
Eternal ID of this version: | #1026470/5 |
Text MD5: | 895a8a33e45441a6fb2a887acb968378 |
Transpilation MD5: | 29f27059c2da48e1464250d49454e692 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-05 04:53:08 |
Source code size: | 545 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 312 / 872 |
Version history: | 4 change(s) |
Referenced in: | [show references] |