Hello! Five years ago was a feature request about C++ variants for GLR. The Bison documentation says that C++ Variants are not supported in GLR, and C++17 variants will not be supported to maintain backward compatibility with older versions of C++ standards.

I know, that Valentin implementing C++ GLR variants. Is there any progress?

I wish to implement at least C++17 variants, and then move forward for backward compatibility. Or I thought about another feature. Something like attributes, that can be attached to rules (for example, I can attach a needed type, like it already implemented by variants in Bison — %type <my_type> rule1 ...), and then in C++ code handling the rule I would like to read this attribute, to access the value from C++17 std::any or std::variant. For example:

%attr rule1 {type}
...
rule2: rule1 {$$ = std::get<$a1>($1);}

And yes, I want help with implementing C++ GLR variants.


Reply via email to