473,806 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script Engine

Hi all,

Anybody knows where can I find some information about script engine theory?

I have the requirement:
Our product has some template files, and there placeholder/variabled
embedded inside template (like %CurrentTime%, %HoursRemaining % and so on).
There are also some other variables (like %Coupon%) whose value is based on
values of other variables.
For example
if (%HoursRemainin g% < 5) {
%Coupon% = "Hello 1";
} else if (%HoursRemainin g% < 10) {
%Coupon% = "Hello 2";
} else {
%Coupon% = "";
}

What we need is to build some generic solution to handle this type of
requirements, what I am thinking is to create some type of very simple
script to embed inside template.

So my question is, where can I start to build my script engine? Any
reference/sample I can look?

--
WWW: http://www.imagestation.com/members/hardywang
ICQ: 3359839
yours Hardy
Oct 11 '06 #1
1 3011

Hardy Wang napisal(a):
Hi all,

Anybody knows where can I find some information about script engine theory?
I have never heard of "script engine theory" but from what you've
written you need to know something about parsing theory. While the
topic, in its full extent, is quite tricky and requires a lot of
math/CS knowledge, your requirement is simple enough that you should
get away with just a good tool
I have the requirement:
Our product has some template files, and there placeholder/variabled
embedded inside template (like %CurrentTime%, %HoursRemaining % and so on).
There are also some other variables (like %Coupon%) whose value is based on
values of other variables.
For example
if (%HoursRemainin g% < 5) {
%Coupon% = "Hello 1";
} else if (%HoursRemainin g% < 10) {
%Coupon% = "Hello 2";
} else {
%Coupon% = "";
}

What we need is to build some generic solution to handle this type of
requirements, what I am thinking is to create some type of very simple
script to embed inside template.

So my question is, where can I start to build my script engine? Any
reference/sample I can look?
I'd recommend AntLr: http://www.antlr.org/ . It's been stable for quite
a long time, it also generates C# code, and in my opinion has gentle
learning curve. Read the docs, give yourself a minute of thinking and
go on. Good luck

Oct 11 '06 #2

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

Similar topics

2
2323
by: jianchiwei | last post by:
question: I run c:\python23\Lib\site-packages\win32comext\axscript\client\pyscript.py and it told me Registered: Python Registration of Python ActiveX Scripting Engine complete. But, when I run a asp script <%@LANGUAGE=Python%>
5
3079
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError, adStatus, pRecordset ) - rs being a server-side ADODB.Recordset object - but it doesn't get called whenever rs is moved (I browse it in a loop). Is there a way to catch those events from ASP?
3
8438
by: Ed Brandmark | last post by:
I have a tag of the form <SCRIPT LANGUAGE="JavaScript1.1" SRC="foo.js"..... and was wondering if this delays the loading of my page until that file foo.js downloads. It seems that if I place this in the HEAD of my document - the page will wait until it downloads. If I place it in the BODY of my document - supposedly the page
16
4755
by: fernandez.dan | last post by:
Hey I'm sorry if this is not the appropriate news group for this question. I was wondering if anyone has any recommendation for embbedding a script engine in a c++ application. I want to feed my C++ application scripts which based on the script would create C++ objects and call the appropriate methods. At the moment I created a simple interpreter within our C++ aplication that we can feed our custom scripts. The interpreter is primitive...
38
7172
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } function makeArray0() {
1
2505
by: Carl Waldbieser | last post by:
Has anyone had any experience embedding a CPython engine in a .NET application? In the COM/ActiveX world, it was pretty easy to use Mark Hammond's win32 modules to create a script engine component that you could expose other COM objects to, but I was not sure how I would go about doing something similar in a .NET environment. For example, something like: .... .NET Application code ... 'Create Foo object. set Foo = New Foo("baz")...
9
1725
by: sam.s.kong | last post by:
Hello! I have a JavaScript code like the following. <script> var s = "</script>"; ....
1
2713
by: Andrus | last post by:
I'm creating WinForms ERP application. This application need to run custom scripts in may places like: retrieving list of invoices before adding invoice before saving invoice after saving invoice before posting invoice after posing etc.
3
11303
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.