I have a quarter million lines of FORTRAN written over the years in the
various versions. Mostly f77 using ! comments, but not entirely. My
goal: convert the entire code to f2008. Parts A, B, and C are
continuation mark, code, and comment. At this stage I'm addressing
various forms of continuation lines, an example:
call s( ! comment maybe
! intervening remarks
*arg)
character*8 a=/'hi'/ ! or whatever
becomes
call s& ! comment maybe
! intervening remarks
&arg)
character(len=8) :: a = (/'hi'/) ! fixed with sed
Later I'll have emacs reindent the whole thing. Such transformations
ignore replacing common blocks with modules. A build with gfortran will
catch problems that our current compiler does not. Transforming the
code with j makes my job fun, whereas becoming an elisp expert hasn't
ever grabbed my attention.
On 01/28/2014 07:00 AM, [email protected] wrote:
Message: 1
Date: Mon, 27 Jan 2014 22:30:14 -0500
From: David Lambert <[email protected]>
To: chat <[email protected]>
Subject: [Jchat] FSM enhancement proposal
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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.
------------------------------
Message: 2
Date: Mon, 27 Jan 2014 22:39:23 -0500
From: Raul Miller <[email protected]>
To: Chat forum <[email protected]>
Subject: Re: [Jchat] FSM enhancement proposal
Message-ID:
<CAD2jOU_tfv6mDdU0o_E5nteCf0k9=v1x_isiaph1omscsud...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
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,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm