[Top][All Lists]

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

Re: syntax_error constructor is declared inline

From: Frank Heckenbach
Subject: Re: syntax_error constructor is declared inline
Date: Fri, 11 May 2018 05:24:31 +0200

Akim Demaille wrote:

> >> Your idea of letting Bison to keep track of the type does not work
> >> in mid-actions as it is needed to decide which copy constructor to
> >> use, unlike C then.
> > 
> > And likewise for %destructor and %printer.
> This is something I have not studied yet, I'll have to look at it.
> I'm really disappointed that we have to double-code the symbol types.

I think it's basically unavoidable. There really is both the static
type (which Bison uses to decide which reductions to apply) and the
dynamic type (which can be overridden with $<type>). So maybe
$<type> is not the best feature to begin with, but I guess that's a
moot point now. I don't currently use it at all (then again, my
parsers are not so time-critical), but apparently others do and it's
probably much too late to drop that feature (even if only in C++).

> I did not run benchmarks, but I expect more space and more time with
> std::variants.  Not to mention the C++-98/03 compatibility :)

That compatibility will be hard to keep if we want move semantics ...


reply via email to

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