Package weasel.compiler

Examples of weasel.compiler.WeaselInstructionList.addAll()


         || oper==WeaselOperator.BITWISE_XOR || oper==WeaselOperator.LESS || oper==WeaselOperator.GREATER
         || oper==WeaselOperator.LESS_EQUAL || oper==WeaselOperator.GREATER_EQUAL
         || oper==WeaselOperator.PLUS || oper==WeaselOperator.MINUS || oper==WeaselOperator.TIMES || oper==WeaselOperator.DIVIDE
         || oper==WeaselOperator.REMAINDER){
      wcr = compileInfixOperator(compiler, compilerHelper, null, expect, null, false, i-1);
      instructions.addAll(wcr.getInstructions());
      wgc = wcr.getReturnType();
      wcr = level.get(i+1).compile(compiler, compilerHelper, null, expect, null, false);
      ret = wcr.getReturnType();
      wgc = WeaselTree.autoCast(compiler, wgc, ret, operator.line, instructions, false);
      instructions.addAll(wcr.getInstructions());
View Full Code Here


      instructions = new WeaselInstructionList();
      instructions.add(token.line, new WeaselInstructionJumperDummy());
    }
    WeaselInstruction startJump = instructions.getLast();
    wcr = tree2.compile(compiler, compilerHelpher, null, new WeaselGenericClass(compiler.baseTypes.voidClass), null, false);
    instructions.addAll(wcr.getInstructions());
    WeaselTree.autoCast(compiler, wcr.getReturnType(), new WeaselGenericClass(compiler.baseTypes.booleanClass), token.line, instructions, true);
    WeaselInstructionIf ifI;
    instructions.add(token.line, ifI = new WeaselInstructionIf());
    if(t.tokenType==WeaselTokenType.OPENBLOCK){
      t = iterator.next();
View Full Code Here

    instructions.add(token.line, ifI = new WeaselInstructionIf());
    if(t.tokenType==WeaselTokenType.OPENBLOCK){
      t = iterator.next();
      while(t.tokenType!=WeaselTokenType.CLOSEBLOCK){
        iterator.previous();
        instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
        t = iterator.next();
      }
    }else{
      iterator.previous();
      instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
View Full Code Here

        instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
        t = iterator.next();
      }
    }else{
      iterator.previous();
      instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
    }
    WeaselInstruction continueJump = instructions.getLast();
    if(tree3!=null){
      wcr = tree3.compile(compiler, compilerHelpher, null, new WeaselGenericClass(compiler.baseTypes.voidClass), null, false);
      instructions = wcr.getInstructions();
View Full Code Here

                superCaller = false;
                auto = false;
                WeaselTree tree = WeaselTree.parse(iterator, WeaselTokenType.CLOSEBRACKET);
                List<WeaselGenericMethod2> methods = classCompiler.genericClass.getGenericMethodsOfThis("<init>", true);
                WeaselParameterCompileReturn wpcr = WeaselTree.compileParamList(token.line, "<init>", compiler, this, tree, methods);
                instructions.addAll(wpcr.instructions);
                instructions.add(token.line, new WeaselInstructionInvoke(wpcr.method.getMethod().getMethod().getClassNameAndDesk()));
                token = iterator.next();
                if(token.tokenType!=WeaselTokenType.SEMICOLON)
                  throw new WeaselCompilerException(token.line, "Expect ; but got %s", token);
              }else if(token.param==WeaselKeyWord.SUPER){
View Full Code Here

                superCaller = true;
                auto = false;
                WeaselTree tree = WeaselTree.parse(iterator, WeaselTokenType.CLOSEBRACKET);
                List<WeaselGenericMethod2> methods = classCompiler.genericClass.getGenericSuperClass().getGenericMethodsOfThis("<init>", true);
                WeaselParameterCompileReturn wpcr = WeaselTree.compileParamList(token.line, "<init>", compiler, this, tree, methods);
                instructions.addAll(wpcr.instructions);
                instructions.add(token.line, new WeaselInstructionInvoke(wpcr.method.getMethod().getMethod().getClassNameAndDesk()));
                token = iterator.next();
                if(token.tokenType!=WeaselTokenType.SEMICOLON)
                  throw new WeaselCompilerException(token.line, "Expect ; but got %s", token);
              }else{
View Full Code Here

        }
      }
    }
    while(iterator.hasNext()){
      try{
        instructions.addAll(WeaselTree.parseAndCompile(compiler, this, iterator));
      }catch(WeaselCompilerException e){
        compiler.addWeaselCompilerMessage(new WeaselCompilerMessage(MessageType.ERROR, e.getLine(), parentClass.getFileName(), e.getMessage()));
        iterator.previous();
        WeaselToken token = iterator.next();
        while(token.tokenType!=WeaselTokenType.SEMICOLON && iterator.hasNext()){
View Full Code Here

    WeaselCompilerReturn wcr;
    WeaselInstructionList instructions = new WeaselInstructionList();
    WeaselInstruction continueJump = new WeaselInstructionJumperDummy();
    instructions.add(token.line, continueJump);
    wcr = tree1.compile(compiler, compilerHelpher, null, new WeaselGenericClass(compiler.baseTypes.booleanClass), null, false);
    instructions.addAll(wcr.getInstructions());
    WeaselTree.autoCast(compiler, wcr.getReturnType(), new WeaselGenericClass(compiler.baseTypes.booleanClass), token.line, instructions, true);
    WeaselInstructionIf ifI;
    instructions.add(token.line, ifI = new WeaselInstructionIf());
    if(t.tokenType==WeaselTokenType.OPENBLOCK){
      t = iterator.next();
View Full Code Here

    instructions.add(token.line, ifI = new WeaselInstructionIf());
    if(t.tokenType==WeaselTokenType.OPENBLOCK){
      t = iterator.next();
      while(t.tokenType!=WeaselTokenType.CLOSEBLOCK){
        iterator.previous();
        instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
        t = iterator.next();
      }
    }else{
      iterator.previous();
      instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
View Full Code Here

        instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
        t = iterator.next();
      }
    }else{
      iterator.previous();
      instructions.addAll(WeaselTree.parseAndCompile(compiler, compilerHelpher, iterator));
    }
    WeaselInstruction ifJump = new WeaselInstructionJump(continueJump);
    instructions.add(token.line, ifJump);
    ifI.setTarget(ifJump);
    WeaselBlockInfo wbi = compilerHelpher.closeBlock();
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.