Hosted by
|
<?php
// $Date: 2004/01/01 15:27:44 $ // $Revision: 1.3 $ // $Author: jcrocholl $
$indent_chars = 3;
function keyword($text) { return span('keyword', $text); } function package($text) { return span('package', $text); } function type($text) { return span('type', $text); } function comment($text) { return span('comment', $text); } function name($text) { return span('name', $text); }
function illegal($text) { global $parsefilename, $line_number, $line; warning($parsefilename, $line_number, $line, $text); return span('illegal', $text); }
// print preg_replace('/".+?"/', 'blah', '"one", "two"'); // print preg_replace('/\((.+?)\)/', '$1', '((one), (two))'); function check_parens($text) { $text = preg_replace('/".+?"/', '', $text); $text = preg_replace('/\'.\'/', '', $text); $open = substr_count($text, '('); $close = substr_count($text, ')'); // print "$text $open $close<br/>\n"; return $open == $close; }
function dotname($name) { $parts = explode('.', $name); $result = name(array_shift($parts)); while ($parts) $result .= '.' . name(array_shift($parts)); return $result; }
function typespec($text) { return $text; } function generic($text) { return $text; } function term($text) { return $text; } function modifier($text) { return $text; } // record modifier: "Size : Positive" function bounds($text) { return $text; } // type bounds: "1 .. Size, 1 .. Size" function actual($text) { return $text; } // actual parameters: Call(A, B, C)
?>
|