now you can get more effective generated code tool by project miniGameEngine
- a tools for generated code by flex and bison
- it only run in linux. centos7.0 bison (GNU Bison) 2.7 flex 2.5.37
- it can identify enum,struct,interface and generated serialize for csglib
- complie it,it use clang for complie
make
- if make error,check if bison or flex install or not.
- start generated code
format is ./csgl inputfileDir outputfileDir inputfileName
test -d generateCode||mkdir generateCode
./csgl ./ generateCode/ Test
- and then,your can find the generated code in generateCode dir.
if success,you will get below output.
[root@VM_38_103_centos csgl]# ./csgl ./ generateCode/ Test
input file is ./Test.csgl
output dir is generateCode/
output headfile is generateCode/Test.h
output cppfile is generateCode/Test.cpp
start generated head file Test.csgl
start generated cpp file Test.csgl
build csgl file success!
and generator code in generateCode.this code is use for csglib