Package com.google.test.metric

Examples of com.google.test.metric.LocalVariableInfo


    @Override
    public void visit(VariableDeclaration localVariableDeclaration) {
      Type variableType = CppType.fromName(localVariableDeclaration.getName(),
          localVariableDeclaration.isPointer());
      variables.add(new LocalVariableInfo(localVariableDeclaration.getName(),
          variableType));
    }
View Full Code Here


    Label runtimeHandler = new Label();
    Label catchEnd = new Label();
    Label finallyHandler = new Label();
    Label l20 = new Label();
    Label l22 = new Label();
    Variable b = new LocalVariableInfo("b", JavaType.INT);
    Variable e = new LocalVariableInfo("e", JavaType.OBJECT);
    Variable any = new LocalVariableInfo("any", JavaType.OBJECT);
    decomposer.tryCatchBlock(tryStart, tryEnd, runtimeHandler, "java/lang/RuntimeException");
    decomposer.tryCatchBlock(tryStart, catchEnd, finallyHandler, null);

    /* 0*/ decomposer.addOp(new Load(0, new Constant(1, JavaType.INT)));
    /* 1*/ decomposer.addOp(new Store(1, b));
View Full Code Here

    this.isFinal = isFinal;
    this.visibility = visibility;
    int slot = 0;
    if (!isStatic) {
      Type thisType = JavaType.fromJava(classInfo.getName());
      methodThis = new LocalVariableInfo("this", thisType);
      slots.put(slot++, methodThis);
      localVariables.add((LocalVariableInfo) methodThis);
    }
    for (Type type : parse(desc).getParameters()) {
      ParameterInfo parameterInfo = new ParameterInfo("param_" + slot, type);
View Full Code Here

  public void visitLocalVariable(String name, String desc, String signature,
      Label start, Label end, int slotNum) {
    Type type = JavaType.fromDesc(desc);
    Variable variable = slots.get(slotNum);
    if (variable == null) {
      LocalVariableInfo localVar = new LocalVariableInfo(name, type);
      slots.put(slotNum, localVar);
      localVariables.add(localVar);
    } else {
      variable.setName(name);
    }
View Full Code Here

  }

  private Variable variable(int varIndex, Type type) {
    Variable variable = slots.get(varIndex);
    if (variable == null) {
      LocalVariableInfo localVar = new LocalVariableInfo("local_" + varIndex, type);
      slots.put(varIndex, localVar);
      localVariables.add(localVar);
      variable = localVar;
    }
    Type varType = variable.getType();
View Full Code Here

    Iterator<MethodInfo> it = classInfo.getMethods().iterator();
    MethodInfo methodInfo = it.next();
    assertEquals("foo", methodInfo.getName());
    List<LocalVariableInfo> localVariables = methodInfo.getLocalVariables();
    assertEquals(2, localVariables.size());
    LocalVariableInfo variableA = localVariables.get(0);
    assertEquals("a", variableA.getName());
    LocalVariableInfo variableB = localVariables.get(1);
    assertEquals("b", variableB.getName());
    assertEquals(Visibility.PROTECTED, methodInfo.getVisibility());
  }
View Full Code Here

    this.desc = desc;
    this.visibility = visibility;
    int slot = 0;
    if (!isStatic) {
      Type thisType = Type.fromJava(classInfo.getName());
      methodThis = new LocalVariableInfo("this", thisType);
      slots.put(slot++, methodThis);
      localVariables.add((LocalVariableInfo) methodThis);
    }
    for (Type type : parse(desc).getParameters()) {
      ParameterInfo parameterInfo = new ParameterInfo("param_" + slot, type);
View Full Code Here

  public void visitLocalVariable(String name, String desc, String signature,
      Label start, Label end, int slotNum) {
    Type type = Type.fromDesc(desc);
    Variable variable = slots.get(slotNum);
    if (variable == null) {
      LocalVariableInfo localVar = new LocalVariableInfo(name, type);
      slots.put(slotNum, localVar);
      localVariables.add(localVar);
    } else {
      variable.setName(name);
    }
View Full Code Here

  }

  private Variable variable(int varIndex, Type type) {
    Variable variable = slots.get(varIndex);
    if (variable == null) {
      LocalVariableInfo localVar = new LocalVariableInfo("local_" + varIndex, type);
      slots.put(varIndex, localVar);
      localVariables.add(localVar);
      variable = localVar;
    }
    Type varType = variable.getType();
View Full Code Here

    Label runtimeHandler = new Label();
    Label catchEnd = new Label();
    Label finallyHandler = new Label();
    Label l20 = new Label();
    Label l22 = new Label();
    Variable b = new LocalVariableInfo("b", Type.INT);
    Variable e = new LocalVariableInfo("e", Type.OBJECT);
    Variable any = new LocalVariableInfo("any", Type.OBJECT);
    decomposer.tryCatchBlock(tryStart, tryEnd, runtimeHandler, "java/lang/RuntimeException");
    decomposer.tryCatchBlock(tryStart, catchEnd, finallyHandler, null);

    /* 0*/ decomposer.addOp(new Load(0, new Constant(1, Type.INT)));
    /* 1*/ decomposer.addOp(new Store(1, b));
View Full Code Here

TOP

Related Classes of com.google.test.metric.LocalVariableInfo

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.