public function preceedingTokens(array $types)
	{
		$result = [];
		
		for($x = $this->index - 2; $x >= 0; $x--)
		{
			$tok = $this->tokens[$x];
			
			if(is_array($tok))
			{
				switch($tok[0])
				{
					case T_COMMENT:
					case T_WHITESPACE:
						continue 2;
				}
				
				if(!in_array($tok[0], $types, true))
				{
					break;
				}
			}
			else
			{
				if(!in_array($tok, $types, true))
				{
					break;
				}
			}
			
			$result[] = $tok;
		}
		
		return $result;
	}
public function preceedingTokens(array $types)
	{
		$result = [];
		
		for($x = $this->index - 2; $x >= 0; $x--)
		{
			$tok = $this->tokens[$x];
			
			if(is_array($tok))
			{
				switch($tok[0])
				{
					case T_COMMENT:
					case T_WHITESPACE:
						continue 2;
				}
				
				if(!in_array($tok[0], $types, true))
				{
					break;
				}
			}
			else
			{
				if(!in_array($tok, $types, true))
				{
					break;
				}
			}
			
			$result[] = $tok;
		}
		
		return $result;
	}
public function preceedingTokens ( array $ types ) { $ result = [ ] ; for ( $ x = $ this -> index - 2 ; $ x >= 0 ; $ x -- ) { $ tok = $ this -> tokens [ $ x ] ; if ( is_array ( $ tok ) ) { switch ( $ tok [ 0 ] ) { case T_COMMENT : case T_WHITESPACE : continue 2 ; } if ( ! in_array ( $ tok [ 0 ] , $ types , true ) ) { break ; } } else { if ( ! in_array ( $ tok , $ types , true ) ) { break ; } } $ result [ ] = $ tok ; } return $ result ; }
Get all preceeding tokens matching the given token types, will stop when a token is encountered
that does not match the given filter.

@param array $types Valid token types (all other tokens cause halt).
@return array All the tokens that matched the filter.
Get all preceeding tokens matching the given token types will stop when a token is encountered that does not match the given filter .