Examples of IRObject


Examples of com.dtrules.interpreter.IRObject

    static class Forfirst extends ROperator {
        Forfirst(){super("forfirst");}

        public void execute(DTState state) throws RulesException {
            RArray   array = state.datapop().rArrayValue();
            IRObject test  = state.datapop();
            IRObject body  = state.datapop();
            Iterator<REntity> ie = (Iterator<REntity>) array.getIterator();
            while(ie.hasNext()){
                state.entitypush(ie.next());
                test.execute(state);
                if(state.datapop().booleanValue()){
                    body.execute(state);
                    state.entitypop();
                    return;
                }
                state.entitypop();
            }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class ForFirstElse extends ROperator {
        ForFirstElse(){super("forfirstelse");}

        public void execute(DTState state) throws RulesException {
            RArray   array = state.datapop().rArrayValue();
            IRObject test  = state.datapop();
            IRObject body2 = state.datapop();
            IRObject body1 = state.datapop();
            for(IRObject obj : array) {
                IREntity e = obj.rEntityValue();
                state.entitypush(e);
                test.execute(state);
                if(state.datapop().booleanValue()){
                    body1.execute(state);
                    state.entitypop();
                    return;
                }
                state.entitypop();
            }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        public void execute(DTState state) throws RulesException {
            int         limit     = state.datapop().intValue();
            int         increment = state.datapop().intValue();
            int         start     = state.datapop().intValue();
            IRObject    body      = state.datapop();
            if(increment>0){
                for(int i = start;i<limit;i+=increment){
                    state.cpush(RInteger.getRIntegerValue(i));
                    body.execute(state);
                    state.cpop();
                }
            }else{
                for(int i = start;i>limit;i+=increment){
                    state.cpush(RInteger.getRIntegerValue(i));
                    body.execute(state);
                    state.cpop();
                }
            }
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

     */
    static class Allocate extends ROperator {
        Allocate(){super("allocate"); alias("cpush");}

        public void execute(DTState state) throws RulesException {
            IRObject v = state.datapop();
            if(state.testState(DTState.TRACE)){
                state.traceInfo("allocate", "value",v.stringValue(),null);
            }
            state.cpush(v);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class Localfetch extends ROperator {
        Localfetch(){super("local@");}

        public void execute(DTState state) throws RulesException {
            int      index = state.datapop().intValue();
            IRObject value = state.getFrameValue(index);
            if(state.testState(DTState.TRACE)){
                state.traceInfo("local_fetch", "index",index+"","value",value.stringValue(),null);
            }
            state.datapush(value);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class Localstore extends ROperator {
        Localstore(){super("local!");}

        public void execute(DTState state) throws RulesException {
            int      index = state.datapop().intValue();
            IRObject value = state.datapop();
            if(state.testState(DTState.TRACE)){
                state.traceInfo("local_store", "index",index+"","value",value.stringValue(),null);
            }
            state.setFrameValue(index, value);
        }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

    static class Lookup extends ROperator {
        Lookup(){super("lookup");}

        public void execute(DTState state) throws RulesException {
            RName name = state.datapop().rNameValue();
            IRObject value = state.find(name);
            if(value == null){
                throw new RulesException(
                        "undefined",
                        "Lookup",
                        "Could not find a value for "+name.stringValue()+" in the current context."
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Greaterthan extends ROperator {
      Greaterthan(){super(">");}

      public void execute(DTState state) throws RulesException {
          IRObject o2 = state.datapop();
          IRObject o1 = state.datapop();
        long number2 = o2.longValue();
        long number1 = o1.longValue();
        state.datapush(RBoolean.getRBoolean(number1 > number2));
      }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

       */
    static class Booleanequal extends ROperator {
      Booleanequal(){super("b="); alias("beq");}

      public void execute(DTState state) throws RulesException {
          IRObject o2 = state.datapop();
          IRObject o1 = state.datapop();
          boolean r = false;
          try{
              r = o1.booleanValue() == o2.booleanValue();
          }catch(RulesException e){}   // Ignore any failures, and simply fail.
         
        state.datapush(RBoolean.getRBoolean(r)  );
      }
View Full Code Here

Examples of com.dtrules.interpreter.IRObject

        FAdd(){
            super("f+");alias("fadd");
        }

        public void execute(DTState state) throws RulesException {
            IRObject b = state.datapop();
            IRObject a = state.datapop();
            state.datapush(RDouble.getRDoubleValue(a.doubleValue()+b.doubleValue()));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.