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 C type definition (typedef).
12: */
13: class TypeDef extends VariableType
14: {
15:
16: /**
17: * Holds the name of the element
18: * @var string
19: */
20: public $name;
21:
22: /**
23: * Reference to the header containing this element.
24: * @var \Peg\Lib\Definitions\Element\Header
25: */
26: public $header;
27:
28: /**
29: * Reference to the namespace containing this element.
30: * @var \Peg\Lib\Definitions\Element\NamespaceElement
31: */
32: public $namespace;
33:
34: /**
35: * Create a typedef element.
36: * @param string $name Name of the parameter.
37: * @param string $type Parameter type by specification, eg: const int*
38: * @param string $description A description used to generate documentation.
39: */
40: public function __construct($name, $type, $description="")
41: {
42: parent::__construct($type, $description);
43:
44: $this->name = $name;
45: }
46:
47: }