To my knowledge (and surprise) no one has such a function. For the
"APL2 school", the parser logic would be based on the <i>APL Two by
Two</i> paper by Bunda & Gerth in APL84,
http://dl.acm.org/citation.cfm?id=801081;
for the "Dictionary APL school" (aka J), there are Table 2 and Section
II.I in <i>A Dictionary of APL</i>,
http://www.jsoftware.com/papers/APLDictionary.htm,
and Section II.E in <i>J Introduction and Dictionary</i>,
http://www.jsoftware.com/help/dictionary/dicte.htm . The J
implementation is designed and build around the table in Section II.E.
On Feb 7, 9:53 am, Aaron W. Hsu <
arcf...@sacrideo.us> wrote:
> Phil Last <
phil.l...@ntlworld.com> writes:
> >All APLs incorporate a parser so I guess that's NOT what you mean.
> >Can you elaborate by giving a short example of expected input and
> >output.
>
> Let's call this function PARSE∆APL. Now, given a character array of
> APL code (either a vector of characters with newlines, or a matrix
> of characters, with one row per line), I would like PARSE∆APL to give me
> some sort of syntax object for manipulating and analyzing the APL code. For
> example, maybe I give it this:
>
> PARSE∆APL '⍎(XAV=0)/''⍳20'''
> 0 1 ⍎ 1 2
> 0 3 2 9
> 1 2 XAV 3 6
> 1 1 = 6 7
> 1 4 0 7 8
> 0 1 / 9 10
> 0 5 ⍳20 11 14
>
> Or something like that, where I can get some sort of analysis of the nesting
> levels, the functions, and everything else. That is, a proper parser for APL
> code.
>
> --
> Aaron W. Hsu |
arcf...@sacrideo.us |
http://www.sacrideo.us