Skip to content

An Oberon compiler written from scratch and a book to aid its understanding.

License

Notifications You must be signed in to change notification settings

kekcleader/oberon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English text below

Компилятор языка программирования Оберон

Исходные файлы находятся в каталоге Mod.

Желающим погрузиться в тему построения компиляторов рекомендуется ознакамливаться с исходным кодом данного проекта по нарастающей, начиная с самых первых коммитов (для более развёрнутого описания изменений см. файл HISTORY), а также с книгами Николая Вальтеровича Вирта, Сергея Залмановича Свердлова и других авторов на данную тему, с кодом компилятора в Project Oberon, с сайтом Free Oberon (на этом сайте есть контактная информация).

Для того, чтобы скомпилировать компилятор, необходим компилятор VOC, входящий в комплект Free Oberon. Компилятор VOC находится в подкаталоге data/bin/voc/bin (файл voc на Линуксе или voc.exe на ОС Windows). Для Линукса также подойдёт оригинальный компилятор VOC. Также можно использовать компиляторы Ofront и Ofront+.

При смене компилятора, пожалуйста, отредактируйте файл Makefile (а именно, переменную VOCPATH наверху, и, возможно, другие).

В будущем компилятор будет компилировать себя сам.

Зайдите в каталог с исходным кодом компилятора (можно зайти как в oberon, так и в oberon/Mod) и выполните:

make

Затем запустите файл Compiler, или воспользуйтесь командой make run для теста.

Для компиляции также понадобятся пакеты make и gcc:

sudo apt-get install -y make gcc

Oberon compiler screenshot

Oberon Programming Language Compiler

The source files are in the Mod directory.

Those wishing to dive into the topic of building compilers are advised to familiarize themselves with the source code of this project on an increasing basis, starting with the very first commits (for a more detailed description of the changes, see the HISTORY file), as well as read books by Niklaus Wirth, S. Z. Sverdlov and other authors on this topic, as well as familiarize with the compiler code of the Project Oberon and with the Free Oberon website (see this website for the contact information).

In order to compile the compiler, you need the VOC compiler included with Free Oberon. The VOC compiler is located in the data/bin/voc/bin (the file name on Linux is voc, and voc.exe on Windows). For Linux, the original VOC compiler is also suitable. You can also use Ofront and Ofront+ compilers.

When changing the compiler for another one, please edit the Makefile (namely, the VOCPATH variable at the top, and possibly others).

In the future, the compiler will compile itself.

Go to the directory with the source code of the compiler (you can go into any of oberon or oberon/Mod) and run:

make

Then run the file Compiler, or type make run to test it.

You will also need make and gcc packages for compilation:

sudo apt-get install -y make gcc

About

An Oberon compiler written from scratch and a book to aid its understanding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages