Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next

  • Book - The Parser Proper

    Chapter - Parser Proper

    [The main parser routine is something of a leviathan, and it has traditionally
    been divided into 11 lettered parts:

    (A) Get the input, do OOPS and AGAIN
    (B) Is it a direction, and so an implicit GO? If so go to (K)
    (C) Is anyone being addressed?
    (D) Get the command verb: try all the syntax lines for that verb
    (E) Break down a syntax line into analysed tokens
    (F) Look ahead for advance warning for |multiexcept|/|multiinside|
    (G) Parse each token in turn (calling |ParseToken| to do most of the work)
    (H) Cheaply parse otherwise unrecognised conversation and return
    (I) Print best possible error message
    (J) Retry the whole lot
    (K) Last thing: check for THEN and further instructions(s), return.

    This lettering has been preserved here, with the code under each letter
    now being the body of ``Parser Letter A'', ``Parser Letter B'' and so on.

    Note that there are three different places where a return can happen.
    The routine returns only when a sensible request has been made; for a
    fairly thorough description of its output, which is written into the
    |parser_results| array and also into several globals (see ``OrderOfPlay.i6t'').]