Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Preposition Chain

    [A small utility for runs of prepositions.]

    To decide if (word - an understood word) is one of the slashed synonyms that start at (Nth - a number) position (this is PrepositionChain):
        if the Nth element of the grammar line data as an understood word is the word, yes;
        repeat running Nth through the slashed synonyms:
            if the Nth element of the grammar line data as an understood word is the word, yes;
        no.
        
    To decide what number is (Nth - a number) advanced past the slashed synonyms:
        repeat running Nth through the slashed synonyms:
            do nothing;
        decide on Nth.
        

    To repeat running (index - an existing number variable) through the slashed synonyms begin -- end:
    (- for ( cacheval4 = ((line_token-->{index})->0 & (+the first slashed synonym+) ~= 0)
            : cacheval4
            : ++{index},
             cacheval4 = ((line_token-->{index} ~= (+the end of line token+)) && (((line_token-->{index})->0 & (+the last slashed synonym+)) ~= 0))
            ) -).



    [ PrepositionChain wd index;
    if (line_tdata-->index == wd) return wd;
    if ((line_token-->index)->0 & $20 == 0) return -1;
    do {
    if (line_tdata-->index == wd) return wd;
    index++;
    } until ((line_token-->index == ENDIT_TOKEN) || (((line_token-->index)->0 & $10) == 0));
    return -1;
    ]