How to install bison on mac OSX

See here. You can install with brew: brew install bison Then update your scripts or your shell config to use brew’s bison first in your PATH: export PATH=”$(brew –prefix bison)/bin:$PATH” Or export PATH=”/usr/local/opt/bison/bin:$PATH”

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

Problem calling std::max

You are probably including windows.h somewhere, which defines macros named max and min. You can #define NOMINMAX before including windows.h to prevent it from defining those macros, or you can prevent macro invocation by using an extra set of parentheses: column = (std::max)(1u, column + count);

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

tech