This is the experimental project of compile principle. It implements lexical and syntax analysis, generate intermediate codes for optimization and generating assembly in the future.
- Linux x86-64
- CMake
- Make
- GCC
Download the pascal-simple-compiler repository:
$> cd ~/Desktop
$> git clone https://github.com/myyerrol/pascal-simple-compiler.gitExecute the build.sh script:
$> cd pascal-simple-compiler
$> sudo ./build.shIf you use the default bash, using following commands:
$> cd ~/Desktop/pascal-simple-compiler
$> echo "export PATH=`pwd`/build/bin:\${PATH}" >> ~/.bashrc
$> source ~/.bashrcIf you use the zsh or other shell, modifying the .bashrc to .zshrc or the configuration file that corresponding to your shell. such as:
$> cd ~/Desktop/pascal-simple-compiler
$> echo "export PATH=`pwd`/build/bin:\${PATH}" >> ~/{your shell configuration file}
$> source ~/{your shell configuration file}Test the pascal-simple-compiler, such as:
$> cd test
$> psc pascal_test_program_while_if.pasAlthough the compiler maybe has some unknown bugs or its function has not strong enough yet at now, with developing, it will become more and more better in the fucture.