C + + parser--cint__c++

Source: Internet
Author: User
Tags inheritance

CINT is an interpreter using the C + + syntax, CINT compatible with 95% ANSI C code and 85% ANSI C + + code. This basically means that if your code doesn't use a too-specialized C + + syntax, CINT can parse correctly, such as classes, virtual functions, operator overloads, inheritance, pointers, arrays, and so on. CINT even supports templates. The CINT-C + + language features that are not supported are listed in Limitions. I. Composition

CINT has been ported to a variety of platforms, the current latest version is 5.18.00, under the Windows platform, CINT consists of the following four parts:

Interpreter Cint.exe

It accepts and interprets the source code for C/C + +, which has the name extension. C.,. cpp,. cxx.

Library file Libcint.dll

It provides a CInt runtime environment.

Lib compiler Makecint.exe

It compiles the specified C + + library to use an extension library by CINT, although the CINT itself does not compile, but it creates a makefile for using the C + + compiler.

System Library/include

Provides header files for standard +/C + + libraries such as stdio.h, iostream.h, and time.h. second, the installation

First, download the latest installation package to the CINT website, there are usually two types of installation packages, one is a compiled binary file, one is an precompiled source code, and my suggestion is that both packages are downloaded because the system library is not included in the binary package. For the source code, first determine the compiler used, in the installation package directory Platform subdirectory to find your compiler, if not found, hehe. In the directory that corresponds to your compiler, there is usually a Setup.bat file that you use to set the related variables and compile them. CINT runtime must have a system variable of cintsysdir, it should be set to contain the above CINT directory, in addition, for ease of use, add Cintsysdir to the system's PATH is a good choice. Third, function

3.1, support K&r-c, Ansi-c, ansi-c++

The Cint covers the 80-90% k&r-c, ansi-c, and C + + language features. Includes multiple inheritance, virtual function overloading, operator overloading, default parameters, templates (this fierce), and so on. CInt's goal is not to become a processor for the 100% compliant ansi/isoc++ language, but rather a portable scripting environment that can parse most of the standard C + +.

3.2, can handle large-scale C/A + + source

CInt can handle a large scale C/s + + source, which is not all C + + interpreter can do. CInt can quickly load into the source file and parse more than 60,000 lines of code.

3.3, can be mixed with the compilation code

Based on the need for speed and interactivity, you can mix code and scripting code. The Makecint tool can embed any C + + object as a precompiled library into a script, and the precompiled library can be configured as a dynamic link library. Scripting code and precompiled code can be called seamlessly in both directions.

3.4, dynamic C + +

The CInt is dynamic. It can handle C + + declarations from the command line, dynamically define/remove declarations of classes and functions, load/unload source files and dynamic libraries, and an extended rtti mechanism, which is enough to give you an incredible C + + usage.

3.5, built-in debugger and class Browser

CInt has a built-in debugger that can be used to debug complex C + + execution processes. Based on the text class browser is a part of the debugger function four, source code compilation

4.1, install MinGW and Msys, and add it to the environment path, such as:

Mingw_home = C:\MinGW

Path= $PATH:;%mingw_home%;%mingw_home%\bin;%mingw_home%\msys\1.0;%mingw_home%\msys\1.0\bin;

4.2, set Msys fstab (c:/mingw/msys/1.0/etc/), add the following statement at the end of the file, note that the Dos8.3 naming rules are used here. You can refer to the following statement to implement:

Char *tmp_sdk = "C:\\Program Files\\microsoftsdks";

TCHAR strlongpathname[256];

MultiByteToWideChar (CP_ACP, 0, TMP_SDK,-1, strlongpathname,256);

TCHAR Szshortpathname[max_path] = {0};

Getshortpathnamew (Strlongpathname,szshortpathname, MAX_PATH);

Fstab

C:/mingw/mingw

C:/activestate/perl/perl

C:/workspace/interpreter/cint-5.18.00/cint

C:/progra~1/mid05a~1/msvc8

C:/progra~1/mi2578~1/windows/v7.0a/psdk

4.3, the preparation of CInt configure documents

4.3.1, a row in the C:\cint\configure function config_msvc7

Cflags= "-G5-MD-NOLOGO-WD4996-GX"

Amended to

Cflags= "-G5-MT-NOLOGO-WD4996-GX"

4.3.2, manglepaths= "cygpath-m" annotation, plus # in front

4.4, from the VS2005 console run Vcvarsall.bat set:

Setting environment for using Microsoft Visual Studio, X86tools.

Then enter Msys.bat run Msys in the vs2005 command window.

4.5 Set the variable in Msys:

Export Path=/msvc8/vc/bin:/msvc8/common7/ide: $PATH

Export Include=/psdk/include:/msvc8/vc/include

Export Lib=/psdk/lib:/msvc8/vc/lib

Then the CD to the CInt source path, and then enter:./configure, finally input: Make–j4 can generate CInt dynamic library

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.