Package weasel.compiler

Examples of weasel.compiler.WeaselBlockInfo


        instructions.add(t.line, new WeaselInstructionPop());
    }
    WeaselInstruction ifJump = new WeaselInstructionJump(startJump);
    instructions.add(token.line, ifJump);
    ifI.setTarget(ifJump);
    WeaselBlockInfo wbi = compilerHelpher.closeBlock();
    int pops = wbi.varsToPop();
    if(pops==1){
      instructions.add(t.line, new WeaselInstructionPop());
    }else if(pops>1){
      instructions.add(t.line, new WeaselInstructionPops(pops));
    }
View Full Code Here


    if(isNative()){
      return;
    }
    System.out.println(method+":"+methodTokens);
    if(WeaselModifier.isStatic(method.getModifier())){
      block = new WeaselBlockInfo(false, -paramNames.size() + 1);
    }else{
      block = new WeaselBlockInfo(false, -paramNames.size());
      block.newVar(0, "this", classCompiler.genericClass);
    }
    for(int i=0; i<paramNames.size(); i++){
      WeaselGenericMethod2 genericMethod = classCompiler.genericClass.getGenericMethod(method.getNameAndDesk(), null);
      block.newVar(paramModifier.get(i), paramNames.get(i), genericMethod.getGenericParams()[i]);
View Full Code Here

   
  }

  @Override
  public void openBlock(boolean canAddBreaks) {
    block = new WeaselBlockInfo(canAddBreaks, block);
  }
View Full Code Here

    block = new WeaselBlockInfo(canAddBreaks, block);
  }

  @Override
  public WeaselBlockInfo closeBlock() {
    WeaselBlockInfo b = block;
    block = block.base;
    return b;
  }
View Full Code Here

    return b;
  }

  @Override
  public int getVarCount() {
    WeaselBlockInfo b = block;
    int count = 0;
    while(b!=null){
      count += b.varsToPop();
      b = b.base;
    }
    return count;
  }
View Full Code Here

    return count;
  }

  @Override
  public void addBreak(int s, WeaselInstructionJump breakJump) {
    WeaselBlockInfo b = block;
    while(s>1){
      if(b.canAddBreaks){
        s--;
      }
      b = b.base;
View Full Code Here

    b.breaks.add(breakJump);
  }
 
  @Override
  public void addContinue(int s, WeaselInstructionJump continueJump) {
    WeaselBlockInfo b = block;
    while(s>1){
      if(b.canAddBreaks){
        s--;
      }
      b = b.base;
View Full Code Here

  }

  @Override
  public void addClosingsAndFrees(int s, WeaselInstructionList instructionList, boolean last) {
    int frees = 0;
    WeaselBlockInfo b = block;
    while(s>1){
      if(b.canAddBreaks){
        s--;
      }
      frees += b.variables.size();
View Full Code Here

      instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
    }
    WeaselInstruction ifJump = new WeaselInstructionJump(continueJump);
    instructions.add(token.line, ifJump);
    ifI.setTarget(ifJump);
    WeaselBlockInfo wbi = compilerHelpher.closeBlock();
    int pops = wbi.varsToPop();
    if(pops==1){
      instructions.add(token.line, new WeaselInstructionPop());
    }else if(pops>1){
      instructions.add(token.line, new WeaselInstructionPops(pops));
    }
View Full Code Here

    instructions.addAll(wcr.getInstructions());
    WeaselTree.autoCast(compiler, wcr.getReturnType(), new WeaselGenericClass(compiler.baseTypes.booleanClass), t.line, instructions, true);
    WeaselInstruction ifJump = new WeaselInstructionJump(startJump);
    instructions.add(t.line, new WeaselInstructionIf(ifJump));
    instructions.add(t.line, ifJump);
    WeaselBlockInfo wbi = compilerHelpher.closeBlock();
    int pops = wbi.varsToPop();
    if(pops==1){
      instructions.add(t.line, new WeaselInstructionPop());
    }else if(pops>1){
      instructions.add(t.line, new WeaselInstructionPops(pops));
    }
View Full Code Here

TOP

Related Classes of weasel.compiler.WeaselBlockInfo

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.