Package org.eclipse.jdt.core.dom

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


//           ---- 1 ----   ----- 2 ---    --- 5 -> 2 --   --- 4 ---
//    -------------------------- 3 -> 4 --------------------------
//    -------------------------- 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);
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);
View Full Code Here

  }
  /**
   * Example: myVar instanceof MyClass
   */
  public boolean visit(InstanceofExpression node) {
    Expression expression = node.getLeftOperand();
    if(expression == null)
      return false;

    ControlFlowNode expressioncfn = controlFlowNode.newControlFlowNode(expression);
    controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, expressioncfn);
View Full Code Here

  }
  /**
   * Example: var.getRef.myMethod(1, "two", true);
   */
  public boolean visit(MethodInvocation node) {   
    Expression expression = node.getExpression();
    List arguments = node.arguments();
    ControlFlowNode expressioncfn = null, last = null;
    List<ControlFlowNode> cfns = null;
   
    if(expression != null) {
View Full Code Here

   */
  public boolean visit(ReturnStatement node) {
   
    controlFlowNode.returning();
   
    Expression expression = node.getExpression();
    if(expression != null) {
      ControlFlowNode expressionCFN = controlFlowNode.newControlFlowNode(expression);
      controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, expressionCFN);
      expressionCFN.addEdge(ControlFlowNode.Direction.FORWARDS, controlFlowNode);
      expressionCFN.evaluate();
View Full Code Here

  public boolean visit(SingleMemberAnnotation node) {
    return false;
  }

  public boolean visit(SingleVariableDeclaration node) {
    Expression initializer = node.getInitializer();
    if(initializer == null)
      return false;
    ControlFlowNode initializercfn = controlFlowNode.newControlFlowNode(initializer);
    controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, initializercfn);
    initializercfn.addEdge(ControlFlowNode.Direction.FORWARDS, controlFlowNode);
View Full Code Here

  }
  /**
   * Example: super(arg1);
   */
  public boolean visit(SuperConstructorInvocation node) {
    Expression expression = node.getExpression();
    List arguments = node.arguments();
    ControlFlowNode expressioncfn = null, last = null;
    List<ControlFlowNode> cfns = null;
   
    if(expression != null) {
View Full Code Here

    evaluate(cfns);
    return false;
  }

  public boolean visit(SwitchCase node) {
    Expression expression = node.getExpression();
    if(expression == null)
      return false;
   
    ControlFlowNode expressioncfn = controlFlowNode.newControlFlowNode(expression);
    controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, expressioncfn);
View Full Code Here

    expressioncfn.evaluate();
    return false;
  }

  public boolean visit(SwitchStatement node) {
    Expression expression = node.getExpression();
    List statements = node.statements();
    if(expression == null)
      throw new CrystalRuntimeException("Switch statement without an expression?");
    if(statements == null || statements.size() == 0)
      throw new CrystalRuntimeException("Switch statements without any statements?");
View Full Code Here

  @Test
  public void testReadField() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldRead", FIELD_READ);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Expression read = (Expression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(read);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof LoadFieldInstruction);
    LoadFieldInstruction load = (LoadFieldInstruction) instr;
    Assert.assertTrue(load.getSourceObject() instanceof ThisVariable);
View Full Code Here

TOP

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

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.