Script Engine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hardy Wang

    #1

    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


  • marcin.rzeznicki@gmail.com

    #2
    Re: Script Engine


    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

    Comment

    Working...