Source code files in SIMPOL are stored with one of two file extensions:
smu. The first extension indicates that the file content is stored in an ASCII format (1 byte per character) and the second one indicates that the file content is stored in Unicode format. Unicode can be stored in a number of different formats. SIMPOL Unicode source files currently must be stored in UCS-2 and should begin with what is known as a byte-order mark (BOM). UCS-2 format stores characters using two bytes per character. It is considered good form to also use the byte order mark (0xFEFF) as the first character. This allows the reading program to determine whether the characters are stored with the least significant byte or with the most significant byte first.
Here is an example of SIMPOL source code:
function main() string s s = "Hello" end function s
After compiling a SIMPOL source code file the result is a byte-code file. SIMPOL byte-code files come in two flavors: programs and libraries. These are distinguished by the file extensions
sml respectively. The only difference between them is that the program files are produced from projects that contain a
main() function. That is the entry point for a SIMPOL program. Compiled programs that do not include a
main() function can not be executed but can be linked to other programs to provide functions and data types that can be called or used. They can also be loaded dynamically.
Here are two examples of the compilation process:
After the compilation process, if multiple source files are used to produce the resulting program, the
smp file is joined with each of the
sml files in a linking type of process in order to produce the final program.
Here is an example of the linking process:
A SIMPOL project is a group of
smu files and the description of how the compilation and link is to be done. It also includes a definition of which directories to search in for included files and potentially one or more targets to be created from the final result. It also includes the list of pre-compiled libraries to link with, in addition to any library modules that are produced as part of the project itself. SIMPOL source code files can also include any number of other SIMPOL source code files which themselves may include yet others. Typically a project may consist of a main source code file that then includes other source code files, which may then include others. This results in a tree of files below the main file and this is shown in the project window to the left of the area where the source files are edited. For each module in the project, there is a main source file. Each main source code file is the top of a tree of included source code files. The SIMPOL language statement to include a file is
include followed by the file name as a string.
It is not possible to simply compile and execute any source code file (if it has a
main() function) using the IDE. Changes that were made to dynamically load the required components mean that the component information is added to the project by the IDE build process. Whether for a simple or complex project, the Superbase NG IDE's real strength is in compiling and linking complex projects. The normal approach to working with the IDE is to create a project and then to build it. This results in either a program or library that can be either executed or loaded into the SVM.
The following is an example of building a project:
Project's main source code files:
MyFile1.sma— includes —>
MyFile2.sma— includes —>
MyFile1.sma— compiles to —>
MyFile2.sma— compiles to —>
MyFile2.sml— links to —>
MyFile1.smplocated in the
bindirectory of the project.
The SIMPOL IDE manages the time dependencies between SIMPOL files, so if in the previous example, we update the file
MyFile2a.sma, the only file that is going to be compiled when we do a build, is
MyFile2.sma, because it is the only main source code file affected.
The project description is stored in a file with the extension
smj. For example, in the previous example the project file name would have been