Component Pascal Compiler for command-line
Description
Component Pascal Compiler is a modified version of BlackBox's
compiler (taken from release 1.6 RC5), adapted for
usage in command-line (terminal). It consists of two parts: compiler's
modules, linked into a shared library (backend), and command-line tool,
using that library (frontend).
*
Backend part is a modified Dev subsystem, linked into shared
library, used by frontend.
*
Cross-platform front-end, written in Free Pascal. Supports as many target platforms as Free Pascal
supports.
Credits
This project is available thanks to:
*
Oberon Microsystems <http://www.oberon.ch>
*
OpenBUGS project <http://www.openbugs.info/>
*
Dmitry Solomennikov
*
http://forum.oberoncore.ru
Current status
*
Supported platforms: x86;
*
Supported OS: Windows 2000/XP, Linux 2.6;
*
Produces: .ocf, .osf, .exe/.dll/.so (PE/ELF Linker);
*
Input source code: plain text files of Component Pascal code in
.mod/.cp and others;
*
Linux: libcpdev.so + cpcc;
*
Windows: cpdev.dll + cpcc.exe
System requirements
Minimal set of subsystems is: /Host/(HostFiles only), System and
OS-specific subsystems (Win for Windows, Lin for Linux).
Linux
Tested on OpenSUSE 10.3 and Ubuntu 10.4.
*
Linux kernel 2.6 [not tested on 2.4]
*
glibc (libc.so.6)
*
libdl (libdl.so.2)
Windows
Tested on Windows XP SP2, but need work in Windows NT/2000 too.
Current implementation's limitations
*
reports only about first compilation error and total number of errors;
*
compiler able to compile only one module per project, so linker
may report about missed modules, otherwise if there are compiled
before;
*
in /Linux/ you can't use framework of BlackBox, because it
depends on subsystem Hosts, that still not ported to Linux and
available only for Windows. But, still you can use underlying OS
API calls and libraries, such as GTK+.
How To Use
*
Location of compiler is at root directory of BlackBox's subsystems.
Compiling a sample project
Run command
cpcc <project_file.prj>
at root directory of BlackBox. For example:
cpcc TestExport.prj
Sample Project
Sample project file for project TestExport.prj:
[Project]
ProjectName=TestExport
[Compiler]
Module=CDev\Mod\Test1.cmps
CompilerOptions=
[Linker]
LinkedMods=TestExport#
LinkerMode=Dll
OutputFile=export.dll
Note
All parameters and values are case-sensitive. Take care, otherwise you
can get report about invalid project error.
Reporting status of compilation
If everything gone smooth, we got linked file export.dll.
D:\BBCBmod>cpcc TestExport.prj
Component Pascal command-line compiler
Compiling CDev\Mod\Test1.cmps
Compiled. pc=68, dsize=0
Linking
File export.dll written: 4608 164
Reporting errors
If errors detected, we get message:
D:\BBCBmod>cpcc TestExport.prj
Component Pascal command-line compiler
Compiling CDev\Mod\Test1.cmps
1 error(s) detected
Error #0: undeclared identifier
Position: row=8, column=7
*Tested on version BlackBox 1.6 RC5.*
Installation
See file INSTALLATION in directory doc.
Usage
Create definition of project (e.g. myproject.prj) in directory where cpcc resides. Follow by template.prj, provided as template for creation of new projects. See TestExport.prj in directory 'examples' too.
Run
cpcc myproject.prj
Project "Component Pascal compiler"