thought you might be interested
properly cast void* to target pointer type (a c vs c++ difference)
added yyinit that zeroes GREG struct
added yydeinit that frees GREG->buf etc.
fixed yyfree by using yydeinit
added make test target
make C++ compileable
implicit void casting not allowed
add const to yymatchString
add yyinit yydeinit and pass YY_INPUT G->data
fixes memory leaks
add make test to build sample and fix sample using new init/deinit
updated greg.g and greg.c
Hey, awesome :) Merging right now, I've been using it lately and it's great to see some support :)
One of the biggest issue around C++ is G->vals is using malloc/realloc/free.
If you want to support C++, you need switching to std::vector or something.
Without switching to vector or some containers, you can't use STL containers as YYSTYPE.
@tokuhirom Having C++ support would be nice - but I definitely don't want to lose C support.
You can support both language by command line options like greg -p foo.y :)
greg -p foo.y
I don't think that's a big deal - you can still compile the C code as a module and use it from C++..