Exemplo n.º 1
0
 private void checkTypes_(Env env, Resolver resolver) throws CError {
   coerce = new Coerce(token).lhsT(children[0].getType()).rhsT(children[1].getType());
   coerce.checkTypes(env, resolver);
   type = coerce.getType();
   modnum = new ModNum(token).type(type);
   modnum.checkTypes(env, resolver);
 }
Exemplo n.º 2
0
  public void genLLVM(Env env, Emitter emitter, Function function) {
    children[0].genLLVM(env, emitter, function);
    children[1].genLLVM(env, emitter, function);

    if (modnum != null) {
      coerce.lhsV(children[0].getInstruction());
      coerce.rhsV(children[1].getInstruction());
      coerce.genLLVM(env, emitter, function);
      modnum.lhs(coerce.getInstructionL());
      modnum.rhs(coerce.getInstructionR());
      modnum.genLLVM(env, emitter, function);
      instruction = modnum.getInstruction();

    } else {
      overload.genLLVM(env, emitter, function);
      instruction = overload.getInstruction();
    }
  }