1 | <?php |
||
23 | class GeneratorParsers extends AbstractGeneratorAware |
||
24 | { |
||
25 | /** |
||
26 | * @var ParserContainer |
||
27 | */ |
||
28 | protected $parsers; |
||
29 | /** |
||
30 | * @param Generator $generator |
||
31 | */ |
||
32 | 504 | public function __construct(Generator $generator) |
|
33 | { |
||
34 | 504 | parent::__construct($generator); |
|
35 | 504 | $this->initParsers(); |
|
36 | 504 | } |
|
37 | /** |
||
38 | * @return GeneratorParsers |
||
39 | */ |
||
40 | 504 | protected function initParsers() |
|
41 | { |
||
42 | 504 | if (!isset($this->parsers)) { |
|
43 | 504 | $this->parsers = new ParserContainer($this->generator); |
|
44 | 504 | $this->parsers |
|
45 | 504 | ->add(new FunctionsParser($this->generator)) |
|
46 | 504 | ->add(new StructsParser($this->generator)) |
|
47 | 504 | ->add(new TagIncludeParser($this->generator)) |
|
48 | 504 | ->add(new TagImportParser($this->generator)) |
|
49 | 504 | ->add(new TagAttributeParser($this->generator)) |
|
50 | 504 | ->add(new TagComplexTypeParser($this->generator)) |
|
51 | 504 | ->add(new TagDocumentationParser($this->generator)) |
|
52 | 504 | ->add(new TagElementParser($this->generator)) |
|
53 | 504 | ->add(new TagEnumerationParser($this->generator)) |
|
54 | 504 | ->add(new TagExtensionParser($this->generator)) |
|
55 | 504 | ->add(new TagHeaderParser($this->generator)) |
|
56 | 504 | ->add(new TagInputParser($this->generator)) |
|
57 | 504 | ->add(new TagOutputParser($this->generator)) |
|
58 | 504 | ->add(new TagRestrictionParser($this->generator)) |
|
59 | 504 | ->add(new TagUnionParser($this->generator)) |
|
60 | 504 | ->add(new TagListParser($this->generator)); |
|
61 | 504 | } |
|
62 | 504 | return $this; |
|
63 | } |
||
64 | /** |
||
65 | * @return GeneratorParsers |
||
66 | */ |
||
67 | 20 | public function doParse() |
|
68 | { |
||
69 | 20 | foreach ($this->parsers as $parser) { |
|
70 | 20 | $parser->parse(); |
|
71 | 20 | } |
|
72 | 20 | return $this; |
|
73 | } |
||
74 | /** |
||
75 | * @return ParserContainer |
||
76 | */ |
||
77 | 180 | public function getParsers() |
|
81 | } |
||
82 |