home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / PARSCOND.ICN < prev    next >
Text File  |  1991-09-05  |  861b  |  36 lines

  1. ############################################################################
  2. #
  3. #    Name:    parscond.icn
  4. #
  5. #    Title:    Condense parse tree
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    September 2, 1991
  10. #
  11. ############################################################################
  12. #
  13. #     Procedure to condense a parse tree produced by the output of pargen.icn
  14. #  and produce the string that was parsed.
  15. #
  16. #     The necessary recod declaration is provided by the program with which if
  17. #  is linked.
  18. #
  19. ############################################################################
  20. #
  21. #  See also:  parsgen.icn
  22. #
  23. ############################################################################
  24.  
  25. procedure parscond(R)
  26.    local result, x
  27.  
  28.    result := ""
  29.  
  30.    every x := !(R.alts) do
  31.      result ||:= string(x) | parscond(x)
  32.    
  33.    return result
  34.  
  35. end
  36.