473,383 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

scripting C++

Using the OOTL (Object Oriented Template Library, http://www.ootl.org ) it
would very feasable to write a scripting engine for C++ programs.

The way this hypothetical engine would work is that any OOTL object (that is
an object containing the OOTL_DEF_OBJECT macro) could be exposed along with
an interface written using the BIL (Boost Interfaces Library) IDL
(Interfaces Description Language).

Using the scripting library, would look like this (pardon any C++ usage
errors):

CppScriptEngine theEngine;

std::list<ootl::String> gList;

class MyClass {
DEF_OOTL_OBJECT(MyClass);
void Push(ool::String x) {
gList.push_back(x);
}
};

BOOST_IDL_BEGIN(IMyInterface)
BOOST_IDL_FN0(Push, void, (ootl::String, x))
BOOST_IDL_END(IMyInterface)

int main() {
theEngine.Expose("MyClass", MyClass, IMyInterface);
theEngine.RunInteractiveSession();
while (!gList.empty()) {
std::cout << gList.back() << std::endl;
gList.pop_back();
}
return 0;
}

When this program is run, it would go into a console mode, where it would
allow a limited C++ syntax, and support the core OOTL objects, i.e. Int,
Bool, Char, String, etc. So a possible user session might look like this:

String s = "hello";
MyClass m;
m.Push(s);
m.Push("world");
^Z

Does this kind of tool (open-source of course) interest anyone? Anyone
potentially interested in collaborating?

--
Christopher Diggins
http://www.cdiggins.com
http://www.heron-language.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Jul 22 '05 #1
0 942

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fiona | last post by:
Catalyst Releases Scripting Editions of SocketTools Client and server-side development for Active Server Pages and PHP. Yucca Valley, CA, May 25, 2005 - Catalyst Development Corp...
0
by: fiona | last post by:
Catalyst Releases Scripting Editions of SocketTools Client and server-side development for Active Server Pages and PHP. Yucca Valley, CA, - Catalyst Development Corp (www.catalyst.com) - with...
0
by: fiona | last post by:
Catalyst Releases Scripting Editions of SocketTools Client and server-side development for Active Server Pages and PHP. Yucca Valley, CA, May 25, 2005 - Catalyst Development Corp...
0
by: fiona | last post by:
Catalyst Releases Scripting Editions of SocketTools Client and server-side development for Active Server Pages and PHP. Yucca Valley, CA, May 25, 2005 - Catalyst Development Corp...
0
by: fiona | last post by:
Catalyst Releases Scripting Editions of SocketTools Client and server-side development for Active Server Pages and PHP. Yucca Valley, CA, - Catalyst Development Corp (www.catalyst.com) - with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.