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

  • Generate
  • Help
  • Init
  • Parse
  • 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;
 9: 
10: use Peg\Custom\CommandLine\Option;
11: use Peg\Custom\CommandLine\OptionType;
12: 
13: /**
14:  * Command to parse files and generate a definitions cache representing them.
15:  */
16: class Parse extends \Peg\Custom\CommandLine\Command
17: {
18: 
19:     public function __construct()
20:     {
21:         parent::__construct("parse");
22: 
23:         $this->description = t("Extracts definitions which are then stored in the 'definitions' directory.");
24: 
25:         $this->RegisterAction(new Action\Parse\Doxygen());
26: 
27:         $input_format = new Option(array(
28:             "long_name"     => "input-format",
29:             "short_name"    => "f",
30:             "type"          => OptionType::STRING,
31:             "required"      => false,
32:             "description"   => t("The kind of input to parse. Default: doxygen") 
33:                 . "\n" . t("Allowed values:") . " doxygen",
34:             "default_value" => "doxygen"
35:         ));
36:         
37:         $this->AddOption($input_format);
38:         
39:         $output_format = new Option(array(
40:             "long_name"     => "output-format",
41:             "short_name"    => "o",
42:             "type"          => OptionType::STRING,
43:             "required"      => false,
44:             "description"   => t("The kind of cached definition files to create. Default: json") 
45:                 . "\n" . t("Allowed values:") . " json, php",
46:             "default_value" => "json"
47:         ));
48: 
49:         $this->AddOption($output_format);
50: 
51:         $source = new Option(array(
52:             "long_name"     => "source",
53:             "short_name"    => "s",
54:             "type"          => OptionType::STRING,
55:             "required"      => true,
56:             "description"   => t("The path were resides the input to parse."),
57:             "default_value" => ""
58:         ));
59: 
60:         $this->AddOption($source);
61: 
62:         $headers = new Option(array(
63:             "long_name"     => "headers",
64:             "short_name"    => "h",
65:             "type"          => OptionType::STRING,
66:             "required"      => false,
67:             "description"   => t("The path were resides the header files of the library in order to correctly solve headers include path."),
68:             "default_value" => ""
69:         ));
70: 
71:         $this->AddOption($headers);
72: 
73:         $verbose = new Option(array(
74:             "long_name"     => "verbose",
75:             "short_name"    => "v",
76:             "type"          => OptionType::FLAG,
77:             "required"      => false,
78:             "description"   => t("Turns verbosity on."),
79:             "default_value" => "",
80:         ));
81: 
82:         $this->AddOption($verbose);
83:     }
84: 
85: }
PEG Api API documentation generated by ApiGen 2.8.0