Yukihiro Matsumoto ha scritto:
> Hi,
> 
> In message "Re: Syntax error messages in 1.8.3"
>     on Thu, 16 Feb 2006 04:58:26 +0900, gabriele renzi <surrender_it / -remove-yahoo.it> writes:
> 
> |> I'm getting this too.  And this is a feature of bison 2.x, I guess.
> 
> |I see, but would it be possible to replace internal identifiers such as 
> |  tSTRING_DVAR with something user-readable?
> 
> I'm afraid not.  Bison doesn't give us a hook to replace it.  Correct
> me if I'm wrong.

mh.. I did some research/test, it seem you could just use something like

%token foo  "expressive name"

i.e. adding this:
%token tSTRING_DVAR "embedded code"
%token tSTRING_END   "end of String"
%token tSTRING_CONTENT "continuated String"
%token tREGEXP_END "end of Regexp"
%token tSTRING_DBEG "beginning of String"

to parse.y gives this result:

$miniruby
p(/)
^D
unterminated string meets end of file
syntax error, unexpected "end of String", expecting "continuated String" 
or "end of Regexp" or "beginning of String" or "embedded code"

(I think there is a switch in bison 2.1 to avoid " )

It is not a whole hook that could allow even better messages but it may 
be better than the current internals identifiers.

Hope this helps.