|
@@ -2,12 +2,12 @@
|
|
/ e exclusive
|
|
/ e exclusive
|
|
slice: {[l;s;e] s_(e-1)#l};
|
|
slice: {[l;s;e] s_(e-1)#l};
|
|
listize: {1_(,/(";",)'{"(",x,")"}'x)};
|
|
listize: {1_(,/(";",)'{"(",x,")"}'x)};
|
|
-iscl: {i: `i$x; ((i>64) & (i<91))}; // is capital letter
|
|
|
|
-isdig: {i: `i$x; ((i>47) & (i<58))}; // is digit
|
|
|
|
-/ :`i$"A"; // 65
|
|
|
|
-/ :`i$"Z"; // 90
|
|
|
|
-/ :`i$"0"; // 48
|
|
|
|
-/ :`i$"9"; // 57
|
|
|
|
|
|
+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
|
|
tstkey: "States/Events"; / key indicating start of transition section
|
|
cstkey: "Events"; / key indicating start of events condition section
|
|
cstkey: "Events"; / key indicating start of events condition section
|
|
@@ -20,10 +20,16 @@ lines: 0: "SS.csv";
|
|
parsel: {[l] comi: &l=",";comi+:1;r: 2':!#comi;r: comi@r;r: (1 2#(0;r[0;0])),r;slice[l].'r};
|
|
parsel: {[l] comi: &l=",";comi+:1;r: 2':!#comi;r: comi@r;r: (1 2#(0;r[0;0])),r;slice[l].'r};
|
|
csv: parsel'lines;
|
|
csv: parsel'lines;
|
|
|
|
|
|
-:letters: &''(iscl'''csv);
|
|
|
|
-:digits: &''(isdig'''csv);
|
|
|
|
|
|
+kw:: "self";
|
|
|
|
+rep:: "t";
|
|
|
|
|
|
-csv@''letters
|
|
|
|
|
|
+deps:: (#csv;#csv[0])#0;
|
|
|
|
+
|
|
|
|
+fnr:{[l;k;rp] e:(#l)-(#k); r:!e; idx: &({y~x}[;k]'({slice[y;x;x+(#z)+1]}[;l;k]'r)); l{[last;x;y;z;r]left:x#last; right:(x+(#z))_last; (left,r,right;right)}[;;l;k;rp]/(|idx)};
|
|
|
|
+rd: {[r] deps[0;0]::1; r[0]}; // register dep
|
|
|
|
+dd: {[r] $[r[1;0]~"[";rd[r];r[0]]}; // detect dep
|
|
|
|
+/ :{[l;kw;rep] r: fnr[l;kw;rep]; $[(@r)=`C;r;dd[r]]}[;kw;rep]''csv;
|
|
|
|
+/ :deps;
|
|
|
|
|
|
/ initialize data
|
|
/ initialize data
|
|
/ f:<`"compiled_ss.k";
|
|
/ f:<`"compiled_ss.k";
|