ReoScript
Script language engine for .Net programs
ReoScript is a powerful JavaScript-like script language engine implemented in C#. It
be designed for inclusion in applications that require a built-in, easy to use,
scalable script language with no dependencies other language like C/C++.
ReoScript Editor
Features
The following features are available:
ReoScript is not completely compliant to JavaScript/ECMAScript standard, it has
stricter syntax check and own additional syntax, function and object in order to
enhance usability of data exchange. For detailed information please check Incompatibility
Notes.
ReoScript provides a simple script Editor it can be used to write and execute script
directly. The Editor can also be included in application and provided to end-user.
Hello World!
Execute ReoScript directly
To make your first ReoScript and see 'hello world' be printed. Just start ReoScript
Editor by executing ReoScriptEditor.exe and input the following code, then choose
menu 'Script' -> 'Run' (or press F5). The 'hello world' will be printed in console.
console.log('hello world');
As you watched the code to print 'hello world' has been already prepared when editor
starting up. Editor may has a default content to load and display in initializing.
To give your Editor a customize default script please see How to integrate script
editor in application.
Execute ReoScript by programming
To use ReoScript in your application, the following assemblies need be referenced.
- Antlr3.Runtime.dll
- Unvell.ReoScript.dll
And following namespace should be imported in code file.
using Unvell.ReoScript;
Now you can use ScriptRunningMachine to execute script, call Run method and
pass script string as argument.
ScriptRunningMachine srm = new ScriptRunningMachine();
srm.Run("alert('hello world!');");
Note that last semicolon in ReoScript is required, ignore it will cause a runtime
exception to be thrown. Here is Simplest Application that shows how to use ReoScript
saying 'hello world!' in .Net program.
Incompatibility Notes
- Semicolon Check - Except statement block (non-anonymous function, if, for, switch and etc.), all sentences in ReoScript should ends with a semicolon.
- Global Object - Global object named window in JavaScript but named script in ReoScript.
- Regular Expressions - JavaScript Regular Expressions currently not supported. However, you can make an extension object or native function to support .Net Regular Expressions for script.
Third-Party
The following softwares may be included in this product:
License
ReoScript and ReoScript Editor released under GNU Lesser General Public License
(LGPLv3).