Compile All define token

@param string $value

@return string
17829
private function compileToken($value)
    {
        foreach ($this->tokens as $token) {
            $out = $this->{'compile'.$token}($value);

            if ($token == 'Comments') {
                if (strlen($out) == 0) {
                    return "";
                }
            }

            if (strlen($out) !== 0) {
                $value = $out;
            }
        }

        return $value;
    }
518834
protected function _compileStatements($value)
    {
        $callback = function ($match) {
            if (method_exists($this, $method = '_compile_' . $match[1])) {
                $match[0] = $this->$method(isset($match[3]) ? $match[3] : null);
            } elseif (isset($this->_directives[$match[1]])) {
                $match[0] = call_user_func($this->_directives[$match[1]], isset($match[3]) ? $match[3] : null);
            }

            return isset($match[3]) ? $match[0] : $match[0] . $match[2];
        };

        return preg_replace_callback('/\B@(\w+)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', $callback, $value);
    }
67202
protected function compileMacroStop($value)
    {
        $pattern = $this->createPlainMatcher('endmacro');

        $value = preg_replace($pattern, '$1<?php $__container->endMacro(); ?>$2', $value);

        $pattern = $this->createPlainMatcher('endstory');

        return preg_replace($pattern, '$1<?php $__container->endMacro(); ?>$2', $value);
    }
20205
public static function compile(Compiler $compiler, $value, $search, $replace, $case_sensitive = true)
    {
        if ($case_sensitive == 'false' || (bool)$case_sensitive === false) {
            return 'str_ireplace(' . $search . ', ' . $replace . ', ' . $value . ')';
        } else {
            return 'str_replace(' . $search . ', ' . $replace . ', ' . $value . ')';
        }
    }
962115
public function lex(string $value): array
    {
        foreach (self::PATTERNS as $pattern => $tokenTypeConstant) {
            if (1 === preg_match($pattern, $value, $matches)) {
                if (null === $tokenTypeConstant) {
                    throw InvalidArgumentExceptionFactory::createForInvalidExpressionLanguageToken($value);
                }

                return [new Token($matches[0], new TokenType($tokenTypeConstant))];
            }
        }

        return $this->lexer->lex($value);
    }
1192845
function token($str) {
		$fw=$this->fw;
		$str=trim(preg_replace('/\{\{(.+?)\}\}/s',trim('\1'),
			$fw->compile($str)));
		if (preg_match('/^(.+)(?<!\|)\|((?:\h*\w+(?:\h*[,;]?))+)$/s',
			$str,$parts)) {
			$str=trim($parts[1]);
			foreach ($fw->split(trim($parts[2],"\xC2\xA0")) as $func)
				$str=((empty($this->filter[$cmd=$func]) &&
					function_exists($cmd)) ||
					is_string($cmd=$this->filter($func)))?
					$cmd.'('.$str.')':
					'Base::instance()->'.
						'call($this->filter(\''.$func.'\'),['.$str.'])';
		}
		return $str;
	}
881602
public function encodeValue($value)
    {
        if ($this->urlEncode == self::RFC_3986) {
            return rawurlencode($value);
        } elseif ($this->urlEncode == self::FORM_URLENCODED) {
            return urlencode($value);
        } else {
            return (string) $value;
        }
    }
9254
protected function compileComments($value)
    {
        $pattern = sprintf('/%s--(.*?)--%s/s', $this->contentTags[0], $this->contentTags[1]);

        return preg_replace($pattern, '<?php /*$1*/ ?>', $value);
    }
1041953
public static function rawValue($value)
    {
        if ($tokenType = Tokens::test($value)) {
            if ($tokenType == 'u') {
                $value = Crush::$process->tokens->get($value)->value;
            }
            elseif ($tokenType == 's') {
                $value = Crush::$process->tokens->get($value);
            }
        }

        return $value;
    }
304154
public function lex(string $value): array
    {
        if (false === $this->functionTokenizer->isTokenized($value)) {
            $value = $this->functionTokenizer->tokenize($value);
        }

        return $this->decoratedLexer->lex($value);
    }
518085
public function asCode($value)
    {
        if ($value instanceof JS) {
            $value = (string) $value;
        } elseif (is_bool($value)) {
            $value = $value ? 'true' : 'false';
        } elseif (is_string($value)) {
            $value = '\''.$value.'\'';
        } elseif (is_array($value)) {
            $tmp = array();
            $useKey = !$this->isKeysNumeric($value);
            foreach ($value as $k => $v) {
                // skip null value
                if (null === $v) {
                    continue;
                }
                $v = $this->asCode($v);
                $tmp[] = $useKey ? sprintf('%s: %s', $k, $v) : $v;
            }
            $multiline = $this->getOption('multiline');
            $value = ($multiline ? "\n" : '').implode($multiline ? ",\n" : ', ', $tmp).($multiline ? "\n" : '');
            if ($useKey) {
                $value = sprintf('{%s}', $value);
            } else {
                $value = sprintf('[%s]', $value);
            }
            if ($multiline) {
                $value = $this->wrapLines($value, 1);
            }
        }

        return $value;
    }
329494
protected function extractTokens($value)
    {
        if (empty($value)) {
            throw new InvalidArgumentException('DateRangeParser: Value can\'t be empty');
        }

        $operation = substr($value, 0, 1);

        if ($operation === '!') {
            $this->operation = 'not between';
            $value           = substr($value, 1);
        }

        $dateTimes = explode(',', $value);

        $this->from = $dateTimes[0];
        $this->to   = $dateTimes[1];
    }
1199376
public function validateToken($value) : bool
    {
        if (!is_string($value)) {
            return false;
        }

        return $this->getCSRFToken()->isValid($value);
    }
855014
public function compileContains($field, $value)
    {
        return $this->wrap($field.Operator::$equals.Operator::$has.$value.Operator::$has);
    }
556658
protected function compileSectionStop($value)
	{
		$pattern = $this->createPlainMatcher('stop');

		$value = preg_replace($pattern, '$1<?php $__env->stopSection(); ?>$2', $value);

		$pattern = $this->createPlainMatcher('endsection');

		return preg_replace($pattern, '$1<?php $__env->stopSection(); ?>$2', $value);
	}
693897
protected function compileExtensions($value)
    {
        foreach ($this->extensions as $compiler) {
            $value = call_user_func($compiler, $value, $this);
        }

        return $value;
    }
628975
public static function getValueAsList($value) {
		$tokens = token_get_all('<?php '.$value);

		$resultArray = array();
		
		// Le's find all the strings, and let's put each string in the table.
		foreach ($tokens as $token) {
			if ($token[0] == T_CONSTANT_ENCAPSED_STRING) {
				$resultArray[] = substr($token[1], 1, strlen($token[1])-2) ;
			}
		}

		return  $resultArray;
	}