This is an "integer" modification of Raul's annotated state table:

STATE =: +. ". & > }. cutLF (0 :0)
  item0  item1  other
  1j1    2j1    1j0   NB. initial state
  1j1    0j2    0j3   NB. state 1, found an item 0
  0j0    0j0    0j0   NB. go to initial state
)


   NB. base configuration

   cutLF
3 : 'if. L. y do. y else. a: -.~ <;._2 y,LF end.'

   a.i.LF
10

Date: Fri, 25 Apr 2014 12:39:26 +0100 From: Ian Clark <[email protected]> To: Programming forum <[email protected]> Subject: [Jprogramming] Convenient input of x-argument of Syntax Machine (; :) Message-ID: <CAB2g=gcfj7v+qnmbfakncble30m_wsxgjk2ypuaawgvyf-s...@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 @Raul Some time ago I remember seeing a code example by you of a state transition table as part of the left argument of a syntax machine defined using (;:). For the sake of newcomers, this is a rank-3 array, but you defined it using (0 : 0) --or "noun define" --which is not a common way of doing it but really convenient. I'd like to use your code example in a mini-article about (0 : 0) and its uses. I've searched for your sample code but can't find it. -- Can you please point me to it? -- Is there a jwiki page showing it? IanClark

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to