Re: %merge confusion

2021-08-04 Thread Akim Demaille
Hi all, > Le 27 déc. 2020 à 17:03, Akim Demaille a écrit : > > Your problem follows from the fact that there is support for "typed" mergers. > > FWIW, I was unaware of this feature (the fact that the merge functions are > "typed"). This is undocumented, yet dates back from the initial introdu

Re: %merge confusion

2021-01-17 Thread Jot Dot
regarding: >> I wished Bison would spit out prototypes in the Parser class for each merge >> routine >> in the form: >> >> class Parser >> { ... >> ... >> YYSTYPE stmtMerge(YYSTYPE y0, YYSTYPE y1); // One for each different merge >> routine used >> }; >> >> and we just supply the implementati

Re: %merge confusion

2021-01-13 Thread Akim Demaille
Jot, Sorry for not answering faster. I don't have enough time :( I hope that meanwhile you managed to get your project move forward. > Le 1 janv. 2021 à 23:32, Jot Dot a écrit : > >>> The incoming arguments are ok but there is no parsing context provided. >>> It would be (to me) a quite useful

Re: %merge confusion

2021-01-05 Thread Akim Demaille
Hi Jot, > Le 1 janv. 2021 à 23:32, Jot Dot a écrit : > > But, in my defence: >*** >*** That wasn't what I was asking for all this time *** >*** Ok :) >> The else-cla

Re: %merge confusion

2021-01-01 Thread Jot Dot
> Jot, as I have already stated several times, your merger is *typed*, > which is an undocumented feature. The signature of your merger, > as mentioned several times in my messages, should not be > > YYSTYPE stmtMerge(YYSTYPE x0, YYSTYPE x1) > > but > > gen::index_t stmtMerge(YYSTYPE x0, YYSTYP

Re: %merge confusion

2020-12-31 Thread Akim Demaille
Jot, > Le 30 déc. 2020 à 10:18, Jot Dot a écrit : > >>> I get the same yyuserMerge as before. This time, it is using >>> the new type of the rule that the merge is in (%type rule) >>> >>> case 1: yy0->index = stmtMerge (*yy0, *yy1); break; >> >> Which is good. That is what is expected. > >

Re: %merge confusion

2020-12-30 Thread Jot Dot
recap: me looking for a working glr solution: >> Alright. I took out the 'api.value.type union' and put in: >> %union { >> gen::index_t index; >> merge_t merge; // A struct to hold my merge info >> } >> >> All my tokens are of the form: %token tok1 tok2 tok3 ... >> All my rules are of th

Re: %merge confusion

2020-12-29 Thread Akim Demaille
Hi Jot, > Le 28 déc. 2020 à 10:09, Jot Dot a écrit : > > I'm not trying to irritate you with all of this. I'm sure you are not. > Alright. I took out the 'api.value.type union' and put in: > %union { > gen::index_t index; > merge_t merge; // A struct to hold my merge info > } > > All

Re: %merge confusion

2020-12-28 Thread Jot Dot
I'm not trying to irritate you with all of this. I probably starting to at this point but I'm really not trying to :) If I must wait for some update then I will have to accept that. I'm trying to convert over to *any glr form* that currently works. > The code works when api.value.type union is no

Re: %merge confusion

2020-12-27 Thread Akim Demaille
Jot, > Le 27 déc. 2020 à 22:31, Jot Dot a écrit : > > BTW: I'm using: Bison 3.7.1 > >>> Assuming I have something simple like the following: >>> %token IDENTIFIER >>> %type subrule expr >> >> Which means that you are probably using "api.value.type variant". Which does > > *Sigh* > That's w

Re: %merge confusion

2020-12-27 Thread Jot Dot
BTW: I'm using: Bison 3.7.1 >> Assuming I have something simple like the following: >> %token IDENTIFIER >> %type subrule expr > > Which means that you are probably using "api.value.type variant". Which does *Sigh* That's why I was wondering what I was doing wrong. I know I must use POD. I sh

Re: %merge confusion

2020-12-27 Thread Akim Demaille
Jot, > Le 25 déc. 2020 à 04:28, Jot Dot a écrit : > > This is the resultant code generated by bison: > > static void > yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) > { > YYUSE (yy0); > YYUSE (yy1); > > switch (yyn) >{ > case 1: yy0->gen::index_t = stmtMerge (*yy0, *yy1); break; //

Re: %merge confusion

2020-12-26 Thread Akim Demaille
Hi Jot, > Le 25 déc. 2020 à 04:28, Jot Dot a écrit : > > I'm using %glr-parser and ran into a snag with the %merge feature. > > I figure I must be misinterpreting something along the way. > I think I've done what the docs say: > https://www.gnu.org/software/bison/manual/html_node/Merging-GLR-Pa

%merge confusion

2020-12-24 Thread Jot Dot
I'm using %glr-parser and ran into a snag with the %merge feature. I figure I must be misinterpreting something along the way. I think I've done what the docs say: https://www.gnu.org/software/bison/manual/html_node/Merging-GLR-Parses.html Everything compiles fine except one bison generated line