Click here to Skip to main content
15,895,462 members
Articles / Programming Languages / C++

Building a simple C++ script compiler from Scintilla and CINT

Rate me:
Please Sign up or sign in to vote.
4.74/5 (26 votes)
8 Jul 2006CPOL7 min read 154.4K   7.6K   85  
How to build a simple C++ script compiler from Scintilla and CINT.
demo/makecint/UserMain/README 

 This is the simplest example of how you can embed Cint into your application.

OUTLINE =====================================================================

1) Files
 This directory contains following files,

	README       : This file
	UserMain.h   : Header file for user's main application
	UserMain.cxx : Source file for user's main application
	script.cxx   : Script to be interpreted by embedded Cint
	setup	     : Shell script to setup and test 
	setup.bat    : Windows batch file to setup and test , VC++
	setupbc.bat  : Windows batch file to setup and test , Borland C++

  To run this demo, simply run setup script.

       $ sh setup              UNIX

       c:\> setup.bat          Windows Visual C++

       c:\> setupbc.bat        Windows Borland C++



2) Compiling UserMain 

   UNIX
	$ makecint -mk Makefile -m -I$CINTSYSDIR -o UserMain -H UserMain.h -C++ UserMain.cxx

   Windows Visual C++
	$ makecint -mk Makefile -m -I%CINTSYSDIR% -o UserMain -H UserMain.h -C++ UserMain.cxx

   Windows Borland C++
	$ makecint -mk Makefile -m -Ic/cint -o UserMain -H UserMain.h -C++ UserMain.cxx

You need to do above only once. After this, you can create the object 
"Complex" simply by make.

   UNIX
	$ make -f Makefile

   WinNT Visual C++
        c:\> nmake /F Makefile CFG="UserMain - Win32 Release"
        c:\> move Release\UserMain.exe UserMain.exe

   WinNT Borland C++
        c:\> make.exe -f Makefile


3) Using the "Complex"
 Created object "UserMain" is a user appliation which invokes C/C++ 
interpreter. Refer to UserMain.cxx how it is implemented.

	$ UserMain

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions