home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / cpm68k / snobol4.lbr / RSENT.RQF / RSENT.RFF
Text File  |  1986-05-22  |  3KB  |  70 lines

  1. .. -*-save,fill,fillw:70,indent:0-*-
  2. ..
  3. .. rsent.rff - rsentence description
  4. .. Robert Heller. Created: Tue Feb 25, 1986 18:39:37.03
  5. .. Last Mod: 
  6. .. 
  7. .. (c) Copyright 1986 by Robert Heller
  8. ..     All Rights Reserved
  9. .. 
  10. .. 
  11. ..
  12. .ow 80
  13. .rm 70
  14. .in 10
  15. .sp 3
  16. .ce 4
  17. ^BRsentence Grammer File Syntax
  18. \date\
  19. Robert Heller
  20. \copyright\ Copyright 1986 by Robert Heller^b
  21. .par
  22. Rsentence's input file describes a grammer to use to generate random
  23. text.  This file defines "syntax" variables, at one of which is a goal
  24. symbol.  A syntax variable defination looks like:
  25. .sp 1
  26. .nf
  27. <^Bvarname^b>::=^Bvalue^b
  28. .fi
  29. .sp 1
  30. where ^Bvarname^b is the name of the symtax variable (can include any
  31. character except '<', '>', '(', ')', '=', or '|'). and ^Bvalue^b
  32. is the replacement value(s).  There can be more than one value - the
  33. values are separated by the '|' character.  Within a value, there are
  34. special forms for refering to other syntax variables, as well as other
  35. special processing. A value can take up more than one line.  Trailing
  36. whitespace characters and the newline character(s) between the lines
  37. are dropped (leading whitespace characters are preserved).  A value is
  38. terminated either by the start of a new defination (which must start
  39. on a fresh line) or by the end of the file or the word END in caps on
  40. a line by itself.  (The END in fact terminates the file - ANY text
  41. after the line with END by itself is ignored.  This is the only way to
  42. document a syntax file.)
  43. .par
  44. The value part can either consist of straight text (not containing any
  45. of the characters '<', '>', '(', ')' or '=') or it can contain one or
  46. more of the special forms:
  47. .nf
  48. .sp 1
  49. ^B<varname>^b        -    a syntax variable to be expanded
  50. ^B=varname\\regnum=^b -    a syntax variable to be expanded, with
  51.                       the expandsion saved in a register
  52. ^B(@regnum)^b        -    a register whose value is to be insert-
  53.                       ed
  54. ^B(/regnum)^b        -    a register whose length is to be insert-
  55.                       ed
  56. ^B(?number)^b        -    a random number between 1 and number is
  57.                       to be inserted
  58. .fi
  59. .sp 1
  60. .par
  61. There are 10 registers (numbered from 0 to 9), which can each hold a
  62. string.  They are mainly used to hold expandsions which need to be
  63. re-used. 
  64. .par
  65. Normally when there is more than one value for a syntax variable, each
  66. value as an equal chance of being selected.  If one, or more values
  67. need a greater chance, the value can be prefixed with #n# where n is a
  68. weight factor.  This is the number of chances a value has of being
  69. selected.
  70.