Package com.dtrules.infrastructure

Examples of com.dtrules.infrastructure.RulesException


     * local variables can be allocated.
     * @throws RulesException
     */
    public void pushframe() throws RulesException{
        if(framestkptr>=stklimit){
            throw new RulesException("Control Stack Overflow",
                    "pushframe", "Control Stack Overflow.");
           
        }
        frames[framestkptr++] = currentframe;
        currentframe = ctrlstkptr;
View Full Code Here


     * by local variables.
     * @throws RulesException
     */
    public void popframe() throws RulesException{
        if(framestkptr<=0){
            throw new RulesException("Control Stack Underflow",
                    "popframe", "Control Stack underflow.");
        }
        ctrlstkptr = currentframe;                  // Pop off this frame,
        currentframe = frames[--framestkptr];       // Then set the currentframe back to its previous value.
    }
View Full Code Here

     * @return
     * @throws RulesException
     */
    public IRObject getFrameValue(int i) throws RulesException{
        if(currentframe+i >= ctrlstkptr){
            throw new RulesException("OutOfRange","getFrameValue","");
        }
        return getcs(currentframe+i);
    }
View Full Code Here

     * @param value
     * @throws RulesException
     */
    public void setFrameValue(int i, IRObject value) throws RulesException{
        if(currentframe+i >= ctrlstkptr){
            throw new RulesException("OutOfRange","getFrameValue","");
        }
        setcs(currentframe+i, value);
    }
View Full Code Here

     * @return
     * @throws RulesException
     */
    public IRObject getcs(int i) throws RulesException{
        if(i>=ctrlstkptr){
            throw new RulesException("Control Stack Overflow","getcs",
                    "index out of range: "+i);
        }
        if(i<0){
            throw new RulesException("Control Stack Underflow","getcs",
                    "index out of range: "+i);
        }
        return ctrlstk[i];
    }
View Full Code Here

     * @param v
     * @throws RulesException
     */
    public void setcs(int i, IRObject v) throws RulesException{
        if(i>=ctrlstkptr){
            throw new RulesException("Control Stack Overflow","setcs",
                    "index out of range: "+i);
        }
        if(i<0){
            throw new RulesException("Control Stack Underflow","getcs",
                    "index out of range: "+i);
        }
        ctrlstk[i] = v;
    }
View Full Code Here

   */
  public boolean evaluateCondition(IRObject c) throws RulesException {
    int stackindex = datastkptr;         // We make sure the object only produces one boolean.
    c.execute(this);              // Execute the condition.
    if(datastkptr-1 != stackindex){
      throw new RulesException("Stack Check Exception","Evaluation of Condition","Stack not balanced");
    }
    return datapop().booleanValue();
  }
View Full Code Here

   */
  public void evaluate(IRObject c) throws RulesException {
    int stackindex = datastkptr;
    c.execute(this);
    if(datastkptr != stackindex){
      throw new RulesException("Stack Check Exception","Evaluation of Action","Stack not balanced");
    }
  }
View Full Code Here

        public void execute(DTState state) throws RulesException {
            IRObject value = state.datapop();
            RName    name  = state.datapop().rNameValue();
            boolean f = state.def(name, value, true);
            if(!f)throw new RulesException("Undefined",
                    "def",
                    name+" is undefined");
        }
View Full Code Here

        Find(){super("find");}

        public void execute(DTState state) throws RulesException {
            RName    name = state.datapop().rNameValue();
            IRObject v    = state.find(name);
            if(v==null)throw new RulesException("Undefined",
                    "find",
                    name+" is undefined");
        }
View Full Code Here

TOP

Related Classes of com.dtrules.infrastructure.RulesException

Copyright © 2018 www.massapicom. 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.