Package com.dragome.compiler.ast

Examples of com.dragome.compiler.ast.Block


          //DragomeJsCompiler.errorCount++;
          //        Log.getLogger().error(msg + "\n" + Utils.stackTraceToString(ex));
        }

      }
      Block body= new Block();
      ThrowStatement throwStmt= new ThrowStatement();
      /*
      MethodBinding binding= MethodBinding.lookup("java.lang.RuntimeException", "<init>", "(java/lang/String)V;");
      ClassInstanceCreation cic= new ClassInstanceCreation(methodDecl, binding);
      cic.addArgument(new StringLiteral("Unresolved decompilation problem"));
View Full Code Here


      TryStatement tryStmt= new TryStatement();
      tryStmt.header= (TryHeaderNode) graph.createNode(TryHeaderNode.class);
      tryStmt.header.tryStmt= tryStmt;

      Block tryBlock= new Block(start, end);
      tryStmt.setTryBlock(tryBlock);

      // tryStmt.setBeginIndex(start);

      tryStatements.add(tryStmt);

      CatchClause cStmt= null;

      // Collect all non-default handlers. The range of each handler is
      // from the 'store'-instruction to the beginning of the next
      // handler.
      while (handle != null && !handle.isDefault() && handle.getStartPC() == start && handle.getEndPC() == end)
      {
        if (cStmt != null)
        {
          cStmt.setEndIndex(handle.getHandlerPC() - 1);
        }
        cStmt= createCatchClause(tryStmt, handle);
        handle= handleIterator.hasNext() ? handleIterator.next() : null;
      }

      int foo= -1;
      if (handle != null && handle.isDefault() && handle.getStartPC() == start)
      {
        // Collect first default handler.
        hasFinally= true;
        if (cStmt != null)
        {
          cStmt.setEndIndex(handle.getHandlerPC() - 1);
          tryStmt.setEndIndex(handle.getHandlerPC() - 1);
          // Warning: We only set a lower bound for the end index. The
          // correct index is set later
          // when the finally statement is analysed.
        }
        cStmt= createCatchClause(tryStmt, handle);
        foo= handle.getHandlerPC();
        handle= handleIterator.hasNext() ? handleIterator.next() : null;
      }

      // Last catch stmt has no endIndex, yet!

      while (handle != null && handle.isDefault() && (handle.getHandlerPC() == foo))
      {
        // Skip all remaining default handlers.
        throw new RuntimeException("remaining default handlers");
        // handle = handleIterator.hasNext()?handleIterator.next():null;
      }

      Block catches= tryStmt.getCatchStatements();
      if (catches.getChildCount() == 0)
      {
        throw new ParseException("A try clause must have at least one (possibly default) catch clause", tryStmt);
      }
      cStmt= (CatchClause) catches.getChildAt(0);
      tryBlock.setEndIndex(cStmt.getBeginIndex() - 1);
      cStmt= (CatchClause) catches.getLastChild();
      if (cStmt.getEndIndex() == Integer.MIN_VALUE)
      {
        cStmt.setEndIndex(cStmt.getBeginIndex() + 1);
      }
      tryStmt.setEndIndex(cStmt.getEndIndex());
View Full Code Here

      {
        logger.error("In Expression Optimizer:\n " + e);
      }
    }

    Block block;
    if (DragomeJsCompiler.compiler.reductionLevel == 0)
    {
      block= graph.reduceDumb();
    }
    else
View Full Code Here

    decl.vbs.remove(vb1);
    decl.vbs.remove(vb2);
    VariableBinding vb= decl.vbs.get(0);
    vb.getParentBlock().replaceChild(p, vb);

    Block b= a1.getParentBlock();
    b.removeChild(a1);
    b.removeChild(a2);
    return true;
  }
View Full Code Here

      replacement= a;
    }

    vb.getParentBlock().replaceChild(replacement, vb);

    Block b= a1.getParentBlock();
    b.removeChild(a1);
    b.removeChild(a2);
    return true;
  }
View Full Code Here

TOP

Related Classes of com.dragome.compiler.ast.Block

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.