#jpgraph
#pma
CKEditor_4.6.1
Date
backup
bibelpopup
classes
config
fetch_bibel
fetch_chorbuch
html2pdf-master
html2pdf_v4.03
images
jpgraph
kalender
language
lib
lieder
livesearch
msd
overlib
pma
doc
examples
js
libraries
locale
setup
sql
templates
themes
tmp
vendor
bacon
composer
dasprid
google
nikic
paragonie
phpmyadmin
phpseclib
pragmarx
psr
samyoul
symfony
cache
cache-contracts
config
dependency-injection
expression-language
Node
CHANGELOG.md
Compiler.php
Expression.php
ExpressionFunction.php
ExpressionFunctionProviderInterface.php
ExpressionLanguage.php
LICENSE
Lexer.php
ParsedExpression.php
Parser.php
README.md
SerializedParsedExpression.php
SyntaxError.php
Token.php
TokenStream.php
composer.json
filesystem
polyfill-ctype
polyfill-mbstring
polyfill-php81
service-contracts
var-exporter
tecnickcom
twig
williamdes
autoload.php
CONTRIBUTING.md
ChangeLog
LICENSE
README
RELEASE-DATE-5.1.1
babel.config.json
composer.json
composer.lock
config.inc.php
config.sample.inc.php
favicon.ico
index.php
package.json
print.css
robots.txt
show_config_errors.php
url.php
yarn.lock
templates
templates_c
validation
++ Umstellung Luther 2017.sql
.gitattributes
.htaccess
Version8_bugs.txt
ajax.js_20170928
ansicht.php
ansicht.php_20200212
ansicht.php_20200915
ansicht.php_lut84_20180219
ansicht2.php
ansicht2.php_20200212
ansicht2.php_20200915
ansicht2.php_lut84_20180219
ausgabe.php
bes_gd.php
bibellookup.php_lut84_20180219
bibellookup_1984.php
bibellookup_2017.php
bibellookup_2017.php_20200212
changelog.php
config.inc.php
copy.js
faq_text.php
faq_text_ber.php
favicon.ico
fetch_data.php
ftp_ansicht.php
ftp_ansicht.php_20181214
func_agent.php
func_ansicht.php
func_ansicht.php_20200212
func_ansicht.php_20200915
func_ansicht.php_lut84_20180219
func_genUser.php
func_highlight.php
func_htmlclean.php
func_make_knk.php
func_make_knk_fa.php
func_make_knk_fa.php_lut84_20180219
func_make_reference_fa.php
func_make_reference_fa.php_lut84_20180219
func_rollenrechte.php
func_rollenrechte_20220202.php
func_write_lue_kat.php
further_publication.php
getSubCat.php
graph.php
graph_einzel.php
graph_hauptframe.php
graph_user.php
graph_user_hauptframe.php
hauptframe.php
hello.cgi
hello.pl
hilfe.php
historie.php
index.php
index2.php
indexframe.php
info.php
job_mail_delete_neue_user.php
job_mail_inaktiv.php
job_user_delete_neue_user.php
job_user_inaktiv.php
jquery.min.js
kat_cont.php
kat_cont.php_20201230
kat_cont.php_20221013
kat_cont_fa.php
kat_main.php
kat_main.php_lut84_20180219
kat_main_fa.php
kat_main_fa.php_lut84_20180219
katechismus.php
katechismus_fa.php
lesung.php
lieder.php
lieder.zip
livesearch.php
livestat.js
livestat.php
livestat2.php
login_log.php
logininfo.php
logout_admin.php
lue_ansicht.php
lue_bearbeiten.php
lue_erfassen.php
lue_inhalt.php
lue_inhalt.php_20200915
lue_inhalt.php_lut84_20180219
lue_notizen.php
lue_suche.php
lue_wahl.php
mail.php
make_ical.php
menuframe.php
nachsenden.php
notizen.php
outlook.php
outlook.php_20200212
outlook_ics.php
outlook_vcs.php
passwort_switch.php
pdf_gen.php
pdf_gen.php_20200915
pdf_gen.php_lut84_20180219
preview.php
profil.php
rollen.php
search_note.php
stichworte.php
suche.php
suche.php_20170928
suche_change.php
suche_simp.php
systemmail.php
test.php
test.txt
test2.php
testmail.php
testmail2.php
topframe.php
upload.php
user_anlegen.php
user_bearbeiten.php
useronline.php
verweise.php
wort_bearbeiten.php
wort_bearbeiten.php_20170928
wort_erfassen.php
wort_erfassen.php_20170928
wort_exegese.php
wort_wahl.php
92 lines
2.2 KiB
PHP
92 lines
2.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Component\ExpressionLanguage;
|
|
|
|
/**
|
|
* Represents a token stream.
|
|
*
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
*/
|
|
class TokenStream
|
|
{
|
|
public $current;
|
|
|
|
private $tokens;
|
|
private $position = 0;
|
|
private $expression;
|
|
|
|
public function __construct(array $tokens, string $expression = '')
|
|
{
|
|
$this->tokens = $tokens;
|
|
$this->current = $tokens[0];
|
|
$this->expression = $expression;
|
|
}
|
|
|
|
/**
|
|
* Returns a string representation of the token stream.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function __toString()
|
|
{
|
|
return implode("\n", $this->tokens);
|
|
}
|
|
|
|
/**
|
|
* Sets the pointer to the next token and returns the old one.
|
|
*/
|
|
public function next()
|
|
{
|
|
++$this->position;
|
|
|
|
if (!isset($this->tokens[$this->position])) {
|
|
throw new SyntaxError('Unexpected end of expression.', $this->current->cursor, $this->expression);
|
|
}
|
|
|
|
$this->current = $this->tokens[$this->position];
|
|
}
|
|
|
|
/**
|
|
* Tests a token.
|
|
*
|
|
* @param array|int $type The type to test
|
|
* @param string|null $value The token value
|
|
* @param string|null $message The syntax error message
|
|
*/
|
|
public function expect($type, $value = null, $message = null)
|
|
{
|
|
$token = $this->current;
|
|
if (!$token->test($type, $value)) {
|
|
throw new SyntaxError(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s).', $message ? $message.'. ' : '', $token->type, $token->value, $type, $value ? sprintf(' with value "%s"', $value) : ''), $token->cursor, $this->expression);
|
|
}
|
|
$this->next();
|
|
}
|
|
|
|
/**
|
|
* Checks if end of stream was reached.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function isEOF()
|
|
{
|
|
return Token::EOF_TYPE === $this->current->type;
|
|
}
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
public function getExpression(): string
|
|
{
|
|
return $this->expression;
|
|
}
|
|
}
|