[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: %token QUOTE "\""

From: Satya
Subject: Re: Fwd: %token QUOTE "\""
Date: Mon, 24 Jul 2006 16:13:46 -0500

I poked into it a bit during the weekend; The problem is this:

In file parse-gram.y we have a rule for string_as_id:

string_as_id:  STRING { $$ = symbol_get (quotearg_style (c_quoting_style,
$1), @1); symbol_class_set ($$, token_sym, @1, false); }

The token returned by lexer (STRING) is a quote mark (")  but the result of
quotearg_style (c_quoting_style, $1) is this quote mark with a backslash
preceding it (and surrounded by quotes) ("\""); So in the symbol table, the
quote mark gets stored as a backslah and quote. When printed, the symbol
gets printed as such;  Infact the .output file also shows it as \" in the
description of the grammar. Is there a cure to it?


On 7/24/06, Paul Eggert <address@hidden> wrote:

Frans Englich <address@hidden> writes:

> Is this a bug in Bison?

Could be, but I don't know what the problem is yet,
Can you please supply a self-contained example so
that we can reproduce the problem?

> %token QUOTE                                "\""
> %token APOS                                 "'"
> When QUOTE is printed it literally prints: \". It hasn't "un-escaped"
> printing, although enough for parsing the grammar at compile time.

"When you have eliminated the impossible, whatever remains, however
improbable, must be the truth".
-Sherlock Holmes, The sign of four.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]