Update of /cvsroot/phpweather/phpweather/docs/src
In directory usw-pr-cvs1:/tmp/cvs-serv20393
Modified Files:
phpdoc2latex.php
Log Message:
This is much better! The graphs are now made from left to right
instead from top to bottom.
Index: phpdoc2latex.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/docs/src/phpdoc2latex.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- phpdoc2latex.php 2001/07/12 19:54:01 1.1
+++ phpdoc2latex.php 2001/07/13 08:35:37 1.2
@@ -11,18 +11,20 @@
die ("Usage: phpdoc2latex.php xml_dir output_file\n");
}
+/* Stores output until later. */
function out($str) {
global $output, $output_type, $output_name;
$output[$output_type][$output_name] .= $str;
}
-
+/* Pushes a tag onto the stack. */
function push($tag) {
global $stack;
array_push($stack, $tag);
}
-
+/* Returns an element from the stack (the topmost element) and removes
+ it. */
function pop() {
global $stack;
if (empty($stack)) {
@@ -33,7 +35,9 @@
}
-
+/* Takes a string and escapes characters that have a special meaning
+ in LaTeX. It also looks for things like "word" and turns it into
+ ``word''. */
function escape($str) {
/* This marks the variables. */
$str =
ereg_replace('(&?\$)([\'a-zA-Z_][a-zA-Z0-9_]*(\['[\'a-zA-Z_][a-zA-Z0-9_]*'\])?)',
@@ -71,8 +75,8 @@
$str);
return $str;
}
-
+/* This is called when we meet an open-tag. */
function tag_open($parser, $tag, $attributes = '') {
global $class, $function, $context;
@@ -109,7 +113,8 @@
}
-
+/* Called when we meet some characterdata. The characterdata is just
+ pushed onto the stack. */
function cdata($parser, $cdata) {
$tag = pop();
@@ -118,6 +123,8 @@
}
+/* Called when we meet a close-tag. When that happens, we know that we
+ must have collected enough information to process the tag. */
function tag_close($parser, $tag) {
global $class, $function, $parameters, $context,
$output, $output_type, $output_name;
@@ -316,6 +323,8 @@
}
}
+/* Takes a classname, and makes a graph that shows which class is the
+ parent, and which class(es) are the siblings, if any. */
function make_dot_file($class, $output_dir) {
global $tree, $baseclass;
@@ -324,7 +333,7 @@
}
fputs($fp, "digraph $class {\n");
-
+ fputs($fp, " rankdir = LR;\n");
fputs($fp, " node [fontname = \"Palatino-Roman\", fontsize = 10];\n");
fputs($fp, " class [label=\"$class\", color=blue];\n");
@@ -351,8 +360,8 @@
fclose($fp);
}
-
+/* Parses an XML file. */
function parse_file($xml_file) {
/* We start by resetting the global variables. */
@@ -382,6 +391,8 @@
}
+/* Parses all XML files in $xml_dir. The resulting LaTeX code is saved
+ in $output_file. */
function parse_files($xml_dir, $output_file) {
global $classes, $tree;
_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins