compiler's frontend for a Pascal like language named SNL
Python Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
python
test_file
README.org
make.sh

README.org

A SNL(a Pascal like language) Compiler’s Frontend(with lexical-analysis and syntactic analysis only)

Run

Check if you have a Python envirament

  • You need a Python envirament(Python is installed by default in many Linux machines).
  • If you don’t, please download and install Python according to your operating system at http://www.python.org/getit/.

In Linux, Follow those steps:

  • tar xzvf snl_frontend.tar.gz
  • cd snl_frontend
  • chmod +x make.sh
  • ./make.sh
  • Then two new file named syntactic_analysis and lexical_analysis is created.
  • Check the new file lexical_analysis. It saved the result of bubble_sort.snl’s lexical analysis.
  • Check the new file syntactic_analysis. It saved the result of bubble_sort.snl’s syntactic analysis.
  • You can also compile your own source file by command in the present directory:
  • python python/main.py test_file/bubble_sort.snl > target_file

In Windows, Follow those steps:

  • Put python in your PATH
  • Extract snl_frontend.tar.gz
  • In a console, enter directory snl_frontend
  • python python/main.py test_file/bubble_sort.snl > syntactic_analysis
  • Then two new file named syntactic_analysis and lexical_analysis is created.
  • Check the new file lexical_analysis. It saved the result of bubble_sort.snl’s lexical analysis.
  • Check the new file syntactic_analysis. It saved the result of bubble_sort.snl’s syntactic analysis.
  • You can also compile your own source file by command in the present directory:
  • python python/main.py test_file/bubble_sort.snl > target_file