Examples of CurrinRef


Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  first_op = evaluateSubExpr(m, first_op);
  second_op = evaluateSubExpr(m, second_op);


  float a = ((CurrinFloat)first_op.getReference()).getValue();
  float b = ((CurrinFloat)second_op.getReference()).getValue();

  if ( b == 0 )
      throw new InterpreterException("Float division: 0 in denominator!");

  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitive float division: " + a + " " + b);
  m.setResult( new CurrinRef(new CurrinFloat(a / b)));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  first_op = evaluateSubExpr(m, first_op);
  second_op = evaluateSubExpr(m, second_op);


  int a = ((CurrinInt)first_op.getReference()).getValue();
  int b = ((CurrinInt)second_op.getReference()).getValue();

  if ( b == 0 )
      throw new InterpreterException("Integer division: 0 in denominator!");

  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitiva Division enteros: " + a + " " + b);
  m.setResult( new CurrinRef(new CurrinFloat(a / b)));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

  Vector _param_refs = preparingParameters(m, run_parameters);

  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitive 62 62 ");

  CurrinRef action1 = (CurrinRef)_param_refs.get(0);
  //evaluateSubExpr(m, action1);
  while (!action1.inHNF() ) {
      action1.evaluate(m);
  }
  CurrinRef action2 = (CurrinRef)_param_refs.get(1);
  //evaluateSubExpr(m, action2);
  while (!action2.inHNF() ) {
      action2.evaluate(m);
  }

  m.setResult( new CurrinRef(new CurrinConstr("EMPTY", new Vector())));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  float a = ((CurrinFloat)first_op.getReference()).getValue();
  float b = ((CurrinFloat)second_op.getReference()).getValue();

  m.setResult( new CurrinRef(new CurrinFloat(a + b)));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  first_op = evaluateSubExpr(m, first_op);
  second_op = evaluateSubExpr(m, second_op);


  int a = ((CurrinInt)first_op.getReference()).getValue();
  int b = ((CurrinInt)second_op.getReference()).getValue();

  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitive Add integer: " + a + " +  " + b);
  m.setResult( new CurrinRef(new CurrinInt(a + b)));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef _char_to_print = (CurrinRef)_param_refs.get(0);

  _char_to_print = evaluateSubExpr(m, _char_to_print);

  char printme = ((CurrinChar)_char_to_print.getReference()).getChar();
  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitive put char: " + printme );
  System.out.print(printme);
  System.out.flush();
  m.setResult( new CurrinRef(new CurrinConstr("EMPTY", new Vector())));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef _str_to_print = (CurrinRef)_param_refs.get(0);

  //FIXME!!!! Si los parametros estan sin evaluar....
  //_str_to_print = evaluateSubExpr(m, _str_to_print);

  String printme = _str_to_print.print();
  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitive put str: " + printme );
  System.out.print(printme);
  System.out.flush();
  m.setResult( new CurrinRef(new CurrinConstr("EMPTY", new Vector())));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  first_op = evaluateSubExpr(m, first_op);
  second_op = evaluateSubExpr(m, second_op);

  int a = ((CurrinInt)first_op.getReference()).getValue();
  int b = ((CurrinInt)second_op.getReference()).getValue();

  Logger logger = Logger.getLogger("RuntimeLogger");
  logger.debug("Primitiva Mul Enteros: " + a + " * " + b);
  m.setResult( new CurrinRef(new CurrinInt(a * b)));
    }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    }

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  m.setResult(new CurrinRef(new CurrinChar('F')));
  }
View Full Code Here

Examples of org.asturlinux.frade.currin.program.type.CurrinRef

    public void run( Machine m , Vector run_parameters )
  throws InterpreterException {

  Vector _param_refs = preparingParameters(m, run_parameters);

  CurrinRef first_op = (CurrinRef)_param_refs.get(0);
  CurrinRef second_op = (CurrinRef)_param_refs.get(1);

  float a = ((CurrinFloat)first_op.getReference()).getValue();
  float b = ((CurrinFloat)second_op.getReference()).getValue();

  m.setResult( new CurrinRef(new CurrinFloat(a * b)));
    }
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.