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: */
11:
12: namespace Nette\Latte;
13:
14: use Nette;
15:
16:
17: /**
18: * Latte parser token.
19: *
20: * @author David Grudl
21: */
22: class Token extends Nette\Object
23: {
24: const TEXT = 'text',
25: MACRO_TAG = 'macroTag', // latte macro tag
26: HTML_TAG_BEGIN = 'htmlTagBegin', // begin of HTML tag or comment
27: HTML_TAG_END = 'htmlTagEnd', // end of HTML tag or comment
28: HTML_ATTRIBUTE = 'htmlAttribute',
29: COMMENT = 'comment'; // latte comment
30:
31: /** @var string token type [TEXT | MACRO_TAG | HTML_TAG_BEGIN | HTML_TAG_END | HTML_ATTRIBUTE | COMMENT] */
32: public $type;
33:
34: /** @var string content of the token */
35: public $text;
36:
37: /** @var int line number */
38: public $line;
39:
40: /** @var string name of macro tag, HTML tag or attribute; used for types MACRO_TAG, HTML_TAG_BEGIN, HTML_ATTRIBUTE */
41: public $name;
42:
43: /** @var string value of macro tag or HTML attribute; used for types MACRO_TAG, HTML_ATTRIBUTE */
44: public $value;
45:
46: /** @var string macro modifiers; used for type MACRO_TAG */
47: public $modifiers;
48:
49: /** @var bool is closing HTML tag? used for type HTML_TAG_BEGIN */
50: public $closing;
51:
52: }
53: