1: <?php
2: /**
3: * @author Jefferson González
4: * @license MIT
5: * @link http://github.com/peg-org/peg-src Source code.
6: */
7:
8: namespace Peg\Lib\Definitions\Element;
9:
10: /**
11: * Represents a class member variable/constant element.
12: */
13: class ClassVariable extends VariableType
14: {
15:
16: /**
17: * Holds the name of the element
18: * @var string
19: */
20: public $name;
21:
22: /**
23: * Flag that indicates if the variable is static.
24: * @var bool
25: */
26: public $static;
27:
28: /**
29: * Flag that indicates if the variable is mutable.
30: * @var bool
31: */
32: public $mutable;
33:
34: /**
35: * Flag that indicates if the variable is protected.
36: * @var bool
37: */
38: public $protected;
39:
40: /**
41: * Flag that indicates if the variable is public.
42: * @var bool
43: */
44: public $public;
45:
46: /**
47: * Reference to the class containing this element.
48: * @var \Peg\Lib\Definitions\Element\ClassElement
49: */
50: public $parent_class;
51:
52: /**
53: * Reference to the header containing this element.
54: * @var \Peg\Lib\Definitions\Element\Header
55: */
56: public $header;
57:
58: /**
59: * Reference to the namespace containing this element.
60: * @var \Peg\Lib\Definitions\Element\NamespaceElement
61: */
62: public $namespace;
63:
64: /**
65: * Create a global variable element using a declaration specification
66: * for its type.
67: * @param string $name Name of the variable.
68: * @param string $type Parameter type by specification, eg: const int*
69: */
70: public function __construct($name, $type, $description="")
71: {
72: parent::__construct($type, $description);
73:
74: $this->name = $name;
75: }
76:
77: }