vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

How to use other libraries? #22

Closed snayaksnayak closed 8 years ago

snayaksnayak commented 8 years ago

Voc has many libraries inbuilt, V4, S3, Ulm's, ooc etc. How to use a specific library? Any compile time option? Or everything available at the same time? No name space clash?

norayr commented 8 years ago

On my system, voc is prefixed in /opt, therefore list of available by default (in libVishapOberon) library interfaces can be get by

ls /opt/voc/lib/voc/sym/

Then, interface of the specific module can be get by running

 /opt/voc/bin/showdef /opt/voc/lib/voc/sym/Strings.sym

This is default Strings module ported from Oberon V4 system.

There are different implementations of that module.

/opt/voc/bin/showdef /opt/voc/lib/voc/sym/oocStrings.sym

comes from ooc compiler version 1.

 /opt/voc/bin/showdef /opt/voc/lib/voc/sym/ooc2Strings.sym

comes from ooc compiler version 2.

 /opt/voc/bin/showdef /opt/voc/lib/voc/sym/powStrings.sym

comes from POW compiler.

 /opt/voc/bin/showdef /opt/voc/lib/voc/sym/ethStrings.sym

comes from Oberon System 3(ETH version)

 /opt/voc/bin/showdef /opt/voc/lib/voc/sym/ulmStrings.sym

comes from Ulm Oberon System.

You can just import necessary module with IMPORT ethStrings or IMPORT oocStrings, or you can IMPORT Strings := oocStrings and then just use Strings alias in your code.

snayaksnayak commented 8 years ago

Good. Now we have too many things to chose from. :-)

norayr commented 8 years ago

btw when module gets compiled, symbol and object files are created with the name which is in the source code after MODULE keyword, not the file name.