ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Represents a Token. More...
Public Member Functions | |
__construct ($type, $value, $lineno) | |
__toString () | |
test ($type, $values=null) | |
Tests the current token for a type and/or a value. More... | |
getLine () | |
getType () | |
getValue () | |
Static Public Member Functions | |
static | typeToString ($type, $short=false) |
Returns the constant representation (internal) of a given type. More... | |
static | typeToEnglish ($type) |
Returns the English representation of a given type. More... | |
Data Fields | |
const | EOF_TYPE = -1 |
const | TEXT_TYPE = 0 |
const | BLOCK_START_TYPE = 1 |
const | VAR_START_TYPE = 2 |
const | BLOCK_END_TYPE = 3 |
const | VAR_END_TYPE = 4 |
const | NAME_TYPE = 5 |
const | NUMBER_TYPE = 6 |
const | STRING_TYPE = 7 |
const | OPERATOR_TYPE = 8 |
const | PUNCTUATION_TYPE = 9 |
const | INTERPOLATION_START_TYPE = 10 |
const | INTERPOLATION_END_TYPE = 11 |
Protected Attributes | |
$value | |
$type | |
$lineno | |
Twig_Token::__construct | ( | $type, | |
$value, | |||
$lineno | |||
) |
Twig_Token::__toString | ( | ) |
Twig_Token::getLine | ( | ) |
Definition at line 87 of file Token.php.
References $lineno.
Referenced by Twig_Extensions_TokenParser_Trans\parse(), Twig_TokenParser_Do\parse(), Twig_TokenParser_Embed\parse(), Twig_TokenParser_With\parse(), Twig_TokenParser_Flush\parse(), Twig_Extensions_Grammar_Boolean\parse(), Twig_Extensions_Grammar_Number\parse(), Twig_Extensions_Grammar_Switch\parse(), Twig_TokenParser_From\parse(), Twig_TokenParser_Import\parse(), Twig_TokenParser_Include\parse(), Twig_TokenParser_Extends\parse(), Twig_TokenParser_Filter\parse(), Twig_TokenParser_Macro\parse(), Twig_Extensions_SimpleTokenParser\parse(), Twig_TokenParser_Block\parse(), Twig_TokenParser_Sandbox\parse(), Twig_TokenParser_For\parse(), Twig_TokenParser_Spaceless\parse(), Twig_TokenParser_If\parse(), Twig_TokenParser_Set\parse(), and Twig_TokenParser_AutoEscape\parse().
Twig_Token::getValue | ( | ) |
Definition at line 103 of file Token.php.
References $value.
Referenced by Twig_ExpressionParser\isBinary(), Twig_ExpressionParser\isUnary(), Twig_Extensions_Grammar_Boolean\parse(), Twig_Extensions_Grammar_Number\parse(), Twig_TokenParser_Macro\parse(), and Twig_TokenParser_Block\parse().
Twig_Token::test | ( | $type, | |
$values = null |
|||
) |
Tests the current token for a type and/or a value.
Parameters may be:
array | int | $type | The type to test |
array | string | null | $values | The token value |
Definition at line 70 of file Token.php.
References $type.
Referenced by Twig_Extensions_Grammar_Body\decideBlockEnd(), Twig_TokenParser_Filter\decideBlockEnd(), Twig_TokenParser_Macro\decideBlockEnd(), Twig_TokenParser_Sandbox\decideBlockEnd(), Twig_TokenParser_Embed\decideBlockEnd(), Twig_TokenParser_Block\decideBlockEnd(), Twig_TokenParser_Set\decideBlockEnd(), Twig_TokenParser_AutoEscape\decideBlockEnd(), Twig_Extensions_TokenParser_Trans\decideForEnd(), Twig_TokenParser_For\decideForEnd(), Twig_Extensions_TokenParser_Trans\decideForFork(), Twig_TokenParser_For\decideForFork(), Twig_TokenParser_If\decideIfEnd(), Twig_TokenParser_If\decideIfFork(), Twig_TokenParser_Spaceless\decideSpacelessEnd(), Twig_TokenParser_With\decideWithEnd(), Twig_ExpressionParser\isBinary(), and Twig_ExpressionParser\isUnary().
|
static |
Returns the English representation of a given type.
int | $type | The type as an integer |
Definition at line 172 of file Token.php.
References $type.
Referenced by Twig_TokenStream\expect(), Twig_ExpressionParser\parseHashExpression(), and Twig_ExpressionParser\parsePrimaryExpression().
|
static |
|
protected |
Definition at line 24 of file Token.php.
Referenced by __construct(), and getLine().
|
protected |
Definition at line 23 of file Token.php.
Referenced by __construct(), getType(), test(), typeToEnglish(), and typeToString().
|
protected |
Definition at line 22 of file Token.php.
Referenced by __construct(), and getValue().
const Twig_Token::BLOCK_END_TYPE = 3 |
Definition at line 30 of file Token.php.
Referenced by Twig_Lexer\lexBlock(), Twig_Extensions_TokenParser_Trans\parse(), Twig_TokenParser_Do\parse(), Twig_TokenParser_Embed\parse(), Twig_TokenParser_With\parse(), Twig_TokenParser_Flush\parse(), Twig_TokenParser_Import\parse(), Twig_TokenParser_From\parse(), Twig_TokenParser_Extends\parse(), Twig_TokenParser_Filter\parse(), Twig_TokenParser_Macro\parse(), Twig_TokenParser_Sandbox\parse(), Twig_TokenParser_Block\parse(), Twig_TokenParser_For\parse(), Twig_TokenParser_Spaceless\parse(), Twig_TokenParser_If\parse(), Twig_TokenParser_Use\parse(), Twig_Extensions_Grammar_Body\parse(), Twig_TokenParser_Set\parse(), Twig_TokenParser_AutoEscape\parse(), Twig_Extensions_Grammar_Tag\parse(), Twig_Extensions_Grammar_Optional\parse(), TwigTestTokenParser_ยง\parse(), Twig_TokenParser_Include\parseArguments(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock(), Twig_Tests_ParserTest\testUnknownTag(), and Twig_Tests_ParserTest\testUnknownTagWithoutSuggestions().
const Twig_Token::BLOCK_START_TYPE = 1 |
Definition at line 28 of file Token.php.
Referenced by Twig_Lexer\lexData(), Twig_TokenParser_Embed\parse(), Twig_Parser\subparse(), Twig_Tests_TokenStreamTest\testEndOfTemplateLook(), Twig_Tests_TokenStreamTest\testEndOfTemplateNext(), Twig_Tests_LexerTest\testNameLabelForTag(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock(), Twig_Tests_ParserTest\testUnknownTag(), and Twig_Tests_ParserTest\testUnknownTagWithoutSuggestions().
const Twig_Token::EOF_TYPE = -1 |
Definition at line 26 of file Token.php.
Referenced by Twig_TokenStream\isEOF(), Twig_Tests_TokenStreamTest\setUp(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_ParserTest\testUnknownTag(), Twig_Tests_ParserTest\testUnknownTagWithoutSuggestions(), and Twig_Lexer\tokenize().
const Twig_Token::INTERPOLATION_END_TYPE = 11 |
Definition at line 38 of file Token.php.
Referenced by Twig_Lexer\lexInterpolation(), Twig_ExpressionParser\parseStringExpression(), Twig_Tests_LexerTest\testStringWithInterpolation(), Twig_Tests_LexerTest\testStringWithNestedInterpolations(), and Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock().
const Twig_Token::INTERPOLATION_START_TYPE = 10 |
Definition at line 37 of file Token.php.
Referenced by Twig_Lexer\lexString(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseStringExpression(), Twig_Tests_LexerTest\testStringWithInterpolation(), Twig_Tests_LexerTest\testStringWithNestedInterpolations(), and Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock().
const Twig_Token::NAME_TYPE = 5 |
Definition at line 32 of file Token.php.
Referenced by Twig_Extensions_Grammar_Constant\__construct(), Twig_ExpressionParser\getTest(), Twig_Lexer\lexExpression(), Twig_TokenParser_Embed\parse(), Twig_TokenParser_With\parse(), Twig_Extensions_Grammar_Boolean\parse(), Twig_Extensions_Grammar_Switch\parse(), Twig_TokenParser_Import\parse(), Twig_TokenParser_From\parse(), Twig_TokenParser_Macro\parse(), Twig_TokenParser_Block\parse(), Twig_TokenParser_For\parse(), Twig_TokenParser_Use\parse(), Twig_TokenParser_AutoEscape\parse(), Twig_Extensions_Grammar_Optional\parse(), Twig_TokenParser_Include\parseArguments(), Twig_ExpressionParser\parseArguments(), Twig_ExpressionParser\parseAssignmentExpression(), Twig_ExpressionParser\parseFilterExpressionRaw(), Twig_ExpressionParser\parseHashExpression(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseSubscriptExpression(), Twig_Parser\subparse(), Twig_Tests_LexerTest\testLineDirective(), Twig_Tests_LexerTest\testLineDirectiveInline(), Twig_Tests_LexerTest\testNameLabelForFunction(), Twig_Tests_LexerTest\testNameLabelForTag(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_LexerTest\testStringWithInterpolation(), Twig_Tests_LexerTest\testStringWithNestedInterpolations(), Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock(), Twig_Tests_ParserTest\testUnknownTag(), and Twig_Tests_ParserTest\testUnknownTagWithoutSuggestions().
const Twig_Token::NUMBER_TYPE = 6 |
Definition at line 33 of file Token.php.
Referenced by Twig_Lexer\lexExpression(), Twig_Extensions_Grammar_Number\parse(), Twig_ExpressionParser\parseHashExpression(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseSubscriptExpression(), Twig_Tests_LexerTest\testOperatorEndingWithALetterAtTheEndOfALine(), and Twig_Tests_LexerTest\testStringWithInterpolation().
const Twig_Token::OPERATOR_TYPE = 8 |
Definition at line 35 of file Token.php.
Referenced by Twig_ExpressionParser\isBinary(), Twig_ExpressionParser\isUnary(), Twig_Lexer\lexExpression(), Twig_TokenParser_For\parse(), Twig_TokenParser_Set\parse(), Twig_ExpressionParser\parseArguments(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseSubscriptExpression(), Twig_Tests_LexerTest\testOperatorEndingWithALetterAtTheEndOfALine(), and Twig_Tests_LexerTest\testStringWithInterpolation().
const Twig_Token::PUNCTUATION_TYPE = 9 |
Definition at line 36 of file Token.php.
Referenced by Twig_ExpressionParser\getPrimary(), Twig_Tests_SimpleTokenParserTest\getTests(), Twig_Lexer\lexExpression(), Twig_TokenParser_From\parse(), Twig_TokenParser_Use\parse(), Twig_ExpressionParser\parseArguments(), Twig_ExpressionParser\parseArrayExpression(), Twig_ExpressionParser\parseAssignmentExpression(), Twig_ExpressionParser\parseConditionalExpression(), Twig_ExpressionParser\parseFilterExpressionRaw(), Twig_Extensions_SimpleTokenParser\parseGrammar(), Twig_ExpressionParser\parseHashExpression(), Twig_ExpressionParser\parseMultitargetExpression(), Twig_ExpressionParser\parsePostfixExpression(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseSubscriptExpression(), Twig_ExpressionParser\parseTestExpression(), and Twig_Tests_LexerTest\testBracketsNesting().
const Twig_Token::STRING_TYPE = 7 |
Definition at line 34 of file Token.php.
Referenced by Twig_Lexer\lexExpression(), Twig_Lexer\lexString(), Twig_TokenParser_Embed\parse(), Twig_ExpressionParser\parseHashExpression(), Twig_ExpressionParser\parsePrimaryExpression(), Twig_ExpressionParser\parseStringExpression(), Twig_Tests_LexerTest\testStringWithEscapedDelimiter(), Twig_Tests_LexerTest\testStringWithEscapedInterpolation(), Twig_Tests_LexerTest\testStringWithHash(), Twig_Tests_LexerTest\testStringWithInterpolation(), Twig_Tests_LexerTest\testStringWithNestedInterpolations(), and Twig_Tests_LexerTest\testStringWithNestedInterpolationsInBlock().
const Twig_Token::TEXT_TYPE = 0 |
Definition at line 27 of file Token.php.
Referenced by Twig_Lexer\lexData(), Twig_Lexer\lexRawData(), Twig_Lexer\pushToken(), Twig_Tests_TokenStreamTest\setUp(), Twig_Parser\subparse(), Twig_Tests_LexerTest\testLineDirective(), Twig_Tests_LexerTest\testLineDirectiveInline(), and Twig_Tests_LexerTest\testStringWithInterpolation().
const Twig_Token::VAR_END_TYPE = 4 |
Definition at line 31 of file Token.php.
Referenced by Twig_Lexer\lexVar(), Twig_Parser\subparse(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_LexerTest\testStringWithEscapedInterpolation(), Twig_Tests_LexerTest\testStringWithHash(), Twig_Tests_LexerTest\testStringWithInterpolation(), and Twig_Tests_LexerTest\testStringWithNestedInterpolations().
const Twig_Token::VAR_START_TYPE = 2 |
Definition at line 29 of file Token.php.
Referenced by Twig_Lexer\lexData(), Twig_Parser\subparse(), Twig_Tests_LexerTest\testLineDirective(), Twig_Tests_LexerTest\testLineDirectiveInline(), Twig_Tests_LexerTest\testNameLabelForFunction(), Twig_Tests_LexerTest\testOperatorEndingWithALetterAtTheEndOfALine(), Twig_Tests_ParserTest\testParseIsReentrant(), Twig_Tests_LexerTest\testStringWithEscapedDelimiter(), Twig_Tests_LexerTest\testStringWithEscapedInterpolation(), Twig_Tests_LexerTest\testStringWithHash(), Twig_Tests_LexerTest\testStringWithInterpolation(), and Twig_Tests_LexerTest\testStringWithNestedInterpolations().