Re: how to solve this reduce/reduce conflict?

2022-09-22 Thread Derek Clegg
This is horrid, and not how math works. Spaces necessarily mean nothing, and imbuing them with meaning is nonsense. Please reconsider your grammar. > On Sep 22, 2022, at 8:28 PM, Lukas Arsalan wrote: > > On 2022-09-22T15:54:31UTC Hans Åberg wrote: >> Context switches are best avoided unles

Re: Which lexer do people use?

2020-07-04 Thread Derek Clegg
On Jul 3, 2020, at 11:14 PM, Akim Demaille wrote: > > Hi Daniele, > >> Le 3 juil. 2020 à 23:15, Daniele Nicolodi a écrit : >> >> Hello, >> >> the historical pairing is using Flex with Bison. However, while Bison is >> under active development and seems to be a very solid code base, there >> i

Re: how to get left hand side symbol in action

2019-05-10 Thread Derek Clegg
> On May 10, 2019, at 10:43 AM, Akim Demaille wrote: > > > >> Le 10 mai 2019 à 16:28, Christian Schoenebeck a >> écrit : >> >> On Freitag, 10. Mai 2019 06:57:00 CEST Derek Clegg wrote: >>> In fact, I do not think error messages in the gen

Re: how to get left hand side symbol in action

2019-05-10 Thread Derek Clegg
On May 10, 2019, at 6:47 AM, Hans Åberg wrote: > > >> On 10 May 2019, at 07:24, Akim Demaille wrote: >> >> 1. there is a real and valid need for the feature, which I still need >> to be convinced of, especially because symbol names are technical >> details! > > One can also write better err

Re: how to get left hand side symbol in action

2019-05-10 Thread Derek Clegg
On May 10, 2019, at 5:21 AM, Hans Åberg wrote: > > >> On 10 May 2019, at 07:24, Akim Demaille wrote: >> >>> In practice you just need the symbol name as is. Nobody needs the >>> translation, >> >> I beg to disagree. Nobody should translate the keyword "break", >> but >> >>> # bison /tmp/fo

Re: %token-table doesn't seem to be working for C++?

2019-03-02 Thread Derek Clegg
It cannot return a > string. > > Anyhow, your sample %token statement declares two tokens, not one; the last > being meaningless. > > On 3/2/19 21:13, Derek Clegg wrote: >> On Feb 18, 2019, at 9:59 PM, Akim Demaille wrote: >>> >>> Hi Derek, >&

Re: %token-table doesn't seem to be working for C++?

2019-03-02 Thread Derek Clegg
On Feb 18, 2019, at 9:59 PM, Akim Demaille wrote: > > Hi Derek, > >> Le 18 févr. 2019 à 21:07, Derek Clegg a écrit : >> >> Perhaps I’m doing something wrong, but it appears that, in C++, %token-table >> doesn’t work: instead of yytname, I only see yytname_. I

%token-table doesn't seem to be working for C++?

2019-02-18 Thread Derek Clegg
Perhaps I’m doing something wrong, but it appears that, in C++, %token-table doesn’t work: instead of yytname, I only see yytname_. It also appears that YYNTOKENS, YYNNTS, YYNRULES, and YYNSTATES are not defined, contrary to the documentation. Am I missing something, or is this broken? Thanks,

Re: Forcing Bison's yacc.c to report more expected tokens on syntax error

2019-02-06 Thread Derek Clegg
I agree with Adrian — it would be nicer, in my opinion, to allow users to handle syntax errors directly, rather than always going through the bison code which formats syntax errors in a fixed way. This seems like it might be not too hard to do: replace the code starting with char const* yyf

Re: Bison 3.2.90 released [beta]

2019-01-13 Thread Derek Clegg
Relatively trivial: aux/parser-internal.h:767:24: error: extra ';' after member function definition [-Werror,-Wextra-semi] symbol_type () {}; The fix: diff -ur bison-3.2.90/data/skeletons/c++.m4 bison/data/skeletons/c++.m4 --- bison-3.2.90/data/skeletons/c++.m4 2019-01-05 06:09:28.0

Re: bison-3.1.91 released [beta]

2018-10-21 Thread Derek Clegg
t the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T)(yyssp - yyss + 1); #ifdef yyoverflow { Derek Clegg > On Oct 18, 2018, at 4:44 AM, Akim Demaille wrote: > > A problem was found in Bison 3.1.90: in mode

Re: bison-3.1.91 released [beta]

2018-10-21 Thread Derek Clegg
oreturn void +static __attribute_noreturn__ void print_and_abort (void) { /* Don't change any of these strings. Yes, it would be possible to add Derek Clegg > On Oct 18, 2018, at 4:44 AM, Akim Demaille wrote: > > A problem was found in Bison 3.1.90: in modern C++ the parser stack >

Re: How to implement optional semicolon rules

2014-11-15 Thread Derek Clegg
cl: VAR INTEGER NAME '[' NUMBER ']' '=' braced_initializer ; braced_initializer: '{' /* initialization */ '}' ; Derek Clegg > On Nov 15, 2014, at 6:25 AM, Matthias Simon wrote: > > Hi, > > I am struggling with some semicolon rules for som