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