[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Java token names containing C trigraphs
From: |
Tim Landscheidt |
Subject: |
Re: Java token names containing C trigraphs |
Date: |
Sat, 05 Nov 2011 22:55:20 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Paul Eggert <address@hidden> wrote:
> I don't see the bug here. The Bison documentation says:
> Bison does not look for trigraphs, so if braced code uses
> trigraphs you should ensure that they do not affect the nesting of
> braces or the boundaries of comments, string literals, or character
> constants.
The problem lies not in trigraphs in braced code, but tri-
graphs in "literal string tokens" (so "token names" was
probably a misleading error on my part). Cf. "3.2 Symbols,
Terminal and Nonterminal":
| All the escape sequences used in string literals in C
| can be used in Bison as well, except that you must not
| use a null character within a string literal. Also,
| unlike Standard C, trigraphs have no special meaning in
| Bison string literals, nor is backslash-newline
| allowed. A literal string token must contain two or
| more characters; for a token containing just one
| character, use a character token (see above).
So the string "??=" is allowed in literal string tokens, but
the generated Java code does not compile.
Tim