Package com.google.test.metric.cpp.dom

Examples of com.google.test.metric.cpp.dom.Name


    this.nodes = nodes;
  }

  @Override
  public void idExpression(String id) {
    nodes.add(new Name(id));
  }
View Full Code Here


      Node rightSide = assignmentExpression.getExpression(1);
      Variable leftVar = null;
      Variable rightVar = null;
      VariableDeclaration leftDeclaration = null;
      if (leftSide instanceof Name) {
        Name leftName = (Name) leftSide;
        leftDeclaration = leftName.lookupVariable(leftName.getIdentifier());
        leftVar = new Variable(leftDeclaration.getName(),
            CppType.fromName(leftDeclaration.getType()), false, false);
      }
      if (rightSide instanceof Name) {
        Name rightName = (Name) rightSide;
        VariableDeclaration declaration = rightName.lookupVariable(
            rightName.getIdentifier());
        rightVar = new Variable(declaration.getName(),
            CppType.fromName(declaration.getType()), false, false);
      }
      if (leftVar != null && rightVar != null) {
        Node leftParent = leftDeclaration.getParent();
View Full Code Here

  public void endPrimaryExpression() {
  }

  @Override
  public void idExpression(String id) {
    nodes.add(new Name(id));
  }
View Full Code Here

  }

  @Override
  public void beginParameterList() {
    int index = nodes.size() - 1;
    Name name = nodes.get(index);
    nodes.remove(index);
    FunctionInvocation functionInvocation =
      new FunctionInvocation(name.getIdentifier());
    nodes.add(functionInvocation);
    pushBuilder(new ParameterListBuilder(functionInvocation.getParameters()));
    nodes = functionInvocation.getChildren();
  }
View Full Code Here

    assertEquals("b", variableB.getName());
    ExpressionStatement statement = functionMain.getChild(2);
    Expression expression = statement.getExpression(0);
    assertTrue(expression instanceof AssignmentExpression);
    AssignmentExpression assignment = (AssignmentExpression) expression;
    Name leftSide = assignment.getExpression(0);
    Name rightSide = assignment.getExpression(1);
    assertEquals("a", leftSide.getIdentifier());
    assertEquals("b", rightSide.getIdentifier());
  }
View Full Code Here

TOP

Related Classes of com.google.test.metric.cpp.dom.Name

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.