> On 17 Mar 2025, at 18:22, Basile Starynkevitch <bas...@starynkevitch.net> > wrote: > > Hello all, > > In the RefPerSys open source inference engine project (the GPL source code is > on > https://github.com/RefPerSys/RefPerSys/ ...) we have a C++ class implementing > lexing. More precisely there is a C++ common super class in > https://github.com/RefPerSys/RefPerSys/blob/master/refpersys.hh > (in commit f13a31b91f0fad it is near line 2840 of refpersys.hh) > which has the following relevant member functions (our textual data is UTF-8). > > const char*curcptr(void) const; // give the current byte pointer > const std::string current_line(void) const; /// give the current line > void advance_cursor_bytes(unsigned nb); // advance the byte pointer by nb > > there are many other member functions (some might become obsolete) > > My question is to find (for inspiration) some open source software, whose > parser > is GNU bison 3.8 generated, and whose lexer is implemented by user provided > C++ > classes. > > The lexer could be used for parsing other things than files (e.g. FLTK widget > containing strings)
I am writing on that, for eventual use in a logical program (theorem prover): https://savannah.gnu.org/git/?group=metalogic-inference In this thread there is information about that and other C++ lexers: https://www.mail-archive.com/austin-group-l@opengroup.org/msg12970.html