Overview

Namespaces

  • None
  • Peg
    • Cli
      • Commands
    • Config
    • Custom
      • Command
        • Action
          • Generate
          • Parse
      • CommandLine
      • Config
      • Localization
      • Utilities
    • Lib
      • Definitions
        • Element
      • Generator
      • Lexers
      • Plugins
      • Signals
        • Data
          • Definitions
          • Lexers
        • Type
  • PHP

Classes

  • Base
  • Doxygen
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: /**
 3:  * @author Jefferson González
 4:  * @license MIT
 5:  * @link http://github.com/peg-org/peg-custom Source code.
 6:  */
 7: 
 8: namespace Peg\Custom\Command\Action\Parse;
 9: 
10: /**
11:  * Implements a doxygen definitions parser action using \Peg\Lib\Lexers\Doxygen.
12:  * @see \Peg\Lib\Lexers\Doxygen
13:  */
14: class Doxygen extends \Peg\Custom\Command\Action\Parse\Base
15: {
16: 
17:     /**
18:      * The lexer that is going to be used for extracting definitions.
19:      * @var \Peg\Lib\Lexers\Doxygen
20:      */
21:     public $lexer;
22:     
23:     /**
24:      * Initialize this action to be of input type doxygen.
25:      */
26:     public function __construct()
27:     {
28:         parent::__construct("doxygen");
29:     }
30: 
31:     /**
32:      * Initializes the parsing/lexing process.
33:      * @param string $path Were the doxygen xml files reside.
34:      */
35:     public function Start($path)
36:     {
37:         $this->lexer = new \Peg\Lib\Lexers\Doxygen($path, $this->headers_path);
38:         
39:         // Start lexer
40:         if($this->verbose)
41:         {
42:             $this->lexer->Listen(
43:                 \Peg\Lib\Signals\Type\Lexers::LEXER_MESSAGE, 
44:                 function(\Peg\Lib\Signals\Data\Lexers\Message $signal_data){
45:                     print $signal_data->message . "\n";
46:                 }
47:             );
48:         }
49:         
50:         $this->lexer->Start();
51:         
52:         // Create definitions cache
53:         if($this->verbose)
54:         {
55:             $this->lexer->exporter->Listen(
56:                 \Peg\Lib\Signals\Type\Definitions::EXPORT_MESSAGE, 
57:                 function(\Peg\Lib\Signals\Data\Definitions\ExportMessage $signal_data){
58:                     print $signal_data->message . "\n";
59:                 }
60:             );
61:         }
62:         
63:         $this->lexer->SaveDefinitions("definitions", $this->output_format);
64:     }
65: 
66: }
PEG Api API documentation generated by ApiGen 2.8.0