|
A Scribe document is composed of Scribe expressions. A Scribe expression
can be:
- An atomic expression, such as a string of characters, a number.
- A list.
- A text.
Here are several examples of correct Scribe expressions:
- "foo", a string of characters composed of the
characters `f', `o'
and `o'.
- 123 3.14, two numbers.
- #t #f, the true and false
Scribe value.
- (bold "foo bar"), a list.
- [A text sample], a simple text containing
three words and no escape sequence.
- [Another text sample (that is still) simple],
another simple text.
- [Another ,(bold "text") sample],
a more complex text that contains two words (Another and sample)
and an expression (bold "text"). The escape sequence is introduced
with the `,(' characters.
|
Expressions are evaluated, thus (bold "foo")
has the effect of typesetting the word foo in
bold face to produce foo. Escape sequences
enable evaluation of expressions inside the text. Thus the text
[Another ,(bold "text") sample]
produces `Another text sample'.
On the other hand
[Another (bold "text") sample]
produces
`Another (bold "text") sample' because it does not contain
the escape sequence `,('.
<expr> --> <atom>
| <text>
| <list>
<list> --> (<expr>+)
<text> --> [any sequence but `,(' or a `,<list>']
<atom> --> <boolean>
| <integer>
| <float>
| <string>
| <color>
<integer> --> [0-9]+
<float> --> [0-9]+.[0-9]*
| [0-9]*.[0-9]+
<string> --> "..."
<color> --> <string>
| "#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]" |
|