bison-patches
[Top][All Lists]
Advanced

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

Re: [updated PATCH] %language declaration


From: Joel E. Denny
Subject: Re: [updated PATCH] %language declaration
Date: Fri, 8 Dec 2006 15:03:19 -0500 (EST)

On Thu, 7 Dec 2006, Joel E. Denny wrote:

> On Thu, 7 Dec 2006, Joel E. Denny wrote:
> 
> >   lhs: rhs
> >     ${
> >       my $$var = "text";
> >       $$var =~ m/(ex)/;
> >       print "These must be escaped: $$1 ", '$$}', "\n";
> >     $}
> > 
> > And the output is:
> > 
> >   These must be escaped: tt $}
> > 
> > I didn't give too much thought to the above, so it's probably not the best 
> > syntax, but hopefully you get the idea.
> 
> Sigh.  Clearly the above is broken since $$ has a meaning already in Bison 
> actions, but surely some other notation could devised.

I must have been having a bad day.  I even forgot to fix the output....

This should make more sense:

  @{
    my @@$var = "text";
    @@$var =~ m/(ex)/;
    print "These must be escaped: @@$1 ", '@@@}', "\n";
  @}

would translate into:

    my $var = "text";
    $var =~ m/(ex)/;  
    print "These must be escaped: $1 ", '@}', "\n";

and the output would be:

  These must be escaped: ex @}

This should still allow all of Bison's usual symbols: $$, $1, @$, @1, and 
even $name and @name.  So, {CODE} would be parsed like C/C++ and 
@address@hidden 
would be parsed in the above language-independent manner.

Just an idea for the future, but this is getting off topic.

Paolo, I get the impression we've reached an understanding about %language 
and why it isn't harmful.  In that case, I will soon try to find time to 
review your patch in detail.




reply via email to

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