Click here to Skip to main content
15,893,668 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.
// stub.h , stub definition for partly compiled and partly interpreted class
#ifndef STUB_H
#define STUB_H

#ifdef __MAKECINT__
#pragma include_noerr "compiled.dll" #on_err "compiled.h"
#else
#include "compiled.h"
#endif

/////////////////////////////////////////////////////////////////////////
// Interface of Stub1 class is compiled so that 
//  - We can use this class in a compiled code
//  - We can resolve virtual function 
// However, body of member functions are interpreted.
/////////////////////////////////////////////////////////////////////////
class Stub1 : public Compiled1 { 
 public:
  Stub1() { }
  int publicData2;
  virtual void publicFunc1(); 
  void publicFunc2();

  long G__virtualinfo; // new feature, this allows you to inherit an 
                       // interpreted class from a Stub class
};

/////////////////////////////////////////////////////////////////////////
// interface of following function is compiled so that this can be used
// from compiled code. However, body of the function is interpreted.
/////////////////////////////////////////////////////////////////////////
void interpretedGlobalStubFunc1(); 

#endif

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