| quotes |
|
grammar |
| |
Five methods of quoting are available in Yoix.
Double-quotes (") for string literals and single-quotes (') for character literals
function as they would in Java or C.
In both cases, a number of escape sequences signaled by a backslash (\) character are
available. These are:
| \b |
backspace
| | \f |
formfeed
| | \n |
newline
| | \r |
carriage return
| | \\ |
backslash (without any escape significance)
| | \xXXXX |
hexidecimal representation of a character value, up to four hexidecimal digits can be present
| | \NNN |
octal representation of a character value, up to three octal digits can be present
|
In a single-quoted character literal, a backslash preceding a single-quote signals
that the single-quote is to be included in the string and not act to terminate the literal.
Similarly, in a double-quoted string literal, a backslash preceding a double-quote signals
that the double-quote is to be included in the string and not act to terminate the literal.
Moreover, backslashes at the end of a line exclude the line break that follows from the
string literal and allows the string literal to continue on the next line.
Finally, a backslash appearing outside of any of these situations is ignored and not included
in the string literal.
The pound-symbol (#) acts as a quoting character that is useful for expressing regular
expression patterns. It behaves the same as the double-quote except that octal number processing
is suppressed and backslashes appearing outside any special escaped meaning are retained in the
string literal rather than discarded. In this way,
\N
sequences indicating substitution in a regular expression can be expressed without resorting to
multiple backslashes.
The fourth quoting mechanism in Yoix involves separate left and right quote indicators involving
two characters each.
These are an at-sign / less-than pair (@<) for the left quote indicator and a greater-than /
at-sign pair (>@) for the right quote indicator.
This quote mechanism also behaves like the double-quote mechanism except than unescaped
newlines in the string literal do not cause a syntax error, but are instead included in the
string literal. Thus, this mechanism simplifies the expression of multi-line string literals.
The fifth and final quoting mechanism also involves separate left and right quote indicators, but
these involve three characters each.
The left quote triplet is at-sign / less-than / less-than (@<<) and the right quote triplet is
greather-then / greater-than / at-sign (>>@).
This quoting mechanism provides completely verbatim quoting. All characters between the
quote indicators, including newlines and backslashes, are accepted unchanged.
|
Yoix is a registered trademark of AT&T Inc.
|