Пример #1
0
  public Object visit(Program program) {
    Object temp;
    for (ICClass icClass : program.getClasses()) {
      temp = icClass.accept(this);
      if (temp != null) {
        return temp;
      }
    }

    return null;
  }
Пример #2
0
  @Override
  public Object visit(ICClass icClass) throws SemanticError {
    for (Field field : icClass.getFields()) {
      field.accept(this);
    }
    for (Method method : icClass.getMethods()) {
      loopCount = 0;
      method.accept(this);

      method.accept(varInitChecker);
    }
    return null;
  }
Пример #3
0
  public Object visit(ICClass icClass) {
    Object temp;
    for (Field field : icClass.getFields()) {
      temp = field.accept(this);
      if (temp != null) {
        return temp;
      }
    }

    for (Method method : icClass.getMethods()) {
      temp = method.accept(this);
      if (temp != null) {
        return temp;
      }
    }

    return null;
  }
Пример #4
0
 @Override
 public Object visit(Program program) throws SemanticError {
   for (ICClass icClass : program.getClasses()) icClass.accept(this);
   return null;
 }