Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 10 - Alternatives (for use without Alternatives by Eric Eve)

    To decide if (item - a value of kind K) is either (v1 - K) or (v2 - K):
    (- ({item} == {v1} or {v2}) -).
    To decide if (item - a value of kind K) is either (v1 - K) or (v2 - K) or (v3 - K):
    (- ({item} == {v1} or {v2} or {v3}) -).
    To decide if (item - a value of kind K) is either (v1 - K) or (v2 - K) or (v3 - K) or (v4 - K):
    (- ({item} == {v1} or {v2} or {v3} or {v4}) -).
    To decide if (item - a value of kind K) is either (v1 - K) or (v2 - K) or (v3 - K) or (v4 - K) or (v5 - K):
    (- ({item} == {v1} or {v2} or {v3} or {v4} or {v5}) -).

    To decide if (item - a value of kind K) is neither (v1 - K) nor (v2 - K):
    (- ({item} ~= {v1} or {v2}) -).
    To decide if (item - a value of kind K) is neither (v1 - K) nor (v2 - K) nor (v3 - K):
    (- ({item} ~= {v1} or {v2} or {v3}) -).
    To decide if (item - a value of kind K) is neither (v1 - K) nor (v2 - K) nor (v3 - K) nor (v4 - K):
    (- ({item} ~= {v1} or {v2} or {v3} or {v4}) -).
    To decide if (item - a value of kind K) is neither (v1 - K) nor (v2 - K) nor (v3 - K) nor (v4 - K) nor (v5 - K):
    (- ({item} ~= {v1} or {v2} or {v3} or {v4} or {v5}) -).