difficulty getting c-style comments in flex/lex

I suggest you use start conditions instead. %x C_COMMENT “/*” { BEGIN(C_COMMENT); } <C_COMMENT>”*/” { BEGIN(INITIAL); } <C_COMMENT>\n { } <C_COMMENT>. { } Do note that there must not be any whitespace between the <condition> and the rule. %x C_COMMENT defines the C_COMMENT state, and the rule /* has it start. Once it’s started, */ … Read more

Doxygen – Could NOT find FLEX (missing: FLEX_EXECUTABLE)

It seems like apt autoremove really removed the package I just installed in the previous step. So what worked for me was: git clone https://github.com/doxygen/doxygen.git cd doxygen mkdir build cd build These are new: sudo apt-get install flex sudo apt-get install bison cmake -G “Unix Makefiles” .. make …but of course the horror wouldn’t end … Read more

Undefined Reference To yywrap

The scanner calls this function on end of file, so you can point it to another file and continue scanning its contents. If you don’t need this, use %option noyywrap in the scanner specification. Although disabling yywrap is certainly the best option, it may also be possible to link with -lfl to use the default … Read more

String input to flex lexer

The following routines are available for setting up input buffers for scanning in-memory strings instead of files (as yy_create_buffer does): YY_BUFFER_STATE yy_scan_string(const char *str): scans a NUL-terminated string` YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len): scans len bytes (including possibly NULs) starting at location bytes Note that both of these functions create, return a corresponding YY_BUFFER_STATE … Read more

How to compile LEX/YACC files on Windows?

As for today (2011-04-05, updated 2017-11-29) you will need the lastest versions of: flex-2.5.4a-1.exe bison-2.4.1-setup.exe After that, do a full install in a directory of your preference without spaces in the name. I suggest C:\GnuWin32. Do not install it in the default (C:\Program Files (x86)\GnuWin32) because bison has problems with spaces in directory names, not … Read more

Writing a parser like Flex/Bison that is usable on 8-bit embedded systems

If you want an easy way to code parsers, or you are tight on space, you should hand-code a recursive descent parser; these are essentially LL(1) parsers. This is especially effective for languages which are as “simple” as Basic. (I did several of these back in the 70s!). The good news is these don’t contain … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)