Skip to content
Simple "Hello World" for lex (flex) and yacc (bison) compiler of compilers
Makefile Lex Yacc
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore .gitignore intermediate files Nov 29, 2017
hello.l Update hello.l Oct 19, 2018
hello.y hello.y (syntactic) added Nov 29, 2017
makefile contribs merged, cleaned Oct 19, 2018
readme.txt readme update versions - linux Oct 19, 2018


Read me TXT

As for today (2018-10-19) you will need the lastest versions of:

* flex-2.5.4a-1.exe (
* flex version 2.6.4 (linux opensuse)
* bison-2.4.1-setup.exe (
* bison version 3.0.4 (linux opensuse)

    After that, do a full install in a directory of your preference (default to C:\Program Files (x86)\GnuWin32). 
I suggest C:\GnuWin32 , because here bison had some problems with spaces in directory names.

    Also, consider installing Dev-CPP in the default directory (C:\Dev-Cpp)

    After that, set the PATH variable to include the bin directories of gcc (in C:\Dev-Cpp\bin) and flex\bison (in C:\GnuWin32\bin). 
To do that, copy this: ;C:\Dev-Cpp\bin;C:\GnuWin32\bin and append it to the end of the PATH variable, defined in the place show by this figure:
    step-by-step to set PATH variable under Win-7.
    If the figure is not in good resolution, you can see a step-by-step here. 

    Open a prompt, cd to the directory where your ".l" and ".y" are, and compile them with:
        flex hello.l
        bison -dy hello.y
        gcc lex.yy.c -o hello.exe

Commands to create lexical analyzer, parser and executable.

You will be able to run the program. I made the sources for a simple test (the infamous Hello World).

You can’t perform that action at this time.