0byt3m1n1
Path:
/
data
/
applications
/
aps
/
tikiwiki
/
7.0-0
/
standard
/
htdocs
/
lib
/
core
/
Math
/
Formula
/
[
Home
]
File: Tokenizer.php
<?php // (c) Copyright 2002-2011 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id: Tokenizer.php 33195 2011-03-02 17:43:40Z changi67 $ class Math_Formula_Tokenizer { function getTokens( $string ) { $tokens = array(); $len = strlen( $string ); $current = ''; for( $i = 0; $len > $i; ++$i ) { $chr = $string{$i}; $end = false; $extra = null; if( ctype_space( $chr ) ) { $end = true; } elseif( $chr == '(' || $chr == ')' ) { $extra = $chr; $end = true; } else { $current .= $chr; } if( $end && 0 != strlen( $current ) ) { $tokens[] = $current; $current = ''; } if( $extra ) { $tokens[] = $extra; } } if( strlen( $current ) != 0 ) { $tokens[] = $current; } return $tokens; } }
© 2017 -
ZeroByte.ID
.