I went through the wiki, with a text search on sequential machine,
looking for pages that might be of use here.

The first page I examined (working up from the bottom on my list of
plausible candidates) was

http://www.jsoftware.com/jwiki/Guides/Language%20FAQ/J%20BNF?highlight=%28sequential%29%7C%28machine%29

This led me to it's "See Also" link:
http://www.jsoftware.com/pipermail/chat/2007-November/000678.html

And, I noticed there a statement by Oleg Kobchenko:

   J uses ... interpreter, which is a context-sensitive
   bottom-up table-driven parser/executor:
     http://www.jsoftware.com/help/dictionary/dicte.htm

   (which is obviosly not recursive-descent).

And, from my point of view, this parser is obviously recursive descent.

That said, the typical recursive descent parser is a left to right
parser.  This is what the "LR" in various parser acronyms stands for.
J's parser is a right to left parser, so the parallel acronym would be
"RL".  [Technically, "LR" means "Left to right, producing a Rightmost
derivation".]

Secondly, most recursive descent parsers have "one token lookahead".
I have thought in the past that J uses "four token lookahead", but
this is not the case.  J uses one token lookahead (only for
assignment).  Instead, J uses four token "lookbehind".

Conceptually speaking, the J parser pops four tokens off the stack.
But this is just a description of the internal state of the parser,
and does not impact its status as a recursive descent parser.

A person might argue that "RL" and "LR" are not logically equivalent,
but I do not think that's relevant here.  Ultimately, the parser sees
a sequence of tokens and from an algorithmic point of view the
meanings of "left" and "right" are implemented in another module (the
one that breaks the input stream into words).  But the lexer -- the
module that breaks the input stream into words -- is not considered
when classifying the parser.

Anyways, I just had to get that off of my chest.

Some pages which look maybe interesting for learning about sequential
machines include (possibly in partially reversed order of relevance):

http://www.jsoftware.com/jwiki/Essays/Huffman%20Coding

http://www.jsoftware.com/jwiki/Essays/Regex%20Lexer

http://www.jsoftware.com/jwiki/Guides/Parsing

http://www.jsoftware.com/jwiki/SequentialMachine

http://www.jsoftware.com/jwiki/JWebServer/HttpParser

And, of course, the Sequential Machine lab is probably a very good
resource to start with.

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

Reply via email to