Bison 3.0: semantic predicates are mis-scanned as invalid directives

2013-10-12 Thread Rici Lake
Bug report comes from SO: http://stackoverflow.com/questions/19330171/controlling-a-parse-with-arbitrary-predicates-not-working-in-bison Example failing grammar: The following was copied from bison manual section 1.5.4. It was minimized by leaving out second widget production; the two declaration

yyclearin does not invoke the lookahead token's %destructor

2018-02-07 Thread Rici Lake
(Collected from a StackOverflow question; see https://stackoverflow.com/questions/48672697/why-does-the-use-of-yyclearin-not-trigger-destructor-in-bison ) As indicated in the question and answer, yyclearin simply marks the lookahead token as YYEMPTY. Its associated value is not destructed, and wil

Re: C++11 move semantics

2018-03-10 Thread Rici Lake
On Mar 10, 2018 19:26, "Frank Heckenbach" wrote: Hans Åberg wrote: > >>> so expensive. Also bison by default reserve()s 200 entries, and I > > >>> Even if so, it's still a good idea to keep it, so vector basically > >>> never actually needs to reallocate. > >> > >> It depends on the gra

#line directives are incorrectly inserted in the middle of a line in semantic predicate tests.

2018-05-27 Thread Rici Lake
Collected from Stack Overflow question https://stackoverflow.com/questions/50550637/bison-semantic-predicate-syntax-error-stray Version: 3.04 (also fails on 3.01 and 3.02) Platform: Linux but I think it would be the same on any platform To reproduce, it is possible to use the semantic predicate t

Re: Bison C++ mid-rule value lost with variants

2018-06-17 Thread Rici Lake
I enthusiastically support this proposal. I agree with the preference for prefix positioning. The `%type` keyword is just noise, imho, and thus unnecessary. I like the `name={ code }` syntax, too, but it's probably too late for that. Perhaps `{ code }[name]` would be a plausible alternative synta

Re: position.hh compile error C4146 (VisualStudio 2017)

2018-08-18 Thread Rici Lake
Hi, Akim I'd try return 0 < rhs || 0 - (static_cast(rhs)) < lhs Or the redundant but harmless return 0 < rhs || static_cast(-(static_cast(rhs))) < lhs C4146 is a warning, not an error. It's telling you that if u is unsigned, -u is still unsigned. The intent is help people avoid doing t

Re: position.hh compile error C4146 (VisualStudio 2017)

2018-08-18 Thread Rici Lake
On Sat, Aug 18, 2018, 10:03 Akim Demaille wrote: > Hi Rici! > > > Le 18 août 2018 à 16:45, Rici Lake a écrit : > > > > Hi, Akim > > > > I'd try > > > > return 0 < rhs || 0 - (static_cast(rhs)) < lhs > > Good idea! > > &g

Re: position.hh compile error C4146 (VisualStudio 2017)

2018-08-18 Thread Rici Lake
Works for me. (Not that I tried it or anything :-) I don't have Visual Studio anywhere.) 2018-08-18 10:33 GMT-05:00 Akim Demaille : > > > Le 18 août 2018 à 17:10, Rici Lake a écrit : > > > >> I don’t remember why I wrote it this way, but today I don’t care much >

Re: Problem with new version of bison's code

2018-08-18 Thread Rici Lake
This is really a problem in kannel, not in bison. Kannel's bison source file uses a feature which has been deprecated since 2003. Support for this feature was removed with the bison 3.0 release. There's a bug in the kannel bug tracker dating from 2014, which includes a description of the problem b

Re: Problem with new version of bison's code

2018-08-18 Thread Rici Lake
Sorry, I omitted the link to the new entry in the Kannel bug-tracker: https://redmine.kannel.org/issues/699#note-5 2018-08-18 11:07 GMT-05:00 Rici Lake : > This is really a problem in kannel, not in bison. Kannel's bison source > file uses a feature which has been deprecated since 20

Re: Enhancement request: enabling Variant in C parsers

2018-08-19 Thread Rici Lake
Vaguely on this topic, since you seem to be working on a new release: On Sun, Aug 19, 2018, 10:23 Akim Demaille wrote: > > Note that you don’t have anything to do to reset the parser, all the > problem is actually the scanner. The parser object holds no state, > everything is local to yyparse.

Re: Problem with new version of bison's code

2018-08-20 Thread Rici Lake
Update: my patch has been committed to kannel's SVN, and there is at least one report that it fixes the build problem. On Sat, Aug 18, 2018, 11:08 Rici Lake wrote: > Sorry, I omitted the link to the new entry in the Kannel bug-tracker: > https://redmine.kannel.org/issues/699#note-5

%nterm directive incorrectly accepts character literals and quoted strings

2018-10-15 Thread Rici Lake
(Modified from an email originally sent privately to Akim, who persuaded me to make it public. It's really a minor point.) I only just noticed that %nterm is a bison directive, although I still don't fully understand the motivation. I can't find any reference in the manual, except for its unexplai

Re: Enhancement request: enabling Variant in C parsers

2018-10-25 Thread Rici Lake
El jue., 25 oct. 2018 a las 3:21, Victor Khomenko (< victor.khome...@newcastle.ac.uk>) escribió: > > Well, when in Rome do as Romans do... This chapter is for C/C++ > programmers, not Go. Some of them are not even familiar with the new > syntax. If you check cppreference website, they don't use tr

Small documentation feature request

2020-06-30 Thread Rici Lake
Hi, Akim and bisonistas, This came up today on SO: https://stackoverflow.com/questions/62658368/unknown-type-yypcontext-t-in-bison. The user complained that their attempt to declare `yyreport_syntax_error` failed because `yypcontext_t` was not defined. (The declaration was put in a `%{` code secti

Re: Small documentation feature request

2020-06-30 Thread Rici Lake
LGTM. Thanks. El mar., 30 jun. 2020 a las 12:41, Akim Demaille () escribió: > Hi Rici! > > > Le 30 juin 2020 à 18:23, Rici Lake a écrit : > > > > Hi, Akim and bisonistas, > > > > This came up today on SO: > > > https://stackoverflow.com/question