Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.Statement


  }
 
  public boolean visit(Block node) {
    IValueList statements = new IValueList(values);
    for (Iterator it = node.statements().iterator(); it.hasNext();) {
      Statement s = (Statement) it.next();
      statements.add(visitChild(s));
    }
   
    ownValue = constructStatementNode("block", statements.asList());
   
View Full Code Here


   
    IValue expression = visitChild(node.getExpression());
 
    IValueList statements = new IValueList(values);
    for (Iterator it = node.statements().iterator(); it.hasNext();) {
      Statement s = (Statement) it.next();
      statements.add(visitChild(s));
    }
 
    ownValue = constructStatementNode("switch", expression, statements.asList());
   
View Full Code Here

    List statements = body.statements();
    if (!adapter.isRoot()&&!statements.isEmpty()) {
      Object firstStatement = statements.get(0);
      if (firstStatement instanceof IfStatement) {
        IfStatement ifstatement = (IfStatement) firstStatement;
        Statement thenstatement = ifstatement.getThenStatement();
        if (thenstatement instanceof Block) {
          statements = ((Block) thenstatement).statements();
        }
      }
    }
    boolean success = false;
    for (Object stmt : statements) {
      Statement statement = (Statement) stmt;
      if (statement instanceof ExpressionStatement) {
        if (processWidgetCreationStatement(type, adapter, esd, mListener, statement))
          success = true;
      }
    }
View Full Code Here

 
  public void parse(String lnfClassname, TypeDeclaration type) {
    List statements = getBeanPropertyInitStatements(adaptable, type);
    for (Object stmt : statements) {
      Statement statement = (Statement) stmt;
      if (statement instanceof ExpressionStatement) {
        ExpressionStatement es = (ExpressionStatement) statement;
        Expression expression = es.getExpression();
        if (expression instanceof MethodInvocation) {
          MethodInvocation mi = (MethodInvocation) expression;
View Full Code Here

        statements = body.statements();
        if (!statements.isEmpty()) {
          Object first = statements.get(0);
          if (first instanceof IfStatement) {
            IfStatement ifs = (IfStatement) statements.get(0);
            Statement thenstmt = ifs.getThenStatement();
            if (thenstmt instanceof Block) {
              Block block = (Block) thenstmt;
              statements = block.statements();
            }
          }
View Full Code Here

    context.peek().push(varCtx);
    List statements = block.statements();
    try {
      if (statements != null && !statements.isEmpty()) {
        for (int i = 0; i < statements.size(); i++) {
          Statement statement = (Statement) statements.get(i);
          IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager().getAdapter(statement, IEvaluator.class);
          int result = evaluator.evaluate(context);
          switch (result) {
          case CONTINUE:
            return CONTINUE;
View Full Code Here

//    ------------------- 2 -> 3 -------------------
//    ------------------- 2 -> exit ----------------

    // TODO: Add formal parameter, so a continue; makes more sense
    Expression expression = node.getExpression();
    Statement body = node.getBody();
    ControlFlowNode expressionCFN = null;
    ControlFlowNode bodyCFN = null;
    ControlFlowNode exit = controlFlowNode.getNode(ControlFlowNode.Direction.FORWARDS);
   
    if(expression == null)
View Full Code Here

//    -------------------------- 3 -> exit -----------------------

    List initializers = node.initializers();
    Expression expression = node.getExpression();
    List updaters = node.updaters();
    Statement body = node.getBody();
    List<ControlFlowNode> initializercfns = null, updatercfns = null;
    ControlFlowNode expressioncfn = null, bodycfn = null, tempcfn;
    ControlFlowNode exit = controlFlowNode.getNode(ControlFlowNode.Direction.FORWARDS);
    ControlFlowNode first = controlFlowNode;
   
View Full Code Here

  /**
   * Example: if(bool) x = 5; else x = 7;
   */
  public boolean visit(IfStatement node) {
    Expression expression = node.getExpression();
    Statement thenStatement = node.getThenStatement();
    Statement elseStatement = node.getElseStatement();

    ControlFlowNode conditionCFN = controlFlowNode.newControlFlowNode(expression);
    // conditionCFN.copyLabelsFrom(controlFlowNode);
    ControlFlowNode thenCFN = controlFlowNode.newControlFlowNode(thenStatement);
    ControlFlowNode elseCFN = null;
View Full Code Here

    controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, expressionCFN);
   
    Iterator i = statements.iterator();
    List<ControlFlowNode> statementCFNs = new LinkedList<ControlFlowNode>();
    ControlFlowNode cfn = null, previous = null;
    Statement astNode;
    boolean haveSeenDefault = false;
    while(i.hasNext()) {
      astNode = (Statement) i.next();
      cfn = controlFlowNode.newControlFlowNode(astNode);
      statementCFNs.add(cfn);
      if(previous != null)
        previous.addEdge(Direction.FORWARDS, cfn);
      if(astNode.getNodeType() == ASTNode.SWITCH_CASE) {
        expressionCFN.addEdge(Direction.FORWARDS, cfn);
        SwitchCase sc = (SwitchCase) astNode;
        if(sc.isDefault()) {
          if(haveSeenDefault)
            throw new CrystalRuntimeException("cannot have more than one default in a switch");
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.Statement

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.