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 an enumeration declared independently on a header file or as
12: * part of a class.
13: */
14: class Enumeration
15: {
16:
17: /**
18: * Holds the name of the enumeration.
19: * @var string
20: */
21: public $name;
22:
23: /**
24: * List of options.
25: * @var array
26: */
27: public $options;
28:
29: /**
30: * Description of the element.
31: * @var string
32: */
33: public $description;
34:
35: /**
36: * Reference to the class containing this element if applicable.
37: * @var \Peg\Lib\Definitions\Element\ClassElement
38: */
39: public $parent_class;
40:
41: /**
42: * Reference to the header containing this element.
43: * @var \Peg\Lib\Definitions\Element\Header
44: */
45: public $header;
46:
47: /**
48: * Reference to the namespace containing this element.
49: * @var \Peg\Lib\Definitions\Element\NamespaceElement
50: */
51: public $namespace;
52:
53: /**
54: * Initializes the enumeration element.
55: * @param string $name
56: * @param array $options
57: * @param string $description
58: */
59: public function __construct($name, array $options, $description="")
60: {
61: $this->name = $name;
62:
63: $this->options = $options;
64:
65: $this->description = $description;
66: }
67:
68: }