2015-12-06 18:59 GMT-03:00 Thomas Lübking <thomas.luebk...@gmail.com>: > On Sonntag, 6. Dezember 2015 17:41:07 CEST, Nicolás Alvarez wrote: >> >> Then we ignore warnings about // comments and pay attention >> to others > > > Wtf does flex/yacc produce incompliant comments? > Seriously, COMMENTS! > That's a convenience thing. > > int foo = bar; // bar defined in wherever > > is simpler than > > int foo = bar; /* bar defined in wherever */ > > but a code generator isn't lazy. > There must be a way to avoid that? > > Otherwise one might convince them to create cpp/cxx suffixes so that > compilers will invoke the C++ compiler?
I have never used yacc, but I know you can make flex produce a file named .cpp and even use C++ code inside your actions. There is even an (experimental, unstable) flex option to make it output an actual C++ parser class. -- Nicolás