Compiler for the Wave language.
$ git clone --recursive https://github.com/wave-lang/wavec.git- GNU development tools
- Lex
- Yacc
doxygenandgraphvizCUnit- GNU
indent
$ apt-get install build-essential bison flex$ apt-get install doxygen graphviz indent
$ apt-get install libcunit1 libcunit1-dev libcunit1-doc libcunit1-ncurses libcunit1-ncurses-dev$ yum groupinstall "Development Tools"
$ yum install flex bison$ yum install doxygen graphviz indent
$ yum install CUnit Cunit-develTo compile the wave compiling tools, type the following command:
$ makeAmong the files and directories created, you will find a bin directory which will contain:
wavepp: the preprocessorwave2c: the Wave to C translatorwavec: the Wave compiler.
For much more ease, it is possible to install the wave compiling tools (this may require root privileges):
$ make
$ make installFor better results, please first uninstall the compiling tools if they are already installed.
$ make uninstallIf you install the tools, you can directly run wavec, wavepp and
wave2c, otherwise, you must run the executables from bin.
To use the compiler:
$ wavec my_file.waveThis will produce several files:
my_file.wpp: the preprocessed file.my_file.c: the C intermediary file.my_file: the executable.
The preprocessing is done with wavepp
$ wavepp my_file.wave [my_file.wpp]If no destination file is supplied, the result will be output to stdout.
Once a file has been preprocessed, it can be converted to C using wave2c
$ wave2c my_file.wpp [my_file.c]The second argument is optionnal. If no destination file is provided, wave2c
will output the resulting C code to the standard output.
It is also possible to read Wave code from standard input:
$ cat my_file.wpp | wave2c -$ wavepp my_file.w | wave2c - my_file.cOr, for nice results:
$ wavepp my_file.w | wave2c - | indent -bad -bap -bli0 -bls -bs -cs -i4 -l80 -lp -pcs -pmt -saf -sai -saw -sc -ss -o my_file.cThe resulting C files are written in C99. They require the libwave, and rely on math.h and OpenMP.
$ gcc -std=c99 -O2 my_file.c -lm -lwave -fopenmpIf you did not install the tools, it might be necessary to specify the location of the headers and the library:
$ gcc -std=c99 -O2 -Iinclude my_file.c -Llib -lm -lwave -fopenmpA few examples are available in the examples directory.
If you installed the tools, you can change directories and compile any example:
$ cd examples
$ wavec your_example_of_choice.wave [other_examples.wave]Otherwise, you need to stay at the directory of the project:
$ bin/wavec examples/your_example_of_choice.wave [other_examples.wave]If you wish to clean up the examples directory, you can run the clean-examples script:
$ script/clean-examples examplesIf you installed the compiling tools, the manpages should be available in your MANPATH:
$ man wavepp
$ man wave2c
$ man wavecOtherwise:
$ man man/wavepp.1
$ man man/wave2c.1
$ man man/wavec.1Please first install doxygen and graphviz. Then run:
$ make docLicensed under the MIT License. See the COPYING file.