Skip to content

jqol/simple_wc_example

 
 

Repository files navigation

Simple Word Count Parser Example

=================

Build Status

Tested on linux and OS X

Build Status

About

So this is a super simple parser example. The tutorial is located here: link

Between the tutorial and the code you should be able to get started with more advanced projects using C++ and Flex/Bison. Admittedly the example itself is a bit contrived, however it's mean to be simple and get the point across. If there are changes in Flex/Bison that prevent the example from compiling or if you just have improvements, feel free to generate a pull request or just shoot me an e-mail.

To compile just download and run make, there's a super simple test harness to make sure it runs in the test dir.

Or you use CMake.

mkdir build/
cmake ..
make

or with clang

mkdir build/
CC=clang CXX=clang++ cmake ..
make

or with clang with optimisations

mkdir build/
CC=clang CXX=clang++ cmake .. -DCMAKE_BUILD_TYPE=Release
make

To run the simple test after make call

ctest

.

Thanks!

About

simple word count example using flex/bison parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 51.0%
  • Lex 14.8%
  • Yacc 13.0%
  • Makefile 9.3%
  • CMake 8.3%
  • Perl 3.6%