mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 00:14:25 +00:00
1 line
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
.. -*-save,fill,fillw:70,indent:0-*-
|
||
|
||
..
|
||
|
||
.. rsent.rff - rsentence description
|
||
|
||
.. Robert Heller. Created: Tue Feb 25, 1986 18:39:37.03
|
||
|
||
.. Last Mod:
|
||
|
||
..
|
||
|
||
.. (c) Copyright 1986 by Robert Heller
|
||
|
||
.. All Rights Reserved
|
||
|
||
..
|
||
|
||
..
|
||
|
||
..
|
||
|
||
.ow 80
|
||
|
||
.rm 70
|
||
|
||
.in 10
|
||
|
||
.sp 3
|
||
|
||
.ce 4
|
||
|
||
^BRsentence Grammer File Syntax
|
||
|
||
\date\
|
||
|
||
Robert Heller
|
||
|
||
\copyright\ Copyright 1986 by Robert Heller^b
|
||
|
||
.par
|
||
|
||
Rsentence's input file describes a grammer to use to generate random
|
||
|
||
text. This file defines "syntax" variables, at one of which is a goal
|
||
|
||
symbol. A syntax variable defination looks like:
|
||
|
||
.sp 1
|
||
|
||
.nf
|
||
|
||
<^Bvarname^b>::=^Bvalue^b
|
||
|
||
.fi
|
||
|
||
.sp 1
|
||
|
||
where ^Bvarname^b is the name of the symtax variable (can include any
|
||
|
||
character except '<', '>', '(', ')', '=', or '|'). and ^Bvalue^b
|
||
|
||
is the replacement value(s). There can be more than one value - the
|
||
|
||
values are separated by the '|' character. Within a value, there are
|
||
|
||
special forms for refering to other syntax variables, as well as other
|
||
|
||
special processing. A value can take up more than one line. Trailing
|
||
|
||
whitespace characters and the newline character(s) between the lines
|
||
|
||
are dropped (leading whitespace characters are preserved). A value is
|
||
|
||
terminated either by the start of a new defination (which must start
|
||
|
||
on a fresh line) or by the end of the file or the word END in caps on
|
||
|
||
a line by itself. (The END in fact terminates the file - ANY text
|
||
|
||
after the line with END by itself is ignored. This is the only way to
|
||
|
||
document a syntax file.)
|
||
|
||
.par
|
||
|
||
The value part can either consist of straight text (not containing any
|
||
|
||
of the characters '<', '>', '(', ')' or '=') or it can contain one or
|
||
|
||
more of the special forms:
|
||
|
||
.nf
|
||
|
||
.sp 1
|
||
|
||
^B<varname>^b - a syntax variable to be expanded
|
||
|
||
^B=varname\\regnum=^b - a syntax variable to be expanded, with
|
||
|
||
the expandsion saved in a register
|
||
|
||
^B(@regnum)^b - a register whose value is to be insert-
|
||
|
||
ed
|
||
|
||
^B(/regnum)^b - a register whose length is to be insert-
|
||
|
||
ed
|
||
|
||
^B(?number)^b - a random number between 1 and number is
|
||
|
||
to be inserted
|
||
|
||
.fi
|
||
|
||
.sp 1
|
||
|
||
.par
|
||
|
||
There are 10 registers (numbered from 0 to 9), which can each hold a
|
||
|
||
string. They are mainly used to hold expandsions which need to be
|
||
|
||
re-used.
|
||
|
||
.par
|
||
|
||
Normally when there is more than one value for a syntax variable, each
|
||
|
||
value as an equal chance of being selected. If one, or more values
|
||
|
||
need a greater chance, the value can be prefixed with #n# where n is a
|
||
|
||
weight factor. This is the number of chances a value has of being
|
||
|
||
selected.
|
||
|
||
|