Produce "dip" -- basically digested paragraphs for standalone backends
authorH. Peter Anvin <hpa@zytor.com>
Tue, 14 May 2002 06:05:06 +0000 (06:05 +0000)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 14 May 2002 06:05:06 +0000 (06:05 +0000)
doc/Makefile.in
doc/rdsrc.pl

index 8d308ca..e7cd2d5 100644 (file)
@@ -62,7 +62,7 @@ nasm.inf: nasmdoc.ipf
        ipfc -i -s $< $@
 
 clean:
-       -rm -f *.rtf *.hpj *.texi *.ph *.gid *.ipf
+       -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
        -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
 
 spotless: clean
index e667c21..e9f5c10 100644 (file)
@@ -142,6 +142,9 @@ print "done.\n";
 print "Producing WinHelp output: ";
 &write_hlp;
 print "done.\n";
+print "Producing Documentation Intermediate Paragraphs: ";
+&write_dip;
+print "done.\n";
 
 sub got_para {
   local ($_) = @_;
@@ -2335,3 +2338,26 @@ sub font_metrics {
      600, 600, 600, 600,   0,   0,   0,   0
   );
 }
+
+#
+# This produces documentation intermediate paragraph format; this is
+# basically the digested output of the front end.  Intended for use
+# by future backends, instead of putting it all in the same script.
+#
+sub write_dip {
+  open(PARAS, "> nasmdoc.dip");
+  foreach $k (keys(%metadata)) {
+      print PARAS 'meta :', $k, "\n";
+      print PARAS $metadata{$k},"\n";
+  }
+  for ($para = 0; $para <= $#pnames; $para++) {
+      print PARAS $pflags[$para], "\n";
+      print PARAS join("\037", @{$pnames[$para]}, "\n");
+  }
+  foreach $k (@itags) {
+      print PARAS 'indx :', $k, "\n";
+      print PARAS join("\037", @{$idxmap{$k}}), "\n";
+  }
+  close(PARAS);
+}
+