target_functions ) ) { return array(); } return array( $this->group_name => array( 'functions' => array_keys( $this->target_functions ), ), ); } /** * Process a matched token. * * @param int $stackPtr The position of the current token in the stack. * @param string $group_name The name of the group which was matched. * @param string $matched_content The token content (function name) which was matched. * * @return int|void Integer stack pointer to skip forward or void to continue * normal file processing. */ public function process_matched_token( $stackPtr, $group_name, $matched_content ) { $parameters = $this->get_function_call_parameters( $stackPtr ); if ( empty( $parameters ) ) { return $this->process_no_parameters( $stackPtr, $group_name, $matched_content ); } else { return $this->process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); } } /** * Process the parameters of a matched function. * * This method has to be made concrete in child classes. * * @param int $stackPtr The position of the current token in the stack. * @param string $group_name The name of the group which was matched. * @param string $matched_content The token content (function name) which was matched. * @param array $parameters Array with information about the parameters. * * @return int|void Integer stack pointer to skip forward or void to continue * normal file processing. */ abstract public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ); /** * Process the function if no parameters were found. * * Defaults to doing nothing. Can be overloaded in child classes to handle functions * were parameters are expected, but none found. * * @param int $stackPtr The position of the current token in the stack. * @param string $group_name The name of the group which was matched. * @param string $matched_content The token content (function name) which was matched. * * @return int|void Integer stack pointer to skip forward or void to continue * normal file processing. */ public function process_no_parameters( $stackPtr, $group_name, $matched_content ) { return; } }