コード例 #1
0
 public BlockUmlBuilder(
     List<String> config,
     String charset,
     Defines defines,
     Reader reader,
     File newCurrentDir,
     String desc)
     throws IOException {
   Preprocessor includer = null;
   try {
     reader2 = new UncommentReadLine(new ReadLineReader(reader, desc));
     includer = new Preprocessor(reader2, charset, defines, newCurrentDir);
     init(includer, config);
   } finally {
     if (includer != null) {
       includer.close();
       usedFiles = includer.getFilesUsed();
     }
   }
 }
コード例 #2
0
  private void init(Preprocessor includer, List<String> config) throws IOException {
    CharSequence2 s = null;
    List<CharSequence2> current2 = null;
    boolean paused = false;
    int startLine = 0;
    while ((s = includer.readLine()) != null) {
      if (StartUtils.isArobaseStartDiagram(s)) {
        current2 = new ArrayList<CharSequence2>();
        paused = false;
        startLine = includer.getLineNumber();
      }
      if (StartUtils.isArobasePauseDiagram(s)) {
        paused = true;
        reader2.setPaused(true);
      }
      if (current2 != null && paused == false) {
        current2.add(s);
      } else if (paused) {
        final CharSequence2 append = StartUtils.getPossibleAppend(s);
        if (append != null) {
          current2.add(append);
        }
      }

      if (StartUtils.isArobaseUnpauseDiagram(s)) {
        paused = false;
        reader2.setPaused(false);
      }
      if (StartUtils.isArobaseEndDiagram(s) && current2 != null) {
        current2.addAll(1, convert(config, s.getLocation()));
        blocks.add(new BlockUml(current2, startLine));
        current2 = null;
        reader2.setPaused(false);
      }
    }
  }