Exemplo n.º 1
0
  private void enter_file(String filename, InputStream in) {

    if (!fFileList.contains(filename)) {
      fFileList.add(filename);
    } else {
      //			System.out.println("File: " + filename + " already included");
    }

    // Add a marker noting that we're switching to a new file
    int file_id = 0;

    if (fFileMapper != null) {
      file_id = fFileMapper.mapFilePathToId(filename, true);
    }

    SVFileBuffer in_b = new SVFileBuffer(in);
    SVPreProc2InputData in_data = new SVPreProc2InputData(this, in_b, filename, file_id);
    add_file_change_info(file_id, in_data.getLineNo());

    in_data.setFileTree(new SVDBFileTree(new SVDBFile(filename)));

    // Record the current state of the pre-processor
    //		in_data.fFileTree.fMacroEntryState.putAll(fMacroMap);

    if (!fInputStack.empty()) {
      SVPreProc2InputData p_data = fInputCurr;
      in_data.getFileTree().setParent(p_data.getFileTree());
      p_data.getFileTree().addIncludedFileTree(in_data.getFileTree());
    }

    fInputStack.push(in_data);
    fInputCurr = in_data;
  }