Example #1
0
 /**
  * Constructor
  *
  * @param string  $sourceName
  * @param boolean $rootParser
  */
 public function __construct($sourceName = null, $rootParser = true)
 {
     $this->sourceName = $sourceName;
     $this->rootParser = $rootParser;
     $this->charset = null;
     if (empty(self::$operatorStr)) {
         self::$operatorStr = $this->makeOperatorStr(self::$operators);
         $commentSingle = $this->pregQuote(self::$commentSingle);
         $commentMultiLeft = $this->pregQuote(self::$commentMultiLeft);
         $commentMultiRight = $this->pregQuote(self::$commentMultiRight);
         self::$commentMulti = $commentMultiLeft . '.*?' . $commentMultiRight;
         self::$whitePattern = '/' . $commentSingle . '[^\\n]*\\s*|(' . self::$commentMulti . ')\\s*|\\s+/Ais';
     }
 }