|
Has the conventional meaning -- evaluates to the expressed Unicode character.
Any unicode character should be able to be expressed literally, but the
"\u..." escape syntax hasn't yet been implemented.
We first need to decide what at level of abstraction this escape should
be processed. (Java makes a non-obvious choice that is probably correct
-- expand only this one prior to lexing -- in which case it would
disappear from the production below.)
|
constChar: \\b # backspace
\\t # tab
\\n # linefeed
\\f # formfeed
\\r # carriage return
\\" # double quote
\\' # single quote
\\\\ # backslash
\\$ # dollar sign
\\@ # at sign
\\u[o-9a-fA-F]+ # not yet implemented
\\digits # reserved
Char: 'constChar | non-blackslash-char'
|
|
<!ELEMENT Char #PCDATA>
Where, after processing the Minimal-XML escapes and whitespace
rules, the #PCDATA must conform to the above regex,
and should be written as it appears in the source text.
|
|
The E syntax can be used directly in Java with the same meaning
with the following exceptions:
in E |
translate to Java |
'\$' or '$'
|
'$'
|
'\@' or '@'
|
'@'
|
'\'' or '''
|
'\''
|
Future versions of the E compiler should try to determine when
it can use the scalar rather than widening it to a Character object.
However, in the general case (and currently the only case), this
will translate to
new Character(char-literal)
XXX Should probably instead call a function that checks if the argument
is in the ascii subset and, if so, indexes into a table of pre-allocated
Characters. |
|
'a'
|
|
same
|
|
<Char>a</Char>
|
|
new Character('a')
|
x |
|