src/eMacros/Parser.php
public static function parse($program) {
		$i = 0;
		$len = strlen($program);
		$forms = [];
		
		while ($i < $len) {
			if (strpos(self::WHITESPACES, $program[$i]) === false) {
				try {
					$form = self::parseExpression(substr($program, $i), $offset);
					if (!is_null($form)) $forms[] = $form;
 				}
 				catch (ParseException $e) {
 					throw new ParseException($program, $e->offset + $i);
 				}
				
				$i += $offset;
			}
			else
				++$i;
		}
		
		return $forms;
	}
public static function parse($program) {
		$i = 0;
		$len = strlen($program);
		$forms = [];
		
		while ($i < $len) {
			if (strpos(self::WHITESPACES, $program[$i]) === false) {
				try {
					$form = self::parseExpression(substr($program, $i), $offset);
					if (!is_null($form)) $forms[] = $form;
 				}
 				catch (ParseException $e) {
 					throw new ParseException($program, $e->offset + $i);
 				}
				
				$i += $offset;
			}
			else
				++$i;
		}
		
		return $forms;
	}
public static function parse ( $ program ) { $ i = 0 ; $ len = strlen ( $ program ) ; $ forms = [ ] ; while ( $ i < $ len ) { if ( strpos ( self :: WHITESPACES , $ program [ $ i ] ) === false ) { try { $ form = self :: parseExpression ( substr ( $ program , $ i ) , $ offset ) ; if ( ! is_null ( $ form ) ) $ forms [ ] = $ form ; } catch ( ParseException $ e ) { throw new ParseException ( $ program , $ e -> offset + $ i ) ; } $ i += $ offset ; } else ++ $ i ; } return $ forms ; }
Parses a program
@param string $program
@throws ParseException
@return \eMacros\GenericList
Parses a program