! ParseToken(type, data): ! Parses the given token, from the current word number wn, with exactly ! the specification of a general parsing routine. ! (Except that for "topic" tokens and prepositions, you need to supply ! a position in a valid grammar line as third argument.) ! ! Returns: ! GPR_REPARSE for "reconstructed input, please re-parse from scratch" ! GPR_PREPOSITION for "token accepted with no result" ! $ff00 + x for "please parse ParseToken(ELEMENTARY_TT, x) instead" ! 0 for "token accepted, result is the multiple object list" ! 1 for "token accepted, result is the number in parsed_number" ! object num for "token accepted with this object as result" ! -1 for "token rejected" ! ! (A) Analyse the token; handle all tokens not involving ! object lists and break down others into elementary tokens ! (B) Begin parsing an object list ! (C) Parse descriptors (articles, pronouns, etc.) in the list ! (D) Parse an object name ! (E) Parse connectives ("and", "but", etc.) and go back to (C) ! (F) Return the conclusion of parsing an object list ! ---------------------------------------------------------------------------- [ ParseToken given_ttype given_tdata token_n x y; x = lookahead; lookahead = NOUN_TOKEN; y = ParseToken__(given_ttype,given_tdata,token_n); if (y == GPR_REPARSE) Tokenise__(buffer,parse); lookahead = x; return y; ];