Evaluates the matcher with this objects nodeContext and returns the result.

@return mixed
433681
protected function evaluateNodeContext()
    {
        $eelContext = new Context($this->nodeContext);
        return $this->eelCompilingEvaluator->evaluate($this->getParsedMatcher(), $eelContext);
    }
1291531
public function getNbResults()
    {
        if (!isset($this->nbResults)) {
            $this->nbResults = $this->tagsService->getTagChildrenCount($this->tag);
        }

        return $this->nbResults;
    }
637711
public function getNode(): NodeInterface
    {
        if (null === $this->node) {
            $this->node = XmlNodeUtils::nodeFromXmlElement($this->document->documentElement);
        }
        return $this->node;
    }
1094508
public function getMatcher()
    {
        if (null === $this->matcher) {
            $this->setMatcher($this->getRouterContainer()->getMatcher());
        }
        return $this->matcher;
    }
1081094
public function getValue()
	{
		if ( is_null( $this->domNode ) )
		{
			return "";
		}

		if ( $this->domNode instanceof \DOMNameSpaceNode )
		{
			/** @var \DOMNameSpaceNode $ns */
			$ns = $this->domNode;
			return $ns->nodeValue;
		}

		// BMS 2017-12-30 This used to return the textContent property.
		// BMS 2018-01-23 Updated to return the text content when the node is the document root
		return $this->domNode instanceof \DOMDocument
			? $this->domNode->textContent
			: $this->domNode->nodeValue;
	}
23678
public function resolve(NodeContract $node)
    {
        $children = $node->getChildren();

        if (count($children) > 0) {
            $this->resolve($node->getChildByIndex(0));

            $value = '';
            $positions = [];
            foreach ($node->getChildren() as $child) {
                if ($child instanceof Nodes\TextNode || $child instanceof Nodes\KeyNode) {
                    $value .= ' '.$child->getValue();
                    $p = array_fill(0, strlen(' '.$child->getValue()), $child->getIndex());
                    $positions = array_merge($positions, $p);
                }
            }

            foreach ($this->regex as $regex) {
                preg_match($regex, $value, $match, PREG_OFFSET_CAPTURE);

                if ($match) {
                    $new_node = new $this->node();

                    $start = $match[0][1];
                    $length = strlen($match[0][0]);

                    $this->groupNode($node, $new_node, $start, $start + $length, $positions);
                    $this->resolveRelationsNode($node, $new_node);

                    // Search for another match in this node.
                    return $this->resolve($node->getParent());
                }
            }
        }

        return $node->next() !== null ? $this->resolve($node->next()) : null;
    }
1286442
protected function parse()
    {
        // Parse Nodes user agent
        if (!preg_match('|Nodes/(.*)\s\((.*)\)|s', $this->userAgent, $match)) {
            return;
        }

        // Put matches into their own variables
        list($version, $parameters) = array_slice($match, 1);

        // Split comma-separated parameters
        $parameters = explode(',', $parameters);

        // Set version if available
        if (!empty($version)) {
            $this->setVersion($version);
        }

        // Set parameters if available
        if (!empty($parameters)) {
            $this->setParameters($parameters);
        }

        // Mark parsing as successful
        $this->successful = true;
    }
455426
private function exprOperand() {
    switch ($this->currentType) {
      case T_STRING_VARNAME:
      case T_CLASS_C:
      case T_LNUMBER:
      case T_DNUMBER:
      case T_LINE:
      case T_FILE:
      case T_DIR:
      case T_TRAIT_C:
      case T_METHOD_C:
      case T_FUNC_C:
      case T_NS_C:
      case T_YIELD:
        return $this->mustMatchToken($this->currentType);
      case T_CONSTANT_ENCAPSED_STRING:
        return $this->arrayDeference($this->mustMatchToken(T_CONSTANT_ENCAPSED_STRING));
      case T_ARRAY:
        $node = new ArrayNode();
        $this->mustMatch(T_ARRAY, $node);
        $this->mustMatch('(', $node, 'openParen');
        $this->arrayPairList($node, ')');
        $this->mustMatch(')', $node, 'closeParen', TRUE);
        return $this->arrayDeference($node);
      case '[':
        $node = new ArrayNode();
        $this->mustMatch('[', $node);
        $this->arrayPairList($node, ']');
        $this->mustMatch(']', $node, NULL, TRUE);
        return $this->arrayDeference($node);
      case '(':
        $node = new ParenthesisNode();
        $this->mustMatch('(', $node, 'openParen');
        if ($this->currentType === T_NEW) {
          $node->addChild($this->newExpr(), 'expression');
          $this->mustMatch(')', $node, 'closeParen', TRUE);
          $node = $this->objectDereference($this->arrayDeference($node));
        }
        elseif ($this->currentType === T_YIELD) {
          $node->addChild($this->_yield());
          $this->mustMatch(')', $node, 'closeParen', TRUE);
        }
        else {
          $node->addChild($this->expr());
          $this->mustMatch(')', $node, 'closeParen', TRUE);
        }
        return $node;
      case T_START_HEREDOC:
        $node = new HeredocNode();
        $this->mustMatch(T_START_HEREDOC, $node);
        if ($this->tryMatch(T_END_HEREDOC, $node, NULL, TRUE)) {
          return $node;
        }
        else {
          $this->encapsList($node, T_END_HEREDOC, TRUE);
          $this->mustMatch(T_END_HEREDOC, $node, NULL, TRUE);
          return $node;
        }
      case '"':
        $node = new InterpolatedStringNode();
        $this->mustMatch('"', $node);
        $this->encapsList($node, '"');
        $this->mustMatch('"', $node);
        return $node;
      case T_STRING:
      case T_NS_SEPARATOR:
      case T_NAMESPACE:
        $namespace_path = $this->name();
        if ($this->currentType === T_DOUBLE_COLON) {
          return $this->exprClass($namespace_path);
        }
        elseif ($this->currentType === '(') {
          return $this->functionCall($namespace_path);
        }
        else {
          $constant_name = strtolower($namespace_path->getText());
          if ($constant_name === 'true') {
            $node = new TrueNode();
          }
          elseif ($constant_name === 'false') {
            $node = new FalseNode();
          }
          elseif ($constant_name === 'null') {
            $node = new NullNode();
          }
          else {
            $node = new ConstantNode();
          }
          $node->addChild($namespace_path, 'constantName');
          return $node;
        }
      case T_STATIC:
        $static = $this->mustMatchToken(T_STATIC);
        if ($this->currentType === T_FUNCTION) {
          return $this->anonymousFunction($static);
        } else {
          return $this->exprClass($static);
        }
      case '$':
      case T_VARIABLE:
        $operand = $this->indirectReference();
        if (!($operand instanceof VariableVariableNode) && $this->currentType === T_DOUBLE_COLON) {
          return $this->exprClass($operand);
        }
        elseif ($this->currentType === '(') {
          return $this->functionCall($operand, TRUE);
        }
        else {
          return $this->objectDereference($operand);
        }
      case T_ISSET:
        $node = new IssetNode();
        $this->mustMatch(T_ISSET, $node, 'name');
        $arguments = new CommaListNode();
        $this->mustMatch('(', $node, 'openParen');
        $node->addChild($arguments, 'arguments');
        do {
          $arguments->addChild($this->variable());
        } while ($this->tryMatch(',', $arguments));
        $this->mustMatch(')', $node, 'closeParen', TRUE);
        return $node;
      case T_EMPTY:
      case T_EVAL:
        if ($this->currentType === T_EMPTY) {
          $node = new EmptyNode();
        }
        else {
          $node = new EvalNode();
        }
        $this->mustMatch($this->currentType, $node, 'name');
        $arguments = new CommaListNode();
        $this->mustMatch('(', $node, 'openParen');
        $node->addChild($arguments, 'arguments');
        $arguments->addChild($this->expr());
        $this->mustMatch(')', $node, 'closeParen', TRUE);
        return $node;
      case T_INCLUDE:
      case T_REQUIRE:
      case T_INCLUDE_ONCE:
      case T_REQUIRE_ONCE:
        if ($this->currentType === T_INCLUDE) {
          $node = new IncludeNode();
        }
        elseif ($this->currentType === T_INCLUDE_ONCE) {
          $node = new IncludeOnceNode();
        }
        elseif ($this->currentType === T_REQUIRE) {
          $node = new RequireNode();
        }
        else {
          $node = new RequireOnceNode();
        }
        $this->mustMatch($this->currentType, $node);
        $node->addChild($this->expr(), 'expression');
        return $node;
      case T_NEW:
        return $this->newExpr();
      case T_LIST:
        return $this->_list();
      case T_EXIT:
        $node = new ExitNode();
        $this->mustMatch(T_EXIT, $node, NULL, TRUE);
        if ($this->currentType !== '(') {
          return $node;
        }
        $this->mustMatch('(', $node, 'openParen');
        if ($this->tryMatch(')', $node, 'closeParen', TRUE)) {
          return $node;
        }
        if ($this->currentType === T_YIELD) {
          $node->addChild($this->_yield(), 'expression');
        }
        else {
          $node->addChild($this->expr(), 'expression');
        }
        $this->mustMatch(')', $node, 'closeParen', TRUE);
        return $node;
      case T_FUNCTION:
        return $this->anonymousFunction();
      case '`':
        return $this->backtick();
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      "excepted expression operand but got " . $this->current->getTypeName());
  }
851450
public function tokens() {
		if ($this->success()) {
			// Get tokens of contained matcher
			if ($this->matched instanceof MatcherInterface) {
				return $this->matched->tokens();
			}
			
			// Allow children to store arrays of matches here
			elseif(\is_array($this->matched)) {
				return $this->matched;
			}
			
			// Default behaviour on success
			elseif ($this->matched instanceof Token) {
				return [ $this->matched ];
			}
		}
		
		// Fallback
		return [];
	}
805071
public function evaluate()
    {
        $sortedChildFusionKeys = $this->sortNestedFusionKeys();

        if (count($sortedChildFusionKeys) === 0) {
            return [];
        }

        $result = [];
        foreach ($sortedChildFusionKeys as $key) {
            try {
                $value = $this->fusionValue($key);
            } catch (\Exception $e) {
                $value = $this->runtime->handleRenderingException($this->path . '/' . $key, $e);
            }
            if ($value === null && $this->runtime->getLastEvaluationStatus() === Runtime::EVALUATION_SKIPPED) {
                continue;
            }
            $result[$key] = $value;
        }

        return $result;
    }
223271
protected function getNodesMatchingInput($input, bool $matchType = true): NodeList {
        if ($input instanceof NodeList || $input instanceof \DOMNode) {
            $inputNodes = $this->inputAsNodeList($input, false);

            $fn = function($node) use ($inputNodes) {
                return $inputNodes->exists($node);
            };


        } elseif (is_callable($input)) {
            // Since we're at the behest of the input callable, the 'matched'
            //  return value is always true.
            $matchType = true;

            $fn = $input;

        } elseif (is_string($input)) {
            $fn = function($node) use ($input) {
                return $node->find($input, 'self::')->count() != 0;
            };

        } else {
            throw new \InvalidArgumentException('Unexpected input value of type "' . gettype($input) . '"');
        }

        // Build a list of matching nodes.
        return $this->collection()->map(function($node) use ($fn, $matchType) {
            if ($fn($node) !== $matchType) {
                return null;
            }

            return $node;
        });
    }
1030708
public function getParsedMatcher()
    {
        $parsedMatcher = $this->matcher;
        // TODO: handle parameters that are not strings
        foreach ($this->parameters as $parameter) {
            $parsedMatcher = str_replace('{parameters.' . $parameter->getName() . '}', $parameter->getValue(), $parsedMatcher);
        }
        return $parsedMatcher;
    }
857205
public function evaluate()
    {
        $collection = $this->fusionValue('collection');

        $output = [];
        if ($collection === null) {
            return [];
        }
        $this->numberOfRenderedNodes = 0;
        $itemName = $this->getItemName();
        $itemKey = $this->fusionValue('itemKey');
        if ($itemName === null) {
            throw new FusionException('The Collection needs an itemName to be set.', 1344325771);
        }
        $iterationName = $this->getIterationName();
        $collectionTotalCount = count($collection);
        foreach ($collection as $collectionElementKey => $collectionElement) {
            $context = $this->runtime->getCurrentContext();
            $context[$itemKey] = $collectionElementKey;
            $context[$itemName] = $collectionElement;
            if ($iterationName !== null) {
                $context[$iterationName] = $this->prepareIterationInformation($collectionTotalCount);
            }

            $this->runtime->pushContextArray($context);
            if ($value = $this->runtime->render($this->path . '/itemRenderer')) {
                if ($this->runtime->canRender($this->path . '/itemKeyRenderer')) {
                    $key = $this->runtime->render($this->path . '/itemKeyRenderer');
                    $output[$key] = $value;
                } else {
                    $output[] = $value;
                }
            }
            $this->runtime->popContext();
            $this->numberOfRenderedNodes++;
        }

        return $output;
    }
269503
public function getHasta()
    {
        if (!$this->xml) {
            return false;
        }
        $H = $this->xml->getElementsByTagName('H')->item(0);
        return $H ? (int)$H->nodeValue : false;
    }
236010
public function evaluate()
    {
        $collection = $this->getItems();

        $result = [];
        if ($collection === null) {
            return $result;
        }
        $this->numberOfRenderedNodes = 0;
        $itemName = $this->getItemName();
        if ($itemName === null) {
            throw new FusionException('The Collection needs an itemName to be set.', 1344325771);
        }
        $itemKey = $this->getItemKey();
        $iterationName = $this->getIterationName();
        $collectionTotalCount = count($collection);

        $itemRenderPath = $this->path . '/itemRenderer';
        $fallbackRenderPath =  $this->path . '/content';
        if ($this->runtime->canRender($itemRenderPath) === false && $this->runtime->canRender($fallbackRenderPath)) {
            $itemRenderPath = $fallbackRenderPath;
        }

        foreach ($collection as $collectionKey => $collectionElement) {
            $context = $this->runtime->getCurrentContext();
            $context[$itemName] = $collectionElement;
            if ($itemKey !== null) {
                $context[$itemKey] = $collectionKey;
            }
            if ($iterationName !== null) {
                $context[$iterationName] = $this->prepareIterationInformation($collectionTotalCount);
            }

            $this->runtime->pushContextArray($context);
            $result[$collectionKey] =  $this->runtime->render($itemRenderPath);
            $this->runtime->popContext();
            $this->numberOfRenderedNodes++;
        }

        return $result;
    }
842802
public function evaluate($expr, DOMElement $node = null)
	{
		return $this->xpath->evaluate($expr, $node);
	}
1121571
public function evaluate()
    {
        $title = trim($this->getTitle());
        $plaintext = $this->getPlaintext();

        $debugData = [];
        foreach (array_keys($this->properties) as $key) {
            if (in_array($key, $this->ignoreProperties)) {
                continue;
            }
            $debugData[$key] = $this->fusionValue($key);
        }

        $title .= ' @ ' . $this->path;

        if (count($debugData) === 0) {
            $debugData =[null];
        }

        foreach ($debugData as $suffix => $data) {
            if (is_string($suffix)) {
                $message = (new DebugMessage(trim($title . '.' . $suffix), $this->path, $data, $plaintext));
            } else {
                $message = (new DebugMessage(trim($title), $this->path, $data, $plaintext));
            }
            $this->stack->register($message);
        }

        return $this->fusionValue('value');
    }