123456789101112131415161718192021222324252627282930313233343536 |
- \d u
- \l utils.k
- \d pat
- \l excelpm.k
- \l ngnk-libs/csv/csv.k
- \d .
- /helpers
- / e exclusive
- slice: {[l;s;e] s_(e)#l};
- listize: {1_(,/(";",)'{"(",x,")"}'x)};
- split: {[l;di] idx: (-1,&(di~'l)),(#l); {slice[x;y[0]+1;y[1]+1]}[l]'(idx@(2':!#idx))};
- s2n: {[s] `i$s;}; // string to number
- parseidx: {core: slice[x;1;#x]; split[core;";"]};
- /:parseidx["[1;2]"];
- /:split["1;2;3";";"];
- tstkey: "States/Events"; / key indicating start of transition section
- cstkey: "Events"; / key indicating start of events condition section
- astkey: "Actions"; / key indicating start of actions section
- sectionkeys: (tstkey;cstkey;astkey);
- lines: {x,"\n",y}/(0: "SS.csv");
- table: csv.csv[lines];
- / excel patterns
- pats: *''|''(pat.run''table);
- :pats {
- u.ppr (x;y);
- u.ppr $[x[0]>4;slice[y;x[1];x[2]];'$'];
- }''table;
|