thinkcn / PHPBot

PHP code generator, which currently includes the ability to generate Getter and Setter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHPBot

PHP code generator, which currently includes the ability to generate Getter and Setter

Building PHPBot

  1. Prepare Antlr4 jar
curl -O https://www.antlr.org/download/antlr-4.7.1-complete.jar
  1. Install Antlr Cpp Runtime
svn co https://github.com/antlr/antlr4/trunk/runtime/Cpp cppruntime
cd cppruntime
mkdir build && mkdir run && cd build
# TODO: Please note to modify to your own path. 
alias antlr-4='java -Xmx500M -cp "/path/to/antlr-4.7.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
cmake .. -DANTLR_JAR_LOCATION=/path/to/antlr-4.7.1-complete.jar -DWITH_DEMO=True
make
# TODO: modify to your own path.
DESTDIR=/antlrcpp/runtime/path/inatall/path/ make install
  1. Build
git clone https://github.com/thinkcn/PHPBot.git
cd PHPBot
# modify 'ANTLR_CPP_RUNTIME_DST' of CMakeLists.txt 
mkdir build
cd build
cmake ..
make

Test

# Generate Getter
./phpbot ../tests/test.php -g
# Generate Setter
./phpbot ../tests/test.php -s
# Both
./phpbot ../tests/test.php -gs
# Help
./phpbot ../tests/test.php -h

Others

  • Tested to pass on WSL and MacOS

About

PHP code generator, which currently includes the ability to generate Getter and Setter

License:BSD 2-Clause "Simplified" License


Languages

Language:C++ 98.6%Language:CMake 1.3%Language:PHP 0.1%