2010-08-02 01:38:25 +00:00
contrib Clean up the vim syntax a bit, add escape characters and incorporate changes from bram 2010-04-01 19:01:18 +00:00
include/chaiscript Initial check in of support for upcasting during function invocation. No examples or tests are checked in yet. Some reorg was necessary to get things compiling in the right order. Is not currently thread safe and probably does not work properly across module boundaries 2010-08-02 01:38:25 +00:00
samples Fix up some broken sample files 2009-12-02 14:29:42 +00:00
src Make warnings stricter on windows and clean up all legit warnings in our code. 2010-07-30 18:06:17 +00:00
unittests Add test of dynamic object attribute access shared between c++ and chaiscript 2010-07-25 19:56:19 +00:00
CMakeLists.txt Make warnings stricter on windows and clean up all legit warnings in our code. 2010-07-30 18:06:17 +00:00
description.txt Get cpack working for source and deb distribtions. Still need to check nsis and rpm 2010-03-29 15:32:20 +00:00
license.txt Update copyright for 2010 2010-05-15 22:48:54 +00:00
readme.txt Update copyright for 2010 2010-05-15 22:48:54 +00:00

ChaiScript v2.3.3
http://www.chaiscript.com
(c) 2009-2010 Jason Turner and Jonathan Turner
Release under the BSD license, see "license.txt" for details.

[Introduction]

ChaiScript is one of the first (and perhaps only) embedded scripting language designed from the ground up to directly target C++.  Being a native C++ application, it has some advantages over existing embedded scripting languages:

1) It uses a header-only approach, which makes it easy to integrate with existing projects.
2) It maintains type safety between your C++ application and the user scripts.
3) It supports a variety of C++ techniques including callbacks, overloaded functions, class methods, and stl containers.

[Requirements]

ChaiScript requires a recent version of Boost (http://www.boost.org) to build.

[Usage]

* Add the ChaiScript include directory to your project's header search path
* Add "#include <chaiscript/chaiscript.hpp> to your source file
* Instantiate the ChaiScript engine in your application.  For example, create a new engine with the name 'chai' like so: "chaiscript::ChaiScript_Engine chai"

Once instantiated, the engine is ready to start running ChaiScript source.  You have two main options for processing ChaiScript source: a line at a time using "chai.evaluate_string(string)" and a file at a time using "chai.evaluate_file(fname)"

To make functions in your C++ code visible to scripts, they must be registered with the scripting engine.  To do so, call register_function:

dispatchkit::register_function(chai.get_eval_engine(), &my_function, "my_function_name");

Once registered the function will be visible to scripts as "my_function_name"

[Examples]

ChaiScript is similar to ECMAScript (aka JavaScript(tm)), but with some modifications to make it easier to use.  For usage examples see the "samples" directory, and for more in-depth look at the language, the unit tests in the "unittests" directory cover the most ground.

For example of how to register parts of your C++ application, see "example.cpp" in the "src" directory.