Parse indirect variable reference.
@return Node
162201
private function indirectReference() {
    if ($this->currentType === '$' && !$this->isLookAhead('{')) {
      $node = new VariableVariableNode();
      $this->mustMatch('$', $node);
      $node->addChild($this->indirectReference(), 'variable');
      return $node;
    }
    return $this->referenceVariable();
  }
558525
public function getDefaultValue(): Node\Expr {
        $factory = new BuilderFactory();

        if ($this->nullable || $this->mixed || $this->class) {
            return $factory->val(null);
        }

        switch ($this->name) {
        case 'array':
            return $factory->val([]);

        case 'bool':
            return $factory->val(false);

        case 'float':
            return $factory->val(0.0);

        case 'int':
            return $factory->val(0);

        case 'string':
            return $factory->val('');

        default:
            return $factory->val(null);
        }
    }
915523
public function parseMain()
    {
        $out = '';

        while ($token = $this->stream->next()) {
            if ($token->test(T_COMMENT, '/* OUTPUT */')) {
                $out .= $this->parseOutput();
            } elseif ($token->test(T_COMMENT, '/* DIRECTIVE */')) {
                $out .= $this->parseDirective();
            } else {
                $out .= $token->getValue();
            }
        }

        if ($this->variables) {
            $info = sprintf('<?php /* %s */ extract(%s, EXTR_SKIP) ?>', $this->filename, str_replace("\n", '', var_export($this->variables, true)));
        } else {
            $info = sprintf('<?php /* %s */ ?>', $this->filename);
        }

        return $info.$out;
    }
807871
public function getReferences(): array
    {
        if (empty($this->parent)) {
            throw new NodeException("Unable to aggregate reference values, parent is missing");
        }

        if (empty($this->parent->references[$this->outerKey])) {
            return [];
        }

        return array_keys($this->parent->references[$this->outerKey]);
    }
922615
public function getDereferenced()
    {
        if ($this->dereferenced_field) {
            return $this->dereferenced_field;
        }
        $f = preg_replace('/_id$/', '', $this->short_name);
        if ($f != $this->short_name) {
            return $f;
        }

        $f = $this->short_name.'_text';
        if ($this->owner->hasElement($f)) {
            return $f;
        }

        $f = $this->_unique($this->owner->elements, $f);
        $this->dereferenced_field = $f;

        return $f;
    }
1268343
def p_simple_indirect_reference(p):
    ''''''
    if len(p) == 3:
        p[0] = ast.Variable(p[2], lineno=p.lineno(1))
    else:
        p[0] = p[1]
1171447
public function GetDeclarationCode()
    {
        $code = "";
        
        if($this->is_const)
            $code .= "const ";
        
        if($this->is_unsigned)
            $code .= "unsigned ";
        
        $code .= $this->type;
        
        if($this->is_reference)
            $code .= "&";
        
        if($this->is_pointer)
        {
            for($i=0; $i<$this->indirection_level; $i++)
            {
                $code .= "*";
            }
        }
        
        if($this->is_array)
            $code .= "[]";
    }
1266985
private function arrayDeference(Node $node) {
    while ($this->currentType === '[') {
      $n = $node;
      $node = new ArrayLookupNode();
      $node->addChild($n, 'array');
      $this->dimOffset($node);
    }
    return $node;
  }
1279034
public function getMiddleNode(): ?IUnaryNode {
        $head = $this->getHead();

        if (null === $head) return null;

        $p = $head;
        $q = $head;

        while (null !== $p &&
            null !== $q && //actually not really necessary since $p and $q point to the same object
            null !== $q->getNext()
        ) {
            $p = $p->getNext();
            $q = $q->getNext()->getNext();
        }
        return $p;
    }
1317649
public static function getVariables()
    {
        // Suppress return by-ref
        $vars = [ 'env' => static::$env ];
        // needs to use a for loop, using `array_merge([], $GLOBALS);` left reference traces somehow
        foreach ($GLOBALS as $varName => $varValue) {
            $vars[$varName] = $varValue;
        }

        return $vars;
    }
745451
final public function parseNameNode($node)
    {
        if ($node instanceof Node\Name) {
            return Expression::value($this->parseAbsoluteName($node));
        } elseif (is_string($node)) {
            return Expression::value($node);
        }

        return $this->parseNode($node);
    }
528478
public function getCallGraph()
    {
        $node = $root = new Node(array());
        foreach ($this->getQueries() as $query) {
            foreach (array_reverse($query['trace']) as $trace) {
                $node = $node->push($trace);
            }
            $node->addValue($query);
            $node = $root;
        }

        return $root;
    }
27247
private function parseAppenderReferences(\SimpleXMLElement $node) {
		$refs = array();
		foreach($node->appender_ref as $ref) {
			$refs[] = $this->getAttributeValue($ref, 'ref');
		}
		
		foreach($node->{'appender-ref'} as $ref) {
			$refs[] = $this->getAttributeValue($ref, 'ref');
		}

		return $refs;
	}
1237270
public function parsedVal()
    {
        if (!isset($this->parsedVal[$this->lang()])) {
            $val = $this->propertyVal();

            if ($val === null) {
                return null;
            }
            $val = $this->p()->parseVal($val);

            // Could be Translation instance
            // Could be array
            if (isset($val[$this->lang()])) {
                $val = $val[$this->lang()];
            }

            // Doing this in the parseVal method of abstract property
            // was causing multiple && l10n properties not to save.
            if (!is_array($val) && $this->p()->multiple()) {
                $val = explode($this->p()->multipleSeparator(), $val);
            }

            $this->parsedVal[$this->lang()] = $val;
        }
        return $this->parsedVal[$this->lang()];
    }
1071681
public static function node($ref = null, $strict = true) {
		$db = static::connection();
		$name = static::meta('name');

		extract(static::meta('acl'), EXTR_SKIP);
		extract(static::actsAs('Tree', true), EXTR_SKIP);

		if (is_string($ref)) {
			$w = $with = 'Parent';
			$i = 0;
			$paths = explode('/', $ref);
			$start = $paths[0];
			unset($paths[0]);

			$query = [
				'alias' => $name,
				'fields' => [$name],
				'with' => [
					$with => [
						'alias' => "{$name}0",
						'constraints' => (object) [
							"{$name}0.{$alias}" => (object) $db->value($start, [
								'type' => 'string'
							])
						]
					]],
				'order' => "{$name}.{$left} DESC"
			];

			$conditions = [static::_wrapCond($db, $name, 0, $left, $right)];

			foreach ($paths as $i => $path) {
				$j = $i - 1;
				$w .= ".{$with}";
				$query['with'][$w] = [
					'alias' => "{$name}{$i}",
					'constraints' => (object) [
						"{$name}{$i}.{$left}" => ['>' => "{$name}{$j}.{$left}"],
						"{$name}{$i}.{$right}" => ['<' => "{$name}{$j}.{$right}"],
						"{$name}{$i}.{$alias}" => $db->value($path, ['type' => 'string']),
						"{$name}{$j}." . static::meta('key') => "{$name}{$i}.{$parent}"
					]
				];
				$conditions[] = static::_wrapCond($db, $name, $i, $left, $right);
			}

			$query['conditions'] = ['OR' => $conditions];

			$result = static::find('all', $query + ['return' => 'array']);

			$paths = array_values($paths);

			if (!isset($result[0])) {
				return false;
			}
			if ($strict && (
				($paths && $result[0][$alias] !== $paths[count($paths) - 1]) ||
				(!$paths && $result[0][$alias] !== $start)
			)) {
				return false;
			}
			return $result;
		} elseif (is_object($ref)) {
			$self = static::_object();
			if ($ref instanceof $self->_classes['entity']) {
				$model = $ref->model();
				$id = $model::meta('key');
				$ref = [$class => $model, $id => $ref->$id];
			}
		}

		if ($ref && is_array($ref) && isset($ref[$class])) {
			$conditions = [];
			$model = $ref[$class];
			$id = $model::meta('key');
			if (isset($ref[$id])) {
				$conditions["{$name}0.{$key}"] = $ref[$id];
			} elseif (isset($ref[$key])) {
				$conditions["{$name}0.{$key}"] = $ref[$key];
			} else {
				return false;
			}
			$conditions["{$name}0.{$class}"] = $model;

			$constraints = (object) static::_wrapCond($db, $name, '0', $left, $right, false);

			$query = [
				'conditions' => $conditions,
				'fields' => [$name],
				'with' => [
					'Parent' => [
						'alias' => "{$name}0",
						'constraints' => $constraints
					]
				],
				'order' => "{$name}.{$left} DESC"
			];

			return static::find('all', $query + ['return' => 'array']);
		}
		return false;
	}
1292389
protected function parseReferenceLinks()
	{
		$labels = $this->getLabels();
		foreach ($labels as $startPos => $id)
		{
			$labelPos = $startPos + 2 + strlen($id);
			$endPos   = $labelPos - 1;
			$endLen   = 1;

			if ($this->text->charAt($labelPos) === ' ')
			{
				++$labelPos;
			}
			if (isset($labels[$labelPos], $this->text->linkReferences[$labels[$labelPos]]))
			{
				$id     = $labels[$labelPos];
				$endLen = $labelPos + 2 + strlen($id) - $endPos;
			}
			if (isset($this->text->linkReferences[$id]))
			{
				$this->addLinkTag($startPos, $endPos, $endLen, $this->text->linkReferences[$id]);
			}
		}
	}
163723
public function parseSymbol()
    {
        $token = $this->str[$this->last];
        if (! ($flags = Context::isSymbol($token))) {
            return null;
        }

        if ($flags & Token::FLAG_SYMBOL_VARIABLE) {
            if ($this->last + 1 < $this->len && $this->str[++$this->last] === '@') {
                // This is a system variable (e.g. `@@hostname`).
                $token .= $this->str[$this->last++];
                $flags |= Token::FLAG_SYMBOL_SYSTEM;
            }
        } elseif ($flags & Token::FLAG_SYMBOL_PARAMETER) {
            if ($this->last + 1 < $this->len) {
                ++$this->last;
            }
        } else {
            $token = '';
        }

        $str = null;

        if ($this->last < $this->len) {
            if (($str = $this->parseString('`')) === null) {
                if (($str = $this->parseUnknown()) === null) {
                    $this->error(
                        'Variable name was expected.',
                        $this->str[$this->last],
                        $this->last
                    );
                }
            }
        }

        if ($str !== null) {
            $token .= $str->token;
        }

        return new Token($token, Token::TYPE_SYMBOL, $flags);
    }