Package org.destecs.core.simulationengine.script.values

Examples of org.destecs.core.simulationengine.script.values.Value


    if(val == null)
    {
      return null;
    }
   
    Value newValue = Value.valueOf(val);
    if (newValue == null)
    {
      interpreter.scriptError("Could not find variable: " + simulator
          + " " + node.getName());
    }
View Full Code Here


  }

  @Override
  public Value caseABinaryExp(ABinaryExp node) throws Throwable
  {
    Value left = node.getLeft().apply(this);
    Value right = node.getRight().apply(this);
    if (left.getClass() != right.getClass())
    {
      return new BooleanValue(false);
    }

    switch (node.getOperator().kindPBinop())
View Full Code Here

  }

  @Override
  public Value caseAUnaryExp(AUnaryExp node) throws Throwable
  {
    Value val = node.getExp().apply(this);
    switch (node.getOperator().kindPUnop())
    {
      case ABS:
        if (val instanceof DoubleValue)
        {
View Full Code Here

  public void caseAWhenStm(AWhenStm node) throws Throwable
  {
   
    boolean checkRevert = false;
   
    Value v = node.getTest().apply(expEval);

    if (v instanceof BooleanValue && ((BooleanValue) v).value && !whenDisabled.contains(node))
    {
     
      if(node.getFor() != null && whenForExp.get(node) == null)
View Full Code Here

    if(disabledOnce.contains(node))
    {
      return;
    }   
   
    Value v = node.getTest().apply(expEval);

    if (!disableOnceRevert.contains(node) && v instanceof BooleanValue && ((BooleanValue) v).value
        || checkOnceFor(node))
    {
      if (node.getFor() != null && onceForExp.get(node) == null)
View Full Code Here

  private boolean checkWhenFor(AWhenStm node) throws Throwable
  {
    PExp forExp = whenForExp.get(node);
    if (forExp != null)
    {
      Value v = forExp.apply(expEval);
      return (v instanceof BooleanValue && ((BooleanValue) v).value);
    }
    return false;
  }
View Full Code Here

  private boolean checkOnceFor(AOnceStm node) throws Throwable
  {
    PExp forExp = onceForExp.get(node);
    if (forExp != null)
    {
      Value v = forExp.apply(expEval);
      return (v instanceof BooleanValue && ((BooleanValue) v).value);
    }
    return false;
  }
View Full Code Here

  }

  @Override
  public void caseAAssignStm(AAssignStm node) throws Throwable
  {
    Value v = null;
    try
    {
      v = node.getValue().apply(expEval);
    } catch (Exception e)
    {
View Full Code Here

TOP

Related Classes of org.destecs.core.simulationengine.script.values.Value

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.