1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: * @package Nette\Latte
11: */
12:
13:
14:
15: /**
16: * Latte parser token.
17: *
18: * @author David Grudl
19: * @package Nette\Latte
20: */
21: class LatteToken extends Object
22: {
23: const TEXT = 'text',
24: MACRO_TAG = 'macroTag', // latte macro tag
25: HTML_TAG_BEGIN = 'htmlTagBegin', // begin of HTML tag or comment
26: HTML_TAG_END = 'htmlTagEnd', // end of HTML tag or comment
27: HTML_ATTRIBUTE = 'htmlAttribute',
28: COMMENT = 'comment'; // latte comment
29:
30: /** @var string token type [TEXT | MACRO_TAG | HTML_TAG_BEGIN | HTML_TAG_END | HTML_ATTRIBUTE | COMMENT] */
31: public $type;
32:
33: /** @var string content of the token */
34: public $text;
35:
36: /** @var int line number */
37: public $line;
38:
39: /** @var string name of macro tag, HTML tag or attribute; used for types MACRO_TAG, HTML_TAG_BEGIN, HTML_ATTRIBUTE */
40: public $name;
41:
42: /** @var string value of macro tag or HTML attribute; used for types MACRO_TAG, HTML_ATTRIBUTE */
43: public $value;
44:
45: /** @var string macro modifiers; used for type MACRO_TAG */
46: public $modifiers;
47:
48: /** @var bool is closing HTML tag? used for type HTML_TAG_BEGIN */
49: public $closing;
50:
51: }
52: