Script language engine for .NET programs
ReoScript is a powerful JavaScript-like script language engine for .NET Applications. It was designed for inclusion in applications that require a built-in, easy to use, scalable script language with no dependencies other language like C/C++.
- Fully JavaScript statements and operators implement
- JSON and Array literals
- Fully prototype chain mechanism
- Lambda Expression
- Enhanced Array Enumerator and Collection Operations
- Console Runner
- Data exchange with .Net CLR
- Property Extension and Function Extension
- Directly access .Net object with DirectAccess
- Import and using .Net Types in script
- Auto CLR Event Binding
ReoScript is not completely compliant to JavaScript/ECMAScript standard, it has stricter syntax check and own additional syntax, functions and objects in order to enhance usability of data exchange.
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.
-
Download or build the following DLLs, add references to target project
Antlr3.Runtime.dll unvell.ReoScript.dll
-
Import the following namespace
using unvell.ReoScript;
-
Create ScriptRunningMachine and run script
ScriptRunningMachine srm = new ScriptRunningMachine(); srm.Run("alert('hello world!');");
(semicolons at end of line in ReoScript are required)
This feature is planned to implement in next release.
function A() {
this.a = 10;
}
function B() : A() {
this.b = 20;
}
var b = new B;
console.log(b.a + b.a);
The output is:
30
Lambda based where, sum, min, max and etc. are available in Array operations.
var arr = [1, 5, 7, 8, 10, 13, 20, 24, 26];
var result = arr.where(n => n < 10).sum();
The result is:
21
function check_alive(user) {
if (...) {
return 'ok';
} else {
setTimeout(check_alive, 1000, user);
}
}
var user = getCurrentUser();
setTimeout(check_alive, 1000, user);
common.rs:
function check_login(usr, pwd) {
return (usr.password == hashed(pwd));
}
login.rs:
import "common.rs";
var usr = getCurrentUser();
check_login(usr, getInputtedPwd());
Supported to access .NET objects directly (DirectAccess mode).
Initializer used to simplify the code by merging construction and property setting:
var newApple = new Apple() {
color : 'red',
};
It is same as:
var newApple = new Apple();
newApple.color = 'red';
var num = 0b1010;
console.log(num);
The output is:
10
Development Documents are available at: https://reoscript.codeplex.com/documentation
Find more Sample programs and Documents at: http://www.unvell.com/ReoScript
Language Specification see the test-cases: https://reoscript.codeplex.com/wikipage?title=Language%20Specification&referringTitle=Documentation
https://reoscript.codeplex.com/wikipage?title=Change%20Log&referringTitle=Home
The following softwares may be included in this product:
- ANTLR v3
- FastColoredTextBox
ReoScript and ReoScript Editor released under GNU Lesser General Public License (LGPLv3).
Jing, Lu (lujing@unvell.com)
copyright (c) unvell.com 2012-2013 all rights reserved.