/ name analysis / character classes A:".abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVXYZ" N:"0123456789" C:":" B:"[" V:(A;N;C;B) V,:,_ci(!256)_dvl _ic,/V / build state machine state:{{.[x;(;y);:;z]}/[((#x),256)#-1;y;+x]} / A N C B X M:state[(1 0 0 0 0 2 2 3 0 0 2 2 3 0 0 1 0 4 0 0 1 0 0 5 0 1 0 0 0 0)]_ic V / takes a function and returns (args;locals;globals) names:{ e:-1_1_ 5:x a:();if["["=*e:di e;i:e?"]";a:";",1_ i#e;e:(1+i)_ e;a:1_'(&a=";")_ a] s:chop e;s@:&~"_"=s[;0];t:type's;l:(?ds's@&t=1)_dvl a;g:(?dk@ds's@&t=2)_dvl l,a `$(a;l;g)} / delete ... dq:{x@&~b|~=\~b:x="\""} / delete quotations dl:{x@&~k|0<':k:>/+\'x=/:"{}"} / delete lambdas db:{x _dvl" \t"} / delete blanks and tabs ds:{x@&x _lin A,N} / delete symbols di:{((x=" ")?0)_ x} / delete initial blanks dk:{x _dvl$`if`while`do} / delete keywords / finite state machine fsm:{cut[x;1_0 M\_ic x]} cut:{(&1=y i)_ x@:i:&y>0} chop:db'fsm dl dq@ / type analysis type:{:[~x[0]_in A;0;|/b:_sm[x;*T];T[1;b?1];2]} T:(("*::[[]*";"*::*";"*:*");1 2 1) \ names names