I am having trouble understanding your specification. Do you mean that you have a sequence of letters, such as:
BBBCCCACBBBCBBAAAAABAABACACACC And you want to separate them into boxes whose letters are lexically increasing? I'd not bother with ;: for that, I'd do something like this: (] <;.1~ 1 , 2 >:/\ 'ABC' i. ]) 'BBBCCCACBBBCBBAAAAABAABACACACC' Though if you prefer gnu flex and bison, I'm sure you can do it that way too, with a little time and effort. Thanks, -- Raul On Mon, Jan 27, 2014 at 10:30 PM, David Lambert <[email protected]> wrote: > I have information of the forms ABC, AB, BC, AC, A, B, C which I'd like to > separate into 3 boxes. If a part is missing the box should be empty. I > think it is impossible with the current FSM implementation because it must > read a character to yield output. With only one character on input I cannot > obtain '';'';C as output, or any three boxes. I haven't investigated emit > vector but I don't see how it will help. The 3 boxes preserve the > classification work that's already been accomplished, and I can use _3&([\) > to generate a useful array. > > We could enhance the FSM retaining backward compatibility. I'd prefer to > pass a gerund as an additional part of x, have the Function code specify to > use it as an agenda determined by the output code. The agenda would > monadically process the matched items. It seems to me that such a j FSM > would have the full capability of the gnu flex program, excepting the > automatic generation of the state table. > > Perhaps a new output code to emit something ( ace if F is 0 otherwise i.0 ? > ) and change state without reading the next input item would be a simpler > solution to treat the case I've presented. > > Or this may be far too complicated and I need to write my own function. It > would surprise me if the gerund concept were not part of the original > implementation debate. And it would surprise me to learn that I understand > the FSM. For now I'll use a flex bison program. > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
